* {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #0a0f2a 0%, #0c112e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', 'Poppins', 'Quicksand', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 20px;
}

.game-container {
    background: rgba(10, 20, 40, 0.6);
    border-radius: 64px;
    padding: 20px 20px 24px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
}

/* 移动端适配 */
@media (max-width: 600px) {
    body {
        padding: 0;
        min-height: 100vh;
        height: 100vh;
        overflow: hidden;
    }

    .game-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 8px 8px 12px;
        display: flex;
        flex-direction: column;
    }

    .game-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        border-radius: 24px;
        padding: 8px;
    }

    .status-bar {
        padding: 6px 10px;
        margin-bottom: 6px;
        flex-shrink: 0;
    }

    .score-box,
    .level-box,
    .target-box {
        padding: 4px 8px;
    }

    .score-label,
    .level-label,
    .target-label {
        font-size: 10px;
    }

    .score-value,
    .level-value,
    .target-value {
        font-size: 18px;
    }

    .board-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 4px 0 8px;
        min-height: 0;
        width: 100%;
        padding: 0;
    }

    canvas {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
        max-width: 100vw;
        max-height: calc(100vh - 120px);
        border-radius: 8px;
    }

    .action-bar {
        flex-shrink: 0;
        gap: 8px;
        margin-top: 6px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    .footer-tip {
        font-size: 12px;
        margin-top: 6px;
        padding: 0 8px;
    }
}

.game-panel {
    background: #1a1f3a;
    border-radius: 48px;
    padding: 8px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: #0f132e;
    padding: 12px 24px;
    border-radius: 60px;
    margin-bottom: 24px;
    color: #ffefcf;
    text-shadow: 0 2px 3px #00000040;
    box-shadow: inset 0 1px 3px #ffffff20, 0 5px 8px #00000030;
}

.score-box,
.level-box,
.target-box {
    background: #232842;
    padding: 8px 18px;
    border-radius: 40px;
    text-align: center;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

.score-label,
.level-label,
.target-label {
    font-size: 14px;
    letter-spacing: 1px;
    color: #b9c8ff;
}

.score-value,
.level-value,
.target-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #ffe6a3;
}

.board-wrapper {
    display: flex;
    justify-content: center;
    margin: 10px 0 20px;
}

canvas {
    background: #1e2448;
    border-radius: 8px;
    box-shadow: 0 12px 28px black, inset 0 0 0 2px rgba(255, 255, 240, 0.15);
    cursor: pointer;
    width: 100%;
    height: auto;
    aspect-ratio: 3.8 / 4;
    max-width: 600px;
    display: block;
    margin: 0 auto;
}

.action-bar {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(135deg, #2a2f55, #191e3a);
    border: none;
    padding: 10px 20px;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: bold;
    color: #f5e7d9;
    box-shadow: 0 5px 0 #0b0e20;
    transition: 0.07s linear;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0b0e20;
}

.btn-primary {
    background: linear-gradient(135deg, #f9b43a, #fb8c2c);
    color: #2a1b0a;
    text-shadow: none;
    box-shadow: 0 5px 0 #a35117;
}

.btn-danger {
    background: linear-gradient(135deg, #7a2e3a, #551e28);
}

/* 锤子模式激活状态 */
.btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: pulse 0.8s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(231, 76, 60, 0);
    }
}

.footer-tip {
    text-align: center;
    font-size: 14px;
    color: #8f9bb5;
    margin-top: 15px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-card {
    background: #232842;
    border-radius: 56px;
    padding: 30px 32px;
    text-align: center;
    width: 280px;
    color: white;
    box-shadow: 0 20px 35px black;
    border: 1px solid #ffd966;
}

.modal-card h3 {
    font-size: 32px;
    margin: 0 0 10px;
}

.modal-card p {
    margin: 15px 0;
    font-size: 18px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* 颜色选择面板 */
.color-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.color-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-option:hover {
    transform: scale(1.15);
    border-color: white;
}

/* 彩蛋输入框 */
.cheat-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 30px;
    border: 2px solid #ffd966;
    background: #1a1f3a;
    color: #ffd966;
    font-size: 18px;
    text-align: center;
    outline: none;
    margin: 15px 0;
}

.cheat-input::placeholder {
    color: #6b7aa3;
}

.toast-score {
    position: fixed;
    pointer-events: none;
    font-weight: bold;
    font-size: 28px;
    color: #ffd966;
    text-shadow: 0 0 6px #ff7e05;
    z-index: 200;
    animation: floatUp 2.2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0px) scale(0.8);
    }

    100% {
        opacity: 0;
        transform: translateY(-70px) scale(1.3);
    }
}

/* 主界面弹窗样式 */
.main-menu-card {
    background: linear-gradient(145deg, #1a1f3a 0%, #0f132e 100%);
    border-radius: 64px;
    padding: 60px 40px;
    text-align: center;
    width: 90%;
    max-width: 450px;
    color: white;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid #ffd966;
    position: relative;
    overflow: hidden;
}

.main-menu-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 217, 102, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.game-title {
    font-size: 64px;
    font-weight: 900;
    margin: 0 0 10px;
    background: linear-gradient(135deg, #90aaff, #ddb70e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: 4px;
    position: relative;
    z-index: 1;
}

.game-subtitle {
    font-size: 32px;
    color: #b9c8ff;
    margin: 0 0 40px;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.btn-large {
    width: 100%;
    max-width: 280px;
    padding: 16px 32px!important;
    font-size: 24px!important;
    border-radius: 50px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

@media (max-width: 550px) {
    .status-bar {
        padding: 6px 16px;
    }

    .score-value,
    .level-value,
    .target-value {
        font-size: 20px;
    }

    .btn {
        padding: 6px 14px;
        font-size: 14px;
    }

    .footer-tip {
        font-size: 12px;
        margin-top: 6px;
        padding: 0 8px;
    }

    canvas {
        width: 100%;
        height: auto;
        aspect-ratio: 13 / 16;
        max-width: 100vw;
        max-height: calc(100vh - 180px);
        border-radius: 8px;
    }
}