:root {
  --bg: #0b0e14;
  --bg2: #131824;
  --panel: #1a2130;
  --panel2: #222b3d;
  --line: #2b3550;
  --text: #e8ecf5;
  --muted: #8d99b5;
  --gold: #c8a45c;
  --gold2: #e7c980;
  --green: #4cc38a;
  --red: #e0555f;
  --blue: #5aa9e6;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #16203a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
}
#app { max-width: 720px; margin: 0 auto; padding: 16px 14px calc(96px + var(--safe-b)); }

h1, h2, h3 { margin: 0 0 8px; font-weight: 700; }
h1 { font-size: 26px; letter-spacing: 1px; }
.title-gold { color: var(--gold2); }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.spacer { height: 12px; }

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.card.tight { padding: 10px; }

input, textarea, select, button { font: inherit; color: inherit; }
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="color"])), textarea, select {
  width: 100%;
  background: #0e1320;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 64px; }

button {
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  background: var(--panel2);
  border: 1px solid var(--line);
  cursor: var(--game-cursor-action, pointer);
  transition: transform .08s ease, filter .15s ease;
}
button:active { transform: scale(.97); }
button:disabled { opacity: .45; }
.btn-primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1a1405; border-color: transparent; font-weight: 700; }
.btn-danger { background: #3a1d22; border-color: #5c2a31; color: #ff9aa2; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; display: block; }
.btn-sm { padding: 9px 12px; font-size: 14px; border-radius: 10px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  font-size: 14px; cursor: var(--game-cursor-action, pointer); user-select: none;
}
.chip.on { background: rgba(200,164,92,.18); border-color: var(--gold); color: var(--gold2); }

.tag { display: inline-block; font-size: 12px; padding: 3px 8px; border-radius: 8px; background: #0e1320; border: 1px solid var(--line); color: var(--muted); margin: 2px 4px 2px 0; }
.tag.gold { color: var(--gold2); border-color: rgba(200,164,92,.5); }
.tag.cc { color: #ffb27a; border-color: rgba(255,178,122,.4); }
.tag.status { color: #8fd0ff; border-color: rgba(143,208,255,.35); }

.players { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: #0e1320; border: 1px solid var(--line); }
.prow.turn { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(200,164,92,.35), 0 0 18px rgba(200,164,92,.15); animation: pulse 1.8s ease-in-out infinite; }
.prow.solved { opacity: .6; }
.prow .pav { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #0a0d15; border: 1px solid var(--line); }
.prow .pav.q { display: grid; place-items: center; font-size: 20px; color: var(--gold2); }
.prow .pname { font-weight: 600; }
.prow .psub { font-size: 12px; color: var(--muted); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 1px rgba(200,164,92,.35), 0 0 14px rgba(200,164,92,.12);} 50% { box-shadow: 0 0 0 1px rgba(200,164,92,.6), 0 0 24px rgba(200,164,92,.3);} }

.log { max-height: none; overflow: visible; display: flex; flex-direction: column; gap: 8px; }
.log .item { font-size: 14px; padding: 8px 10px; border-radius: 10px; background: #0e1320; border: 1px solid var(--line); }
.log .item .who { color: var(--gold2); font-weight: 600; }
.log .item.ask { border-left: 3px solid var(--blue); }
.log .item.answer { border-left: 3px solid var(--green); }
.log .item.hint { border-left: 3px solid var(--gold); }
.log .item.guess.ok { border-left: 3px solid var(--green); background: #10251c; }
.log .item.guess.no { border-left: 3px solid var(--red); }
.log .item.sys { color: var(--muted); font-size: 13px; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(11,14,20,.4), var(--bg) 40%);
  padding: 10px 14px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.actionbar .inner { max-width: 720px; margin: 0 auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ccard { background: #0e1320; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: var(--game-cursor-action, pointer); }
.ccard img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; background: #0a0d15; }
.ccard .nm { font-size: 12px; padding: 5px 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(5,8,14,.72); display: flex; align-items: flex-end; }
.sheet .panel { width: 100%; max-width: 720px; margin: 0 auto; background: var(--bg2); border-top-left-radius: 18px; border-top-right-radius: 18px; border: 1px solid var(--line); max-height: 86vh; display: flex; flex-direction: column; }
.sheet .head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sheet .body { padding: 12px 14px; overflow-y: auto; }

.hero-preview { display: flex; gap: 12px; align-items: center; }
.hero-preview img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: #2a1d22; border: 1px solid #5c2a31; color: #ffd0d4; padding: 10px 16px; border-radius: 12px; z-index: 90; font-size: 14px; }

.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 95; text-align: center; font-size: 13px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px; background: #4a3410; color: #ffd98a; border-bottom: 1px solid #6b4d16; }

.result-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #0e1320; border: 1px solid var(--line); }
.result-row .rk { width: 30px; text-align: center; font-weight: 800; color: var(--gold2); }
.medal { font-size: 18px; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }

/* 倒计时环 */
.ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: 0 0 auto;
  background: conic-gradient(var(--gold) 100%, #223 0); }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #0e1320; }
.ring span { position: relative; font-size: 15px; font-weight: 800; color: var(--gold2); }

/* 首次提示条 */
.notice { border-color: rgba(200,164,92,.5); background: linear-gradient(180deg, #1d2434, #171d2b); }

/* 动画 */
@keyframes flipIn { from { transform: perspective(600px) rotateY(85deg); opacity: 0; } to { transform: perspective(600px) rotateY(0); opacity: 1; } }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes popIn { 0% { transform: scale(.85); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes riseIn { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fallDown { to { transform: translateY(112vh) rotate(760deg); opacity: 0; } }

.flip-in { animation: flipIn .5s ease both; }
.shake { animation: shakeX .42s ease; }
.pop { animation: popIn .5s ease; }
.actionbar.rise { animation: riseIn .28s ease; }

.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; opacity: .95; animation: fallDown 1.6s linear forwards; }

@media (prefers-reduced-motion: reduce) {
  .flip-in, .shake, .pop, .actionbar.rise, .prow.turn { animation: none !important; }
  .confetti { display: none; }
}

/* 第一轮体验升级：当前事件优先、稳定操作区、可访问的触控与反馈。 */
:root { --actionbar-height: 0px; --keyboard-offset: 0px; }
[hidden] { display: none !important; }
#app { max-width: 1080px; padding-bottom: calc(var(--actionbar-height) + 24px + var(--safe-b)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
button { min-height: 44px; touch-action: manipulation; }
button:disabled { cursor: var(--game-cursor-disabled, not-allowed); }
button:focus-visible, .ccard:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; }
input, textarea { scroll-margin-bottom: 24px; }
textarea { max-height: 120px; }
h2 { margin: 8px 0 12px; font-size: clamp(21px, 4.5vw, 28px); line-height: 1.4; overflow-wrap: anywhere; }
p { line-height: 1.7; }
.small { font-size: 12px; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.home-title { padding: 48px 0 22px; }
.home-title h1 { font-size: 36px; margin: 10px 0; }
#home-form > button { margin-top: 18px; }
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 22px 0; }
#code { min-width: 0; letter-spacing: 3px; text-transform: uppercase; }
.room-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.room-code { padding: 0; border: 0; color: var(--gold2); font-size: 26px; font-weight: 800; letter-spacing: 5px; }
.room-code span { font-size: 11px; letter-spacing: 0; color: var(--muted); margin-left: 6px; font-weight: 400; }
#rules-banner { align-items: center; font-size: 13px; }
#lobby-summary, #lobby-players, #lobby-settings, .setting-card, .end-title { max-width: 720px; margin-left: auto; margin-right: auto; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; background: var(--muted); border-radius: 50%; }
.status-dot.online { background: var(--green); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.settings-grid label { color: var(--muted); font-size: 12px; }
.settings-grid input { display: block; margin-top: 6px; }
.locked-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px; background: #101c22; border: 1px solid #2d5146; border-radius: 14px; }
.locked-card > span { color: var(--green); font-size: 34px; }
.locked-card small { color: var(--muted); }
.pick-progress { margin-top: 22px; }
.turn-order { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding: 2px 0 8px; }
.turn-chip { flex: 0 0 auto; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; min-width: 90px; background: #111722; }
.turn-chip small, .turn-chip b { display: block; }
.turn-chip small { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.turn-chip b { font-size: 13px; }
.turn-chip.current { border-color: var(--gold); background: #29261f; }
.turn-chip.current small { color: var(--gold2); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
#game-main { min-width: 0; }
.event-card { min-height: 180px; padding: 22px; border-color: #645437; background: radial-gradient(ellipse at 100% 0%, #343022 0%, #1a2130 65%); }
.event-card h2 { font-size: 23px; }
.log-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.log-heading h3 { margin: 0; font-size: 16px; }
.selected { background: #332d20; border-color: var(--gold); color: var(--gold2); }
.answer-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.answer-summary span { padding: 5px 9px; border: 1px solid var(--line); background: #101723; border-radius: 8px; font-size: 12px; color: var(--muted); }
.answer-summary .yes { color: var(--green); }
.answer-summary .no { color: #ff929a; }
.conflict { font-size: 12px; color: #ead097; background: #352c1b; padding: 10px; border-radius: 8px; }
.answers { display: flex; flex-direction: column; gap: 8px; }
.answer-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; background: #0f1723; font-size: 13px; overflow-wrap: anywhere; }
.answer-item b { grid-column: 1; min-width: 0; color: var(--gold2); text-align: left; }
.answer-item span { grid-column: 2; min-width: 0; text-align: center; overflow-wrap: anywhere; }
blockquote { margin: 16px 0; padding: 14px; border-left: 3px solid var(--gold); background: #131a23; border-radius: 4px 12px 12px 4px; overflow-wrap: anywhere; }
#hint-send { margin-top: 10px; }
.result-hero { text-align: center; }
.result-hero img { display: block; width: 90px; height: 90px; margin: 18px auto 12px; border-radius: 18px; border: 2px solid var(--line); }
.result-hero.correct img { border-color: var(--gold2); box-shadow: 0 0 32px #c8a45c33; }
.result-hero.correct h2 { color: var(--gold2); }
.result-hero.incorrect h2 { color: #ff9aa2; }
.result-hero p { font-size: 13px; }
.actionbar { bottom: var(--keyboard-offset); max-height: none; overflow: visible; background: rgba(11,14,20,.97); }
.action-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.action-choices > button { flex-basis: 0; padding: 10px 6px; }
.action-choices b, .action-choices small { display: block; }
.action-choices small { font-size: 11px; color: var(--muted); margin-top: 3px; }
#act-slot:not(:empty) { margin-top: 12px; }
#ask-send { margin-top: 8px; }
.quick-questions { display: flex; overflow-x: auto; gap: 4px; margin-bottom: 6px; }
.quick-questions button { white-space: nowrap; font-size: 12px; padding: 5px 8px; }
.answer-buttons { margin: 10px 0; }
.answer-buttons button:first-child { border-color: #285d47; color: var(--green); }
.answer-buttons button:nth-child(2) { border-color: #663039; color: #ff9aa2; }
.submitted { color: var(--green); padding: 12px; font-size: 13px; }
#ans-text { min-width: 0; }

.prow.solved { opacity: .8; }
.prow.turn { animation: none; }
.result-row .pav { width: 52px; height: 52px; border-radius: 10px; }
.sheet { padding-bottom: var(--keyboard-offset); }
.sheet .panel { max-height: calc(var(--viewport-height, 100dvh) - 24px); animation: riseIn .2s ease both; }
.sheet .body { overscroll-behavior: contain; min-height: 0; }
.picker-footer { padding: 12px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.filter-actions { display: flex; flex-shrink: 0; align-items: center; gap: 8px; padding: 8px 14px 12px; }
.position-filters { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.position-filter, .picker-more, .picker-clear { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #869dbb; }
.position-filter, .picker-clear { width: 44px; }
.position-filter .game-icon { width: 23px; height: 23px; }
.picker-more { position: relative; gap: 6px; padding: 0 6px; font-size: 12px; white-space: nowrap; border-color: var(--line); }
.picker-more .game-icon, .picker-clear .game-icon { width: 18px; height: 18px; }
.position-filter:hover, .picker-more:hover, .picker-clear:hover { color: #ead094; background: #d6b66c0d; border-color: #89764a; }
.position-filter.on, .picker-more.on { color: #ecd08c; border-color: #ad8e4b; background: linear-gradient(180deg, #d6b66c25, #d6b66c0c); box-shadow: inset 0 0 10px #d6b66c0d; }
.picker-clear.has-filters { color: #c9d7e9; }
.filter-count { position: absolute; top: -5px; right: -4px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ddbe75; color: #171b24; font-size: 10px; font-weight: 700; }
.position-filter:focus-visible, .picker-more:focus-visible, .picker-clear:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
@media (max-width: 400px) {
  .position-filters { gap: 2px; }
  .position-filter, .picker-clear { width: 40px; }
}
@media (max-width: 360px) {
  .filter-actions { gap: 6px; }
  .position-filters { gap: 2px; }
  .position-filter, .picker-clear { width: 36px; }
  .picker-more { gap: 4px; padding: 0 4px; font-size: 11px; }
  .picker-more .game-icon { width: 16px; height: 16px; }
}
.filter-group { margin: 12px 0; }
.filter-group > span { display: block; margin-bottom: 6px; }
.grid { margin-top: 14px; }
.ccard { padding: 0; color: var(--text); }
.ccard .nm { display: block; }
.ccard:active { transform: scale(.96); }
.ccard.sel { background: #332d20; }
.empty-state { padding: 22px; text-align: center; color: var(--muted); }
.rules-body { color: var(--muted); font-size: 14px; }
.rules-body h3 { color: var(--gold2); margin-top: 18px; }
.rules-body h3:first-child { margin-top: 0; }
.toast { bottom: calc(var(--keyboard-offset) + 28px); max-width: min(90vw, 480px); width: max-content; background: #202b39; border-color: #42536b; color: var(--text); }
.ring.urgent span { color: #ff9aa2; }
.log .item { overflow-wrap: anywhere; }
#turn-actions.rise { animation: riseIn .25s ease; }
@keyframes answerIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.answer-in { animation: answerIn .16s ease; }
@media (min-width: 900px) {
  #app { padding-top: 28px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 285px; gap: 18px; }
  .event-card { min-height: 220px; }
  .actionbar .inner { max-width: 720px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.answer-reference { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 12px 0; background: #101723; border: 1px solid var(--line); border-radius: 10px; }
.answer-reference img { width: 40px; height: 40px; border-radius: 8px; }
.answer-reference small, .answer-reference b { display: block; }
.answer-reference small { color: var(--muted); font-size: 11px; }
.answer-reference b { font-size: 14px; color: var(--gold2); }

/* ---------- 视觉升级：入口页 ---------- */
:root {
  --gold-bright: #f4d78a;
  --gold-deep: #b88335;
  --ink: #070b13;
  --panel-glass: rgba(23, 31, 48, .82);
  --panel-edge: rgba(124, 151, 195, .24);
}
html { background: var(--ink); }
body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(650px 360px at 50% -8%, rgba(55, 78, 128, .45), transparent 68%),
    radial-gradient(420px 300px at 12% 35%, rgba(28, 55, 102, .20), transparent 74%),
    radial-gradient(500px 360px at 90% 70%, rgba(91, 62, 30, .10), transparent 75%),
    linear-gradient(180deg, #10182b 0%, #0b111e 47%, #070b12 100%);
}
body::before, body::after {
  position: fixed; content: ""; pointer-events: none; z-index: -1;
}
body::before {
  inset: 0;
  opacity: .23;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
body::after {
  width: 520px; height: 520px; top: 80px; left: 50%; transform: translateX(-50%);
  border: 1px solid rgba(222, 182, 99, .08); border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(222,182,99,.025), 0 0 0 48px rgba(222,182,99,.018), inset 0 0 80px rgba(222,182,99,.025);
}
.home-page { display: flex; flex-direction: column; align-items: center; }
.home-title { padding: clamp(18px, 4vh, 34px) 0 12px; position: relative; }
.brand-mark { position: relative; display: grid; place-items: center; width: 48px; height: 48px; margin: 18px auto 10px; border: 1px solid rgba(224, 187, 104, .48); border-radius: 15px 15px 21px 21px; background: linear-gradient(145deg, rgba(255,226,145,.22), rgba(123,79,23,.18)); box-shadow: 0 0 0 5px rgba(225,186,97,.035), 0 0 30px rgba(225,186,97,.13); transform: rotate(45deg); }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(245,215,138,.22); border-radius: 11px 11px 16px 16px; }
.brand-mark span { color: var(--gold-bright); font-family: Georgia, serif; font-size: 26px; font-weight: 700; transform: rotate(-45deg); }
.home-title h1 { margin: 20px 0 8px; color: var(--gold-bright); font-size: clamp(34px, 5vw, 48px); letter-spacing: 3px; text-shadow: 0 2px 20px rgba(238,198,105,.16); }
.home-panel { position: relative; isolation: isolate; width: min(100%, 500px); margin: 15px auto 0; padding: 28px 26px 22px; border: 1px solid var(--panel-edge); border-radius: 21px; background: linear-gradient(145deg, rgba(32,43,64,.91), rgba(17,25,42,.88)); box-shadow: 0 24px 70px rgba(0,0,0,.32), 0 2px 0 rgba(255,255,255,.05) inset, 0 0 0 6px rgba(255,255,255,.012); backdrop-filter: blur(16px); overflow: hidden; }
.panel-shine { position: absolute; width: 320px; height: 180px; top: -110px; right: -80px; background: radial-gradient(ellipse, rgba(255,219,132,.18), transparent 70%); pointer-events: none; }
.panel-heading { position: relative; margin-bottom: 24px; }
.panel-eyebrow { display: inline-block; color: #d3b56f; font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.panel-heading h2 { margin: 7px 0 4px; font-size: 21px; letter-spacing: .2px; }
.panel-heading p { margin: 0; color: #8190ae; font-size: 13px; }
.field-block, .join-block { position: relative; }
.field-block label, .join-block label { display: block; margin: 0 0 8px 2px; color: #aab8d0; font-size: 12px; font-weight: 600; letter-spacing: .3px; }
.input-shell { display: flex; align-items: center; gap: 9px; height: 52px; padding: 0 14px; border: 1px solid #354564; border-radius: 13px; background: rgba(7, 12, 22, .68); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 8px 20px rgba(0,0,0,.10); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.input-shell:focus-within { border-color: rgba(232,201,128,.9); background: rgba(8, 14, 25, .88); box-shadow: 0 0 0 3px rgba(221,184,95,.12), 0 8px 24px rgba(0,0,0,.15); }
.field-icon { display: grid; place-items: center; width: 20px; color: #d1aa59; font-size: 14px; }
.input-shell input { min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; color: #f1f3f8; font-size: 16px; }
.input-shell input::placeholder { color: #697893; }
.input-shell input:focus { border: 0; box-shadow: none; }
.home-create { display: flex; align-items: center; justify-content: center; gap: 12px; height: 54px; margin-top: 17px; border-radius: 13px; color: #211707; background: linear-gradient(135deg, #f5d98d 0%, #d3a74f 54%, #bc8933 100%); box-shadow: 0 8px 22px rgba(184,132,48,.22), 0 1px 0 rgba(255,255,255,.55) inset; font-size: 16px; letter-spacing: .4px; }
.home-create:hover { filter: brightness(1.07); box-shadow: 0 10px 28px rgba(184,132,48,.32), 0 1px 0 rgba(255,255,255,.6) inset; }
.button-arrow { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(33,23,7,.28); border-radius: 50%; font-size: 17px; line-height: 1; }
.home-divider { display: flex; align-items: center; gap: 12px; margin: 23px 0 19px; color: #7e8da9; font-size: 12px; }
.home-divider::before, .home-divider::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(112,133,170,.36)); }
.home-divider::after { transform: rotate(180deg); }
.join-row { display: flex; gap: 10px; }
.join-row .code-shell { flex: 1; }
.code-shell input { letter-spacing: 4px; text-transform: uppercase; }
.code-shell input::placeholder { letter-spacing: 1px; }
.join-button { min-width: 84px; height: 52px; padding: 0 17px; border-radius: 13px; color: #dbe3f1; background: rgba(34,47,72,.78); border-color: #3d4f72; font-weight: 600; }
.join-button:hover, .rules-link:hover { border-color: rgba(231,201,128,.7); color: var(--gold-bright); background: rgba(51,61,84,.82); }
.home-footer {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; width: min(100%, 500px); gap: 12px; margin: auto 0 0; padding-top: 8px;
  color: #93a5c2; font-size: 12px;
}
.home-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, #9c875544 25%, #9c875566 50%, #9c875544 75%, transparent);
}
.home-facts { display: flex; align-items: center; gap: 18px; }
.home-fact { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.home-fact .game-icon { width: 16px; height: 16px; color: #aa956b; }
.home-fact b { color: #e8cf94; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.home-footer .rules-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0;
  min-height: 44px; margin: 0; padding: 0 12px; border-radius: 12px;
  color: #dfcb9f; background: linear-gradient(145deg, #b9953f14, #17223666);
  border-color: #ad90583d; box-shadow: inset 0 1px 0 #fff5d209; font-size: 12px;
}
.home-footer .rules-link span { margin: 0; }
.home-footer .rules-arrow { width: 14px; height: 14px; transform: rotate(-90deg); color: #b7985b; transition: transform .18s ease; }
.home-footer .rules-link:hover { color: #f4d78a; border-color: #c8a45c99; background: #39322366; }
.home-footer .rules-link:hover .rules-arrow { transform: translateX(2px) rotate(-90deg); }
@media (max-width: 560px) {
  #app { padding-left: 16px; padding-right: 16px; }
  .home-title { padding-top: 34px; }
  .home-panel { margin-top: 8px; padding: 24px 18px 20px; border-radius: 18px; }
  .home-title h1 { font-size: 36px; letter-spacing: 2px; }
}
@media (prefers-reduced-motion: no-preference) {
  .brand-mark { animation: markFloat 5s ease-in-out infinite; }
  .home-panel { animation: panelIn .55s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes markFloat { 0%,100% { transform: rotate(45deg) translateY(0); } 50% { transform: rotate(45deg) translateY(-4px); } }
  @keyframes panelIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
}
.hint-status { color: var(--gold2); border-color: rgba(200,164,92,.42); background: rgba(200,164,92,.10); }
.hint-setting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setting-caption { color: var(--muted); font-size: 12px; }

/* ---------- 游戏化头像与线索牌 ---------- */
.avatar-section { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0 18px; margin-bottom: 18px; border-bottom: 1px solid rgba(100,125,165,.18); }
.avatar-section label, .join-block label { display: block; margin: 0; color: #d1dbeb; font-size: 13px; font-weight: 700; }
.avatar-hint { display: block; margin-top: 5px; color: #7484a0; font-size: 11px; }
.avatar-picker { display: grid; grid-template-columns: repeat(4, 42px); gap: 7px; }
.avatar-choice { min-height: 42px; width: 42px; padding: 2px; display: grid; place-items: center; border-radius: 13px; background: rgba(10,16,29,.7); border: 1px solid rgba(73,93,128,.8); transition: transform .16s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.avatar-choice:hover { transform: translateY(-2px); border-color: #d8b668; background: rgba(64,55,37,.7); }
.avatar-choice.selected { border-color: var(--gold-bright); background: rgba(201,157,72,.2); box-shadow: 0 0 0 3px rgba(228,191,103,.12), 0 5px 16px rgba(202,156,69,.16); }
.avatar-face { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 12px; font-size: 22px; line-height: 1; background: radial-gradient(circle at 35% 27%, rgba(255,255,255,.55), transparent 20%), linear-gradient(145deg, #394e74, #19263d); border: 1px solid rgba(159,185,227,.32); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.avatar-face[data-avatar="fox"] { background: linear-gradient(145deg, #ce8c4a, #713b35); }
.avatar-face[data-avatar="panda"] { background: linear-gradient(145deg, #9aa6b8, #3c4659); }
.avatar-face[data-avatar="frog"] { background: linear-gradient(145deg, #83bd6a, #315d53); }
.avatar-face[data-avatar="cat"] { background: linear-gradient(145deg, #c58a9c, #5d3d64); }
.avatar-face[data-avatar="octopus"] { background: linear-gradient(145deg, #b879c6, #4e356e); }
.avatar-face[data-avatar="robot"] { background: linear-gradient(145deg, #74a9c9, #2b4967); }
.avatar-face[data-avatar="ghost"] { background: linear-gradient(145deg, #b7c7dc, #596785); }
.avatar-face[data-avatar="dragon"] { background: linear-gradient(145deg, #bd7161, #5d2c3e); }
.lobby-avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; }
.board-avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 18px; }
.result-avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 23px; }
.mini-avatar { width: 28px; height: 28px; border-radius: 9px; font-size: 16px; }
.hero-pav { width: 42px !important; height: 42px !important; border-radius: 11px !important; }
.turn-chip { display: flex; align-items: center; gap: 8px; }
.turn-chip > div { min-width: 0; }
.turn-chip b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hint-card-head .hint-avatar { width: 48px; height: 48px; border-radius: 15px; font-size: 27px; }
.hint-card-head h2 { margin: 5px 0 0; font-size: 21px; }
#hint-composer { margin-top: 18px; padding: 14px; border: 1px solid rgba(207,165,82,.38); border-radius: 15px; background: linear-gradient(135deg, rgba(85,63,29,.28), rgba(24,30,43,.36)); box-shadow: 0 0 25px rgba(202,158,70,.08) inset; }
#hint-composer textarea { background: rgba(9,14,25,.76); }
#hint-send { background: linear-gradient(135deg, #f2d489, #bd8531); color: #251a08; border: 0; box-shadow: 0 7px 18px rgba(190,135,49,.2); }
#hint-send:hover { filter: brightness(1.08); }
.result-row { gap: 9px; }
.result-row .pav { flex: 0 0 auto; }
@media (max-width: 560px) {
  .avatar-section { align-items: flex-start; flex-direction: column; }
  .avatar-picker { grid-template-columns: repeat(8, 36px); gap: 5px; }
  .avatar-choice { width: 36px; min-height: 36px; border-radius: 11px; }
  .avatar-choice .avatar-face { width: 30px; height: 30px; font-size: 18px; border-radius: 9px; }
}

.avatar-face img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; pointer-events: none; }
.avatar-choice .avatar-face { border: 0; box-shadow: none; }
.avatar-choice .avatar-face img { border-radius: 10px; }
.prow .avatar-face + .status-dot { margin-left: -3px; }
.service-mismatch { width: min(100%, 460px); margin: 16vh auto 0; padding: 42px 28px; text-align: center; border: 1px solid rgba(219,179,93,.34); border-radius: 22px; background: linear-gradient(145deg, rgba(31,41,61,.96), rgba(14,21,36,.96)); box-shadow: 0 24px 70px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06); animation: panelIn .4s ease both; }
.mismatch-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border: 1px solid rgba(233,198,117,.56); border-radius: 20px; color: var(--gold-bright); font-size: 34px; box-shadow: 0 0 24px rgba(214,169,75,.14); }
.service-mismatch h2 { color: var(--gold-bright); }
.service-mismatch p { color: #91a0bb; margin: 0 0 22px; }
@media (min-width: 900px) {
  .sheet { align-items: center; padding: 28px; }
  .sheet .panel { max-width: 760px; border: 1px solid rgba(118,143,185,.34); border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.52), 0 1px 0 rgba(255,255,255,.07) inset; animation: sheetPop .24s cubic-bezier(.2,.8,.2,1) both; }
  .sheet .head { padding: 17px 20px; background: linear-gradient(180deg, rgba(43,54,78,.42), transparent); }
  .sheet .body { padding: 20px; }
  .picker-footer { padding: 14px 20px 18px; }
  .sheet .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .sheet .ccard { border-radius: 14px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
  .sheet .ccard:hover { transform: translateY(-3px); border-color: rgba(231,201,128,.82); box-shadow: 0 9px 22px rgba(0,0,0,.22); }
  @keyframes sheetPop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
}
