/* ========================================================================
   iangame 设计系统 — 深色霓虹电竞风
   改样式请只改 :root 变量与组件类,勿在模板堆内联样式。
   ======================================================================== */

/* ---------- 设计 Token ---------- */
:root {
  /* 背景层级 */
  --bg:        #060912;
  --bg-card:   #0d1320;
  --bg-hover:  #141b2e;
  --bg-elev:   rgba(20, 27, 46, .6);

  /* 霓虹主色 */
  --neon-purple: #b537f2;
  --neon-cyan:   #00e0ff;
  --neon-blue:   #7c3aed;
  --grad-main:   linear-gradient(135deg, #b537f2 0%, #00e0ff 100%);
  --grad-soft:   linear-gradient(135deg, rgba(181,55,242,.18), rgba(0,224,255,.18));

  /* 文字 */
  --text:    #eaf0fb;
  --text-2:  #8b97b3;
  --text-3:  #5a6580;

  /* 状态 */
  --ok:    #2ee6a6;
  --warn:  #ffb627;
  --danger:#ff2e63;

  /* 描边 / 辉光 */
  --border:      rgba(124, 58, 237, .25);
  --border-2:    rgba(0, 224, 255, .25);
  --glow-purple: 0 0 20px rgba(181, 55, 242, .45);
  --glow-cyan:   0 0 20px rgba(0, 224, 255, .35);

  /* 尺寸 */
  --radius:   16px;
  --radius-sm:10px;
  --maxw:     1200px;
  --nav-h:    64px;

  /* 字体 */
  --ff-title: 'Orbitron', sans-serif;
  --ff-body:  'Rajdhani', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* 全站背景:径向霓虹光晕 + 网格 */
  background-image:
    radial-gradient(900px 500px at 80% -10%, rgba(181,55,242,.18), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(0,224,255,.14), transparent 60%),
    linear-gradient(var(--bg), var(--bg));
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
canvas { display: block; }

/* ---------- 布局 ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 0; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(6, 9, 18, .7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--ff-title); font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.brand .hex {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--grad-main); border-radius: 8px;
  box-shadow: var(--glow-purple); color: #060912; font-weight: 900;
}
.brand b { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 600;
  transition: all .18s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg-hover); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.lang-select {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 26px 6px 10px; font: 600 13px var(--ff-body);
  cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b97b3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .2s, box-shadow .2s;
}
.lang-select:hover, .lang-select:focus { border-color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.lang-select option { background: var(--bg-card); color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--bg-hover); border: 1px solid var(--border); font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-main); display: grid; place-items: center; color: #060912; font-weight: 800; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 15px;
  transition: all .18s ease; white-space: nowrap;
}
.btn-primary { background: var(--grad-main); color: #060912; box-shadow: var(--glow-purple); }
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-ghost { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: rgba(255,46,99,.15); color: var(--danger); border: 1px solid rgba(255,46,99,.4); }
.btn-block { width: 100%; }

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  margin-top: 24px; padding: 56px 40px; border-radius: 24px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  box-shadow: var(--glow-purple);
}
.hero::before { /* 网格底纹 */
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,224,255,.08) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%);
}
.hero-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(0,224,255,.12); border: 1px solid var(--border-2); color: var(--neon-cyan); font-weight: 700; font-size: 13px; letter-spacing: .5px; position: relative; }
.hero h1 { font-family: var(--ff-title); font-weight: 800; font-size: clamp(38px, 7vw, 72px); line-height: 1; margin: 18px 0 14px; letter-spacing: 2px; position: relative; }
.hero h1 span { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-2); font-size: 18px; max-width: 540px; position: relative; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; position: relative; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 30px; position: relative; }
.hero-stat b { font-family: var(--ff-title); font-size: 28px; display: block; }
.hero-stat span { color: var(--text-2); font-size: 13px; }

/* ---------- 区块标题 ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-title { font-family: var(--ff-title); font-weight: 700; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section-title .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad-main); box-shadow: var(--glow-purple); }
.section-link { color: var(--neon-cyan); font-weight: 700; font-size: 14px; }
.section-link:hover { text-decoration: underline; }

/* ---------- 游戏卡片 ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.game-grid.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.game-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all .22s ease;
}
.game-card:hover { transform: translateY(-6px); border-color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.game-cover {
  position: relative; height: 120px; display: grid; place-items: center;
  font-size: 52px; background: var(--cover, var(--grad-soft));
}
.game-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(6,9,18,.55)); }
.game-cover .tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(6,9,18,.6); border: 1px solid var(--border); color: var(--text-2);
}
.game-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-body h3 { font-size: 17px; font-weight: 700; }
.game-body .desc { color: var(--text-2); font-size: 13px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-body .play { margin-top: 8px; }

/* ---------- 筛选 ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-2);
  transition: all .16s ease;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--grad-main); color: #060912; border-color: transparent; box-shadow: var(--glow-purple); }

/* ---------- 卡片容器(玻璃) ---------- */
.panel { background: var(--bg-elev); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel h4 { font-family: var(--ff-title); font-size: 15px; letter-spacing: .5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- 游戏页布局 ---------- */
.play-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 20px; }
.play-main { display: flex; flex-direction: column; gap: 16px; }
.play-canvas-box {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #000; border: 1px solid var(--border);
  display: grid; place-items: center; min-height: 480px;
}
.play-canvas-box canvas { width: 100%; height: auto; background: #000; }

/* ---------- 全屏模式:画布撑满屏幕 + 横屏适配 ---------- */
/* 真全屏(桌面 / Chrome Android) */
.play-canvas-box:fullscreen,
.play-canvas-box:-webkit-full-screen {
  width: 100vw; height: 100vh;
  border-radius: 0; border: none;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.play-canvas-box:fullscreen canvas,
.play-canvas-box:-webkit-full-screen canvas {
  width: 100%; height: 100%;          /* 配合容器 flex,object-fit:contain 居中留黑边 */
  object-fit: contain;
}
/* 伪全屏(iOS Safari 不支持 div 真全屏的 fallback) */
.play-canvas-box.pseudo-fs {
  position: fixed; inset: 0; z-index: 9999;
  width: 100vw; height: 100vh;
  border-radius: 0; border: none;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.play-canvas-box.pseudo-fs canvas {
  width: 100%; height: 100%; object-fit: contain;
}
/* 浮层退出按钮(全屏 / 伪全屏时可见) */
.fs-exit-btn {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(13,19,32,.75);
  border: 1px solid rgba(0,224,255,.5);
  color: var(--text); font-size: 20px; cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s, transform .15s, border-color .2s;
}
.fs-exit-btn:hover { background: rgba(0,224,255,.25); border-color: var(--neon-cyan); transform: scale(1.08); }
.play-canvas-box:fullscreen .fs-exit-btn,
.play-canvas-box:-webkit-full-screen .fs-exit-btn,
.play-canvas-box.pseudo-fs .fs-exit-btn { display: flex; }
.play-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.play-meta { display: flex; align-items: center; gap: 18px; }
.stat-pill { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; }
.stat-pill .k { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.stat-pill .v { font-family: var(--ff-title); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--neon-cyan); }
.play-side { display: flex; flex-direction: column; gap: 16px; }

/* 游戏结束/准备遮罩 */
.overlay { position: absolute; inset: 0; background: rgba(6,9,18,.82); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 5; text-align: center; padding: 20px; }
.overlay .ttl { font-family: var(--ff-title); font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.overlay .sub { color: var(--text-2); margin-bottom: 18px; }
.overlay .final-score { font-family: var(--ff-title); font-size: 44px; font-weight: 800; background: var(--grad-main); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin: 8px 0 18px; }
.overlay.hidden { display: none; }

/* ---------- 排行榜 ---------- */
.lb { display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.lb-row.me { background: rgba(0,224,255,.1); border: 1px solid var(--border-2); }
.lb-rank { font-family: var(--ff-title); font-weight: 800; color: var(--text-3); text-align: center; }
.lb-row:nth-child(1) .lb-rank { color: #ffd54a; }
.lb-row:nth-child(2) .lb-rank { color: #cfd8e6; }
.lb-row:nth-child(3) .lb-rank { color: #e0a06b; }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: var(--ff-title); font-weight: 700; color: var(--neon-cyan); font-variant-numeric: tabular-nums; }
.lb-empty { color: var(--text-3); text-align: center; padding: 20px 0; font-size: 14px; }

/* ---------- 表单 / 认证 ---------- */
.auth-wrap { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg-elev); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 20px; padding: 36px 30px; box-shadow: var(--glow-purple); }
.auth-card .brand { justify-content: center; margin-bottom: 6px; }
.auth-card h2 { text-align: center; font-family: var(--ff-title); font-size: 22px; margin: 12px 0 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text); font-size: 15px;
  transition: border-color .16s;
}
.field input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.form-msg { min-height: 18px; font-size: 13px; margin-top: 8px; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.auth-switch { text-align: center; margin-top: 18px; color: var(--text-2); font-size: 14px; }
.auth-switch a { color: var(--neon-cyan); font-weight: 700; }

/* ---------- 个人中心 ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 24px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 28px; }
.profile-head h2 { font-family: var(--ff-title); }
.profile-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.profile-table { width: 100%; border-collapse: collapse; }
.profile-table th, .profile-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.profile-table th { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.profile-table td .v { font-family: var(--ff-title); font-weight: 700; color: var(--neon-cyan); }

/* ---------- Toast ---------- */
.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); font-weight: 600; box-shadow: var(--glow-purple); animation: toastIn .2s ease; }
.toast.err { border-color: var(--danger); box-shadow: 0 0 16px rgba(255,46,99,.4); }
.toast.ok { border-color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0; color: var(--text-3); font-size: 14px; text-align: center; }

/* ---------- 工具类 ---------- */
.muted { color: var(--text-2); }
.tiny { font-size: 13px; }
.hide { display: none !important; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.text-grad { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- 响应式 ---------- */
/* 表格容器:小屏允许横向滚动(配合 profile.html 的 .table-scroll) */
.table-scroll { overflow: hidden; }

/* 平板:游戏页单栏,导航收紧但入口保留 */
@media (max-width: 880px) {
  .play-wrap { grid-template-columns: 1fr; }
  .nav-inner { gap: 12px; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 8px 10px; font-size: 14px; }
  .hero { padding: 36px 22px; }
  /* 竖屏下去掉 480px 最小高,画布随宽度等比自撑,消除上下黑边 */
  .play-canvas-box { min-height: 0; }
}

/* 手机:导航精简(logo=首页 · 大厅保留 · 头像=个人中心),触控目标加大 */
@media (max-width: 520px) {
  .container { padding: 0 14px; }
  html, body { overflow-x: hidden; }
  .nav .brand span:last-child { display: none; }        /* 只留 logo 方块 */
  .nav-inner { gap: 8px; }
  .nav-links .nav-home, .nav-links .nav-profile { display: none; }
  .nav-links a { padding: 8px 10px; }
  .nav-right { gap: 6px; }
  .nav-right .nav-login { display: none; }              /* 注册页内有登录入口 */
  .chip-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
  .lang-select { padding: 7px 24px 7px 8px; }

  .hero { padding: 28px 18px; border-radius: 18px; }
  .hero p { font-size: 16px; }
  .hero-stats { gap: 16px; }
  .hero-stat b { font-size: 22px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1; min-width: 140px; }

  .game-grid, .game-grid.compact { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-cover { height: 92px; font-size: 40px; }
  .game-body { padding: 10px; gap: 4px; }
  .game-body h3 { font-size: 15px; }
  .game-body .desc { font-size: 12px; }
  .btn-sm { padding: 9px 13px; }                        /* 触控目标贴近 44px */
  .chip { padding: 9px 14px; }

  .play-meta { gap: 10px; width: 100%; justify-content: space-between; }
  .stat-pill { padding: 6px 10px; }
  .stat-pill .v { font-size: 16px; }
  .overlay .ttl { font-size: 24px; }
  .overlay .final-score { font-size: 36px; }
  .play-toolbar { gap: 8px; }

  .auth-wrap { padding: 16px; min-height: calc(100dvh - var(--nav-h)); }  /* dvh 修移动地址栏跳变 */
  .auth-card { padding: 26px 20px; }
  .panel { padding: 16px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .toast { max-width: calc(100vw - 32px); }
  .section { padding: 32px 0; }
}

/* ---------- 狼人杀(Werewolf) ---------- */
/* 首页 banner 推广位 */
.ww-banner-promo { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 16px 20px; border-radius: var(--radius); text-decoration: none; background: linear-gradient(120deg, rgba(255,46,99,.16), rgba(124,58,237,.14) 55%, rgba(6,9,18,.65)); border: 1px solid rgba(255,46,99,.35); transition: border-color .18s, box-shadow .18s, transform .18s; }
.ww-banner-promo:hover { border-color: rgba(255,46,99,.75); box-shadow: 0 0 26px rgba(255,46,99,.22); transform: translateY(-1px); }
.ww-promo-text { display: flex; flex-direction: column; gap: 3px; }
.ww-promo-text b { font-family: var(--ff-title); font-size: 17px; color: var(--text); }
.ww-promo-text span { color: var(--text-2); font-size: 13px; }
@media (max-width: 520px) {
  .ww-banner-promo { flex-direction: column; align-items: stretch; text-align: center; padding: 14px 16px; }
  .ww-promo-text { align-items: center; }
}


.ww-lobby-card { max-width: 460px; margin: 40px auto; }
/* 房号输入:flex 内必须 min-width:0,否则 input 默认 min-content(size≈20字符)会撑破容器 */
.ww-code-input { letter-spacing: 10px; font-size: 22px; text-align: center; font-family: var(--ff-title); min-width: 0; flex: 1; width: 100%; }
.ww-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.ww-code-chip { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: 12px; padding: 8px 14px; }
.ww-code-chip b { font-family: var(--ff-title); font-size: 22px; letter-spacing: 4px; color: var(--neon-cyan); }
.ww-role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; border: 1px solid var(--border-2); background: var(--bg-card); }
.ww-role-chip.wolf { color: #ff2e63; border-color: rgba(255,46,99,.5); }
.ww-role-chip.village { color: #2ee6a6; border-color: rgba(46,230,166,.5); }

.ww-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; padding: 14px 18px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(13,19,32,.7)); border: 1px solid var(--border); }
.ww-banner.night { background: linear-gradient(135deg, rgba(10,14,40,.9), rgba(6,9,18,.9)); border-color: rgba(0,224,255,.3); }
.ww-banner .ph { font-family: var(--ff-title); font-size: 18px; font-weight: 800; }
.ww-banner .sub { color: var(--text-2); font-size: 13px; }

.ww-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ww-seat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); text-align: center; position: relative; }
.ww-seat.dead { opacity: .45; filter: grayscale(.8); }
.ww-seat .nm { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-seat .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.ww-seat .tag-mini { font-size: 10px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); }
.ww-seat .tag-mini.host { color: #ffd54a; border-color: rgba(255,213,74,.4); }
.ww-seat .tag-mini.police { color: #00e0ff; border-color: rgba(0,224,255,.4); }
.ww-seat .tag-mini.off { color: var(--text-3); }
.ww-seat .rl { font-size: 12px; font-weight: 700; }
.ww-seat .rl.wolf { color: #ff2e63; } .ww-seat .rl.village { color: #2ee6a6; }
.ww-seat .ops { display: flex; gap: 4px; }

/* 3D 翻牌角色卡 */
.ww-card { perspective: 1200px; max-width: 320px; margin: 24px auto; cursor: pointer; }
.ww-card-inner { position: relative; width: 100%; aspect-ratio: 3/4.2; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.7,.3,1); }
.ww-card.flipped .ww-card-inner { transform: rotateY(180deg); }
.ww-card-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; border: 1px solid var(--border-2); }
.ww-card-back { background: linear-gradient(160deg, #1b1040, #0d0a1a 70%); box-shadow: var(--glow-purple); }
.ww-card-back .pat { font-size: 64px; filter: drop-shadow(0 0 18px rgba(181,55,242,.8)); }
.ww-card-front { transform: rotateY(180deg); background: linear-gradient(160deg, #0d1320, #060912); }
.ww-card-front.wolf { background: linear-gradient(160deg, #33081b, #0d0a12); }
.ww-card-front .ico { font-size: 56px; filter: drop-shadow(0 0 14px currentColor); }
.ww-card-front .rname { font-family: var(--ff-title); font-size: 26px; font-weight: 800; }
.ww-card-front .camp { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; border: 1px solid; }
.ww-card-front .desc { color: var(--text-2); font-size: 13px; line-height: 1.5; text-align: center; }

/* 投票/选人网格 */
.ww-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ww-pick .pk { padding: 12px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-weight: 600; cursor: pointer; transition: all .15s; font-size: 13px; }
.ww-pick .pk small { display: block; color: var(--text-3); font-weight: 400; font-size: 11px; margin-top: 2px; }
.ww-pick .pk:hover { border-color: var(--neon-cyan); }
.ww-pick .pk.sel { border-color: var(--neon-cyan); background: rgba(0,224,255,.12); box-shadow: var(--glow-cyan); }
.ww-pick .pk:disabled { opacity: .4; cursor: not-allowed; }

.ww-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ww-host-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px dashed rgba(255,213,74,.4); background: rgba(255,213,74,.05); margin: 12px 0; }
.ww-host-bar .lb { color: #ffd54a; font-size: 12px; font-weight: 700; letter-spacing: 1px; }

/* 复盘时间线 */
.ww-timeline { position: relative; padding-left: 18px; }
.ww-timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: linear-gradient(var(--neon-blue), transparent); }
.ww-tl-day { font-family: var(--ff-title); font-weight: 700; color: var(--neon-cyan); margin: 14px 0 6px; font-size: 14px; }
.ww-tl-item { position: relative; padding: 4px 0 4px 10px; color: var(--text-2); font-size: 13px; }
.ww-tl-item::before { content: ''; position: absolute; left: -17px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--neon-blue); }
.ww-tl-item.secret { color: #b39ddb; font-style: italic; }
.ww-votes-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ww-votes-bar .bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan)); min-width: 6px; }
.ww-timer { font-family: var(--ff-title); font-size: 26px; font-weight: 800; color: #ffb627; font-variant-numeric: tabular-nums; }
.ww-join-wrap { max-width: 420px; margin: 48px auto; }

@media (max-width: 520px) {
  .ww-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ww-pick { grid-template-columns: repeat(3, 1fr); }
  .ww-code-input { letter-spacing: 8px; font-size: 20px; }
  .ww-banner { padding: 10px 12px; }
  .ww-banner .ph { font-size: 15px; }
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--neon-blue); }

/* ---------- 在线麻将 ---------- */
.mj-room { max-width: 720px; margin: 16px auto 90px; padding: 0 10px; }
.mj-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.mj-code-chip { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.mj-code-chip b { color: var(--neon-yellow, #ffd35c); font-size: 15px; letter-spacing: 2px; }

.mj-opps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.mj-opp { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px; min-width: 0; }
.mj-opp.active { border-color: var(--neon-yellow, #ffd35c); box-shadow: 0 0 0 1px var(--neon-yellow, #ffd35c); }
.mj-opp.won { border-color: #63e6a3; }
.mj-opp-info { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; margin-bottom: 6px; }
.mj-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mj-que { color: #ff9d9d; }
.mj-wintag { color: #63e6a3; font-weight: 700; }
.mj-score { color: var(--muted, #9aa); }
.mj-timer { color: var(--neon-yellow, #ffd35c); font-weight: 700; }
.mj-timer.urgent { color: #ff6b6b; animation: mjblink 0.8s infinite; }
@keyframes mjblink { 50% { opacity: 0.35; } }
.mj-opp-row { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.mj-melds { display: flex; gap: 4px; flex-wrap: wrap; }

.mjt { background: #f6f1e7; border: 1px solid #9a8f7d; border-radius: 5px; width: 44px; height: 60px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; user-select: none; flex: none; }
.mjt i { font-style: normal; font-size: 15px; line-height: 1.1; display: block; }
.mjt b { font-size: 13px; line-height: 1.1; display: block; }
.mjt-sm { width: 26px; height: 36px; border-radius: 3px; }
.mjt-sm i { font-size: 10px; } .mjt-sm b { font-size: 9px; }
.mjt.dim { opacity: 0.45; }
.mjt-back { width: 26px; height: 36px; border-radius: 3px; background: repeating-linear-gradient(45deg, #2d5f52, #2d5f52 4px, #254f44 4px, #254f44 8px);
  border: 1px solid #173830; color: #cfe8df; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: none; }
.mjt.sel { outline: 3px solid var(--neon-yellow, #ffd35c); outline-offset: 1px; transform: translateY(-4px); }

.mj-table { background: linear-gradient(180deg, #12433a, #0b2c26); border-radius: 12px; padding: 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; position: relative; }
.mj-pool { min-height: 64px; display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; padding: 4px;
  border-radius: 8px; }
.mj-pool.mine { outline: 1px dashed rgba(255, 211, 92, 0.4); }
.mj-pool-tag { position: absolute; font-size: 10px; color: rgba(255,255,255,0.45); }
.mj-pool .mjt.last { outline: 2px solid var(--neon-yellow, #ffd35c); }

.mj-feed { min-height: 18px; margin-bottom: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.mj-me-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.mj-me-info { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.mj-hand-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.mj-ting { min-height: 16px; color: #8fe3b0; margin-bottom: 4px; }
.mj-hand { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; min-height: 64px; }
.mj-hand .mjt { cursor: pointer; transition: transform 0.12s; }
.mj-hand .mjt:active { transform: scale(0.95); }

.mj-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.mj-actions .btn { min-width: 72px; }
.mj-seats { width: 100%; }

.mj-result { width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.mj-result-title { font-size: 17px; font-weight: 700; color: var(--neon-yellow, #ffd35c); margin-bottom: 8px; text-align: center; }
.mj-result-row { font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.mj-result-row:last-child { border-bottom: none; }
.mj-result-row.won { color: #63e6a3; font-weight: 600; }

@media (max-width: 520px) {
  .mj-opps { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .mj-opp { padding: 6px; }
  .mj-name { max-width: 70px; }
  .mjt { width: 34px; height: 48px; }
  .mjt i { font-size: 12px; } .mjt b { font-size: 11px; }
  .mj-hand { gap: 3px; }
}
