/* Drinking + HOAing 3D — Willow Court */
:root {
  --navy: #1a2530;
  --navy-2: #243442;
  --accent: #d9534f;
  --gold: #f0ad4e;
  --bg: #f8f9fa;
  --text: #333333;
  --cite: #c0392b;
  --teal: #2f7a80;
  --bourbon: #8a6b32;
  --paper: #f4efe4;
  --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; }
#c {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
}

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(to bottom, rgba(26,37,48,0.92), rgba(26,37,48,0.35) 70%, transparent);
  pointer-events: none;
}
.topbar .logo-sm {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--gold);
}
.topbar .brand { flex: 1; min-width: 0; }
.topbar h1 {
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; line-height: 1.15;
}
.topbar .slogan {
  font-size: 11px; color: var(--gold); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hud-btns { display: flex; gap: 6px; pointer-events: auto; }
.hud-btns button {
  background: var(--navy-2); color: var(--bg); border: 1px solid var(--gold);
  border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 600;
}

.hud {
  position: fixed; top: 52px; left: 12px; right: 12px; z-index: 6;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px; pointer-events: none; max-width: 720px;
}
.hud .cell {
  background: rgba(26,37,48,0.72);
  border: 1px solid rgba(240,173,78,0.35);
  border-radius: 6px; padding: 6px 8px;
}
.hud .lbl { font-size: 9px; text-transform: uppercase; color: var(--gold); letter-spacing: 0.14em; }
.hud .val { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; }
.lives { display: flex; gap: 5px; margin-top: 2px; }
.life {
  width: 14px; height: 14px; border-radius: 50% 50% 45% 45%;
  background: #e8c4a8; position: relative; opacity: 0.22;
}
.life.on { opacity: 1; }
.life:after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 8px; height: 6px;
  background: #3d5a73; border-radius: 1px;
}

.mission {
  position: fixed; left: 12px; top: 122px; z-index: 6;
  width: min(260px, 46vw);
  background: rgba(26,37,48,0.78);
  border: 1px solid rgba(240,173,78,0.3);
  border-radius: 8px; padding: 8px 10px;
  font-size: 12px; line-height: 1.4;
  pointer-events: none;
}
.mission h2 {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 4px;
}
.mission li { list-style: none; padding: 2px 0; color: #d5dde3; }
.mission li.done { color: #8fd18f; text-decoration: line-through; }
.mission .bac-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.bac-pill {
  background: var(--cite); color: #fff; font-weight: 700; font-size: 11px;
  border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums;
  min-width: 46px; text-align: center;
}
.bac-pill.sober { background: #5a6b4a; }
.bac-meter { flex: 1; height: 6px; background: #2a3540; border-radius: 99px; overflow: hidden; }
.bac-meter > span { display: block; height: 100%; background: var(--accent); width: 0%; }

.plates {
  position: fixed; right: 12px; top: 122px; z-index: 6;
  width: min(200px, 40vw);
  display: grid; gap: 6px; pointer-events: none;
}
.plate {
  background: rgba(244,239,228,0.92); color: var(--navy);
  border-radius: 8px; padding: 6px 8px; border-left: 4px solid #999;
}
.plate .who { display: flex; justify-content: space-between; gap: 4px; }
.plate .nm { font-weight: 700; font-size: 12px; }
.plate .role { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: #666; }
.plate .bac-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }

#minimap {
  position: fixed; right: 12px; bottom: calc(12px + var(--safe)); z-index: 6;
  width: 148px; height: 148px;
  border: 2px solid var(--gold); border-radius: 8px;
  background: #1a2530;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.toast {
  position: fixed; left: 50%; top: 22%;
  transform: translate(-50%, 0);
  width: min(92%, 440px);
  background: #fff; color: var(--cite);
  border: 3px solid var(--cite); border-radius: 4px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  display: none; z-index: 8; pointer-events: none;
}
.toast.show { display: block; animation: stamp 0.25s ease-out; }
.toast .stamp {
  font-size: 11px; letter-spacing: 0.18em; font-weight: 800;
  text-transform: uppercase; color: var(--cite);
}
.toast .msg { color: var(--text); font-size: 13px; margin-top: 6px; line-height: 1.4; }
@keyframes stamp {
  0% { transform: translate(-50%, -8px) rotate(-4deg) scale(1.08); opacity: 0; }
  100% { transform: translate(-50%, 0) rotate(-1deg) scale(1); opacity: 1; }
}

.click-hint {
  position: fixed; left: 50%; bottom: 18%;
  transform: translateX(-50%);
  z-index: 7;
  background: rgba(26,37,48,0.88);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 10px 16px; border-radius: 8px;
  font-size: 13px; letter-spacing: 0.06em;
  display: none; text-align: center; max-width: 90vw;
}
.click-hint.show { display: block; }

.overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(26, 37, 48, 0.94);
  color: var(--bg);
  display: none;
  overflow: auto;
  padding: 24px 16px 32px;
}
.overlay.show { display: flex; flex-direction: column; align-items: center; }
.overlay .card { width: min(560px, 100%); text-align: center; }
.logo-lg {
  width: 96px; height: 96px; border-radius: 18px;
  border: 2px solid var(--gold); margin-bottom: 12px;
}
.tshirt {
  width: min(200px, 64%);
  margin: 8px auto;
  display: block; border-radius: 8px; background: #ececec;
}
.overlay h1 {
  font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase;
}
.overlay .slogan {
  color: var(--gold); font-style: italic; font-size: 17px; margin: 8px 0 4px;
}
.overlay .tagline { font-size: 13px; color: #c9d2da; margin-bottom: 8px; }
.please {
  margin-top: 14px; font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold);
}
.mode-row, .who-grid {
  display: grid; gap: 8px; margin-top: 14px;
}
.mode-row { grid-template-columns: 1fr 1fr; }
.who-grid { grid-template-columns: 1fr 1fr; display: none; }
.who-grid.show { display: grid; }
.pick {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(240,173,78,0.3);
  color: #d5dde3; border-radius: 8px;
  padding: 10px 8px; font-size: 13px; font-weight: 700;
}
.pick small { display: block; font-weight: 500; color: #9aa8b3; margin-top: 4px; font-size: 11px; }
.pick.on { border-color: var(--gold); background: rgba(240,173,78,0.16); color: #fff; }
.pick.brenda.on { border-color: var(--accent); }
.pick.jill.on { border-color: var(--gold); }
.pick.gary.on { border-color: var(--teal); }
.pick.oscar.on { border-color: var(--bourbon); }

.btn {
  background: var(--accent); color: #fff; border: 0;
  padding: 12px 28px; border-radius: 8px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; font-size: 14px;
  margin-top: 14px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.4; filter: none; cursor: not-allowed; }
.btn.ghost {
  background: transparent; border: 1px solid var(--gold); color: var(--gold);
  margin-left: 8px;
}
.how {
  margin-top: 16px; font-size: 12px; color: #b7c2cb; line-height: 1.5; text-align: left;
}
.how b { color: #fff; }
.cast {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  text-align: left; margin-top: 16px;
}
.cast article {
  background: rgba(255,255,255,0.05);
  border-radius: 8px; padding: 8px 10px;
  border-top: 3px solid #888;
  font-size: 11px; line-height: 1.35; color: #d5dde3;
}
.cast h3 { font-size: 13px; color: #fff; }
.cast h3 span { font-weight: 500; color: var(--gold); font-size: 11px; }
.incident {
  background: var(--paper); color: var(--text); text-align: left;
  padding: 16px; border-radius: 6px; margin-top: 12px;
  border: 1px solid var(--gold);
}
.incident h2 {
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cite); margin-bottom: 8px;
}
.incident p { font-size: 13px; line-height: 1.45; margin: 6px 0; }
.incident .who { font-weight: 700; color: var(--navy); }
.pause-hint { font-size: 11px; color: #9aa8b3; margin-top: 8px; }

.mobile {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  padding: 0 16px calc(12px + var(--safe));
  pointer-events: none;
  justify-content: space-between; align-items: flex-end;
}
.joy {
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(26,37,48,0.45);
  border: 2px solid rgba(240,173,78,0.45);
  position: relative; pointer-events: auto; touch-action: none;
}
.joy .knob {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(240,173,78,0.85);
  position: absolute; left: 36px; top: 36px;
}
.mob-btns { display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.mob-btns button {
  width: 72px; height: 48px; border-radius: 10px;
  background: rgba(26,37,48,0.6); color: var(--gold);
  border: 1px solid var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
}

.site-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 4px 12px calc(6px + var(--safe));
  color: #9aa8b3; font-size: 10px; text-align: center;
  pointer-events: none;
  background: linear-gradient(to top, rgba(26,37,48,0.75), transparent);
}
.site-foot a { color: var(--gold); text-decoration: none; pointer-events: auto; }

.play-ui { display: none; }
.play-ui.on { display: block; }
.play-ui.on.plates { display: grid; }
#minimap.play-ui.on { display: block; }
.mobile.play-ui.on { display: none; }

@media (hover: none), (max-width: 720px) {
  .mobile.play-ui.on { display: flex; }
  .cast, .who-grid, .mode-row { grid-template-columns: 1fr; }
  .hud { grid-template-columns: 1fr 1fr; }
  .plates { display: none !important; }
  #minimap { width: 110px; height: 110px; bottom: calc(148px + var(--safe)); }
  .mission { width: min(200px, 52vw); font-size: 11px; }
  .site-foot { display: none; }
}
