:root {
  --bg: #0b0e14;
  --panel: #121722;
  --panel-2: #1a2130;
  --line: #243044;
  --text: #e6ecf5;
  --muted: #7f8ca3;
  --accent: #35e0ff;
  --danger: #ff4d5e;
  --gold: #ffd166;
  --good: #6ee7b7;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { background: radial-gradient(ellipse at 30% 20%, #1a1024 0%, var(--bg) 60%); }
#app { display: flex; height: 100%; }

#stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px; min-width: 0; position: relative; }
/* The hand-off picker sits over the game screen itself, so it is in view on a phone and in fullscreen. */
.handoff-over { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60; width: min(660px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; box-sizing: border-box; background: rgba(16,20,31,0.96); }
.handoff-over h2 { font-size: 15px; color: var(--gold); }
.ho-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .ho-cols { grid-template-columns: 1fr; } }
/* Phone held upright: the game screen is short, so the picker takes the whole screen until the hand-off is sent. */
@media (max-width: 700px) and (orientation: portrait) { .handoff-over { position: fixed; inset: 10px 10px auto; transform: none; width: auto; max-height: calc(100vh - 20px); } }
.handoff-over .row input { min-width: 0; }
/* Phone DASH while the Blink Ring recharges. */
.cp-btn.hmd-cool { opacity: 0.4; }
#c { width: 100%; max-width: calc((100vh - 24px) * 5 / 3); aspect-ratio: 5 / 3; height: auto; background: #0d0b14; border-radius: 10px; cursor: crosshair; touch-action: none; display: block;
     box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,0.55), 0 0 80px rgba(255,150,60,0.05); }

#side { width: 340px; flex: none; overflow-y: auto; padding: 14px; border-left: 1px solid var(--line); background: linear-gradient(180deg, #131927 0%, var(--panel) 100%); display: flex; flex-direction: column; gap: 12px; }
header .back { display: inline-block; margin-bottom: 8px; font: 700 12px/1 "Rajdhani", system-ui, sans-serif; letter-spacing: 0.18em; color: var(--muted); text-decoration: none; }
header .back:hover { color: var(--accent); }
header h1 { margin: 0; font: 700 28px/1 "Rajdhani", system-ui, sans-serif; letter-spacing: 0.12em; text-shadow: 0 0 24px rgba(255,209,102,0.2); }
header h1 span { color: var(--gold); text-shadow: 0 0 18px rgba(255,209,102,0.5); }
#status { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; margin-top: 6px; }
.card { background: linear-gradient(180deg, #1c2434 0%, var(--panel-2) 100%); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.card[hidden] { display: none; }
.card h2 { margin: 0 0 8px; font: 700 13px/1 "Rajdhani", system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card.hot { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 30px rgba(255,209,102,0.15); }
.pill { background: var(--line); color: var(--text); border-radius: 999px; padding: 0 8px; font-size: 11px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
input { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; }
input:focus { outline: none; border-color: var(--accent); }
button { background: var(--line); color: var(--text); border: 0; border-radius: 6px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
button.primary { background: linear-gradient(180deg, #5ee8ff, #22cdf0); color: #04121a; box-shadow: 0 4px 14px rgba(53,224,255,0.25); }
button:hover { filter: brightness(1.1); }
button[hidden] { display: none; }
#you-msg { font-size: 13px; }
#you-msg b { color: var(--accent); }
#you.hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 30px rgba(53,224,255,0.15); }
.note { margin-top: 8px; font-size: 12px; color: var(--danger); }
.note[hidden] { display: none; }

#inherit-msg { font-size: 13px; line-height: 1.5; }
#inherit-msg .heir { font: 700 13px/1.4 "Rajdhani", system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.note-q { margin-top: 6px; color: var(--gold); font-style: italic; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 700 11px/1.6 "Rajdhani", system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--line); }
.chip.item { color: var(--gold); background: rgba(255,209,102,0.1); }
.chip.curse { color: var(--danger); background: rgba(255,77,94,0.1); }

.votes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.votes button { display: flex; justify-content: space-between; gap: 6px; text-align: left; font-size: 12px; padding: 8px 10px; background: rgba(255,77,94,0.08); border: 1px solid var(--line); }
.votes button .pct { color: var(--muted); }
.votes button.on { border-color: var(--danger); background: rgba(255,77,94,0.22); }

.label { font: 700 11px/1 "Rajdhani", system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.looks { display: flex; gap: 6px; flex-wrap: wrap; }
.looks button { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 8px; }
.looks button canvas { width: 34px; height: 34px; display: block; }
.looks button.on { border-color: var(--accent); background: rgba(53,224,255,0.14); box-shadow: 0 0 10px rgba(53,224,255,0.25); }
.looks button:disabled { opacity: 0.45; cursor: default; filter: none; }
.label .hint { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 6px; }
.picks { display: flex; flex-direction: column; gap: 5px; }
.picks button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 7px 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.picks button b { font-size: 13px; }
.picks button span { font-size: 11px; color: var(--muted); }
.picks button.item.on { border-color: var(--gold); background: rgba(255,209,102,0.16); }
.picks button.curse.on { border-color: var(--danger); background: rgba(255,77,94,0.18); }
.votes button i, .picks button i { font-style: normal; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--danger); margin-left: 5px; vertical-align: 1px; }

.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.list li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.list li .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 45%; }
.list li .d { color: var(--muted); white-space: nowrap; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.list li.me .n { color: var(--accent); }
.list li.legend .n::before { content: "★ "; color: var(--gold); }
.list.lineage li.kind .n { color: var(--good); }
.list.lineage li.cruel .n { color: var(--danger); }
.help p { margin: 6px 0; font-size: 13px; }

@media (max-width: 900px) {
  #app { flex-direction: column; }
  #side { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  #c { max-width: min(100%, calc((100vh - 24px) * 5 / 3)); margin: 0 auto; } /* phones in landscape: never taller than the screen, so the touch buttons stay visible */
}
