/* 单词接龙 · 在线版样式
   深色主题；对局页用 flex 纵向布局，消息区 flex:1 独立滚动，
   输入栏 flex:0 0 auto —— 这样输入框从第一轮起就贴在底部，不会随消息增多下移。 */

:root {
  --bg: #0b0d16;
  --bg-2: #10131f;
  --panel: #161a29;
  --panel-2: #1d2233;
  --panel-3: #232941;
  --line: #2a3049;
  --line-2: #353d5c;
  --text: #e9ecf8;
  --muted: #8f96b3;
  --muted-2: #6b7290;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
  --r: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: radial-gradient(1200px 700px at 12% -10%, #1d2340 0%, transparent 55%),
              radial-gradient(900px 600px at 96% 4%, #16283a 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }
.hidden { display: none !important; }

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------------- 通用控件 ---------------- */

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700;
  padding: 11px 22px; border-radius: 12px;
  transition: .16s; box-shadow: 0 8px 22px rgba(124, 92, 255, .32);
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(124, 92, 255, .42); }
.primary:active { transform: translateY(0); }
.primary:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.soft-btn {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 12px; color: var(--text);
  font-weight: 600; transition: .16s;
}
.soft-btn:hover { background: var(--panel-3); border-color: var(--line-2); }
.soft-btn:disabled { opacity: .4; cursor: not-allowed; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 15px; transition: .16s;
}
.icon-btn:hover { background: var(--panel-3); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input {
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); padding: 12px 14px; border-radius: 11px;
  outline: none; transition: .16s; width: 100%;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }
.field input::placeholder { color: var(--muted-2); }

.seg { display: flex; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); padding: 5px; border-radius: 13px; flex-wrap: wrap; }
.seg button { padding: 8px 15px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: .16s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 255, .32); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.chip.on { color: var(--good); border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .12); }
.chip.warn { color: var(--warn); border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .12); }

/* ---------------- 登录页 ---------------- */

.auth-wrap {
  flex: 1; display: grid; place-items: center; padding: 24px; overflow-y: auto;
}
.auth-card {
  width: min(94vw, 420px); background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 28px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 21px;
  box-shadow: 0 8px 20px rgba(124, 92, 255, .35);
}
/* 品牌位换成真实图标：图标自己带底色，不能再叠一层渐变，
   否则圆角边缘会透出紫色渐变、和图标白底打架。 */
.brand .logo.logo-img {
  background: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
  overflow: hidden; padding: 0;
}
.brand .logo.logo-img img {
  width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit;
}
.brand h1 { font-size: 21px; letter-spacing: .5px; }
.brand .sub { font-size: 11px; color: var(--muted-2); letter-spacing: 2.5px; font-weight: 600; }
.auth-card .brand { margin-bottom: 22px; }

/* ---------------- 在线人数 ----------------
   两个位置共用：登录页品牌下方（.online-line）与大厅「我的战绩」卡片标题行右侧
   （.online-chip）。数字由 app.js 统一往所有 .online-text 里写，所以这里只管外观。 */

.online-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--good); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18);
  animation: onlinePulse 2.4s ease-in-out infinite;
}
/* 呼吸效果只是「有人在活动」的暗示，不承载信息，所以做得极轻；
   并且尊重系统「减少动态效果」设置，免得前庭敏感的用户难受。 */
@keyframes onlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  .online-dot { animation: none; }
}

.online-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .3);
  color: var(--good); white-space: nowrap;
}
/* 卡片标题行里的那颗：靠 margin-left:auto 顶到最右侧。
   h3 本身是 flex+gap，标题与名字标签在左，在线人数独占右边。
   margin-left 给 8px 是为了在极窄屏上跟名字标签至少留出 gap 的距离。 */
.card h3 .online-chip { margin-left: auto; padding: 3px 9px; font-size: 11.5px; }
/* 窄屏优先保在线人数的完整显示，让左侧的名字标签先缩 */
.card h3 .tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-line {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: -10px 0 18px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.auth-card .field { margin-bottom: 13px; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.auth-switch button { color: var(--accent-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12px; margin: 18px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------------- 顶栏 ---------------- */

.topbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: rgba(22, 26, 41, .72); backdrop-filter: blur(10px);
}
.topbar .brand { margin: 0; gap: 10px; }
.topbar .brand .logo { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
.topbar .brand h1 { font-size: 16px; }
.topbar .brand .sub { display: none; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.topbar .who b { color: var(--text); }

/* ---------------- 页面容器 ---------------- */

.screen { flex: 1 1 auto; min-height: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

.scroll-area { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px; }
.wrap { width: min(1080px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px;
}
.card h3 { font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.card h3 .tag { font-size: 11px; font-weight: 600; color: var(--muted-2); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-strip .st { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; }
.stat-strip .st b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.stat-strip .st span { font-size: 11.5px; color: var(--muted-2); }

.setup-row { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; flex-wrap: wrap; }
.setup-row > label { width: 74px; font-size: 13px; color: var(--muted); font-weight: 600; flex: 0 0 auto; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* 房间码输入 */
.code-input {
  text-transform: uppercase; letter-spacing: 6px; font-weight: 800;
  font-size: 19px; text-align: center; font-family: ui-monospace, Consolas, monospace;
}

/* 公开房间列表 */
.room-list { display: flex; flex-direction: column; gap: 8px; max-height: 210px; overflow-y: auto; }
.room-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 13px;
}
.room-item .rc { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: 2px; color: var(--accent-2); }
.room-item .rh { font-size: 13px; }
.room-item .rn { font-size: 11.5px; color: var(--muted-2); }
.room-item .spacer { flex: 1; }
.room-item button { font-size: 12.5px; padding: 7px 14px; }

/* 「我的房间」分区标题 */
.sub-label { font-size: 12px; color: var(--muted-2); margin: 0 0 8px; }
.sub-label:not(:first-of-type) { margin-top: 15px; }
.room-item.pending { border-color: var(--bad); background: rgba(251, 113, 133, .08); }

/* 退出/取消这类破坏性操作：默认描边提示，进入确认态后填充强调 */
.soft-btn.danger { color: var(--bad); border-color: rgba(251, 113, 133, .4); }
.soft-btn.danger:hover { background: rgba(251, 113, 133, .12); border-color: var(--bad); }
.soft-btn.danger-on {
  background: var(--bad); border-color: var(--bad); color: #2a0d14; font-weight: 700;
}
.soft-btn.danger-on:hover { background: #ff8fa1; border-color: #ff8fa1; }

/* 我的房间列表里可能有两种按钮，窄屏下让它们换行而不是挤压 */
#myCreatedRooms .room-item, #myJoinedRooms .room-item { flex-wrap: wrap; }

.empty { text-align: center; color: var(--muted-2); font-size: 13px; padding: 18px; }

/* ---------------- 对局页 ---------------- */

.game-shell { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.game-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap;
}
.game-head .code-badge {
  font-family: ui-monospace, Consolas, monospace; font-weight: 800;
  background: var(--panel-2); border: 1px solid var(--line-2);
  padding: 5px 12px; border-radius: 9px; letter-spacing: 2px; color: var(--accent-2);
}
.game-head .spacer { flex: 1; }

.game-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 16px 18px; scroll-behavior: smooth;
}
.chat-inner { display: flex; flex-direction: column; gap: 14px; justify-content: flex-end; min-height: 100%; }

/* 消息气泡 */
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.right { flex-direction: row-reverse; }
.msg-ava {
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
  background: var(--pc, var(--accent)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.msg-col { max-width: min(74%, 560px); display: flex; flex-direction: column; gap: 3px; }
.msg.right .msg-col { align-items: flex-end; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; color: var(--muted-2); }
.msg-name { font-weight: 700; color: var(--pc, var(--muted)); }
.msg-bubble {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px;
}
.msg.right .msg-bubble { background: linear-gradient(135deg, var(--pc, var(--accent)), #4d3bd6); border-color: transparent; }
.msg-word { font-size: 19px; font-weight: 800; letter-spacing: .5px; line-height: 1.25; word-break: break-word; }
.msg.right .msg-bubble .msg-word { color: #fff; }
.msg-word .cap { color: var(--pc); }
.msg.right .msg-bubble .msg-word .cap { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.msg-meta { display: flex; align-items: center; gap: 9px; margin-top: 3px; font-size: 11px; color: var(--muted-2); }
.msg.right .msg-bubble .msg-meta { color: rgba(255, 255, 255, .84); }
.msg-meta .rare { color: var(--accent-2); font-weight: 700; }
.msg-meta .seal { color: var(--warn); font-weight: 700; }
.msg-meta .pts { color: var(--good); font-weight: 800; }
.msg.right .msg-bubble .msg-meta .pts { color: #fff; }
.msg.right .msg-bubble .msg-meta .rare { color: #c8f4ff; }
.msg.right .msg-bubble .msg-meta .seal { color: #ffe6a8; }

.msg-sys { display: flex; justify-content: center; }
.msg-sys span {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; padding: 6px 14px; border-radius: 999px; max-width: 82%; text-align: center;
}
.msg-sys.warn span { color: #ffd7dd; border-color: rgba(251, 113, 133, .45); background: rgba(251, 113, 133, .12); }
.msg-sys.ok span { color: #d5ffef; border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .12); }
.msg-sys.info span { color: #d8fbff; border-color: rgba(34, 211, 238, .4); background: rgba(34, 211, 238, .1); }

/* 输入中动画 */
.typing-row { display: flex; gap: 10px; align-items: flex-end; }
.typing-bubble { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; display: flex; gap: 5px; }
.typing-bubble i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: tup 1.1s infinite; }
.typing-bubble i:nth-child(2) { animation-delay: .16s; }
.typing-bubble i:nth-child(3) { animation-delay: .32s; }
@keyframes tup { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* 底部输入栏 */
.game-input {
  flex: 0 0 auto; border-top: 1px solid var(--line);
  background: var(--panel); padding: 10px 18px 14px;
}
.must-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.must-letter {
  display: inline-grid; place-items: center; min-width: 25px; height: 25px;
  border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 14px; padding: 0 6px;
}
.must-letter.free { background: linear-gradient(135deg, var(--good), #0ea5e9); font-size: 11.5px; }
.must-bar .spacer { flex: 1; }
.timer-track { width: 96px; height: 5px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--good), var(--accent)); transition: width .25s linear; }
.timer-fill.low { background: linear-gradient(90deg, var(--warn), var(--bad)); }
.timer-num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); min-width: 40px; text-align: right; }

.mini-btn {
  height: 29px; padding: 0 9px; border-radius: 8px; font-size: 12.5px;
  background: var(--panel-2); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 4px;
  transition: .16s;
}
.mini-btn:hover { background: var(--panel-3); }
.mini-btn:disabled { opacity: .4; cursor: not-allowed; }

.wait-bar { display: flex; gap: 10px; margin-bottom: 10px; }
.wait-bar button { flex: 1; }

.input-line { display: flex; gap: 10px; }
.input-line input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 13px 15px; border-radius: 12px; outline: none; transition: .16s;
}
.input-line input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .16); }
.input-line input:disabled { opacity: .55; cursor: not-allowed; }

/* 侧栏成员 */
.side { display: none; }
/* 移动端才用的成员条：桌面由侧栏承担同样信息，避免重复 */
.mobile-members { display: none; }
.side .pcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px; }
.side .pcard.turn { border-color: var(--pc); box-shadow: 0 0 0 1px var(--pc); }
.side .pcard.dead { opacity: .5; }
.side .pc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.side .pc-name { font-weight: 700; font-size: 13.5px; }
.side .pc-badge { font-size: 9.5px; padding: 2px 6px; border-radius: 5px; background: var(--panel-3); color: var(--muted); font-weight: 700; }
.side .pc-bot { display: flex; align-items: center; justify-content: space-between; }
.side .pc-score { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.side .pc-unit { font-size: 10.5px; color: var(--muted-2); margin-left: 2px; }
.side .pc-words { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.side .pc-lives { font-size: 11px; letter-spacing: 1px; }
.side .side-title { font-size: 12px; color: var(--muted-2); font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; }

/* 对局页：桌面分栏 */
@media (min-width: 900px) {
  .game-shell { flex-direction: row; }
  .game-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .side { display: block; flex: 0 0 250px; border-left: 1px solid var(--line); background: var(--panel); padding: 16px; overflow-y: auto; }
}
@media (max-width: 899px) {
  .game-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .mobile-members { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 9px; }
  .mobile-members .mm {
    flex: 0 0 auto; background: var(--panel-2); border: 1px solid var(--line);
    border-radius: 10px; padding: 7px 11px; font-size: 12px; display: flex; align-items: center; gap: 7px;
  }
  .mobile-members .mm.turn { border-color: var(--pc); box-shadow: 0 0 0 1px var(--pc); }
  .mobile-members .mm.dead { opacity: .45; }
  .mobile-members .mm b { font-variant-numeric: tabular-nums; }
  .msg-col { max-width: 82%; }
}

/* ---------------- 排行榜 ---------------- */

.rank-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rank-table th {
  text-align: left; font-size: 11.5px; color: var(--muted-2); font-weight: 700;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.rank-table td { padding: 11px 12px; border-bottom: 1px solid rgba(42, 48, 73, .5); font-size: 14px; }
.rank-table tr.me td { background: rgba(124, 92, 255, .13); }
.rank-table tr.top1 td { background: rgba(251, 191, 36, .1); }
.rank-table .rno { font-weight: 800; color: var(--muted); width: 62px; }
.rank-table .rno.g { color: #fbbf24; }
.rank-table .rno.s { color: #cbd5e1; }
.rank-table .rno.b { color: #d97706; }
.rank-table .rname { font-weight: 700; }
.rank-table .rbest { font-weight: 800; color: var(--accent-2); font-size: 16px; white-space: nowrap; }
.rank-table .rmeta { font-size: 11.5px; color: var(--muted-2); }
.rank-table .uid { font-size: 11px; font-weight: 700; color: var(--muted-2); margin-right: 4px; }
.rank-table .rbest .unit,
.my-rank-bar .val .unit { font-size: 11px; font-weight: 400; color: var(--muted-2); margin: 0 6px 0 2px; }
.rank-table .rrounds,
.my-rank-bar .val .rrounds {
  font-size: 11px; font-weight: 400; color: var(--muted);
  background: var(--panel-3); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 999px;
}

/* 自己那一行固定在底部 */
.my-rank-bar {
  position: sticky; bottom: 0; margin-top: 12px;
  background: linear-gradient(135deg, rgba(124, 92, 255, .22), rgba(34, 211, 238, .12));
  border: 1px solid rgba(124, 92, 255, .45);
  border-radius: 13px; padding: 13px 16px;
  display: flex; align-items: center; gap: 14px;
  backdrop-filter: blur(8px);
}
.my-rank-bar .lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.my-rank-bar .no { font-size: 25px; font-weight: 900; font-variant-numeric: tabular-nums; }
.my-rank-bar .spacer { flex: 1; }
.my-rank-bar .val { font-size: 21px; font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; }

/* ---------------- 弹窗 / 提示 ---------------- */

.overlay {
  position: fixed; inset: 0; background: rgba(6, 8, 15, .78);
  display: grid; place-items: center; z-index: 80; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  width: min(94vw, 460px); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 20px;
  padding: 26px; box-shadow: var(--shadow);
  max-height: 88vh; overflow-y: auto;
}
.modal h2 { font-size: 19px; margin-bottom: 16px; text-align: center; }
.hero-stat { text-align: center; margin: 10px 0 6px; }
.hero-stat b {
  display: block; font-size: 54px; line-height: 1; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stat span { font-size: 12.5px; color: var(--muted); }
.hero-sub { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0 18px; }
.hero-sub b { color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 18px; }
.stat-grid .stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px; text-align: center; }
.stat-grid .stat b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.stat-grid .stat span { font-size: 10.5px; color: var(--muted-2); }
.rank-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.rank-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 13px;
}
.rank-row .rank-no { font-weight: 800; color: var(--muted); width: 20px; font-variant-numeric: tabular-nums; }
.rank-row .rank-name { font-weight: 700; font-size: 13.5px; }
.rank-row .rank-sub { font-size: 11px; color: var(--muted-2); }
.rank-row .spacer { flex: 1; }
.rank-row .rank-rounds { text-align: right; }
.rank-row .rank-rounds b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-row .rank-rounds span { font-size: 10.5px; color: var(--muted-2); }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; }

.rules-body { font-size: 13.5px; line-height: 1.95; color: var(--muted); }
.rules-body b { color: var(--text); }
.rules-body code { background: var(--panel-3); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; font-size: 12.5px; color: var(--text); }
.rules-body ul { margin: 6px 0; padding-left: 20px; }

.toast-wrap {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none; width: min(92vw, 460px);
}
.toast {
  padding: 10px 17px; border-radius: 12px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); background: var(--panel); border: 1px solid var(--line-2);
  animation: tin .28s ease; max-width: 100%; text-align: center;
}
.toast.err { border-color: rgba(251, 113, 133, .6); color: #ffd7dd; background: linear-gradient(135deg, rgba(251, 113, 133, .24), rgba(251, 113, 133, .1)); }
.toast.ok { border-color: rgba(52, 211, 153, .55); color: #d5ffef; background: linear-gradient(135deg, rgba(52, 211, 153, .2), rgba(52, 211, 153, .06)); }
.toast.info { border-color: rgba(34, 211, 238, .5); color: #d8fbff; background: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(124, 92, 255, .1)); }
@keyframes tin { from { opacity: 0; transform: translateY(-9px); } to { opacity: 1; transform: none; } }

.banner {
  background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .4);
  color: #ffe6a8; border-radius: 11px; padding: 10px 14px; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}
.banner .spacer { flex: 1; }
.banner button { font-size: 12.5px; font-weight: 700; color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .scroll-area { padding: 14px; }
  .card { padding: 15px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .game-head { padding: 8px 14px; gap: 8px; }
  .game-body { padding: 12px 14px; }
  .game-input { padding: 8px 14px 12px; }
  .msg-word { font-size: 17px; }
  .hero-stat b { font-size: 44px; }
  .toast-wrap { top: 60px; }
  .setup-row > label { width: 100%; }
  .auth-card { padding: 24px 20px; }
  .rank-table .rmeta { display: none; }
}
