/* Drinking + HOAing — satirical HOA notice board, not a generic arcade skin */
:root {
  --navy: #1a2530;
  --navy-2: #243442;
  --accent: #d9534f;
  --gold: #f0ad4e;
  --bg: #f8f9fa;
  --text: #333333;
  --cite: #c0392b;
  --teal: #2f7a80;
  --bourbon: #8a6b32;
  --paper: #f4efe4;
  --line: rgba(240, 173, 78, 0.45);
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--navy);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; }

#app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(1200px 500px at 50% -80px, #2b3d4d 0%, var(--navy) 62%);
}

.topbar {
  width: min(100%, 920px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 6px;
  color: var(--bg);
}
.topbar .logo-sm {
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--gold);
}
.topbar .brand {
  flex: 1; min-width: 0;
}
.topbar h1 {
  font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; color: #fff; line-height: 1.15;
}
.topbar .slogan {
  font-size: 12px; color: var(--gold); font-style: italic; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hud-btns { display: flex; gap: 6px; }
.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-btns button:hover { background: #2e4252; }

.hud {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 0 14px 8px;
  color: var(--bg);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.hud .cell { background: rgba(255,255,255,0.04); border: 1px solid rgba(240,173,78,0.25); 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.25;
}
.life.on { opacity: 1; }
.life:after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 8px; height: 6px;
  background: #3d5a73; border-radius: 1px;
}

.plates {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 14px 8px;
}
.plate {
  background: var(--paper);
  border-radius: 8px;
  padding: 6px 8px 7px;
  border-left: 4px solid #999;
  min-width: 0;
}
.plate .who { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.plate .nm { font-weight: 700; font-size: 12px; color: var(--navy); }
.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; }
.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: #ddd; border-radius: 99px; overflow: hidden; }
.bac-meter > span { display: block; height: 100%; background: var(--accent); width: 0%; transition: width 0.3s; }

.stage-wrap {
  width: min(100%, 920px);
  display: flex;
  justify-content: center;
  padding: 0 8px;
  position: relative;
  flex: 1;
}
#game {
  display: block;
  touch-action: none;
  width: auto;
  height: auto;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 250px);
  background: var(--navy);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  border: 2px solid var(--gold);
}

.toast {
  position: absolute;
  left: 50%; top: 18%;
  transform: translate(-50%, 0);
  width: min(92%, 420px);
  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: 5;
  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; }
}

.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(220px, 70%);
  margin: 10px auto 8px;
  display: block;
  border-radius: 8px;
  background: #ececec;
}
.overlay h1, .overlay h2 {
  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);
}
.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; }

.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.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; }

.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); }

.dpad {
  display: none;
  width: min(280px, 90vw);
  margin: 8px auto 4px;
  padding-bottom: var(--safe);
  grid-template-columns: 64px 64px 64px;
  grid-template-rows: 52px 52px 52px;
  gap: 6px;
  justify-content: center;
  justify-items: center;
}
.dpad button {
  width: 64px; height: 52px; border-radius: 10px;
  background: var(--navy-2); color: var(--gold);
  border: 1px solid var(--gold); font-size: 18px; font-weight: 700;
}
.dpad button:active { background: #3a5164; }
.dpad .u { grid-column: 2; grid-row: 1; }
.dpad .l { grid-column: 1; grid-row: 2; }
.dpad .r { grid-column: 3; grid-row: 2; }
.dpad .d { grid-column: 2; grid-row: 3; }

.site-foot {
  width: min(100%, 920px);
  padding: 6px 14px calc(10px + var(--safe));
  color: #9aa8b3; font-size: 11px; text-align: center;
}
.site-foot a { color: var(--gold); text-decoration: none; }

@media (hover: none), (max-width: 720px) {
  .dpad { display: grid; }
  #game { max-height: calc(100dvh - 330px); }
  .cast { grid-template-columns: 1fr; }
  .plates { grid-template-columns: 1fr 1fr; }
  .topbar .slogan { white-space: normal; }
}

@media (min-width: 860px) {
  #game { max-height: calc(100dvh - 210px); }
}

.pause-hint { font-size: 11px; color: #9aa8b3; margin-top: 8px; }
