/* ============================================================
   WORDLE ARENA — 样式
   ============================================================ */

:root {
  --bg: #f4f5f1;
  --bg-soft: #eceee7;
  --panel: #ffffff;
  --panel-2: #fafaf7;
  --text: #14161a;
  --text-dim: #6f7680;
  --text-faint: #9aa1aa;
  --border: #e4e6df;
  --border-strong: #cfd3cb;
  --tile-empty: #d3d6da;
  --tile-filled: #8b8f92;

  --correct: #6aaa64;
  --present: #c9b458;
  --absent: #787c7e;

  --accent: #3f7d58;
  --accent-hover: #356a4a;
  --accent-soft: #e8f2ea;
  --danger: #d2544f;
  --gold: #d8a13a;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .06);
  --shadow: 0 4px 18px rgba(20, 22, 26, .07), 0 1px 3px rgba(20, 22, 26, .05);
  --shadow-lg: 0 18px 50px rgba(20, 22, 26, .13), 0 2px 8px rgba(20, 22, 26, .06);

  --tile: clamp(44px, min(9.4vw, 6.4vh), 60px);
  --gap: 6px;
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif,
          "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji";
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0e0f10;
  --bg-soft: #17181a;
  --panel: #17181a;
  --panel-2: #1d1f21;
  --text: #eef0ec;
  --text-dim: #9aa1aa;
  --text-faint: #6b7178;
  --border: #2a2c30;
  --border-strong: #3b3e43;
  --tile-empty: #35383c;
  --tile-filled: #5c6066;

  --correct: #538d4e;
  --present: #b59f3b;
  --absent: #3a3a3c;

  --accent: #5fa87a;
  --accent-hover: #6fb98a;
  --accent-soft: #1c2a21;
  --shadow: 0 4px 20px rgba(0, 0, 0, .4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background .25s ease, color .25s ease;
}

button, input, select { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
.hidden { display: none !important; }
.dim { color: var(--text-dim); }
.c-correct { color: var(--correct); }
.c-present { color: var(--present); }

.view { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ============================ 通用控件 ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, box-shadow .18s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: var(--text-faint); }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(63, 125, 88, .25);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-lg { height: 50px; font-size: 15.5px; flex: 1; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-dim); height: 38px; font-size: 13.5px; }
.btn-ghost:hover { color: var(--text); }

.icon-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(210, 84, 79, .3); background: rgba(210, 84, 79, .06); }

.link-btn { font-size: 12.5px; color: var(--text-dim); padding: 4px 8px; border-radius: 6px; }
.link-btn:hover { color: var(--accent); background: var(--accent-soft); }

.mini-btn {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--panel);
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }

input[type="text"], input[type="password"], input:not([type]), select {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
  width: 100%;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--text-faint); }

.hint { font-size: 12.5px; color: var(--text-faint); }

/* ============================ 首页 ============================ */

.view-home {
  overflow-y: auto;
  align-items: center;
  padding: 32px 20px 48px;
  background:
    radial-gradient(900px 420px at 50% -8%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.home-glow {
  position: fixed;
  inset: auto 0 -30% 0;
  height: 60%;
  background: radial-gradient(closest-side, rgba(106, 170, 100, .12), transparent);
  pointer-events: none;
}
.home-wrap {
  width: 100%;
  max-width: 452px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  position: relative;
  z-index: 1;
}
.home-left { text-align: center; }
.home-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.features { display: none; }

@media (min-width: 980px) {
  .view-home { padding: 40px 32px; }
  .home-wrap {
    max-width: 1000px;
    grid-template-columns: minmax(0, 1fr) 424px;
    gap: 72px;
    align-items: center;
  }
  .home-left { text-align: left; }
  .home-left .logo-tiles { justify-content: flex-start; margin-bottom: 22px; }
  .home-left .lt { width: 42px; height: 42px; font-size: 21px; border-radius: 9px; }
  .home-left h1 { font-size: 54px; letter-spacing: -2.2px; line-height: 1.05; }
  .view-home .home-left h1 { font-size: 54px; letter-spacing: -2.2px; line-height: 1.08; }
  .view-home .home-left h1 em {
    display: inline-block;
    font-size: 26px;
    margin: 0 0 0 10px;
    letter-spacing: 2px;
    color: var(--text-faint);
    vertical-align: 6px;
  }
  .home-left .tagline { font-size: 15px; margin-top: 16px; }

  .features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
  }
  .features li { display: flex; gap: 12px; align-items: flex-start; }
  .f-ico {
    width: 30px; height: 30px; flex: 0 0 30px;
    display: grid; place-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
  }
  .f-body { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
  .f-body b { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 1px; }
}

.hero { text-align: center; }
.logo-tiles { display: flex; gap: 5px; justify-content: center; margin-bottom: 16px; }
.lt {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 7px;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  animation: tileIn .5s cubic-bezier(.2, .9, .3, 1.3) backwards;
}
.lt:nth-child(1) { animation-delay: .02s } .lt:nth-child(2) { animation-delay: .07s }
.lt:nth-child(3) { animation-delay: .12s } .lt:nth-child(4) { animation-delay: .17s }
.lt:nth-child(5) { animation-delay: .22s } .lt:nth-child(6) { animation-delay: .27s }
.lt.correct { background: var(--correct); }
.lt.present { background: var(--present); }
.lt.absent { background: var(--absent); }

.home-left h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -1.2px;
  font-weight: 800;
}
.home-left h1 em {
  font-style: normal;
  font-weight: 300;
  color: var(--text-faint);
  letter-spacing: .5px;
  font-size: 22px;
  display: block;
  margin-top: 4px;
  text-transform: uppercase;
}
.tagline { margin: 10px 0 0; font-size: 13.5px; color: var(--text-dim); }

.home-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.name-row { display: flex; gap: 8px; }
.avatar-btn {
  width: 46px; height: 46px;
  flex: 0 0 46px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--panel-2);
  font-size: 22px;
  display: grid; place-items: center;
  transition: transform .15s, border-color .15s;
}
.avatar-btn:hover { border-color: var(--accent); transform: rotate(-6deg) scale(1.05); }

/* Emoji 头像选择弹层 */
.avatar-pop {
  position: fixed;
  z-index: 130;
  width: 272px;
  max-width: calc(100vw - 20px);
  padding: 10px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: fadeUp .14s ease;
}
.ap-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 8px;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
}
.ap-close {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 7px;
  font-size: 11px;
  color: var(--text-faint);
}
.ap-close:hover { background: var(--bg-soft); color: var(--text); }
.ap-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  max-height: 186px;
  overflow-y: auto;
  padding: 2px;
}
.ap-item {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 17px;
  line-height: 1;
  transition: background .12s, transform .12s;
}
.ap-item:hover { background: var(--bg-soft); transform: scale(1.16); }
.ap-item.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.ap-foot {
  padding: 8px 4px 2px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-faint);
}
.name-row input { height: 46px; }

.home-actions { display: flex; gap: 10px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-faint); font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.join-row { display: flex; gap: 8px; }
.code-input {
  text-transform: uppercase;
  letter-spacing: 6px;
  font-weight: 700;
  font-size: 17px;
  text-align: center;
  padding-left: 20px !important;
}
.join-row .btn { flex: 0 0 88px; }

.room-list-wrap { display: flex; flex-direction: column; gap: 8px; }
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  padding: 0 4px;
}
.room-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 232px;
  overflow-y: auto;
}
.room-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 11px;
  text-align: left;
  width: 100%;
  transition: all .16s;
}
.room-item:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateX(2px); }
.room-item .ri-main { flex: 1; min-width: 0; }
.room-item .ri-name {
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-item .ri-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.room-item .ri-code {
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-dim);
  background: var(--bg-soft);
  padding: 4px 8px; border-radius: 6px;
}
.room-item .ri-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--correct); flex: 0 0 7px; }
.room-item .ri-dot.playing { background: var(--gold); }
.empty-hint {
  text-align: center; font-size: 12.5px; color: var(--text-faint);
  padding: 18px; border: 1px dashed var(--border-strong); border-radius: 11px;
}

.home-foot { text-align: center; font-size: 11.5px; color: var(--text-dim); line-height: 1.9; margin-top: 26px; }
.home-foot p { margin: 0; }

@media (min-width: 980px) {
  .home-foot { margin-top: 40px; font-size: 12px; }
}

/* ============================ 账号 & 排行榜 ============================ */

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }

.account-strip { display: block; }
.as-guest {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--panel-2);
}
.as-hint { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

.as-user {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.as-avatar {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  font-size: 19px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.as-main { flex: 1; min-width: 0; }
.as-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.as-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.as-actions { display: flex; gap: 4px; }

/* 称号徽章 */
.title-badge {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  padding: 1px 6px; border-radius: 5px; line-height: 1.6;
  border: 1px solid transparent; white-space: nowrap;
  vertical-align: 1px;
}
.title-badge.t1 {
  color: #6d4f0d;
  background: linear-gradient(135deg, #ffe9a8, #f3c14a);
  border-color: #e0ac33;
  box-shadow: 0 1px 5px rgba(216, 161, 58, .4);
}
.title-badge.t2 {
  color: #4b5563;
  background: linear-gradient(135deg, #eef1f4, #c9d1d9);
  border-color: #b3bcc6;
}
.title-badge.t3 {
  color: #6d4327;
  background: linear-gradient(135deg, #f6dcc4, #dcae86);
  border-color: #c99567;
}
.title-badge.t4 { color: var(--accent); background: var(--accent-soft); border-color: rgba(63, 125, 88, .25); }
.title-badge.t5 { color: var(--text-faint); background: var(--bg-soft); border-color: var(--border); }

[data-theme="dark"] .title-badge.t1 { color: #2a1e00; }
[data-theme="dark"] .title-badge.t2 { color: #171a1e; }
[data-theme="dark"] .title-badge.t3 { color: #2a1a0d; }

/* 首页面板切换 */
.pane-tabs { display: flex; gap: 2px; background: var(--bg-soft); padding: 3px; border-radius: 9px; }
.pane-tab {
  font-size: 12px; font-weight: 600;
  color: var(--text-dim);
  padding: 4px 11px; border-radius: 7px;
  transition: background .15s, color .15s;
}
.pane-tab:hover { color: var(--text); }
.pane-tab.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }

/* 排行榜 */
.rank-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 300px; overflow-y: auto;
}
.rank-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  transition: border-color .15s, transform .15s;
}
.rank-row:hover { border-color: var(--border-strong); transform: translateX(2px); }
.rank-row.r1 { border-color: #e0ac33; background: linear-gradient(90deg, rgba(255, 233, 168, .45), var(--panel) 70%); }
.rank-row.r2 { border-color: #bfc7cf; background: linear-gradient(90deg, rgba(226, 232, 238, .5), var(--panel) 70%); }
.rank-row.r3 { border-color: #d3a880; background: linear-gradient(90deg, rgba(246, 220, 196, .45), var(--panel) 70%); }
/* 自己的条目要压过名次底色，所以放在 r* 之后 */
.rank-row.me { border-color: var(--accent); background: var(--accent-soft); }

[data-theme="dark"] .rank-row.r1 { background: linear-gradient(90deg, rgba(216, 161, 58, .18), var(--panel) 70%); }
[data-theme="dark"] .rank-row.r2 { background: linear-gradient(90deg, rgba(200, 208, 216, .13), var(--panel) 70%); }
[data-theme="dark"] .rank-row.r3 { background: linear-gradient(90deg, rgba(220, 174, 134, .15), var(--panel) 70%); }

.rk-no {
  width: 24px; flex: 0 0 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 800;
  color: var(--text-faint);
}
.rk-no.m1 { color: #d8a13a; }
.rk-no.m2 { color: #98a2ad; }
.rk-no.m3 { color: #c08b5c; }
.rk-avatar { font-size: 17px; flex: 0 0 auto; }
.rk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rk-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-meta { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.rk-score {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  flex: 0 0 auto;
}
.rank-empty { font-size: 12px; }

/* 登录弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(10, 12, 14, .45);
  backdrop-filter: blur(3px);
  animation: fadeIn .16s ease;
}
.modal-card {
  position: relative;
  width: 100%; max-width: 372px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
.modal-card h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-sub { margin: 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.65; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-faint);
}
.modal-close:hover { background: var(--bg-soft); color: var(--text); }
.modal-card .field { margin: 0; }
.modal-card input { width: 100%; height: 42px; }

.auth-tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 3px; border-radius: 9px; }
.auth-tab {
  flex: 1;
  padding: 7px 0;
  font-size: 13px; font-weight: 600;
  color: var(--text-dim);
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.auth-tab.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-error {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--danger);
  background: rgba(210, 84, 79, .09);
  border-radius: 8px;
  line-height: 1.5;
}
.auth-tip { margin: 0; font-size: 11px; color: var(--text-faint); text-align: center; line-height: 1.6; }

/* ============================ 顶栏 ============================ */

.topbar {
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  z-index: 20;
}
.brand-mini {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 800; letter-spacing: .3px;
}
.brand-mini i {
  font-style: normal; font-weight: 400;
  color: var(--text-faint); font-size: 11px; letter-spacing: 1.5px;
}
.bm-tile {
  width: 24px; height: 24px; border-radius: 5px;
  background: var(--correct); color: #fff;
  display: grid; place-items: center; font-size: 13px;
}

.room-code-chip {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 12px;
  border-radius: 9px;
  border: 1px dashed var(--border-strong);
  background: var(--panel-2);
  transition: all .16s;
}
.room-code-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.rc-label { font-size: 11px; color: var(--text-faint); }
.room-code-chip b {
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 2.5px;
  color: var(--text);
}
.rc-copy { font-size: 11px; color: var(--accent); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill {
  font-size: 11.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 20px;
  background: var(--bg-soft); color: var(--text-dim);
  white-space: nowrap;
}
.pill.conn { display: inline-flex; align-items: center; gap: 5px; }
.pill.conn::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.conn.online { color: var(--correct); }
.pill.conn.offline { color: var(--danger); }
.pill.timer.warn { color: var(--danger); background: rgba(210, 84, 79, .1); }

/* ============================ 布局 ============================ */

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 300px;
  gap: 0;
  overflow: hidden;
}

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
}
.side-players { border-right: 1px solid var(--border); }
.side-chat { border-left: 1px solid var(--border); }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  flex: 0 0 auto;
}
.panel-head h2 {
  margin: 0; font-size: 12px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-dim);
}
.count {
  display: inline-block; margin-left: 4px;
  background: var(--bg-soft); color: var(--text-dim);
  border-radius: 20px; padding: 1px 7px; font-size: 11px;
}
.panel-head-actions { display: flex; gap: 6px; }

/* 玩家列表 */
.players-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.player-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  transition: background .15s;
  position: relative;
}
.player-row:hover { background: var(--panel-2); }
.player-row.me { background: var(--accent-soft); }
.player-row.me::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 2.5px; border-radius: 2px; background: var(--accent);
}
.p-avatar {
  width: 28px; height: 28px; flex: 0 0 28px;
  display: grid; place-items: center;
  font-size: 16px;
  background: var(--bg-soft);
  border-radius: 8px;
}
.player-row.me .p-avatar { background: rgba(106, 170, 100, .18); }
.p-avatar.editable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.p-avatar.editable:hover { transform: scale(1.12); box-shadow: 0 0 0 2px var(--accent); }
.p-main { flex: 1; min-width: 0; }
.p-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 5px;
  min-width: 0;
}
.pn-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tag {
  font-size: 9.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  background: var(--gold); color: #fff;
  letter-spacing: .3px;
}
.p-tag.off { background: var(--text-faint); }
.p-tag.bot { background: #7b6cd9; }
.p-dots { display: flex; gap: 2.5px; margin-top: 4px; }
.p-dot {
  width: 7px; height: 7px; border-radius: 1.5px;
  background: var(--bg-soft);
  transition: background .2s;
}
.p-dot.filled { background: var(--text-faint); }
.p-dot.ok { background: var(--correct); }
.p-dot.fail { background: var(--danger); }
.p-score {
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex: 0 0 auto;
}
.p-score small { font-size: 9.5px; color: var(--text-faint); font-weight: 500; }
.p-status { font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.p-status.solved { color: var(--correct); font-weight: 600; }

/* 舞台 */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 16px;
  background:
    radial-gradient(600px 300px at 50% 0%, var(--accent-soft), transparent 75%),
    var(--bg);
}

/* ============================ 大厅 ============================ */

.stage-lobby {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: auto;
  animation: fadeUp .35s ease;
}
.lobby-hero { text-align: center; }
.lobby-code-label { font-size: 12px; color: var(--text-dim); letter-spacing: .5px; }
.lobby-code {
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 10px;
  padding-left: 10px;
  margin: 4px 0 10px;
  color: var(--text);
  user-select: all;
}

.mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mode-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--panel);
  text-align: left;
  transition: border-color .16s, background .16s, transform .12s;
}
.mode-opt:hover { border-color: var(--border-strong); }
.mode-opt:active { transform: scale(.985); }
.mode-opt.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(106, 170, 100, .1);
}
.mode-opt:disabled { cursor: not-allowed; }
.mode-picker.locked .mode-opt:not(.active) { opacity: .55; }
.mo-ico {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  font-size: 16px;
  background: var(--bg-soft);
  border-radius: 8px;
}
.mode-opt.active .mo-ico { background: rgba(106, 170, 100, .2); }
.mo-body { display: flex; flex-direction: column; min-width: 0; }
.mo-body b { font-size: 13px; font-weight: 700; }
.mo-body i { font-style: normal; font-size: 11px; color: var(--text-dim); margin-top: 1px; }

.settings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.settings-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.settings-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.setting {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.setting.locked { opacity: .55; }
.s-label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  font-size: 14px; line-height: 1;
  display: grid; place-items: center;
  color: var(--text-dim);
}
.stepper button:hover { border-color: var(--accent); color: var(--accent); }
.stepper b {
  min-width: 26px; text-align: center;
  font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.setting select {
  height: 28px; width: auto; padding: 0 6px;
  font-size: 12px; border-width: 1px; border-radius: 6px;
}

.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 20px;
  transition: background .2s;
}
.switch i::after {
  content: ''; position: absolute;
  width: 15px; height: 15px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(17px); }

.lobby-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lobby-actions .btn { width: 100%; }

/* ============================ 棋盘 ============================ */

.stage-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 520px;
  animation: fadeUp .3s ease;
}
.play-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  justify-content: center;
  min-height: 24px;
}
.round-label { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: .4px; }
.play-notice {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  animation: fadeUp .25s ease;
  max-width: 100%;
}
.play-notice.accent { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.play-notice.warm { color: var(--gold); border-color: var(--gold); background: rgba(216, 161, 58, .08); }
.play-notice.myturn {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(63, 125, 88, .3);
  animation: pulseGlow 1.8s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(63, 125, 88, .28); }
  50% { box-shadow: 0 4px 22px rgba(63, 125, 88, .5); }
}
.timer-bar {
  position: relative;
  width: 130px; height: 4px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.timer-bar i {
  position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: left;
  transition: transform .25s linear, background .3s;
}
.timer-bar span {
  position: absolute; right: -34px; top: -6px;
  font-size: 11px; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.timer-bar.warn i { background: var(--danger); }

.board {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  position: relative;
}
.board-row { display: flex; gap: var(--gap); position: relative; }
.row-author {
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  text-align: center;
  font-size: 15px;
  line-height: 1;
  opacity: .95;
}

.tile {
  width: var(--tile);
  height: var(--tile);
  display: grid;
  place-items: center;
  border: 2px solid var(--tile-empty);
  border-radius: 4px;
  font-size: calc(var(--tile) * .48);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text);
  background: transparent;
  transition: border-color .1s, background .1s;
  user-select: none;
  position: relative;
}
.tile.filled { border-color: var(--tile-filled); animation: pop .12s ease; }
.tile.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.tile.present { background: var(--present); border-color: var(--present); color: #fff; }
.tile.absent { background: var(--absent); border-color: var(--absent); color: #fff; }

.tile.reveal {
  animation: flip .58s ease forwards;
  animation-delay: calc(var(--i) * 85ms);
}
.tile.win { animation: bounce .55s ease; animation-delay: calc(var(--i) * 90ms + 300ms); }

.board-row.shake { animation: shake .42s ease; }
.board-row.dim { opacity: .5; }

/* 键盘 */
.keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 480px;
  margin-top: 2px;
}
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  border-radius: 5px;
  background: var(--tile-empty);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: background .16s, color .16s, transform .1s;
  text-transform: uppercase;
  user-select: none;
  touch-action: manipulation;
}
.key:hover { filter: brightness(1.05); }
.key:active { transform: scale(.94); }
.key.wide { flex: 1.6 1 0; font-size: 11.5px; }
.key.correct { background: var(--correct); color: #fff; }
.key.present { background: var(--present); color: #fff; }
.key.absent { background: var(--absent); color: #fff; }
.key.spacer { background: transparent; flex: .5 1 0; pointer-events: none; }

/* ============================ 遮罩 ============================ */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  animation: fadeIn .25s ease;
}
.overlay-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: popIn .35s cubic-bezier(.2, .9, .3, 1.2);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* 内容区自己滚，操作按钮永远贴在卡片底部可见 */
.overlay-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}
.oc-foot { flex: 0 0 auto; padding-top: 14px; }
.overlay-card h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.3px; }
.overlay-sub { font-size: 12.5px; color: var(--text-dim); margin: 0 0 18px; }

.answer-reveal {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 0 20px;
}
.answer-word {
  font-family: var(--font-mono);
  font-size: 32px; font-weight: 800;
  letter-spacing: 8px; padding-left: 8px;
  text-transform: uppercase;
}
.answer-tiles { display: flex; gap: 6px; }
.answer-zh {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .6px;
  text-align: center;
  margin-top: 2px;
}
.answer-zh .zh-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--bg-soft);
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 6px;
  letter-spacing: 0;
  vertical-align: 2px;
}
.ans-tile {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--correct);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  animation: tileIn .45s cubic-bezier(.2, .9, .3, 1.3) backwards;
}
.answer-label { font-size: 11.5px; color: var(--text-faint); letter-spacing: 1px; text-transform: uppercase; }

.score-table { display: flex; flex-direction: column; gap: 3px; margin-bottom: 16px; }
.score-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  animation: fadeUp .3s ease backwards;
}
.score-row.me { background: var(--accent-soft); }
.score-row .rank {
  width: 18px; font-size: 11px; font-weight: 700; color: var(--text-faint);
  text-align: center; flex: 0 0 18px;
}
.score-row .rank.gold { color: var(--gold); }
.score-row .s-avatar { font-size: 15px; }
.score-row .s-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-row .s-detail { font-size: 11px; color: var(--text-faint); }
.score-row .s-pts {
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-dim); min-width: 34px; text-align: right;
}
.score-row .s-pts.plus { color: var(--correct); }

.overlay-actions { display: flex; gap: 8px; }
.overlay-actions .btn { flex: 1; }

.countdown-hint { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 12px; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 4px 0 20px; }
.podium-item { text-align: center; flex: 1; max-width: 100px; }
.podium-avatar { font-size: 26px; }
.podium-name { font-size: 11.5px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-title { margin-top: 3px; }
.podium-score { font-size: 11px; color: var(--text-faint); }
.podium-bar {
  margin-top: 6px;
  border-radius: 7px 7px 0 0;
  background: var(--bg-soft);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: var(--text-faint);
}
.podium-item.p1 .podium-bar { background: linear-gradient(180deg, #f0cd7a, var(--gold)); color: #fff; }
.podium-item.p2 .podium-bar { background: linear-gradient(180deg, #d8dde2, #b9c0c7); color: #fff; }
.podium-item.p3 .podium-bar { background: linear-gradient(180deg, #e0b48d, #c08e63); color: #fff; }

/* ============================ 聊天 ============================ */

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

/* 别人的消息：头像在左，气泡在右 */
.chat-msg { display: flex; gap: 8px; align-items: flex-start; animation: fadeUp .2s ease; }
.chat-msg .cm-avatar {
  flex: 0 0 26px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; line-height: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  user-select: none;
}
.chat-msg .cm-body {
  min-width: 0;
  max-width: calc(100% - 44px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.chat-msg .cm-name {
  max-width: 100%;
  padding: 0 3px;
  font-size: 10.5px;
  color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-msg .cm-text {
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 13px 13px 13px 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 自己的消息：头像在右，气泡也靠右 */
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .cm-body { align-items: flex-end; }
.chat-msg.mine .cm-name { color: var(--accent); }
.chat-msg.mine .cm-text {
  border-radius: 13px 13px 4px 13px;
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.chat-msg.sys {
  font-size: 11.5px; color: var(--text-faint);
  justify-content: center; text-align: center;
  padding: 2px 0;
}
.chat-msg.sys span {
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  word-break: break-word;
}

.reaction-bar {
  display: flex; gap: 2px;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
}
.reaction-bar button {
  flex: 1;
  height: 28px;
  border-radius: 7px;
  font-size: 14px;
  transition: background .15s, transform .15s;
}
.reaction-bar button:hover { background: var(--bg-soft); transform: scale(1.15); }

.chat-form {
  display: flex; gap: 7px;
  padding: 8px 12px 12px;
}
.chat-form input {
  height: 38px;
  font-size: 13.5px;
  border-radius: 9px;
  border-width: 1px;
}
.send-btn {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: grid; place-items: center;
  transition: background .15s, transform .12s;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:active { transform: scale(.93); }

/* ============================ Toast / 特效 ============================ */

.toast-host {
  position: fixed;
  top: 74px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2);
  max-width: 82vw;
  text-align: center;
}
.toast.out { animation: toastOut .25s ease forwards; }

.fx-host { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.float-emoji {
  position: absolute;
  bottom: 12%;
  font-size: 34px;
  animation: floatUp 2.4s ease-out forwards;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .15));
}

.confetti {
  position: absolute;
  width: 8px; height: 12px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

/* ============================ 连接提示 ============================ */

.conn-banner {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 210;
  box-shadow: var(--shadow-lg);
}

/* ============================ 移动端 ============================ */

.mobile-tabs { display: none; }
.drawer-backdrop { display: none; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 232px minmax(0, 1fr) 268px; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; }
  .side {
    position: fixed;
    top: 54px;
    bottom: 56px;
    width: min(88vw, 360px);
    z-index: 40;
    box-shadow: var(--shadow-lg);
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.3, .8, .3, 1);
  }
  .side-chat { right: 0; left: auto; transform: translateX(105%); border-left: 1px solid var(--border); }
  .side-players { left: 0; }
  body[data-tab="players"] .side-players { transform: translateX(0); }
  body[data-tab="chat"] .side-chat { transform: translateX(0); }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 54px 0 56px;
    background: rgba(10, 12, 10, .32);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  body[data-tab="players"] .drawer-backdrop,
  body[data-tab="chat"] .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-tabs {
    display: flex;
    flex: 0 0 56px;
    border-top: 1px solid var(--border);
    background: var(--panel);
    z-index: 45;
  }
  .mobile-tabs button {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-faint);
    border-top: 2px solid transparent;
    transition: color .15s, border-color .15s;
  }
  .mobile-tabs button.active { color: var(--accent); border-top-color: var(--accent); }
  .mobile-tabs b {
    font-weight: 600; font-size: 10.5px;
    background: var(--bg-soft); border-radius: 20px;
    padding: 1px 5px; margin-left: 2px;
  }

  .topbar { height: 54px; flex: 0 0 54px; padding: 0 10px; gap: 8px; }
  .brand-mini i { display: none; }
  .brand-mini { font-size: 0; gap: 0; }
  .room-code-chip { padding: 0 9px; gap: 6px; }
  .rc-copy { display: none; }
  .rc-label { display: none; }
  .pill.conn { display: none; }
  #btn-theme { display: none; }
  .stage { padding: 10px 8px 8px; }
  .key { height: 44px; font-size: 12.5px; }
  .keyboard { gap: 5px; }
  .kb-row { gap: 4px; }
  .overlay-card { padding: 20px; }
  .lobby-code { font-size: 38px; letter-spacing: 8px; }
  .settings-grid { gap: 8px; }
  .home-wrap { gap: 18px; }
  .home-left h1 { font-size: 29px; }
}

@media (max-width: 380px) {
  .settings-grid { grid-template-columns: 1fr; }
  .key { height: 40px; }
}

/* ============================ 动画 ============================ */

@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes flip {
  0% { transform: rotateX(0deg); background: transparent; border-color: var(--tile-filled); color: var(--text); }
  45% { transform: rotateX(-90deg); background: transparent; border-color: var(--tile-filled); color: var(--text); }
  55% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0deg); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-22px); }
  50% { transform: translateY(2px); }
  70% { transform: translateY(-8px); }
  85% { transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-7px); }
  30% { transform: translateX(7px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  80% { transform: translateX(-2px); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes tileIn { from { opacity: 0; transform: translateY(-14px) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(.96); } }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  15% { opacity: 1; transform: translateY(-30px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-60vh) scale(.9) rotate(12deg); }
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(-10vh) rotate(0deg); }
  100% { opacity: 0; transform: translateY(105vh) rotate(720deg); }
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
