:root {
  --ink: #1a2230;
  --muted: #5a6578;
  --panel: rgba(255, 255, 255, 0.95);
  --accent: #ff6b35;
  --accent-deep: #e04e1a;
  --host: #1f8a7a;
  --target: #ffc857;
  --font-d: "ZCOOL KuaiLe", "Noto Sans SC", sans-serif;
  --font-b: "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-b);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  background: #152033;
}
.scene {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(255, 107, 53, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 10%, rgba(31, 138, 122, 0.2), transparent 50%),
    linear-gradient(165deg, #1e2d48 0%, #152033 50%, #0f1724 100%);
}
.topbar {
  max-width: 1200px; margin: 0 auto; padding: 1rem 1.2rem 0.4rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; color: #eef3fa;
}
.back { color: #7dceb8; text-decoration: none; font-weight: 700; }
.brand { display: flex; gap: 0.7rem; align-items: center; flex: 1; }
.mark {
  width: 2.6rem; height: 2.6rem; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #ff9a5c, #ff6b35);
  color: #fff; font-family: var(--font-d); font-size: 1.3rem;
}
.brand h1 { margin: 0; font-family: var(--font-d); font-size: 1.5rem; }
.brand p { margin: 0; font-size: 0.85rem; opacity: 0.75; }
main { max-width: 1200px; margin: 0 auto; padding: 0.5rem 1.2rem 3rem; }
.panel {
  background: var(--panel); border-radius: 18px; padding: 1.3rem;
  max-width: 520px; box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.panel h2 { margin: 0 0 0.8rem; font-family: var(--font-d); font-size: 1.8rem; }
.field { display: grid; gap: 0.4rem; margin-top: 0.7rem; }
.field > span { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.row { display: flex; gap: 0.5rem; }
.row input, #roundsInput, #clueInput {
  border: 1px solid #cfd8e6; border-radius: 12px;
  padding: 0.7rem 0.85rem; font: inherit; background: #fff;
}
.row input { flex: 1; }
#roundsInput { max-width: 8rem; }
.name-list { list-style: none; margin: 0.8rem 0; padding: 0; display: grid; gap: 0.35rem; }
.name-list li {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0.7rem; background: #eef3f8; border-radius: 10px; font-weight: 700;
}
.name-list button { border: 0; background: transparent; color: var(--accent-deep); cursor: pointer; font: inherit; }
.hint { color: var(--muted); font-size: 0.9rem; }
.hint.top { margin: 0 0 0.5rem; }
.btn {
  border: 0; cursor: pointer; font: inherit; font-weight: 700;
  border-radius: 14px; padding: 0.75rem 1.3rem;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(145deg, #ff9a5c, #ff6b35); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid #cfd8e6; }
.btn.ghost { background: rgba(255,255,255,0.12); color: #eef3fa; border: 1px solid rgba(255,255,255,0.25); }
.btn.wide { width: 100%; margin-top: 0.6rem; }
.layout { display: grid; gap: 1rem; }
@media (min-width: 900px) { .layout { grid-template-columns: 1fr 270px; } }
.status {
  display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem;
  padding: 0.85rem 1rem; border-radius: 14px;
  background: rgba(255,255,255,0.1); color: #eef3fa; font-size: 1.1rem;
}
.status strong { color: #fff; font-size: 1.25rem; }
.spectrum-card {
  margin-top: 0.9rem; padding: 1.1rem 1rem 0.9rem; border-radius: 20px;
  background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.14);
  color: #eef3fa;
}
.end {
  font-family: var(--font-d); font-size: clamp(1.4rem, 3.5vw, 2rem);
  text-align: center; line-height: 1.2; min-height: 2.4em;
  display: flex; align-items: center; justify-content: center;
}
.end.left { color: #7dceb8; }
.end.right { color: #ffb088; }
.bar-track {
  position: relative; height: 22px; margin: 1.6rem 0 0.35rem;
  border-radius: 999px; background: rgba(0,0,0,0.35); overflow: visible;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.12);
}
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #1f8a7a, #ffc857, #ff6b35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  z-index: 2;
}
.marker.target.peg {
  width: auto; height: auto; background: none; border: 0; box-shadow: none;
}
.marker .peg-stem {
  display: block; width: 10px; height: 28px; margin: -18px auto 0;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #ffe08a, #f59f00);
  box-shadow: 0 2px 0 rgba(0,0,0,0.35);
  border: 2px solid #fff3c0;
}
.marker.meeple-marker {
  width: auto; height: auto; background: none; border: 0; box-shadow: none;
  top: auto; bottom: 100%; transform: translate(-50%, 0);
  padding-bottom: 0.15rem;
}
.marker.meeple-marker .meeple-fig { width: 1.5rem; height: 1.8rem; }
.marker.meeple-marker .marker-label { top: auto; bottom: 100%; margin-bottom: 0.15rem; }
.marker-label {
  position: absolute; top: -1.7rem; left: 50%; transform: translateX(-50%);
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  background: rgba(0,0,0,0.55); padding: 0.1rem 0.35rem; border-radius: 6px;
  color: #fff;
}
.marker.target .marker-label { top: -2.4rem; color: #ffe08a; }
.scale-labels {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; opacity: 0.65; margin-top: 1.4rem;
}
.host-box {
  margin-top: 0.9rem; padding: 1rem; border-radius: 16px;
  background: rgba(31, 138, 122, 0.18); border: 2px dashed rgba(125, 206, 184, 0.45);
  color: #eef3fa;
}
.host-box .kicker { margin: 0 0 0.6rem; font-size: 0.9rem; opacity: 0.8; font-weight: 700; }
.target-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.target-view {
  min-width: 5.5rem; padding: 0.45rem 0.9rem; border-radius: 12px;
  font-family: var(--font-d); font-size: 2.4rem; text-align: center;
  background: rgba(0,0,0,0.35); color: var(--target);
  border: 2px solid rgba(255, 200, 87, 0.4);
}
.target-view.is-hidden { filter: blur(10px); user-select: none; color: transparent; text-shadow: 0 0 16px var(--target); }
.clue-field { margin-top: 0.75rem; }
.clue-field input { width: 100%; }
.host-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.clue-show {
  margin-top: 0.9rem; padding: 1rem; border-radius: 16px; text-align: center;
  background: rgba(255,255,255,0.12); color: #eef3fa;
}
.clue-show .kicker { margin: 0; opacity: 0.7; font-weight: 700; }
.clue-text {
  margin: 0.4rem 0 0; font-family: var(--font-d);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.msg {
  text-align: center; font-family: var(--font-d); font-size: 1.35rem;
  color: #7dceb8; min-height: 1.6em; margin: 0.85rem 0;
}
.guess-box {
  background: var(--panel); border-radius: 16px; padding: 1rem; color: var(--ink);
}
.guess-title { margin: 0 0 0.7rem; font-weight: 700; }
.guess-inputs { display: grid; gap: 0.5rem; }
.guess-row {
  display: grid; grid-template-columns: 1fr 7rem; gap: 0.5rem; align-items: center;
}
.guess-row label { font-weight: 700; }
.guess-row input {
  border: 1px solid #cfd8e6; border-radius: 10px;
  padding: 0.55rem 0.7rem; font: inherit; font-weight: 700; text-align: center;
}
.result-box {
  margin-top: 0.7rem; padding: 1rem; border-radius: 16px; text-align: center;
  background: rgba(255, 200, 87, 0.15); border: 2px solid rgba(255, 200, 87, 0.35);
  color: #ffe8a8; font-family: var(--font-d); font-size: 1.4rem;
}
.side {
  background: var(--panel); border-radius: 18px; padding: 1rem;
  color: var(--ink); position: sticky; top: 0.6rem;
}
.side h2 { margin: 0; font-family: var(--font-d); font-size: 1.5rem; }
.scores { list-style: none; margin: 0.8rem 0; padding: 0; display: grid; gap: 0.4rem; }
.scores li {
  display: grid; grid-template-columns: 1fr auto; gap: 0.25rem;
  padding: 0.55rem 0.65rem; background: #eef3f8; border-radius: 10px;
}
.scores li.is-best .pts { color: var(--host); }
.scores .nm { font-weight: 700; }
.scores .pts { font-weight: 700; font-size: 1.25rem; color: var(--accent-deep); }
.scores .sub { grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); }
.rules { border-top: 1px solid #d8e0ea; padding-top: 0.7rem; }
.rules .t { margin: 0 0 0.35rem; font-weight: 700; }
.rules ul { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
[hidden] { display: none !important; }
