/* ChemSpy (live game) — phone-first. Colors come from style.css. */

.live { max-width: 620px; margin: 0 auto; padding: 4px 16px 64px; }
.live h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); line-height: 1.1; letter-spacing: -0.02em; margin: 8px 0 10px; }
.live h2 { font-size: 1.1rem; margin: 0 0 12px; }
.live .lead { color: var(--ink-2); margin: 0 0 16px; }
.live .meta { display: block; font-size: 0.9rem; color: var(--ink-2); }
.live .hint { color: var(--ink-2); font-size: 0.92rem; margin: 10px 0 8px; }
.live .center { text-align: center; }
.live .waiting { text-align: center; color: var(--ink-2); background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.live .tip { color: var(--ink-2); font-size: 0.95rem; text-align: center; margin: 10px 4px 16px; }
.live .error:empty { display: none; }

.live-banner { position: sticky; top: 0; z-index: 5; margin: 0; padding: 10px 16px; text-align: center; background: var(--sulfur); color: var(--ink); font-weight: 600; }

.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }
.button.wide { width: 100%; margin-top: 14px; }

/* home */
.join-row { display: flex; gap: 10px; }
.code-input { flex: 1; min-width: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; text-align: center; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.code-input:focus { border-color: var(--nitrogen); outline: none; box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.2); }

/* choice buttons (units, minutes, guesses) */
.choice-list { display: grid; gap: 8px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; text-align: left; cursor: pointer; font-size: 1rem; }
.segmented .choice { text-align: center; }
.choice:hover { border-color: var(--nitrogen); }
.choice.picked { border-color: var(--nitrogen); background: #e7effc; box-shadow: inset 0 0 0 1.5px var(--nitrogen); font-weight: 600; }

/* lobby */
.lobby-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 6px; }
.lobby-head h1 { font-size: 1.35rem; margin: 2px 0 0; }
.code-chip { flex: none; display: grid; justify-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px; line-height: 1.2; }
.code-chip span { font-size: 0.75rem; color: var(--ink-2); }
.code-chip strong { font-size: 1.2rem; letter-spacing: 0.15em; }
.code-panel { text-align: center; }
.big-code { font-size: clamp(3rem, 18vw, 4.5rem); font-weight: 700; letter-spacing: 0.2em; margin: 0; line-height: 1.1; color: var(--nitrogen-dark); }

.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: #f6f8fb; }
.players li.offline { opacity: 0.6; }
.pname { font-weight: 600; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pscore { color: var(--ink-2); font-size: 0.95rem; }
.tag { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; background: var(--grid); color: var(--ink-2); }
.tag.you { background: #e7effc; color: var(--nitrogen-dark); }
.tag.off { background: #fbe9e8; color: var(--oxygen); }
.tag.spy { background: var(--oxygen); color: #fff; }

.rules { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 14px 0; }
.rules summary { font-weight: 600; cursor: pointer; }
.rules ol { padding-left: 1.2em; margin: 10px 0; }
.rules li { margin-bottom: 6px; }

/* timer */
.timer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: var(--radius); }
.timer .meta { color: #c7d2e6; }
.timer .clock { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer .clock.low { color: var(--sulfur); }

/* the card: press and hold to see it */
.card { position: relative; display: block; width: 100%; min-height: 210px; padding: 0; border: 0; border-radius: var(--radius); background: none; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.card.small { min-height: 120px; margin-top: 14px; }
.card-back, .card-face { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; padding: 16px; border-radius: var(--radius); text-align: center; }
.card-back { background: repeating-linear-gradient(45deg, var(--nitrogen) 0 14px, #3a7ae0 14px 28px); color: #fff; font-weight: 600; font-size: 1.1rem; box-shadow: 0 4px 0 var(--nitrogen-dark); }
.card-icon { font-size: 2.2rem; }
.card-face { visibility: hidden; background: var(--card); border: 2px solid var(--nitrogen); }
.card-face.spy { border-color: var(--oxygen); background: #fff5f4; }
.card.showing .card-face { visibility: visible; }
.card.showing .card-back { visibility: hidden; }
.card-label { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.card-cat { margin: 0 0 8px; font-size: 1.15rem; font-weight: 600; }
.card-big { margin: 0; font-size: clamp(1.3rem, 6vw, 1.9rem); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.card-face.spy .card-big { color: var(--oxygen); font-size: 2.4rem; letter-spacing: 0.06em; }
.card-help { margin: 6px 0 0; color: var(--ink-2); }
.card.small .card-big { font-size: 1.2rem; }

.cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cats li { padding: 8px 10px; border-radius: var(--radius-sm); background: #f6f8fb; border: 1px solid var(--line); font-size: 0.95rem; }

/* results */
.reveal { text-align: center; }
.reveal-line { font-size: 1.2rem; margin: 6px 0; }
.result-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result-rows li { padding: 10px 12px; border-radius: var(--radius-sm); background: #f6f8fb; border: 1px solid var(--line); }
.result-rows li.is-spy { background: #fff5f4; border-color: #f0c2bf; }
.row-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-detail { display: grid; gap: 2px; margin-top: 4px; font-size: 0.93rem; color: var(--ink-2); }
.row-detail .right { color: var(--chlorine); }
.row-detail .wrong { color: var(--oxygen); }
.points { font-size: 1.3rem; font-weight: 700; color: var(--ink-2); }
.points.got { color: var(--chlorine); }
.totals { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.totals li span { display: inline-flex; gap: 6px; align-items: center; }
.totals li { padding: 4px 0; }
.totals li strong { float: right; }
.leave { margin-top: 24px; }
