/* ===== tilt-maze · 倾斜迷宫 ===== */

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

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

/* ---- HUD ---- */
.tm-hud {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 520px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.tm-hud-item {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #a7f3d0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}
.tm-hud-label {
    font-size: 11px;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.tm-hud-value {
    font-size: 20px;
    font-weight: 900;
    color: #065f46;
    margin-top: 2px;
    line-height: 1.2;
}

/* ---- Controls ---- */
.tm-controls {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.tm-btn {
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid #a7f3d0;
    background: #fff;
    color: #065f46;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tm-btn:hover { background: #f0fdf4; transform: translateY(-1px); }
.tm-btn:active { transform: translateY(0); }
.tm-btn.primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}
.tm-btn.primary:hover { background: linear-gradient(135deg, #059669, #047857); }
.tm-btn.is-active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-color: transparent;
}

/* ---- Canvas ---- */
.tm-canvas-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.25);
    touch-action: none;
    user-select: none;
}
.tm-canvas-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

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

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

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

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .tm-hero { padding: 24px 14px 20px; }
    .tm-hud-item { min-width: 72px; padding: 8px 10px; }
    .tm-hud-value { font-size: 17px; }
    .tm-controls { gap: 8px; }
    .tm-btn { padding: 8px 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .tm-overlay { animation: none; }
}
