/* The waiting room of the Games section: same dark look as the hub (/games/), pixel avatars, one accent. */
:root { --bg: #0f1114; --panel: #181b20; --panel2: #1f232a; --line: #2c3138; --ink: #e8e6df; --dim: #9a9890; --accent: #f0d060; --good: #5fc46f; --bad: #e5484d; --versus: #f28c38; --coop: #4aa3ff; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.5 "Oswald", "Segoe UI", system-ui, sans-serif; min-height: 100vh; }
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
#app { width: min(1080px, 100% - 32px); margin: 0 auto; padding: 22px 0 80px; }
.boot { color: var(--dim); text-align: center; padding: 80px 0; }

.top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.top .back { text-decoration: none; color: var(--dim); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.top .back:hover { color: var(--accent); }
h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 600; letter-spacing: 0.04em; margin: 0; margin-right: auto; }
.lang a { display: inline-block; padding: 1px 7px; margin-left: 4px; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--dim); }
.lang a.on { color: #111; background: var(--accent); border-color: var(--accent); }
.lead { color: var(--dim); max-width: 760px; margin: 6px 0 20px; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.col { display: grid; gap: 18px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
@media (max-width: 820px) {
  .grid, .split { grid-template-columns: minmax(0, 1fr); }
  /* one column: the chat right under the people, the games last */
  .grid .col { display: contents; }
  #me { order: 1; } #who { order: 2; } #chat { order: 3; } #rooms { order: 4; } #fame { order: 5; } #games { order: 6; } #how { order: 7; }
}

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px 18px; min-width: 0; }
.card.narrow { max-width: 460px; }
.card h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.card h2 small { color: var(--dim); font-size: 12px; margin-left: 6px; }
.dim { color: var(--dim); font-size: 14px; }
.pad { padding: 10px 0 2px; margin: 0; }
.err { color: var(--bad); margin: 6px 0; }
.note { color: var(--dim); font-size: 13px; margin: 14px 0 0; }
.alt { margin: 12px 0 0; font-size: 14px; }
.or { text-align: center; color: var(--dim); font-size: 13px; margin: 12px 0 4px; }

.avatar { display: block; flex: none; border-radius: 18%; }
.chip { display: inline-block; padding: 0 7px; border-radius: 3px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; line-height: 18px; background: #2a2f37; color: #cfcdc4; vertical-align: 1px; }
.chip.versus { background: rgba(242, 140, 56, 0.16); color: var(--versus); }
.chip.coop { background: rgba(74, 163, 255, 0.16); color: var(--coop); }
.chip.lv2 { background: rgba(95, 196, 111, 0.16); color: #7fd68c; }
.chip.lv3 { background: rgba(74, 163, 255, 0.16); color: #7fbcff; }
.chip.lv4 { background: rgba(160, 108, 240, 0.18); color: #c0a0f8; }
.chip.lv5 { background: rgba(242, 140, 56, 0.18); color: #f7ab6a; }
.chip.lv6 { background: rgba(240, 208, 96, 0.2); color: var(--accent); }

.btn { background: var(--panel2); border: 1px solid #3a404a; border-radius: 5px; padding: 8px 16px; cursor: pointer; font-weight: 500; letter-spacing: 0.04em; transition: border-color 0.12s, background 0.12s, transform 0.08s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; border-color: #3a404a; }
.btn.big { background: var(--accent); border-color: var(--accent); color: #15130a; font-weight: 600; padding: 10px 20px; }
.btn.big:hover { background: #f7dc7a; }
.btn.small { padding: 4px 12px; font-size: 14px; }
.btn.ghost { background: none; border-color: transparent; color: var(--dim); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.link { background: none; border: 0; padding: 0 4px; color: var(--dim); cursor: pointer; }
.link:hover { color: var(--accent); }

form label { display: block; font-size: 13px; letter-spacing: 0.06em; color: var(--dim); margin: 10px 0 0; }
input { display: block; width: 100%; background: #0f1114; border: 1px solid #3a404a; border-radius: 5px; padding: 8px 10px; margin-top: 3px; outline: none; }
input:focus { border-color: var(--accent); }
form .btn.big { margin-top: 14px; width: 100%; }
.card > .btn.big { width: 100%; }

/* my card */
.me { display: flex; gap: 16px; align-items: flex-start; position: relative; }
.me .face { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 16px; transition: transform 0.12s; }
.me .face:hover { transform: scale(1.05) rotate(-2deg); }
.me .who { min-width: 0; flex: 1; }
.me .nick b { font-size: 24px; font-weight: 600; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.me .karma { margin-top: 2px; color: var(--dim); }
.num { font-family: "Press Start 2P", monospace; font-size: 15px; color: var(--accent); }
.me .karma .num { font-size: 20px; margin-right: 2px; }
.bar { height: 6px; background: #0f1114; border-radius: 3px; margin: 8px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #b8973a, var(--accent)); border-radius: 3px; }
.rec { margin-top: 8px; font-size: 14px; color: #c9c7be; display: grid; gap: 2px; }
.rec b { color: var(--dim); font-weight: 500; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin-right: 6px; }
.me .out { position: absolute; top: 12px; right: 14px; font-size: 13px; }

/* people, rooms */
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid #23272e; }
.people li:first-child { border-top: 0; }
.people li > div { flex: 1; min-width: 0; display: grid; }
.people li b { font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people li em { color: var(--dim); font-style: normal; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.people li.away { opacity: 0.6; }
.empty { border-top: 1px solid #23272e; padding-top: 12px; color: var(--dim); font-size: 15px; }
.empty p { margin: 0 0 10px; }

/* games */
.gamelist { display: grid; gap: 8px; }
.gamelist .g { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; background: var(--panel2); border: 1px solid transparent; border-radius: 6px; text-decoration: none; color: inherit; }
.gamelist .g:hover { border-color: var(--accent); }
.gamelist .g b { font-weight: 600; font-size: 17px; letter-spacing: 0.03em; }
.gamelist .g em { margin-left: auto; font-style: normal; color: var(--accent); font-size: 14px; }

/* chat */
.chat { display: flex; flex-direction: column; }
.lines { list-style: none; margin: 0 -6px 10px; padding: 0 6px; height: 300px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a404a transparent; }
.lines li { display: flex; gap: 9px; padding: 5px 0; align-items: flex-start; }
.lines li > div { min-width: 0; }
.lines b { font-weight: 500; color: #d9d6cc; }
.lines li.mine b { color: var(--accent); }
.lines time { color: #6f6d66; font-size: 12px; margin-left: 4px; }
.lines p { margin: 0; color: #c9c7be; overflow-wrap: anywhere; line-height: 1.35; }
.lines .none { color: var(--dim); font-size: 15px; padding: 110px 0 0; justify-content: center; }
#say { display: flex; gap: 8px; }
#say input { margin: 0; }

/* hall of fame */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tabs button { background: none; border: 1px solid var(--line); border-radius: 3px; color: var(--dim); padding: 1px 10px; font-size: 13px; letter-spacing: 0.06em; cursor: pointer; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #15130a; font-weight: 600; }
.fame { list-style: none; margin: 0; padding: 0; }
.fame li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #23272e; }
.fame li:first-child { border-top: 0; }
.fame li > div { flex: 1; min-width: 0; display: grid; }
.fame li b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fame .rank { width: 26px; text-align: center; color: var(--dim); font-size: 17px; flex: none; }
.fame li.mine b { color: var(--accent); }
.fame.own { border-top: 1px dashed #3a404a; margin-top: 4px; }

.how summary { cursor: pointer; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.how p { color: #c9c7be; margin: 10px 0 0; font-size: 15px; }

/* the layer: modals and the banner of my challenge */
.veil { position: fixed; inset: 0; background: rgba(8, 9, 11, 0.72); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade 0.15s; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid #3a404a; border-radius: 10px; padding: 22px 24px; width: min(440px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); animation: pop 0.18s; }
.modal.wide { width: min(640px, 100%); }
.modal h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: 0.03em; }
.modal p { margin: 4px 0; }
.challenge { text-align: center; border-color: var(--accent); }
.challenge .vs { display: grid; place-items: center; margin-bottom: 10px; animation: bob 0.9s ease-in-out infinite alternate; }
.challenge .what { font-size: 18px; }
.challenge .btns { justify-content: center; }
.picks { display: grid; gap: 8px; margin-top: 12px; }
.pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-align: left; background: var(--panel2); border: 1px solid #3a404a; border-radius: 6px; padding: 10px 14px; cursor: pointer; }
.pick:hover { border-color: var(--accent); }
.pick b { font-size: 18px; font-weight: 600; letter-spacing: 0.03em; }
.pick .dim { flex-basis: 100%; }
.swatches { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--panel); outline: 2px solid transparent; cursor: pointer; padding: 0; }
.swatches button.on { outline-color: var(--ink); }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: min(52vh, 420px); overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.faces button { background: none; border: 2px solid transparent; border-radius: 8px; padding: 6px 2px 4px; cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.faces button:hover { background: var(--panel2); }
.faces button.on { border-color: var(--accent); background: var(--panel2); }
.faces span { font-size: 12px; color: var(--dim); line-height: 1.2; }

.banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 15; background: var(--panel2); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-width: calc(100% - 24px); overflow: hidden; }
.count { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; animation: run linear forwards; }
.count.wide { position: static; display: block; margin: 14px 0 0; border-radius: 2px; }
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: #262b33; border: 1px solid #3a404a; border-left: 3px solid var(--accent); border-radius: 5px; padding: 8px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); animation: pop 0.18s; transition: opacity 0.5s; }
.toast.bad { border-left-color: var(--bad); }
.toast.out { opacity: 0; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes run { to { transform: scaleX(0); } }
@keyframes bob { to { transform: translateY(-6px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .challenge .vs, .veil, .modal, .toast { animation: none; } }
