/* ===== rhythm-tap · 节奏点击 ===== */

.rt-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 28px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fef2f2 0%, #fff1f2 60%, #fff7ed 100%);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #fecaca;
}

.rt-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    width: 460px;
    height: 460px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

/* ---- HUD ---- */
.rt-hud {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.rt-hud-item {
    flex: 1;
    min-width: 72px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #fecaca;
    text-align: center;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.08);
}
.rt-hud-label {
    font-size: 10px;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.rt-hud-value {
    font-size: 18px;
    font-weight: 900;
    color: #991b1b;
    margin-top: 1px;
    line-height: 1.2;
}
.rt-combo { color: #7c2d12; }
.rt-combo.is-bump { animation: rt-combo-pop 0.25s ease; }
@keyframes rt-combo-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #ef4444; }
    100% { transform: scale(1); }
}

/* ---- Controls ---- */
.rt-controls {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}
.rt-btn {
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fff;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rt-btn:hover { background: #fef2f2; transform: translateY(-1px); }
.rt-btn:active { transform: translateY(0); }
.rt-btn.primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.4);
}
.rt-btn.primary:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ---- Canvas ---- */
.rt-canvas-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1.5;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.3);
    touch-action: none;
    user-select: none;
}
.rt-canvas-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* ---- Overlay ---- */
.rt-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(17, 24, 39, 0.72);
    backdrop-filter: blur(3px);
    animation: rt-fade 0.25s ease;
}
.rt-overlay[hidden] { display: none; }
@keyframes rt-fade { from { opacity: 0; } to { opacity: 1; } }

.rt-overlay-card {
    text-align: center;
    padding: 28px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
    max-width: 86%;
}
.rt-overlay-emoji { font-size: 48px; line-height: 1; margin-bottom: 10px; }
.rt-overlay-title { font-size: 26px; font-weight: 900; color: #991b1b; letter-spacing: -0.02em; }
.rt-overlay-text { font-size: 14px; color: #dc2626; margin: 8px 0 18px; }
.rt-overlay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- 移动端轨道按键 ---- */
.rt-dpad {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    margin-top: 14px;
    width: 100%;
    max-width: 420px;
}
.rt-dpad-btn {
    flex: 1;
    padding: 10px 6px;
    border-radius: 10px;
    border: 2px solid #dc2626;
    background: #fff;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.08s ease;
    user-select: none;
}
.rt-dpad-btn kbd {
    font-size: 10px;
    font-weight: 800;
    font-family: ui-monospace, monospace;
    color: #991b1b;
}
.rt-dpad-btn:active, .rt-dpad-btn.is-pressed {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    transform: scale(0.95);
}
.rt-dpad-btn:active kbd, .rt-dpad-btn.is-pressed kbd {
    color: #fff;
}

.rt-hint {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    font-size: 12.5px;
    color: #dc2626;
    font-weight: 500;
}
.rt-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    margin: 0 1px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #fecaca;
    border-bottom-width: 2px;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    color: #991b1b;
}

/* ---- Info ---- */
.rt-info { margin-bottom: 28px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .rt-hero { padding: 24px 14px 20px; }
    .rt-hud { gap: 6px; }
    .rt-hud-item { min-width: 62px; padding: 6px 8px; }
    .rt-hud-value { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .rt-overlay { animation: none; }
    .rt-combo.is-bump { animation: none; }
}
