/* public/assets/css/tools/game/typing-game.css */
.typ-wrapper { 
    background: var(--bg-surface); border-radius: 24px; padding: 24px; 
    border: 1px solid var(--border-color); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); 
    display: flex; flex-direction: column; gap: 16px;
}

/* 原生全屏状态下的专属样式 */
.typ-wrapper:fullscreen {
    padding: 40px 5%; background: var(--bg-surface); overflow-y: auto; border-radius: 0;
}
.typ-wrapper:-webkit-full-screen {
    padding: 40px 5%; background: var(--bg-surface); overflow-y: auto; border-radius: 0;
}

.typ-header { font-size: 1.5rem; font-weight: 700; color: var(--text-main); text-align: center; margin: 0; }
.typ-subtitle { color: var(--text-muted); text-align: center; font-size: 0.9rem; margin-bottom: 8px; }

/* 极致紧凑的控制台排版 */
.typ-controls-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
    background: var(--bg-body); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-color);
}
.typ-cfg-group { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.typ-control-item { display: flex; align-items: center; gap: 6px; }
.typ-control-item label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin: 0; white-space: nowrap; }
.typ-select { padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-surface); color: var(--text-main); outline: none; font-size: 0.9rem; cursor: pointer; }

.typ-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.typ-btn { background: var(--primary-color); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.typ-btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0,102,204,0.2); }
.typ-btn-sec { background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-color); }
.typ-btn-sec:hover { border-color: var(--primary-color); color: var(--primary-color); box-shadow: none; }

/* 赛道区域 */
.typ-track-container { background: #1e293b; border-radius: 12px; padding: 16px; position: relative; overflow: hidden; box-shadow: inset 0 4px 15px rgba(0,0,0,0.4); border: 2px solid #334155; }
.typ-lane { position: relative; height: 50px; border-bottom: 2px dashed #475569; margin-bottom: 8px; display: flex; align-items: center; }
.typ-lane:last-child { border-bottom: none; margin-bottom: 0; }
.typ-finish-line { position: absolute; right: 16px; top: 0; bottom: 0; width: 8px; background: repeating-linear-gradient(45deg, #fff, #fff 8px, #000 8px, #000 16px); z-index: 1; opacity: 0.8; border-radius: 2px; }

/* 比赛单位：修正模型朝向反了的问题 */
.typ-player, .typ-bot { position: absolute; left: 0; font-size: 2.2rem; transition: left 0.1s linear; z-index: 2; transform: translateX(0); filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); display: flex; flex-direction: column; align-items: center; }
.typ-name-tag { position: absolute; top: -12px; font-size: 0.65rem; background: rgba(0,0,0,0.7); color: white; padding: 2px 6px; border-radius: 4px; white-space: nowrap; z-index: 3; font-weight: bold; }
.typ-emoji-icon { display: inline-block; transform: scaleX(-1); }

/* 打字区域 */
.typ-typing-area { flex-grow: 1; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; font-size: 1.5rem; line-height: 1.8; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: 1px; word-wrap: break-word; position: relative; cursor: text; min-height: 150px; }
.typ-char { color: var(--text-muted); position: relative; transition: 0.1s; border-radius: 4px; padding: 0 1px; }
.typ-char.correct { color: #10b981; }
.typ-char.incorrect { color: #ef4444; background: #fee2e2; }
.typ-char.active { color: var(--text-main); font-weight: bold; border-bottom: 3px solid var(--primary-color); }

.typ-overlay-msg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.9); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; z-index: 10; opacity: 0; pointer-events: none; transition: 0.3s; }
.typ-overlay-msg.show { opacity: 1; pointer-events: auto; }
.typ-overlay-title { font-size: 1.8rem; font-weight: bold; margin-bottom: 16px; text-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* 数据统计 */
.typ-stats { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.typ-stat-card { flex: 1; min-width: 100px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; text-align: center; }
.typ-stat-val { font-size: 1.6rem; font-weight: 700; color: var(--primary-color); margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

[data-theme="dark"] .typ-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .typ-wrapper:fullscreen { background: #0f172a; }
[data-theme="dark"] .typ-controls-bar, [data-theme="dark"] .typ-typing-area, [data-theme="dark"] .typ-stat-card { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .typ-select, [data-theme="dark"] .typ-btn-sec { background: #1e293b; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .typ-char.incorrect { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .typ-overlay-msg { background: rgba(15, 23, 42, 0.9); }