/* ==========================================================================
   电竞反应 · 通用舞台样式（arcade.css）
   --------------------------------------------------------------------------
   这份文件是**源文件**，会在构建时被拼到每个「电竞反应」工具的 style.css 开头。
   修改后运行：python _bt/gen_tool_css.py
   设计：沿用站点 custom_ui.css 的配色变量（品牌橙 #ff6500）+ 深色舞台，
        与既有「视觉反应速度测试(sudutest)」视觉语言保持一致。
   ========================================================================== */

.es-wrap {
    --es-accent: #ff6500;
    --es-accent-soft: #fff4ec;
    --es-ink: var(--ui-text-strong, #1d2530);
    --es-body: var(--ui-text-body, #3d4655);
    --es-muted: var(--ui-text-muted, #8b95a5);
    --es-line: var(--ui-border, #e9edf2);
    --es-soft: var(--ui-bg-soft, #f3f5f8);
    --es-font: var(--ui-font, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    font-family: var(--es-font);
    color: var(--es-body);
}

/* ---------------- 顶部数据卡 ---------------- */

.es-hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .6rem;
    margin-bottom: .7rem;
}

.es-hud > div {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: .6rem .3rem;
    text-align: center;
    transition: .15s;
    background: #fff;
}

.es-hud > div > span:first-child {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #54738f;
    margin-bottom: .25rem;
}

.es-hud b {
    font-size: 1.35rem;
    line-height: 1.5;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.es-hud i {
    font-size: .72rem;
    font-style: normal;
    color: #6f8da8;
    margin-left: 2px;
}

/* ---------------- 舞台 ---------------- */

.es-stage {
    border-radius: 10px;
    height: 13rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
    font-size: 1.4rem;
    color: #fff;
    text-shadow: 0 3px 8px rgba(0, 0, 0, .45);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .18);
    padding: 1rem .6rem;
    text-align: center;
    line-height: 1.35;
    word-break: break-word;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    transition: background .12s ease, transform .1s;
}

.es-stage.idle { background: #3a4f63; background-image: radial-gradient(circle at 30% 40%, #5d7a94, #2f3f4e); }
.es-stage.wait { background: #3f7090; background-image: radial-gradient(circle at 70% 30%, #6fa3cc, #2b5470); }
.es-stage.go   { background: #3f8f4a; background-image: radial-gradient(circle at 40% 50%, #7fd08a, #2f7a3a); }
.es-stage.warn { background: #8f3f3f; background-image: radial-gradient(circle at 40% 50%, #d08a8a, #7a2f2f); }
.es-stage.night-stage { background: #2b3440; background-image: radial-gradient(circle at 40% 45%, #475566, #232b35); }

.es-stage-tip {
    position: absolute;
    left: 50%;
    bottom: .55rem;
    transform: translateX(-50%);
    font-size: .7rem;
    color: rgba(255, 255, 255, .72);
    text-shadow: none;
    white-space: nowrap;
}

/* ---------------- 工具条 ---------------- */

.es-bar {
    display: flex;
    gap: .5rem .6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: .7rem;
    font-size: .78rem;
    color: var(--es-muted);
}

.es-btn {
    background: var(--es-accent);
    border: 0;
    color: #fff;
    font-size: .82rem;
    padding: .42rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: .18s;
    font-family: inherit;
    line-height: 1.5;
}

.es-btn:hover { background: #e65a00; }
.es-btn:disabled { opacity: .45; cursor: not-allowed; }

.es-btn.ghost {
    background: #fff;
    color: var(--es-body);
    border: 1px solid var(--es-line);
}

.es-btn.ghost:hover { border-color: var(--es-accent); color: var(--es-accent); background: #fff; }

.es-select {
    border: 1px solid var(--es-line);
    border-radius: 999px;
    padding: .35rem .7rem;
    font-size: .78rem;
    font-family: inherit;
    color: var(--es-body);
    background: #fff;
    outline: none;
    cursor: pointer;
}

.es-select:focus { border-color: var(--es-accent); }

/* ---------------- 日志 ---------------- */

.es-log {
    background: rgba(10, 20, 32, .9);
    border-radius: 8px;
    border: 1px solid #2e4b62;
    color: #e4edf5;
    padding: .55rem .7rem;
    max-height: 8rem;
    overflow-y: auto;
    font-size: .76rem;
    line-height: 1.85;
    font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

.es-log div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.es-log .ok  { color: #8fe08f; }
.es-log .bad { color: #ff9f9f; }
.es-log .dim { color: #8fa8bd; }

/* ---------------- 结果小结 ---------------- */

.es-result {
    border: 1px solid var(--es-line);
    border-left: 3px solid var(--es-accent);
    border-radius: 8px;
    padding: .7rem .9rem;
    margin-bottom: .7rem;
    background: var(--es-accent-soft);
    font-size: .82rem;
    line-height: 1.9;
    display: none;
}

.es-result.show { display: block; }

.es-result b {
    font-size: 1.05rem;
    color: var(--es-accent);
    font-variant-numeric: tabular-nums;
}

/* ---------------- 网格类游戏（序列记忆 / 瞄准等复用） ---------------- */

.es-grid {
    display: grid;
    gap: .5rem;
    margin: 0 auto;
    justify-content: center;
}

.es-cell {
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    cursor: pointer;
    transition: background .1s, transform .1s;
}

.es-cell:hover { background: rgba(255, 255, 255, .18); }
.es-cell.on { background: #7fd08a; transform: scale(.96); }
.es-cell.err { background: #d08a8a; }

/* ---------------- 暗色模式 ---------------- */

.night .es-hud > div,
body.night .es-hud > div { background: #181a1b; border-color: #444; }

.night .es-hud > div > span:first-child,
.night .es-hud i { color: #aaa; }

.night .es-btn.ghost { background: #1b1e23; color: #c4ccd6; border-color: #2a2f37; }
.night .es-btn.ghost:hover { background: #1b1e23; }

.night .es-select { background: #1b1e23; color: #c4ccd6; border-color: #2a2f37; }

.night .es-result { background: rgba(255, 101, 0, .1); border-color: #2a2f37; border-left-color: var(--es-accent); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 510px) {
    .es-hud { grid-template-columns: repeat(2, 1fr); }
    .es-stage { height: 11rem; font-size: 1.15rem; }
    .es-hud b { font-size: 1.2rem; }
    .es-log { font-size: .72rem; }
}


/* ===== 瞄准训练 · 专有样式 ===== */

.es-stage { cursor: crosshair; }

.es-target {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #ffe0a8, #ff6500 58%, #b84700 100%);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .26), 0 8px 20px rgba(0, 0, 0, .45);
    cursor: crosshair;
    animation: at-pop .15s ease-out;
    will-change: left, top;
}

/* 靶心白点 */
.es-target::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26%;
    height: 26%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
}

@keyframes at-pop {
    from { transform: scale(.55); opacity: .35; }
    to   { transform: scale(1);   opacity: 1; }
}

#atStage { touch-action: manipulation; }

@media (max-width: 510px) {
    .es-stage { height: 15rem; }
    .es-bar .es-select { font-size: .72rem; padding: .3rem .55rem; }
}
