/* ===== 提瓦特猜角色 · 样式 ===== */
:root {
  --bg-0: #0b1020;
  --bg-1: #131a2e;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(211, 188, 142, 0.22);
  --gold: #d3bc8e;
  --gold-bright: #ecd8aa;
  --ink: #e8e4d8;
  --ink-dim: #9aa3b5;
  --c-green: #3f9d63;
  --c-green-bg: #2f7a4d;
  --c-yellow: #c9a24b;
  --c-yellow-bg: #96742c;
  --c-gray: #55607a;
  --c-gray-bg: #39415a;
  --r5: #ffd765;
  --r4: #b28dff;
  font-size: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(90, 120, 200, 0.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(211, 188, 142, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  display: flex; flex-direction: column;
}

/* 星空点缀 */
.bg-stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .7;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff8, transparent),
    radial-gradient(1px 1px at 32% 68%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 58% 14%, #ffdca055, transparent),
    radial-gradient(1px 1px at 74% 44%, #fff6, transparent),
    radial-gradient(1px 1px at 86% 78%, #fff4, transparent),
    radial-gradient(1.5px 1.5px at 44% 88%, #ffe9b866, transparent);
}

/* ===== 头部 ===== */
.site-header { position: relative; z-index: 1; padding: 26px 16px 6px; text-align: center; }
.logo { font-size: 2rem; letter-spacing: .35em; text-indent: .35em; color: var(--gold); font-weight: 700; }
.logo span { color: var(--gold-bright); }
.tagline { margin-top: 6px; color: var(--ink-dim); font-size: .85rem; letter-spacing: .12em; }
.header-actions { position: absolute; top: 20px; right: 16px; display: flex; gap: 8px; }
.icon-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 15px;
}
.icon-btn span { font-size: .62rem; color: var(--ink-dim); }
.icon-btn:hover { border-color: var(--gold); }

/* ===== 主容器 ===== */
.container { position: relative; z-index: 1; width: min(980px, 94vw); margin: 18px auto 40px; flex: 1; }

.controls { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pool-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pool-label { color: var(--gold); font-size: .85rem; letter-spacing: .2em; }
.pool-size-hint { color: var(--ink-dim); font-size: .78rem; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg-btn {
  appearance: none; border: none; background: transparent; color: var(--ink-dim);
  padding: 9px 18px; font-size: .92rem; cursor: pointer; transition: all .18s;
  border-right: 1px solid var(--line); letter-spacing: .08em;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: linear-gradient(180deg, #d8bd8d33, #d3bc8e1f); color: var(--gold-bright); font-weight: 600; }

/* ===== 输入区 ===== */
.guess-area { margin-bottom: 14px; }
.input-wrap { position: relative; display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
#guess-input {
  flex: 1; padding: 13px 16px; font-size: 1rem; color: var(--ink);
  background: var(--panel-strong); border: 1px solid var(--line); border-radius: 12px; outline: none;
}
#guess-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211, 188, 142, .12); }
#guess-input::placeholder { color: #7c8496; }
.primary-btn {
  padding: 0 22px; font-size: .98rem; letter-spacing: .2em; text-indent: .2em; font-weight: 600;
  color: #2c2413; background: linear-gradient(180deg, #eed9ab, #cdb27f);
  border: none; border-radius: 12px; cursor: pointer; transition: filter .15s;
}
.primary-btn:hover { filter: brightness(1.06); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }

.autocomplete {
  position: absolute; top: calc(100% + 6px); left: 0; right: 104px; z-index: 30;
  list-style: none; background: #171f36; border: 1px solid var(--line); border-radius: 12px;
  max-height: 330px; overflow-y: auto; box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.autocomplete li {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .04); font-size: .95rem;
}
.autocomplete li:last-child { border-bottom: none; }
.autocomplete li:hover, .autocomplete li.hl { background: rgba(211, 188, 142, .14); }
.ac-el { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ac-name { flex: 1; }
.ac-en { color: var(--ink-dim); font-size: .76rem; }
.ac-rarity { font-size: .72rem; letter-spacing: -1px; }
.r5 { color: var(--r5); } .r4 { color: var(--r4); }

.status-line { text-align: center; color: var(--ink-dim); font-size: .85rem; margin-top: 10px; min-height: 1.2em; }
.status-line b { color: var(--gold-bright); }
.pool-chip {
  margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--gold); font-size: .76rem; letter-spacing: .05em;
}

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 880px; }
thead th {
  font-size: .78rem; color: var(--gold); letter-spacing: .18em; font-weight: 600;
  padding: 6px 4px; text-align: center; white-space: nowrap;
}
tbody td {
  padding: 11px 8px; text-align: center; border-radius: 8px; font-size: .92rem;
  background: var(--panel); animation: pop .35s ease backwards;
  transition: transform .12s;
}
tbody td.col-name { text-align: left; padding-left: 14px; white-space: nowrap; min-width: 110px; }
td.green { background: var(--c-green-bg); color: #eafff1; }
td.yellow { background: var(--c-yellow-bg); color: #fff7df; }
td.gray { background: var(--c-gray-bg); color: #dfe4ef; opacity: .92; }
tbody tr:hover td { transform: translateY(-1px); }
.ver-arrow { margin-left: 5px; font-weight: 700; }
@keyframes pop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.name-cell { display: inline-flex; align-items: center; gap: 8px; }
.el-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.game-badge {
  font-size: .68rem; padding: 2px 7px; border: 1px solid; border-radius: 6px;
  letter-spacing: .06em; white-space: nowrap;
}
.game-cell { font-weight: 600; letter-spacing: .04em; }

.empty-hint {
  text-align: center; color: var(--ink-dim); padding: 46px 0 30px; line-height: 1.9; font-size: .92rem;
}
.empty-icon { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ===== 结果面板 ===== */
.result-panel {
  margin-top: 22px; text-align: center; padding: 26px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  animation: rise .45s ease;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.result-panel h2 { font-size: 1.5rem; margin-bottom: 16px; color: var(--gold-bright); letter-spacing: .12em; }
.result-panel h2.win { color: #8fe3ae; }
.answer-card {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px;
}
.answer-card .chip { font-size: .9rem; }
.answer-title { width: 100%; font-size: 1.06rem; color: var(--ink); }
.answer-title small { color: var(--ink-dim); margin-left: 8px; letter-spacing: .05em; }
.answer-title a { color: var(--gold); text-decoration: none; border-bottom: 1px dashed var(--line); }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.ghost-btn {
  padding: 10px 20px; border-radius: 12px; cursor: pointer; font-size: .95rem;
  background: transparent; color: var(--gold); border: 1px solid var(--line); transition: all .15s;
}
.ghost-btn:hover { border-color: var(--gold); background: rgba(211, 188, 142, .08); }
.countdown { margin-top: 14px; color: var(--ink-dim); font-size: .85rem; }
.countdown b { color: var(--gold-bright); font-variant-numeric: tabular-nums; }

/* ===== 通用 chip ===== */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px;
  font-size: .85rem; background: var(--panel-strong);
}
.chip-green { background: var(--c-green-bg); color: #eafff1; }
.chip-yellow { background: var(--c-yellow-bg); color: #fff7df; }
.chip-gray { background: var(--c-gray-bg); color: #dfe4ef; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 8, 18, .66); backdrop-filter: blur(4px); padding: 20px;
}
.modal-box {
  position: relative; width: min(520px, 100%); max-height: 84vh; overflow-y: auto;
  background: #141b31; border: 1px solid var(--line); border-radius: 16px; padding: 26px 26px 22px;
  animation: rise .3s ease;
}
.modal-box h2 { color: var(--gold-bright); font-size: 1.25rem; margin-bottom: 16px; letter-spacing: .1em; }
.modal-box h3 { color: var(--gold); font-size: .98rem; margin: 18px 0 10px; letter-spacing: .08em; }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 8px;
  background: var(--panel); color: var(--ink-dim); border: 1px solid var(--line); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.rules-list, .legend-list { padding-left: 20px; line-height: 2; font-size: .93rem; color: #cfd5e2; }
.legend-list { list-style: none; padding-left: 4px; }
.legend-list li { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0; }
.legend-list .chip { flex: none; min-width: 76px; justify-content: center; }
.legend-list .legend-text { flex: 1; min-width: 0; }
.rules-tip {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: .86rem;
  background: rgba(211, 188, 142, .09); color: #d9cba6; line-height: 1.7;
}

.stats-scope { font-size: .8rem; color: var(--ink-dim); letter-spacing: .05em; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.stat-item {
  text-align: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 4px;
}
.stat-item b { display: block; font-size: 1.35rem; color: var(--gold-bright); }
.stat-item span { font-size: .74rem; color: var(--ink-dim); }
.dist-chart { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-dim); }
.dist-label { width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.dist-bar {
  height: 20px; min-width: 26px; border-radius: 4px; padding: 0 7px;
  background: var(--c-gray-bg); color: #eef; font-size: .74rem; line-height: 20px;
  display: flex; align-items: center; justify-content: flex-end; transition: width .4s ease;
}
.dist-bar.best { background: var(--c-green-bg); }

/* ===== Toast & Footer ===== */
.toast {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: #20293f; border: 1px solid var(--line); color: var(--ink);
  padding: 11px 20px; border-radius: 12px; font-size: .9rem; box-shadow: 0 10px 26px rgba(0,0,0,.45);
  animation: rise .25s ease;
}
.hidden { display: none !important; }

.site-footer {
  position: relative; z-index: 1; text-align: center; padding: 18px 12px 26px;
  color: #6b7488; font-size: .76rem; letter-spacing: .05em;
}
.site-footer a { color: #8d97ad; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .logo { font-size: 1.5rem; }
  .header-actions { top: 14px; right: 10px; }
  .icon-btn span { display: none; }
  .seg-btn { padding: 8px 12px; font-size: .85rem; }
  table { min-width: 800px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ===== 多页面布局 ===== */
/* 顶栏（内页通用） */
.site-header.compact { padding: 16px 20px 4px; text-align: left; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(980px, 94vw); margin: 0 auto; }
.logo-link { font-size: 1.15rem; font-weight: 700; color: var(--gold); text-decoration: none; letter-spacing: .12em; }
.logo-link span { color: var(--gold-bright); }
.top-nav { display: flex; align-items: center; gap: 10px; }
.nav-link { color: var(--ink-dim); text-decoration: none; font-size: .85rem; padding: 6px 10px; border-radius: 8px; border: 1px solid transparent; }
.nav-link:hover { color: var(--gold); border-color: var(--line); }
.page-title { text-align: center; color: var(--gold-bright); letter-spacing: .25em; margin-top: 10px; font-size: 1.05rem; }

/* 游戏页池信息条 */
.pool-bar { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* 首页 */
.home-wrap { position: relative; z-index: 1; width: min(980px, 94vw); margin: 0 auto; flex: 1; }
.home-hero { text-align: center; padding: 64px 10px 30px; }
.home-logo { font-size: 2.7rem; }
.cta-row { display: flex; justify-content: center; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.cta-row.center { margin-top: 22px; }
.cta-main { display: inline-flex; align-items: center; padding: 14px 34px; font-size: 1.08rem; text-decoration: none; }
a.primary-btn { color: #2c2413; }
/* 首页「玩法说明」次级按钮：与主 CTA 等高的描边玻璃款 */
.cta-rules {
  display: inline-flex; align-items: center; gap: 9px; padding: 14px 26px;
  font-size: 1.02rem; font-weight: 600; letter-spacing: .08em; text-indent: .08em;
  text-decoration: none; color: var(--gold-bright); border-radius: 12px;
  background: linear-gradient(180deg, rgba(211, 188, 142, .13), rgba(211, 188, 142, .05));
  border: 1px solid rgba(211, 188, 142, .38);
  transition: transform .18s, border-color .18s, background .18s, box-shadow .18s;
}
.cta-rules-arrow { display: inline-block; font-weight: 400; transition: transform .18s; }
.cta-rules:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(211, 188, 142, .22), rgba(211, 188, 142, .09));
  box-shadow: 0 8px 22px rgba(211, 188, 142, .16);
}
.cta-rules:hover .cta-rules-arrow { transform: translateX(4px); }
.cta-rules:active { transform: translateY(1px); box-shadow: none; }
.home-stats { margin-top: 18px; color: var(--ink-dim); font-size: .88rem; letter-spacing: .06em; }
.game-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 10px; }
.g-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  text-decoration: none; transition: transform .15s, border-color .15s;
}
.g-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.g-name { font-size: 1.2rem; font-weight: 700; }
.g-bh3 .g-name { color: #ff6b81; } .g-gi .g-name { color: #d3bc8e; } .g-sr .g-name { color: #9aa7e8; } .g-zzz .g-name { color: #ff8a3d; }
.g-count { color: var(--gold-bright); font-size: .88rem; }
.g-hint { color: var(--ink-dim); font-size: .78rem; line-height: 1.5; }
.home-how { margin-top: 34px; padding: 22px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.home-how h2 { color: var(--gold-bright); font-size: 1.05rem; margin-bottom: 10px; letter-spacing: .1em; }
.rules-more { display: inline-block; margin-top: 10px; color: var(--gold); text-decoration: none; font-size: .9rem; }
.rules-more:hover { text-decoration: underline; }

/* 难度选择页 */
.select-wrap { padding-top: 10px; }
.diff-group { margin-bottom: 30px; }
.diff-title { font-size: 1.15rem; color: var(--ink); margin-bottom: 12px; letter-spacing: .12em; }
.diff-title small { color: var(--ink-dim); font-size: .76rem; margin-left: 10px; letter-spacing: .05em; }
.diff-easy { color: #8fe3ae; } .diff-normal { color: #9fc0f0; } .diff-hard { color: #f0a39f; }
.pool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pool-card {
  display: flex; flex-direction: column; gap: 7px; text-align: left;
  padding: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer; color: var(--ink);
  font-family: inherit; transition: transform .13s, border-color .13s;
}
.pool-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.pool-card.last-played { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(211,188,142,.35) inset; }
.pc-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pc-name { font-size: 1.02rem; font-weight: 700; letter-spacing: .04em; }
.pc-count { color: var(--ink-dim); font-size: .82rem; }
.last-tag { margin-left: auto; font-size: .68rem; color: var(--gold); border: 1px dashed var(--line); padding: 2px 7px; border-radius: 999px; }
.select-tip { text-align: center; color: var(--ink-dim); font-size: .86rem; margin-top: 8px; }

/* 规则页 */
.rules-page { max-width: 760px; }
.rules-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; }
.rules-box h2 { color: var(--gold-bright); font-size: 1.02rem; margin: 20px 0 10px; letter-spacing: .08em; }
.rules-box h2:first-child { margin-top: 0; }
.rules-box p { color: #cfd5e2; line-height: 1.9; font-size: .93rem; }
.diff-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: .9rem; margin-top: 6px; }
.rules-box { overflow-x: auto; }
.diff-table th, .diff-table td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; color: #cfd5e2; }
.diff-table th { color: var(--gold); background: rgba(211,188,142,.07); }

@media (max-width: 720px) {
  .game-cards { grid-template-columns: 1fr; }
  .home-hero { padding-top: 40px; }
  .home-logo { font-size: 2.1rem; }
}

