/* Bungee by The Bungee Project Authors, SIL Open Font License 1.1 (fonts/OFL.txt). Served from this site, not Google. */
@font-face { font-family: "Bungee"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/bungee-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bungee"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/bungee-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #16171a; --bg2: #1e2024; --panel: #24262b; --line: #363940; --text: #f3efe6; --muted: #a29e95;
  --yellow: #ffc72c; --yellow-dk: #b98a00; --orange: #ff6b1a; --red: #ef4b4b; --green: #3fbf6f;
  --t-frosh: #8d929b; --t-clever: #3fbf6f; --t-upper: #4c8dff; --t-rare: #b66dff; --t-deep: #ff8a3d; --t-ubc: #ffc72c;
  --display: "Bungee", "Arial Black", Impact, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh; color: var(--text); background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 6px 6px;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.tape { height: 12px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, #111 14px 28px); }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 56px; }
h1, h2, h3 { font-family: var(--display); font-weight: normal; letter-spacing: .5px; margin: 0 0 10px; }
h2 { font-size: 17px; } h3 { font-size: 14px; }
a { color: var(--yellow); }
.center { text-align: center; } .muted { color: var(--muted); } .small { font-size: 13px; }

/* buttons and inputs */
.btn {
  font: 15px var(--display); letter-spacing: .5px; color: var(--text); background: #3a3d44;
  border: 0; border-radius: 10px; padding: 12px 16px; cursor: pointer; box-shadow: 0 4px 0 #26282d;
}
.btn.primary { background: var(--yellow); color: #141414; box-shadow: 0 4px 0 var(--yellow-dk); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #26282d; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.wide { display: block; width: 100%; margin-top: 12px; }
.btn.big { font-size: 18px; padding: 16px; }
.btn.small { font-size: 12px; padding: 8px 12px; box-shadow: 0 3px 0 #26282d; }
.link { font: inherit; color: var(--muted); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input {
  width: 100%; font: inherit; font-size: 17px; color: var(--text); background: var(--bg2);
  border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none;
}
input:focus { border-color: var(--yellow); }
input:disabled { opacity: .6; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; }
.count { color: var(--muted); font-size: .85em; }
.msg { color: var(--orange); min-height: 1.2em; margin: 10px 0 0; }

/* home */
.brand { text-align: center; margin: 26px 0 18px; }
.brand h1 { font-size: 40px; line-height: 1.02; color: var(--yellow); text-shadow: 3px 3px 0 #000; margin: 10px 0; }
.brand-jack { width: 48px; height: 86px; animation: rattle .2s infinite; }
.tag { color: var(--muted); margin: 0 auto; max-width: 30ch; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; font-family: var(--display); letter-spacing: 4px; text-align: center; }
.join-row .btn { flex: none; }
.foot { text-align: center; color: var(--muted); font-size: 13px; }

/* room top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.roomcode { font-family: var(--display); color: var(--muted); font-size: 13px; }
.roomcode b { color: var(--yellow); font-size: 22px; letter-spacing: 3px; font-weight: normal; margin-left: 4px; }
.net { background: var(--orange); color: #111; font-weight: 600; text-align: center; border-radius: 10px; padding: 8px; margin-top: 10px; }

/* lobby */
.crew { list-style: none; margin: 0; padding: 0; }
.crew li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.crew li:last-child { border-bottom: 0; }
.crew .hat { width: 24px; height: 16px; color: var(--yellow); flex: none; }
.crew .away { opacity: .5; }
.pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pname em { color: var(--muted); font-style: normal; }
.badge { font: 10px var(--display); letter-spacing: .5px; background: var(--yellow); color: #111; border-radius: 6px; padding: 2px 6px; }
.badge.dim { background: #3a3d44; color: var(--muted); }
.x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; }
.x:hover { color: var(--red); }
.settings .set { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.settings .set:last-child { border-bottom: 0; }
.set-label { flex: 1; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.set-v { min-width: 72px; text-align: center; font: 19px var(--display); color: var(--yellow); }
.arrow { width: 38px; height: 34px; border: 0; border-radius: 8px; background: #3a3d44; color: var(--text); cursor: pointer; font-size: 13px; }
.arrow:disabled { opacity: .3; cursor: default; }
.arrow.ghost { display: inline-block; visibility: hidden; }
.results h2 { color: var(--yellow); }
.results ol { margin: 0; padding-left: 22px; }
.results li { margin: 6px 0; }
.results li span { display: block; color: var(--muted); font-size: 13px; }

/* game */
.prompt { text-align: center; border-color: var(--yellow); position: relative; overflow: hidden; }
.prompt::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, #111 10px 20px); }
.prompt-no { font: 11px var(--display); color: var(--muted); letter-spacing: 1px; margin-top: 4px; }
.prompt h2 { font-size: 20px; line-height: 1.3; margin: 8px 0 4px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.holder { display: flex; align-items: center; gap: 14px; margin: 6px 4px 12px; min-height: 84px; }
.jack { width: 42px; height: 76px; flex: none; }
.holder-name { font-size: 17px; }
.holder-name b { color: var(--yellow); }
.typing { color: var(--muted); font-size: 18px; min-height: 1.4em; word-break: break-word; }
.typing:not(:empty)::before { content: "“"; } .typing:not(:empty)::after { content: "”"; }
.answer-row { display: flex; gap: 10px; }
.answer-row .btn { flex: none; }
body.my-turn #answer { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 199, 44, .18); }
.feedback { min-height: 1.4em; margin: 10px 2px; font-weight: 600; }
.feedback.good { color: var(--green); } .feedback.bad { color: var(--orange); }
.players { list-style: none; padding: 0; margin: 4px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pl { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 10px; position: relative; transition: border-color .2s, transform .2s; }
.pl.me .pname { color: var(--yellow); }
.pl.holding { border-color: var(--yellow); box-shadow: 0 0 22px rgba(255, 199, 44, .22); transform: translateY(-2px); }
.pl.out { opacity: .4; }
.pl.away .pname::after { content: " (away)"; color: var(--muted); font-weight: normal; }
.pl-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 700; }
.mini-jack { width: 14px; height: 26px; flex: none; animation: rattle .15s infinite; }
.hats { display: flex; flex-wrap: wrap; gap: 3px; margin: 8px 0; }
.hat { width: 22px; height: 15px; color: var(--yellow); }
.hat.empty { color: #3f4249; }
.meter { height: 7px; background: #111; border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); transition: width .4s; }
.pl-pts { color: var(--muted); font-size: 12px; margin-top: 6px; }
.pl.hit { animation: hit .5s; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg2); border-left: 4px solid var(--c, var(--line)); border-radius: 8px; padding: 4px 9px; font-size: 13px; }
.chip.none { border: 0; color: var(--muted); padding-left: 0; background: none; }
.t-frosh { --c: var(--t-frosh); } .t-clever { --c: var(--t-clever); } .t-upper { --c: var(--t-upper); }
.t-rare { --c: var(--t-rare); } .t-deep { --c: var(--t-deep); } .t-ubc { --c: var(--t-ubc); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; pointer-events: none; background: rgba(12, 12, 14, .9); }
.count-n { font: 96px/1 var(--display); color: var(--yellow); text-shadow: 4px 4px 0 #000; animation: pulse 1s infinite; }
.count-p { font: 18px/1.35 var(--display); max-width: 22ch; }
.boom { background: rgba(48, 20, 6, .93); }
.boom-word { font: 64px/1 var(--display); color: var(--orange); -webkit-text-stroke: 2px #111; text-shadow: 4px 4px 0 #111; animation: boom .5s ease-out; }
.boom-who { font: 18px var(--display); }
body.quake main { animation: quake .45s; }

/* how-to dialog */
dialog { max-width: 460px; width: calc(100% - 32px); color: var(--text); background: var(--panel); border: 2px solid var(--yellow); border-radius: 16px; padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog ol { padding-left: 20px; } dialog li { margin: 8px 0; }
.fine { color: var(--muted); font-size: 13px; }

/* motion */
@keyframes rattle { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-1px, 1px) rotate(-1.5deg); } 50% { transform: translate(1px, -1px) rotate(1.5deg); } 75% { transform: translate(-1px, 0) rotate(-1deg); } }
@keyframes rattle2 { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-3px, 2px) rotate(-5deg); } 50% { transform: translate(3px, -2px) rotate(5deg); } 75% { transform: translate(-2px, 1px) rotate(-3deg); } }
.jack.r1 { animation: rattle .24s infinite; } .jack.r2 { animation: rattle .12s infinite; } .jack.r3 { animation: rattle2 .07s infinite; }
@keyframes pulse { 0% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes boom { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.15) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes quake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
@keyframes hit { 0% { transform: scale(1); } 40% { transform: scale(1.05); border-color: var(--green); } 100% { transform: scale(1); } }
.shake { animation: quake .35s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
