/* ─── typefall 下落打字游戏：全屏锁定、字母下落层、遮罩、指法坞 ─── */

/* 全屏不可滚动：仅本页 body.tf-locked 生效，不污染全站 */
body.tf-locked {
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: #020617;
}
body.tf-locked > header,
body.tf-locked > footer {
    display: none;
}

#tfRoot {
    position: relative;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(1200px 600px at 50% -10%, #0f172a 0%, #020617 70%);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* 顶栏（固定，不滚动） */
.tf-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    padding: 0 1rem;
    box-sizing: border-box;
    font-size: 1rem;
    color: #cbd5e1;
    background: rgba(2, 6, 17, 0.55);
    border-bottom: 1px solid rgba(96, 165, 250, 0.14);
    z-index: 30;
}
.tf-stat b { color: #60a5fa; font-size: 1.15rem; font-weight: 800; }
.tf-stat i { font-style: normal; font-size: .78rem; color: #64748b; }

.tf-hand-btn {
    position: absolute;
    right: 1rem;
    top: 10px;
    padding: .32rem .85rem;
    font-size: .85rem;
    color: #cbd5e1;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s;
}
.tf-hand-btn:hover { background: rgba(96, 165, 250, 0.22); }
#tfPauseBtn { right: auto; left: 1rem; }

/* 下落层 + 地板线（高度自适应视口） */
.tf-field {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 48px;
    overflow: hidden;
}
.tf-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.85), transparent);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
    z-index: 20;
}
.tf-hintbar {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .8rem;
    color: #475569;
    z-index: 25;
}

/* 只读隐藏输入框（中文输入法影子层锚点） */
#tfInput {
    position: absolute;
    left: -1000px;
    top: -1000px;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: 0;
    padding: 0;
}

/* 下落字母（绝对定位；禁用 CSS transition 防抖动） */
.tf-letter {
    position: absolute;
    top: 0;
    left: 0;
    width: 64px;
    height: 64px;
    line-height: 64px;
    text-align: center;
    font-size: 38px;
    font-weight: 800;
    font-family: Consolas, 'Courier New', monospace;
    color: #f1f5f9;
    text-shadow: 0 0 14px rgba(96, 165, 250, 0.8);
    will-change: transform;
    pointer-events: none;
}
.tf-letter.tf-danger { color: #fbbf24; text-shadow: 0 0 16px rgba(251, 191, 36, 0.9); }

/* 命中爆炸 / 落地失败特效（JS 用 rAF 驱动 transform/opacity，不用 transition） */
.tf-fx {
    position: absolute;
    top: 0;
    left: 0;
    width: 64px;
    height: 64px;
    line-height: 64px;
    text-align: center;
    font-size: 38px;
    font-weight: 800;
    font-family: Consolas, 'Courier New', monospace;
    pointer-events: none;
}
.tf-fx-hit { color: #4ade80; text-shadow: 0 0 18px rgba(74, 222, 128, 0.95); }
.tf-fx-miss { color: #ef4444; text-shadow: 0 0 18px rgba(239, 68, 68, 0.95); }

/* 实时小气泡 */
.tf-live {
    position: absolute;
    left: 50%;
    top: 70px;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: 800;
    color: #4ade80;
    text-shadow: 0 0 16px rgba(74, 222, 128, 0.8);
    opacity: 0;
    pointer-events: none;
    z-index: 26;
}

/* 遮罩（开始/暂停/结束） */
.tf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 17, 0.78);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.tf-overlay.hidden { display: none; }
.tf-overlay-box {
    max-width: 560px;
    margin: 0 1rem;
    padding: 2rem 2.4rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 17, 0.96));
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 20px;
    color: #e2e8f0;
}
.tf-overlay-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .9rem; }
.tf-overlay-sub { font-size: .92rem; color: #94a3b8; line-height: 1.9; margin-bottom: 1rem; }
.tf-today { font-size: .85rem; color: #64748b; margin-bottom: 1.3rem; }
.tf-today b { color: #60a5fa; }
.tf-btn-primary {
    padding: .7rem 2.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #020617;
    background: linear-gradient(90deg, #60a5fa, #38bdf8);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.tf-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(96, 165, 250, 0.35); }

/* 指法演示坞（复用 typing_hand.css 内部布局；本页覆写为右上角弹出面板） */
.tf-ttdock-wrap {
    position: fixed;
    top: 64px;
    right: 16px;
    z-index: 1500;
    display: none;
    width: min(720px, 90vw);
}
.tf-ttdock-wrap.show { display: block; }
.tf-ttdock-wrap #ttDock { width: 100%; }

/* 触屏/小屏：不支持提示（任务书：移动端不做） */
@media (pointer: coarse) {
    .tf-top { font-size: .9rem; gap: 1.2rem; }
}
