:root {
    --white: #fff;
    --yellow: #fab545;
    --red: #e24365;
    --red-dark: #b82d4f;
    --panel: #fafcfd;
    --primary-text: #495995;
    --secondary-text: #495995;
    --secondary-bg: #e5edf7;
    --secondary-line: #e6eaf2;
    --secondary-highlight: #495995;
    --btn-purple: #bcb5ff;
    --btn-yellow: #fab545;
    --btn-blue: #9ddef6;
    --alien: #7fd32a;
    --alien-secondary: #eef8e7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('../images/cursor_e.png'), auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

*:focus,
button:focus,
a:focus,
input:focus {
    cursor: url('../images/cursor_e.png'), auto;
    outline: none;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'FusionPixel', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #61a8c9;
}

body.game-active {
    background: #61a8c9;
}

#pixi-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
}

#pixi-container.hidden {
    opacity: 0;
    display: none;
}

#pixi-container canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edged;
}

@font-face {
    font-family: 'FusionPixel';
    src: url('../fonts/fusion-pixel-subset.woff2') format('woff2');
    font-display: swap;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: hidden;
    pointer-events: auto;
}

#loading-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.loading-bg-text{
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: var(--white);
    z-index: 1000;
    opacity: 0;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* 竖屏 */
@media (orientation: portrait) {
    .loading-bg-text {
        font-size: 16px;
    }
}

/* 横屏 */
@media (orientation: landscape) {
    .loading-bg-text {
        font-size: 24px;
    }
}


.loading-bg-coutinue-text {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: var(--yellow);
    z-index: 1000;
    opacity: 0;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* 竖屏 */
@media (orientation: portrait) {
    .loading-bg-coutinue-text {
        font-size: 16px;
    }
}

/* 横屏 */
@media (orientation: landscape) {
    .loading-bg-coutinue-text {
        font-size: 24px;
    }
}


.loading-bg-text-bg {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 60px;
    background: #009ac5;
    z-index: 999;
    opacity: 0.5;
}



#loading-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    image-rendering: pixelated;
    image-rendering: crisp-edged;
    opacity: 0;
    will-change: transform;
}

#loading-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #61a8c9;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}

#loading-bg-dark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 2;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    z-index: 2;
    position: relative;
}

.loading-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-dot-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
}

.loading-dot-wrap:nth-child(1) {
    transform: rotate(180deg);
}

.loading-dot-wrap:nth-child(2) {
    transform: rotate(144deg);
}

.loading-dot-wrap:nth-child(3) {
    transform: rotate(108deg);
}

.loading-dot-wrap:nth-child(4) {
    transform: rotate(72deg);
}

.loading-dot-wrap:nth-child(5) {
    transform: rotate(36deg);
}

.loading-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    transform: translate(0, -32px);
    background: #ffb15e;
    border: 2px solid #fafcfd;
    border-radius: 50%;
}

.loading-progress-wrap {
    width: 260px;
}

.loading-progress-track {
    width: 100%;
    height: 12px;
    background: #3a7a9e;
    border: 2px solid #fafcfd;
    border-radius: 6px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    width: 0%;
    background: #ffb15e;
    border-radius: 6px;
}

.loading-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: 'FusionPixel', sans-serif;
    color: #fafcfd;
}

.loading-item-name {
    font-size: 16px;
    letter-spacing: 1px;
}

.loading-counter {
    font-size: 16px;
    font-family: 'FusionPixel', sans-serif;
}

/* ====== 主菜单（加载完成后合并页面） ====== */

#main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

#main-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.01);
}

.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    z-index: 1;
    margin-top: -80px;
}

@media (orientation: portrait) {
    .start-content {
        margin-top: 0;
    }
}

.title-image {
    width: 320px;
    height: auto;
    image-rendering: auto;
}

.start-btn-main {
    position: relative;
    padding: 18px 52px;
    min-width: 240px;
    font-family: 'FusionPixel', sans-serif;
    font-size: 28px;
    color: #fafcfd;
    font-weight: bold;
    border-radius: 40px;
    border: 12px solid #fafcfd;
    outline: none;
    letter-spacing: 6px;
    transform: translateY(0);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
}

.start-btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at -7px -7px, #fafcfd 6px, transparent 6px),
        radial-gradient(circle at calc(100% + 7px) -7px, #fafcfd 6px, transparent 6px),
        radial-gradient(circle at -7px calc(100% + 7px), #fafcfd 6px, transparent 6px),
        radial-gradient(circle at calc(100% + 7px) calc(100% + 7px), #fafcfd 6px, transparent 6px),
        radial-gradient(circle at -7px -7px, #ffd93d 4px, transparent 4px),
        radial-gradient(circle at calc(100% + 7px) -7px, #ff6b6b 4px, transparent 4px),
        radial-gradient(circle at -7px calc(100% + 7px), #6bcb77 4px, transparent 4px),
        radial-gradient(circle at calc(100% + 7px) calc(100% + 7px), #4d96ff 4px, transparent 4px);
}

.start-btn-main::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 6px solid #fafcfd;
    pointer-events: none;
    z-index: 1;
}

.start-btn-main:hover {
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
}

#start-btn {
    background: #fab545;
}

#start-btn::after {
    background: #fab545;
}

#records-btn {
    background: #9ddef6;
    color: #5166b4;
}

#records-btn::after {
    background: #9ddef6;
}

#about-btn {
    background: #bcb5ff;
    color: #394ca8;
}

#about-btn::after {
    background: #bcb5ff;
}

#game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#game-over-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}

#game-over-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-bg-deco {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 40%, rgba(183, 91, 100, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(128, 165, 193, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.modal-content {
    position: relative;
    background: var(--panel);
    padding: 30px 40px 26px;
    border: 8px solid #fafcfd;
    border-radius: 28px;
    text-align: center;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
    width: 320px;
    max-height: 600px;
    /* min-width: 310px;
    max-width: 356px; */
    transform: scale(0.5) rotate(-2deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#game-over-modal.visible .modal-content {
    transform: scale(1) rotate(0deg);
}

.modal-stamp {
    position: absolute;
    top: -18px;
    right: -10px;
    padding: 6px 18px;
    background: var(--secondary-highlight);
    color: #fafcfd;
    font-size: 16px;
    font-weight: bold;
    font-family: 'FusionPixel', sans-serif;
    letter-spacing: 3px;
    border: 4px solid #fafcfd;
    border-radius: 16px;
    transform: rotate(8deg);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.icon-back {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 10px solid #a54800;
    margin-right: 4px;
    vertical-align: middle;
}

.icon-clock-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #4a2000;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
    position: relative;
}

.icon-clock-sm::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 1.5px;
    background: #4a2000;
    transform: translate(-50%, -100%) rotate(0deg);
}

.icon-clock-sm::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.5px;
    height: 4px;
    background: #4a2000;
    transform: translate(-50%, -100%) rotate(0deg);
}

.modal-content h1 {
    font-family: 'FusionPixel', sans-serif;
    color: var(--secondary-text);
    font-size: 24px;
    margin: 8px 0 12px;
    letter-spacing: 4px;
}

.score-label {
    color: var(--secondary-text);
    font-size: 16px;
    margin-bottom: 4px;
    letter-spacing: 3px;
}

.final-score-wrap {
    position: relative;
    background: var(--secondary-bg);
    border-radius: 4px;
    padding: 10px 0;
    margin: 8px 0 4px;
}

.score-display {
    font-size: 32px;
    color: var(--secondary-highlight);
    font-weight: bold;
    font-family: 'FusionPixel', sans-serif;
    margin: 0;
    letter-spacing: 2px;
    line-height: 1;
}

.new-record-tag {
    position: absolute;
    top: -8px;
    right: 78px;
    font-size: 10px;
    font-weight: bold;
    font-family: 'FusionPixel', sans-serif;
    color: #fff;
    background: var(--red);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    box-shadow: 0 2px var(--red-dark);
}

.new-record-tag.hidden {
    display: none;
}

.score-stars {
    height: 2px;
    margin: 8px 0 20px;
    background: var(--secondary-line);
    border-radius: 4px;
}

.modal-btn {
    position: relative;
    font-family: 'FusionPixel', sans-serif;
    font-size: 16px;
    border-radius: 28px;
    border: 8px solid #fafcfd;
    outline: none;
    letter-spacing: 3px;
    padding: 10px 32px;
    min-width: 200px;
    transform: translateY(0);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
}

.modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at -5px -5px, #fafcfd 5px, transparent 5px),
        radial-gradient(circle at calc(100% + 5px) -5px, #fafcfd 5px, transparent 5px),
        radial-gradient(circle at -5px calc(100% + 5px), #fafcfd 5px, transparent 5px),
        radial-gradient(circle at calc(100% + 5px) calc(100% + 5px), #fafcfd 5px, transparent 5px),
        radial-gradient(circle at -5px -5px, #ffd93d 3px, transparent 3px),
        radial-gradient(circle at calc(100% + 5px) -5px, #ff6b6b 3px, transparent 3px),
        radial-gradient(circle at -5px calc(100% + 5px), #6bcb77 3px, transparent 3px),
        radial-gradient(circle at calc(100% + 5px) calc(100% + 5px), #4d96ff 3px, transparent 3px);
}

.modal-btn::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 5px solid #fafcfd;
    pointer-events: none;
    z-index: 1;
}

.modal-btn:hover {
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
}

.modal-btn-primary {
    color: #fafcfd;
    background: #fab545;
    box-shadow: 0 0 0 1px #fab545, 0 6px 0 rgba(0, 0, 0, 0.1);
}

.modal-btn-primary:hover {
    box-shadow: 0 0 0 1px #fab545, 0 6px 0 rgba(0, 0, 0, 0.1);
}

.modal-btn-primary::after {
    background: #fab545;
}

.modal-btn-secondary {
    color: #5166b4;
    background: #9ddef6;
    box-shadow: 0 0 0 1px #9ddef6, 0 6px 0 rgba(0, 0, 0, 0.1);
}

.modal-btn-secondary:hover {
    box-shadow: 0 0 0 1px #9ddef6, 0 6px 0 rgba(0, 0, 0, 0.1);
}

.modal-btn-secondary::after {
    background: #9ddef6;
}

.modal-btn-purple {
    color: #394ca8;
    background: #bcb5ff;
    box-shadow: 0 0 0 1px #bcb5ff, 0 6px 0 rgba(0, 0, 0, 0.1);
}

.modal-btn-purple:hover {
    box-shadow: 0 0 0 1px #bcb5ff, 0 6px 0 rgba(0, 0, 0, 0.1);
}

.modal-btn-purple::after {
    background: #bcb5ff;
}

#pause-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#pause-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}

#pause-screen:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#pause-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#pause-screen:not(.hidden) .modal-content {
    transform: scale(1) rotate(0deg);
}

#pause-screen .modal-content {
    transform: scale(0.5) rotate(-2deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#pause-screen .modal-content h1 {
    color: var(--secondary-text);
    margin-bottom: 4px;
}

.pause-volume-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

#resume-btn {
    position: relative;
}

#records-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#records-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}

#records-screen:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#records-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#records-screen:not(.hidden) .modal-content {
    transform: scale(1) rotate(0deg);
}

#records-screen .modal-content {
    transform: scale(0.5) rotate(-2deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.records-content {
    font-size: 17px;
}

.records-content h1 {
    color: var(--secondary-text);
    margin: 8px 0 12px;
    font-size: 24px;
}

.records-table-wrap {
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 18px;
    scrollbar-width: none;
    position: relative;
}

.records-table-wrap::-webkit-scrollbar {
    display: none;
}

.records-scroll-hint {
    display: none;
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--secondary-text);
    pointer-events: none;
    z-index: 1;
}

.records-table-wrap.overflow+.records-scroll-hint {
    display: block;
}

.records-table-wrap.scrolled-bottom+.records-scroll-hint {
    display: none;
}

#records-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
    color: var(--secondary-text);
    font-size: 16px;
    font-family: 'FusionPixel', sans-serif;
    font-weight: bold;
    white-space: nowrap;
}

#records-table th {
    color: var(--secondary-text);
    font-size: 12px;
    padding: 7px 10px;
    letter-spacing: 1px;
}

#records-table td {
    padding: 8px 10px;
    text-align: center;
    background: var(--secondary-bg);
}

#records-table td:first-child {
    border-radius: 4px 0 0 4px;
}

#records-table td:last-child {
    position: relative;
    border-radius: 0 4px 4px 0;
}

#records-table tr.rank-1 td {
    color: #f9a825;
    background: #fff8e1;
}

#records-table tr.rank-2 td {
    color: #8b789c;
    background: #f9effd;
}

#records-table tr.rank-3 td {
    color: #5b91b7;
    background: #e2f3ff;
}

#records-table .empty-records {
    color: #999;
    font-size: 16px;
    padding: 20px 0;
    background: transparent;
    border-radius: 0;
}

.gb-tag {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: bold;
    color: var(--red);
    display: none;
}

.records-footer {
    text-align: center;
    font-size: 12px;
    color: var(--secondary-text);
    font-family: 'FusionPixel', sans-serif;
    letter-spacing: 1px;
    margin-top: 0px;
    margin-bottom: 10px;
}

.game-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
    font-size: 16px;
    font-family: 'FusionPixel', sans-serif;
    color: var(--secondary-text);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--secondary-bg);
    padding: 8px 14px;
    border-radius: 4px;
}

.stat-label {
    letter-spacing: 2px;
}

.stat-item {
    white-space: nowrap;
}

.about-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--secondary-bg);
    border-radius: 4px;
    font-family: 'FusionPixel', sans-serif;
}

.about-line {
    font-size: 16px;
    color: var(--secondary-text);
    letter-spacing: 1px;
}

.about-info-wrap {
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 18px;
    scrollbar-width: none;
    position: relative;
}

.about-info-wrap::-webkit-scrollbar {
    display: none;
}

.about-scroll-hint {
    display: none;
    position: absolute;
    bottom: 16%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--secondary-text);
    pointer-events: none;
    z-index: 1;
}

.about-info-wrap.overflow + .about-scroll-hint {
    display: block;
}

.about-info-wrap.scrolled-bottom + .about-scroll-hint {
    display: none;
}

.footer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.footer-section-title {
    font-size: 14px;
    color: var(--primary-text);
    letter-spacing: 2px;
    margin-bottom: 4px;
    margin-top: 6px;
    font-weight: bold;
}

.footer-section-content {
    font-size: 14px;
    color: var(--secondary-text);
}

.footer-section-content a {
    color: var(--secondary-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.footer-section-content a:hover {
    color: var(--red);
}

.link-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

#about-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#about-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}

#about-screen:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#about-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#about-screen:not(.hidden) .modal-content {
    transform: scale(1) rotate(0deg);
}

#about-screen .modal-content {
    transform: scale(0.5) rotate(-2deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#about-screen .modal-content h1 {
    color: var(--secondary-text);
    margin: 8px 0 12px;
}

.version-tag {
    position: fixed;
    right: 12px;
    top: 8px;
    font-family: 'FusionPixel', sans-serif;
    font-size: 16px;
    color: var(--white);
    opacity: 0.8;
    z-index: 9999;
    pointer-events: none;
}

.settings-btn {
    position: fixed;
    background: var(--btn-blue);
    border: 12px solid #fafcfd;
    outline: none;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    color: #fafcfd;
    font-family: 'FusionPixel', sans-serif;
    font-size: 24px;
    transform: translateY(0);
    transition: left 0.3s ease, top 0.3s ease, bottom 0.3s ease,
        width 0.3s ease, height 0.3s ease,
        border-radius 0.3s ease, box-shadow 0.3s ease;
}

.settings-btn-icon {
    width: 28px;
    height: 28px;
    fill: #fafcfd;
    pointer-events: none;
}

/* 竖屏：左下角 1/4 圆 */
@media (orientation: portrait) {
    .settings-btn {
        left: 0;
        bottom: 0;
        width: 56px;
        height: 56px;
        border-left: none;
        border-bottom: none;
        border-radius: 0 56px 0 0;
    }
}

/* 横屏：全圆，位置由 JS 动态设定 */
@media (orientation: landscape) {
    .settings-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
    }
}

#settings-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#settings-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}

#settings-screen:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#settings-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#settings-screen:not(.hidden) .modal-content {
    transform: scale(1) rotate(0deg);
}

#settings-screen .modal-content {
    transform: scale(0.5) rotate(-2deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#settings-screen .modal-content h1 {
    color: var(--secondary-text);
    margin: 8px 0 12px;
}

.settings-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.setting-label {
    font-family: 'FusionPixel', sans-serif;
    font-size: 16px;
    color: var(--secondary-text);
    width: 48px;
    text-align: right;
    letter-spacing: 2px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 12px;
    background: var(--secondary-bg);
    border: 2px solid #fafcfd;
    border-radius: 4px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--secondary-highlight);
    border: 2px solid #fafcfd;
    border-radius: 4px;
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--secondary-highlight);
    border: 2px solid #fafcfd;
    border-radius: 4px;
}

.quality-toggle {
    display: flex;
    gap: 0;
    border: 2px solid #fafcfd;
    border-radius: 4px;
    overflow: hidden;
}

.quality-btn {
    font-family: 'FusionPixel', sans-serif;
    font-size: 12px;
    color: var(--secondary-text);
    background: var(--secondary-bg);
    border: none;
    padding: 6px 16px;
    cursor: inherit;
    transition: background 0.2s, color 0.2s;
}

.quality-btn.active {
    background: var(--secondary-highlight);
    color: #fff;
}

.quality-btn:first-child {
    border-right: 2px solid #fafcfd;
}

/* ====== 赞赏按钮 ====== */
.sponsor-btn {
    position: fixed;
    background: #fab545;
    border: 12px solid #fafcfd;
    outline: none;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    color: #fafcfd;
    font-family: 'FusionPixel', sans-serif;
    font-size: 24px;
    transform: translateY(0);
    transition: left 0.3s ease, top 0.3s ease, bottom 0.3s ease,
        width 0.3s ease, height 0.3s ease,
        border-radius 0.3s ease, box-shadow 0.3s ease;
}

.sponsor-btn-icon {
    width: 28px;
    height: 28px;
    fill: #fafcfd;
    pointer-events: none;
}

/* 竖屏：右下角 1/4 圆 */
@media (orientation: portrait) {
    .sponsor-btn {
        right: 0;
        bottom: 0;
        width: 56px;
        height: 56px;
        border-right: none;
        border-bottom: none;
        border-radius: 56px 0 0 0;
    }
}

/* 横屏：全圆，位置由 JS 动态设定 */
@media (orientation: landscape) {
    .sponsor-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
    }
}

/* ====== 赞赏弹窗 ====== */
#sponsor-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#sponsor-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}

#sponsor-screen:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#sponsor-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#sponsor-screen:not(.hidden) .modal-content {
    transform: scale(1) rotate(0deg);
}

#sponsor-screen .modal-content {
    transform: scale(0.5) rotate(-2deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#sponsor-screen .modal-content h1 {
    color: var(--secondary-text);
    margin: 8px 0 12px;
}

.sponsor-body {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.sponsor-image {
    width: 100%;
    max-width: 240px;
    height: auto;
    border-radius: 4px;
    border: 2px solid var(--secondary-line);
    image-rendering: auto;
}

.footer-section-copyright {
    font-family: 'FusionPixel', sans-serif;
    font-size: 12px;
    color: var(--secondary-text);
    margin-top: 12px;
}

/* ====== 外星人模式聊天气泡 ====== */
.alien-chat-bubble {
    position: fixed;
    z-index: 1500;
    pointer-events: auto;
    cursor: url('../images/cursor_e.png'), auto;
}

.alien-chat-bubble:hover {
    cursor: url('../images/cursor_e.png'), auto;
}

.alien-bubble-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    fill: var(--white);
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}

.alien-bubble-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-55%, -55%);
    font-size: 18px;
    pointer-events: none;
    line-height: 1;
}

/* ====== 外星人模式配色覆盖 ====== */
body.alien-mode #start-btn {
    background: var(--alien);
}

body.alien-mode #start-btn::after {
    background: var(--alien);
}


body.alien-mode #records-btn {
    background: var(--alien);
    color: #fafcfd;
}

body.alien-mode #records-btn::after {
    background: var(--alien);
}

body.alien-mode #about-btn {
    background: var(--alien);
    color: #fafcfd;
}

body.alien-mode #about-btn::after {
    background: var(--alien);
}

body.alien-mode .settings-btn {
    background: var(--alien);
}

body.alien-mode .sponsor-btn {
    background: var(--alien);
}

body.alien-mode .modal-stamp {
    background: var(--alien);
}

body.alien-mode .title-image {
    filter: hue-rotate(-75deg) saturate(1.5);
}

body.alien-mode .loading-bg-coutinue-text {
    color: var(--alien);
}

body.alien-mode .modal-btn-primary {
    background: var(--alien);
}

body.alien-mode .modal-btn-primary::after {
    background: var(--alien);
}

body.alien-mode .modal-btn-secondary {
    background: var(--alien);
    color: #fafcfd;
}

body.alien-mode .modal-btn-secondary::after {
    background: var(--alien);
}

body.alien-mode .modal-btn-purple {
    background: var(--alien);
    color: #fafcfd;
}

body.alien-mode .modal-btn-purple::after {
    background: var(--alien);
}

body.alien-mode .version-tag {
    color: var(--alien);
}

body.alien-mode .new-record-tag {
    background: var(--alien);
    box-shadow: 0 2px var(--alien-secondary);
}

body.alien-mode .score-display {
    color: var(--alien);
}

body.alien-mode .final-score-wrap {
    background: var(--alien-secondary);
}

body.alien-mode .loading-item-name {
    color: var(--alien);
}

body.alien-mode .loading-counter {
    color: var(--alien);
}

/* 二级面板标题 */
body.alien-mode .modal-content h1,
body.alien-mode #pause-screen .modal-content h1,
body.alien-mode #records-screen .modal-content h1,
body.alien-mode #about-screen .modal-content h1,
body.alien-mode #settings-screen .modal-content h1,
body.alien-mode #sponsor-screen .modal-content h1 {
    color: var(--alien);
}

/* 统计区域 */
body.alien-mode .game-stats {
    color: var(--alien);
}

body.alien-mode .stat-label {
    color: var(--alien);
}

/* 设置标签 */
body.alien-mode .setting-label {
    color: var(--alien);
}

/* 排行榜空状态 */
body.alien-mode #records-table .empty-records {
    color: var(--alien);
}

/* 按钮边框和阴影 */
body.alien-mode .modal-btn-primary {
    border-color: var(--white);
    box-shadow: 0 0 0 1px var(--alien), 0 6px 0 rgba(0, 0, 0, 0.1);
}

body.alien-mode .modal-btn-primary:hover {
    box-shadow: 0 0 0 1px var(--alien), 0 6px 0 rgba(0, 0, 0, 0.1);
}

body.alien-mode .modal-btn-secondary {
    border-color: var(--white);
    box-shadow: 0 0 0 1px var(--alien), 0 6px 0 rgba(0, 0, 0, 0.1);
}

body.alien-mode .modal-btn-secondary:hover {
    box-shadow: 0 0 0 1px var(--alien), 0 6px 0 rgba(0, 0, 0, 0.1);
}

body.alien-mode .modal-btn-purple {
    border-color: var(--white);
    box-shadow: 0 0 0 1px var(--alien), 0 6px 0 rgba(0, 0, 0, 0.1);
}

body.alien-mode .modal-btn-purple:hover {
    box-shadow: 0 0 0 1px var(--alien), 0 6px 0 rgba(0, 0, 0, 0.1);
}

/* 按钮 ::before 装饰色点 */
body.alien-mode .modal-btn::before {
    background:
        radial-gradient(circle at -5px -5px, #fafcfd 5px, transparent 5px),
        radial-gradient(circle at calc(100% + 5px) -5px, #fafcfd 5px, transparent 5px),
        radial-gradient(circle at -5px calc(100% + 5px), #fafcfd 5px, transparent 5px),
        radial-gradient(circle at calc(100% + 5px) calc(100% + 5px), #fafcfd 5px, transparent 5px),
        radial-gradient(circle at -5px -5px, var(--alien) 3px, transparent 3px),
        radial-gradient(circle at calc(100% + 5px) -5px, var(--alien) 3px, transparent 3px),
        radial-gradient(circle at -5px calc(100% + 5px), var(--alien) 3px, transparent 3px),
        radial-gradient(circle at calc(100% + 5px) calc(100% + 5px), var(--alien) 3px, transparent 3px);
}

/* 统计行背景 */
body.alien-mode .stat-row {
    background: rgba(127, 211, 42, 0.1);
}

body.alien-mode .volume-slider {
    background: var(--alien-secondary);
    border: 2px solid #fafcfd;
}

body.alien-mode .volume-slider::-webkit-slider-thumb {
    background: var(--alien);
    border: 2px solid #fafcfd;

}

body.alien-mode .volume-slider::-moz-range-thumb {
    background: var(--alien);
    border: 2px solid #fafcfd;
}

/* 排行榜表头 */
body.alien-mode #records-table {
    color: var(--alien);
}

body.alien-mode #records-table th {
    color: var(--alien);
}

/* 排行榜数据行背景 */
body.alien-mode #records-table td {
    background: rgba(127, 211, 42, 0.08);
}

/* 排行榜底部文字 */
body.alien-mode .records-footer {
    color: var(--alien);
}

/* 排行榜滚动提示 */
body.alien-mode .records-scroll-hint {
    border-top: 10px solid var(--alien);
}

/* 关于赞助页面文字 */
body.alien-mode .footer-section-content {
    color: var(--alien);
}

body.alien-mode .footer-section-content a {
    color: var(--alien);
}

body.alien-mode .score-stars {
    background: var(--alien-secondary);
}

body.alien-mode .footer-section-title {
    color: var(--alien);
}

body.alien-mode .about-line {
    color: var(--alien);
}

body.alien-mode .about-info {
    background: var(--alien-secondary);
}

body.alien-mode .about-scroll-hint {
    border-top: 10px solid var(--alien);
}

body.alien-mode .footer-section-copyright {
    color: var(--alien);
}
