:root {
  --parch: #f6e3b4;
  --parch-d: #e8cb8c;
  --wood: #8a4f2a;
  --wood-d: #5a3018;
  --wood-l: #c27c3e;
  --ink: #3a2414;
  --sign: #f7c51e;
  --red: #c8322b;
  --ok: #3f9a3a;
  --warn: #d48a12;
  --bad: #c8322b;
  --font: "VT323", "Courier New", monospace;
  --num: "Jost", "Futura", "Century Gothic", sans-serif; /* numbers: 5 and S must never be confused */
  --head: "Jost", "Futura", "Century Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1416; color: var(--ink); font-family: var(--font); }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }
kbd { display: inline-block; min-width: 1.5em; padding: 0 .35em; border: 2px solid var(--wood-d); border-bottom-width: 3px; border-radius: 4px; background: #fff6dc; color: var(--ink); font-family: var(--font); font-size: .85em; line-height: 1.3; text-align: center; }
.small { font-size: 17px; opacity: .8; margin-top: 6px; }

/* ---------- Stardew-ish wooden panels ---------- */
.panel {
  background: var(--parch);
  border: 4px solid var(--wood);
  box-shadow: inset 0 0 0 2px var(--wood-l), inset 0 0 0 4px var(--parch-d), 0 4px 0 var(--wood-d), 0 6px 14px rgba(0,0,0,.45);
  border-radius: 8px;
  padding: 8px 12px;
}
.tag { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 14px; color: #fff; background: #777; letter-spacing: .5px; vertical-align: middle; }
.tag.ok { background: var(--ok); } .tag.warn { background: var(--warn); } .tag.bad { background: var(--bad); }
.swatch { display: inline-block; width: 10px; height: 14px; border: 2px solid var(--ink); border-top-color: #fff; border-radius: 0 0 3px 3px; vertical-align: middle; margin-right: 5px; flex: none; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { position: absolute; }

/* top-left: clock & score */
#hud-tl { top: 12px; left: 12px; min-width: 230px; }
.clockrow { display: flex; align-items: baseline; gap: 10px; }
#clock { font-size: 30px; font-weight: 700; letter-spacing: 1px; }
#phase { font-size: 17px; opacity: .85; }
.timebar { height: 6px; background: var(--parch-d); border: 2px solid var(--wood-d); border-radius: 3px; margin: 4px 0 6px; overflow: hidden; }
#timebar { height: 100%; background: linear-gradient(90deg, var(--red), var(--sign)); width: 100%; }
.scorerow { display: flex; gap: 22px; }
.scorerow small { display: block; font-size: 14px; opacity: .7; }
.scorerow b { font-size: 24px; }

/* top-right: minimap */
#hud-tr { top: 12px; right: 12px; padding: 6px; }
#minimap { display: block; width: 196px; height: auto; image-rendering: pixelated; border: 2px solid var(--wood-d); border-radius: 3px; }
.maphint { font-size: 14px; text-align: center; margin-top: 4px; }

/* check-in queue */
#queue-panel { right: 12px; top: 232px; width: 260px; }
.qhead { font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; }
#queue { list-style: none; margin: 6px 0; padding: 0; }
#queue li { display: grid; grid-template-columns: 16px 1fr auto; grid-template-rows: auto auto; column-gap: 4px; font-size: 17px; padding: 2px 4px; border-bottom: 1px dashed var(--parch-d); }
#queue li .swatch { grid-row: span 2; align-self: center; }
#queue li .qn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
#queue li .qb { grid-column: 2; font-size: 14px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#queue li .qp { grid-row: 1 / span 2; grid-column: 3; align-self: center; color: var(--ok); font-weight: 700; }
#queue li.first { background: rgba(255,255,255,.45); border-radius: 4px; }
#queue li.empty { display: block; opacity: .35; text-align: center; }
#queue-hint { font-size: 16px; text-align: center; }
#queue-panel.full { border-color: var(--red); }
#queue-panel.flash { animation: flash .5s; }
@keyframes flash { 0% { transform: scale(1.05); background: #fff6c9; } 100% { transform: scale(1); } }

/* glasses */
#hud-bl { left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.glasscard { display: flex; align-items: center; gap: 10px; width: 330px; padding: 6px 10px; }
.gkey { font-size: 26px; font-weight: 700; width: 30px; height: 30px; display: grid; place-items: center; background: #fff6dc; border: 2px solid var(--wood-d); border-bottom-width: 4px; border-radius: 6px; flex: none; }
.glass { position: relative; width: 26px; height: 40px; border: 3px solid #fff; border-top-width: 2px; outline: 2px solid var(--ink); border-radius: 0 0 8px 8px; background: rgba(255,255,255,.35); overflow: hidden; flex: none; }
.glass .liquid { position: absolute; bottom: 0; left: 0; right: 0; transition: height .2s; }
.glass .resid { position: absolute; bottom: 0; left: 0; right: 0; height: 18%; opacity: .7; }
.glass.broken { background: #ccc; }
.glass .crack { position: absolute; inset: 0; display: grid; place-items: center; color: var(--red); font-weight: 700; font-size: 29px; }
.ginfo { min-width: 0; flex: 1; }
.gname { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gstyle { font-size: 14px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghint { font-size: 14px; opacity: .7; }

/* gauges & prompt */
#hud-bc { left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gauges { display: flex; flex-direction: column; gap: 4px; width: 360px; }
.gauge { display: grid; grid-template-columns: 70px 1fr 80px; align-items: center; gap: 8px; font-size: 17px; }
.gl { font-weight: 700; }
.gv { text-align: right; font-size: 16px; }
.bar { position: relative; height: 14px; background: #5a3a24; border: 2px solid var(--wood-d); border-radius: 4px; overflow: hidden; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #e8b23a; transition: width .15s; }
.bar .fill.hot { background: #f07a2a; }
.bar .fill.max { background: var(--red); animation: pulse .6s infinite alternate; }
.bar.bladder .fill { background: #f2d84a; }
.bar.bladder .fill.hot { background: #e8a020; }
.bar .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.5); }
@keyframes pulse { from { opacity: 1; } to { opacity: .55; } }
#prompt { background: rgba(26,20,22,.85); color: #fff6dc; padding: 6px 14px; border-radius: 8px; font-size: 21px; border: 2px solid #000; display: none; white-space: nowrap; }
#prompt kbd { font-size: 18px; }

/* stand info */
#standinfo { left: 50%; bottom: 128px; transform: translateX(-50%); min-width: 360px; max-width: 520px; display: none; }
.si-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 2px solid var(--parch-d); margin-bottom: 4px; padding-bottom: 2px; }
.si-name { font-family: var(--head); font-weight: 700; text-transform: uppercase; font-size: 18px; background: var(--sign); padding: 0 6px; border: 2px solid #b8870c; }
.hype { color: #e8402a; font-size: 20px; letter-spacing: 1px; } .hype .dim { color: #c9b48a; }
.beer { font-size: 17px; margin: 2px 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.beer .style { font-size: 14px; opacity: .75; }
.si-foot { font-size: 14px; opacity: .85; margin-top: 4px; }

/* squeeze */
#squeeze { left: 50%; bottom: 130px; transform: translateX(-50%); width: 360px; text-align: center; display: none; }
.sq-title { font-weight: 700; font-size: 20px; margin-bottom: 4px; }
.sq-hint { font-size: 16px; margin-top: 4px; }

/* toasts & banners */
#toasts { top: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 560px; }
.toast { background: rgba(26,20,22,.88); color: #fff6dc; padding: 6px 14px; border-radius: 6px; font-size: 20px; border-left: 5px solid #888; transition: opacity .6s; max-width: 100%; text-align: center; }
.toast.good { border-color: #5fd36a; } .toast.bad { border-color: #ff5a3d; } .toast.warn { border-color: #f2c94c; }
.toast.fade { opacity: 0; }
#banner { left: 50%; top: 30%; transform: translate(-50%, -50%) scale(.8); text-align: center; opacity: 0; transition: opacity .3s, transform .3s; }
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner .b-main { font-family: var(--head); font-weight: 700; font-size: 64px; color: var(--sign); text-shadow: 0 4px 0 #6b4a08, 0 0 20px rgba(0,0,0,.8), 3px 3px 0 #000; letter-spacing: 2px; }
#banner.count .b-main { font-size: 120px; }
#banner.warn .b-main { color: #ff6b3d; }
#banner .b-sub { color: #fff6dc; font-size: 23px; text-shadow: 2px 2px 0 #000, 0 0 10px #000; margin-top: 4px; }
#cheer { left: 50%; top: 60%; transform: translate(-50%, -50%); display: none; text-align: center; animation: wiggle .15s infinite alternate; }
#cheer .ch-main { font-family: var(--head); font-weight: 700; font-size: 48px; color: #fff; text-shadow: 3px 3px 0 #000, 0 0 16px #ff6b3d; }
#cheer .bar { width: 320px; margin: 6px auto 0; }
#cheer .fill { background: #ffe14d; }
@keyframes wiggle { from { transform: translate(-50%, -50%) rotate(-2deg); } to { transform: translate(-50%, -50%) rotate(2deg); } }
#fps { right: 12px; bottom: 12px; color: #fff; font-size: 16px; text-shadow: 1px 1px 0 #000; }

/* staging */
#staging { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); display: none; max-width: 560px; text-align: center; font-size: 21px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20,12,14,.6); z-index: 10; }
#loading { background: #1a1416; }
#loading p { text-align: center; }
.logo-sign { font-family: var(--head); font-weight: 700; font-size: 64px; line-height: .95; text-align: center; background: var(--sign); color: #1b1715; padding: 22px 34px 18px; border: 5px solid #b8870c; box-shadow: 0 8px 0 #6b4a08, 0 12px 30px rgba(0,0,0,.6); position: relative; letter-spacing: 2px; }
.logo-sign::before { content: ''; position: absolute; top: 10px; left: 50%; width: 30px; height: 6px; margin-left: -15px; background: var(--red); }
.logo-sign.small { font-size: 32px; padding: 12px 18px; margin: 0 auto 10px; width: max-content; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 24px; }
.logo-sub { color: #fff6dc; font-size: 18px; text-shadow: 2px 2px 0 #000; }
#menu { background: radial-gradient(ellipse at center, rgba(40,26,20,.55), rgba(15,10,12,.92)); overflow-y: auto; flex-direction: column; justify-content: flex-start; }
.menu-inner { display: flex; flex-direction: column; align-items: center; margin: auto; padding: 14px 0; } /* margin:auto centres without clipping the top on short screens */
@media (max-height: 900px) {
  .logo { gap: 10px; margin-bottom: 14px; }
  .logo-sign { font-size: 46px; padding: 16px 28px 12px; }
}
.disclaimer { position: sticky; bottom: 0; flex-shrink: 0; width: 100%; margin: 0; padding: 6px 16px 7px; font-size: 15px; line-height: 1.15; text-align: center; color: rgba(255, 240, 210, .6); background: rgba(12, 8, 10, .88); border-top: 2px solid rgba(255, 240, 210, .12); z-index: 1; }
.disclaimer a { color: rgba(255, 240, 210, .8); }
.disclaimer a:hover { color: #fff; }
.menu-panel { width: 640px; max-width: 94vw; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.menu-panel label { font-weight: 700; font-size: 17px; letter-spacing: 1px; }
#name-input { font-family: var(--font); font-size: 29px; padding: 8px 12px; border: 3px solid var(--wood-d); border-radius: 6px; background: #fffaf0; color: var(--ink); outline: none; }
#name-input:focus { border-color: var(--red); }
#name-input.shake { animation: shake .1s 4; }
@keyframes shake { 0% { transform: translateX(-4px); } 100% { transform: translateX(4px); } }
.chars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#char-blurb { font-size: 18px; min-height: 2.6em; background: #fff6dc; border: 2px dashed var(--wood-l); border-radius: 6px; padding: 6px 10px; }
.char-card { border: 3px solid var(--wood); border-radius: 8px; background: #fff6dc; padding: 8px 4px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.char-card b { font-size: 17px; } .char-card small { font-size: 14px; opacity: .7; }
.char-card .cc-icon { font-size: 26px; }
.char-card.selected { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px var(--sign); }
.char-card.locked { opacity: .5; filter: grayscale(.8); }
button { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: 1px; padding: 10px 20px; background: var(--sign); color: #1b1715; border: 4px solid #b8870c; border-radius: 6px; box-shadow: 0 4px 0 #6b4a08; cursor: pointer; pointer-events: auto; }
button:hover { background: #ffd94a; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #6b4a08; }
.controls-mini { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 16px; justify-content: center; opacity: .85; }

.help-panel { max-width: 680px; font-size: 20px; }
.help-panel h2, .pause-panel h2 { font-family: var(--head); margin: 0 0 8px; }
.help-panel td { padding: 4px 8px; vertical-align: top; }
.help-panel td:first-child { white-space: nowrap; }
.pause-panel { text-align: center; padding: 20px 40px; }

.bigmap-panel { padding: 10px; max-height: 96vh; display: flex; flex-direction: column; }
.bm-head { font-weight: 700; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; font-size: 18px; }
.legend { font-weight: 400; font-size: 16px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin: 0 3px 0 8px; border: 1px solid #000; }
.bm-body { position: relative; }
#bigmap { display: block; height: min(82vh, 660px); width: auto; image-rendering: pixelated; border: 2px solid var(--wood-d); }
#bigmap-tip { position: absolute; display: none; width: 340px; z-index: 2; pointer-events: none; }

.results-panel { width: 820px; max-width: 96vw; max-height: 94vh; display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; }
.res-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--parch-d); padding-bottom: 8px; }
.res-head h2 { font-family: var(--head); font-size: 36px; margin: 0; }
#res-title { font-size: 21px; color: var(--red); font-weight: 700; }
.res-score { text-align: right; } .res-score b { font-size: 48px; font-family: var(--head); display: block; line-height: 1; }
.res-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 0; overflow: hidden; }
.rs { display: flex; justify-content: space-between; font-size: 18px; border-bottom: 1px dashed var(--parch-d); padding: 3px 0; }
.res-list { display: flex; flex-direction: column; min-height: 0; }
.rl-head { font-weight: 700; font-size: 17px; }
#res-beers { margin: 4px 0; padding-left: 22px; overflow-y: auto; max-height: 300px; font-size: 17px; pointer-events: auto; }
#res-beers li { margin: 2px 0; }
#res-beers li span { opacity: .7; font-size: 14px; }
#res-beers li i { float: right; color: var(--ok); font-style: normal; font-weight: 700; }
.res-buttons { align-self: center; display: flex; gap: 10px; }
#restart-btn:disabled { opacity: .55; cursor: default; }
#menu-btn small { font-size: 15px; opacity: .7; }
#restart-btn small { font-size: 17px; opacity: .7; }

@media (max-width: 1100px) {
  #queue-panel { top: auto; bottom: 180px; width: 220px; }
  .glasscard { width: 270px; }
  .gauges { width: 300px; }
}

/* ---- iteration 2 ---- */
.tag.gold { background: #b8870c; }
.glasses { display: flex; gap: 6px; flex: none; }
.glass.focus { outline-color: var(--red); }
.gline { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.beer .pts { color: var(--ok); font-weight: 700; font-size: 16px; }
#queue li.dupe { opacity: .55; }
#queue li.dupe .qp { color: var(--red); font-size: 14px; }
#queue-panel.long #queue li { font-size: 16px; padding: 1px 4px; }
#queue-panel.long #queue li .qb { display: none; }
#queue-panel.long #queue li .qn { grid-row: span 1; }
.char-card { min-height: 92px; }

/* numbers in the clean Futura-like face */
#clock, #score, #uniq, #queue-count, #queue li .qp, .beer .pts, .res-score b, .rs b, #res-beers li i, #banner.count .b-main { font-family: var(--num); font-weight: 700; }
#clock { letter-spacing: 0; }

/* character select: compact cards, details below */
.chars { grid-template-columns: repeat(4, 1fr); }
.char-card { min-height: 0; padding: 8px 4px; }
.char-card b { font-size: 20px; line-height: 1; }
.char-card .cc-icon { font-size: 30px; }
#char-blurb { min-height: 5.2em; }
#char-blurb .cb-name { font-family: var(--head); font-weight: 700; font-size: 20px; text-transform: uppercase; }
#char-blurb .cb-text { font-size: 19px; margin: 2px 0; }
#char-blurb .cb-perk { font-size: 18px; color: var(--red); font-weight: 700; }

/* session report: fill the height, tidy check-in list */
.results-panel { height: min(94vh, 900px); }
.res-body { flex: 1; min-height: 0; grid-template-rows: 100%; }
#res-stats { overflow-y: auto; min-height: 0; }
.res-list { min-height: 0; height: 100%; }
#res-beers { list-style: none; padding: 0 6px 0 0; margin: 4px 0 0; flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
#res-beers li { display: grid; grid-template-columns: 2.4em 16px minmax(0, 1fr) 3.6em; align-items: center; column-gap: 6px; padding: 3px 0; border-bottom: 1px dashed var(--parch-d); margin: 0; }
#res-beers li .rn { text-align: right; opacity: .6; font-family: var(--num); font-size: 14px; }
#res-beers li .swatch { margin: 0; }
#res-beers li .rb { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
#res-beers li .rb b, #res-beers li .rb small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#res-beers li .rb small { opacity: .7; font-size: 15px; }
#res-beers li i { float: none; text-align: right; }
#res-beers li.none { display: block; }
#res-beers li .rb { opacity: 1; font-size: 17px; }

/* ---------- multiplayer ---------- */
.mp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 38px; }
.mp-label { font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.switch { position: relative; width: 52px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #b9a27a; border: 3px solid var(--wood-d); border-radius: 16px; cursor: pointer; transition: background .15s; }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff6dc; border: 2px solid var(--wood-d); border-radius: 50%; transition: transform .15s; }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.mp-box { display: none; align-items: center; gap: 10px; margin-left: auto; }
.mp-box.on { display: flex; }
.mp-opt { font-size: 18px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
#room-input { font-family: var(--num); font-weight: 700; font-size: 20px; width: 110px; padding: 4px 8px; text-transform: uppercase; letter-spacing: 3px; border: 3px solid var(--wood-d); border-radius: 6px; background: #fffaf0; color: var(--ink); text-align: center; }
#room-input:disabled { opacity: .35; }
#mp-status { min-height: 1.2em; font-size: 18px; color: var(--red); text-align: center; }
#mp-status.ok { color: var(--ok); }
.menu-buttons { display: flex; gap: 10px; }
.menu-buttons #start-btn { flex: 1; }
button.secondary { background: #fff6dc; border-color: var(--wood); box-shadow: 0 4px 0 var(--wood-d); font-size: 18px; }
button.secondary:hover { background: #fff; }

#room-panel { left: 12px; top: 150px; min-width: 230px; max-width: 260px; padding: 6px 10px; }
#room-panel .rp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; border-bottom: 2px solid var(--parch-d); margin-bottom: 3px; }
#room-panel .rp-head b { font-family: var(--num); font-size: 22px; letter-spacing: 3px; color: var(--red); }
#room-panel .rp-row { display: grid; grid-template-columns: 1.4em 1fr auto; gap: 6px; font-size: 17px; line-height: 1.15; }
#room-panel .rp-row.me { color: #1d5fa0; font-weight: 700; }
#room-panel .rp-rank, #room-panel .rp-score { font-family: var(--num); font-size: 14px; font-weight: 700; align-self: center; }
#room-panel .rp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.results-panel { width: 1180px; }
.res-body { grid-template-columns: 1fr 1.2fr 0.9fr; }
.res-side { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; gap: 4px; }
.rank-list { list-style: none; margin: 2px 0 8px; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; column-gap: 6px; padding: 2px 0; border-bottom: 1px dashed var(--parch-d); font-size: 18px; align-items: center; }
.rank-list li .rk { font-family: var(--num); font-size: 14px; opacity: .65; text-align: right; }
.rank-list li .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-list li .nm small { opacity: .6; font-size: 14px; }
.rank-list li .sc { font-family: var(--num); font-weight: 700; color: var(--ok); }
.rank-list li.me { background: rgba(255, 225, 77, .45); border-radius: 4px; font-weight: 700; }
.rank-list li.none { display: block; opacity: .6; }
#res-global-note { font-size: 16px; text-align: center; color: var(--red); }
.hs-panel { width: 620px; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; gap: 8px; }
.hs-panel .rank-list { overflow-y: auto; min-height: 0; flex: 1; }
.hs-panel button { align-self: center; }
#catchup { background: rgba(20,12,14,.85); z-index: 20; }
#catchup p { text-align: center; font-size: 20px; }

#staging .room-code { font-family: var(--num); font-size: 26px; letter-spacing: 4px; color: var(--red); }
