* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background: linear-gradient(180deg, #2c1810 0%, #1a0f0a 50%, #0d0705 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Arial', 'PingFang SC', sans-serif;
    overflow: hidden;
    touch-action: manipulation;
}

.game-wrapper {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: -31px;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.game-title {
    font-size: 24px;
    font-weight: 700;
    color: #d4a84b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 4px;
}

.bgm-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bgm-label {
    font-size: 12px;
    color: rgba(212, 168, 75, 0.6);
}

.back-btn {
    background: rgba(212, 168, 75, 0.15);
    border: 1px solid rgba(212, 168, 75, 0.3);
    color: #d4a84b;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:active {
    transform: scale(0.95);
    background: rgba(212, 168, 75, 0.25);
}

.merit-label {
    font-size: 22px;
    color: rgba(212, 168, 75, 0.7);
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 5px;
}

.merit-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px 40px;
    background: rgba(212, 168, 75, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(212, 168, 75, 0.2);
}

.merit-value {
    font-size: 48px;
    font-weight: 700;
    color: #d4a84b;
    text-shadow: 0 0 20px rgba(212, 168, 75, 0.5);
    font-family: 'Courier New', 'Consolas', monospace;
}

.game-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#game-canvas {
    border-radius: 50%;
    cursor: pointer;
}

.stats-container {
    width: 100%;
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    padding: 12px 20px;
    background: rgba(212, 168, 75, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(212, 168, 75, 0.15);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: rgba(212, 168, 75, 0.6);
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #d4a84b;
}

.game-tip {
    color: rgba(212, 168, 75, 0.5);
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
}

.floating-text {
    position: fixed;
    font-size: 24px;
    font-weight: 700;
    color: #d4a84b;
    text-shadow: 0 0 10px rgba(212, 168, 75, 0.8);
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 100;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(1.2);
    }
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(212, 168, 75, 0.2);
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid rgba(212, 168, 75, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: rgba(212, 168, 75, 0.6);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(212, 168, 75, 0.4);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background-color: #d4a84b;
}
