/*html, body {*/
/*    min-height: 100%;*/
/*    background: #041f24 url("/static/imgs/game/finger-bg-4fb7ff1fb9a7697b86b451b6e71e3782.jpg") no-repeat;*/
/*    background-size: cover;*/
/*    font-family: "Microsoft YaHei", sans-serif;*/
/*}*/

.finger-container {
    position: relative;
    min-height: 100%;;
}

/*背景图层*/
.finger-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("/static/imgs/game/finger-bg-4fb7ff1fb9a7697b86b451b6e71e3782.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    z-index: -1;
}

.main-layout {
    display: flex;
    gap: 16px;
    padding: 20px 12px;
    max-width: 1400px;
    margin: 0 auto;
    opacity: 0.9;
}

.leftbar, .sidebar {
    width: 195px;
    flex-shrink: 0;
    background: #eee26c;
    opacity: 0.8;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 20px 16px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar-title, .controls-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mode-selector .mode-btn {
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
    transition: all 0.2s;
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.mode-btn:hover, .mode-btn.active {
    background-color: #5cb85c;
    color: #fff;
}

.game-area {
    background: #2c323c;
    border-radius: 12px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
    padding: 32px 20px;
    margin-bottom: 20px;
    cursor: pointer;

    position: relative;
    min-height: 200px;
}

.target-key {
    min-height: 120px;
    font-size: 32px;
    line-height: 1.5;
    /*color: #222;*/
    text-align: center;
}

.target-key.correct {
    background-color: #eaf8ee;
    color: #27ae60;
}

.target-key.wrong {
    background-color: #ffe9e9;
    color: #d94444;
}

.keyboard {
    --key-scale: 1;
    background: #2c323c;
    border-radius: 12px;
    padding: calc(16px * var(--key-scale)) calc(12px * var(--key-scale));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    /*overflow-x: auto; !*极端窄屏幕横向滚动兜底*!*/
}

.keyboard-row {
    display: flex;
    gap: calc(6px * var(--key-scale));
    margin-bottom: calc(8px * var(--key-scale));
    justify-content: center;
    flex-wrap: nowrap;
}

.keyboard-maxed .keyboard-row {
    justify-content: space-evenly;
}

.key {
    background-color: #444b58;
    color: #fff;
    border: none;
    border-radius: 6px;
    min-width: calc(42px * var(--key-scale));
    height: calc(46px * var(--key-scale));
    font-size: calc(14px * var(--key-scale));
    position: relative;
    box-shadow: 0 3px 0 #22262d;
    transition: all 0.12s ease;
    padding: 2px 4px;
}

.key:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #22262d;
}

.key.target {
    background: linear-gradient(135deg, #fff59d 0%, #ffee58 100%);
    color: black;
    animation: targetBounce 1.5s infinite;
    box-shadow: 0 0 25px rgba(255, 238, 88, 0.6);
    border-color: #fbc02d;
}

@keyframes targetBounce {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    25% {
        transform: scale(1.07) translateY(-2px);
    }
    75% {
        transform: scale(1.15) translateY(-2px);
    }
}

.key.correct {
    background-color: #27ae60;
}

.key.wrong {
    background-color: #d63031;
}

.key.active {
    background-color: #586272;
}

.space-key {
    flex: 1;
    min-width: calc(180px * var(--key-scale));
}

.home-bump {
    position: absolute;
    bottom: calc(4px * var(--key-scale));
    left: 50%;
    transform: translateX(-50%);
    font-size: calc(10px * var(--key-scale));
    opacity: 0.6;
}

.finger-hint-bubble {
    position: absolute;
    top: calc(-28px * var(--key-scale));
    left: 50%;
    transform: translateX(-50%);
    background: #ffc107;
    color: #222;
    font-size: calc(11px * var(--key-scale));
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
}

.stats {
    margin-bottom: 24px;
}

.stat-box {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-label {
    color: #666;
}

.stat-number {
    font-weight: bold;
    font-size: 18px;
    color: #222;
}

.ctrl-btn {
    width: 100%;
    margin-bottom: 10px;
}

.speed-control-group {
    margin-top: 16px;
}

.speed-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
}

.speed-buttons {
    display: flex;
    gap: 2px;
}

.speed-btn {
    flex: 1;
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.speed-btn.active {
    background-color: #5cb85c;
    color: #fff;
}

#settingsBtn.active {
    background-color: #5cb85c;
    color: #fff;
}

.bubble {
    position: absolute;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.1) 70%, transparent 100%);
    animation: bubbleRise linear forwards;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0);
        opacity: 0.7;
    }
    100% {
        transform: translateY(calc(-100% - 120px)); /*向上移出容器顶部*/
        opacity: 0;
    }
}

/*响应式适配*/
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }

    .leftbar, .sidebar {
        width: auto;
    }

    .mode-selector {
        display: grid;
        grid-template-columns:repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }

    .mode-selector .mode-btn {
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {
    .target-key {
        font-size: 24px;
        min-height: 90px;
    }
}