/* Shared by every Nathan for You game: page ground, HUD pills, rules and result panels.
   The bottom bar itself is bar.css, the same component as the Mass Effect arcade. */
:root {
  --bg: #0d0b10;
  --text: #f4efe8;
  --muted: rgba(244, 239, 232, 0.62);
  --faint: rgba(244, 239, 232, 0.4);
  --line: rgba(244, 239, 232, 0.14);
  --panel: rgba(18, 16, 24, 0.94);
  --display: "Archivo", "Inter", system-ui, sans-serif;
  --ui: "Inter", system-ui, sans-serif;
  --kb: 90, 150, 255;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--ui); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hud { position: fixed; top: 16px; left: 16px; right: 16px; z-index: 10; display: flex; justify-content: space-between; align-items: start; gap: 8px; pointer-events: none; }
.hud .grp { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font: 500 13.5px/1 var(--ui); letter-spacing: -0.01em; padding: 9px 13px; border-radius: 999px;
  background: rgba(12, 14, 28, 0.72); border: 1px solid rgba(140, 190, 255, 0.18); color: #e6f1ff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; }
.pill b { font-weight: 600; }
.pill.dim { color: rgba(205, 222, 255, 0.62); }

/* the lobby title that sits over the attract screen before a round */
.title { position: fixed; left: 0; right: 0; top: 18vh; z-index: 5; text-align: center; pointer-events: none; padding: 0 16px; transition: opacity .35s, transform .35s; }
.title .logo { --logo-size: clamp(40px, 7.5vw, 80px); }
.title p { font: 500 16px/1.4 var(--ui); color: rgba(255, 255, 255, 0.82); margin: 14px auto 0; max-width: 34ch; text-wrap: pretty; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6); }
body.playing .title { opacity: 0; transform: translateY(-8px); }
body:not(.playing) .hud .live { display: none; }

/* panels: rules sheets and results */
.panel { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 4, 8, 0.55); }
.panel.open { display: flex; }
.sheet { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  --pad: 26px; scrollbar-width: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: var(--pad); }
.sheet::-webkit-scrollbar { display: none; }
.sheet h2 { font: 800 30px/1 var(--display); letter-spacing: -0.02em; margin: 0 0 18px 0; text-wrap: balance; }
/* the close button sits 16px from the top and the right edge and stays in that corner while a long sheet scrolls
   (it is each sheet's first child; sticky top counts from the content edge, so it takes the same offset as the margin) */
.sheet > .x { position: sticky; top: calc(16px - var(--pad)); float: right; z-index: 2; margin: calc(16px - var(--pad)) calc(16px - var(--pad)) 0 12px;
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(var(--kb), 0.32); background: rgba(var(--kb), 0.14); color: #e6f1ff; font-size: 0; padding: 0; }
/* the X is drawn, not typed: a × glyph sits wherever the font puts it, which is never quite the middle of the circle */
.sheet .x::before, .sheet .x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.75px; margin: -0.875px 0 0 -7px;
  border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.sheet .x::after { transform: rotate(-45deg); }
.sheet .x:hover { background: rgba(var(--kb), 0.26); border-color: rgba(var(--kb), 0.55); }
.rules { display: flex; flex-direction: column; gap: 14px; }
.rule { display: flex; gap: 16px; align-items: center; }
.rule canvas { width: 132px; height: 72px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.rule div { font: 400 14.5px/1.45 var(--ui); color: var(--muted); text-wrap: pretty; }
.rule b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.result canvas { width: 100%; height: auto; display: block; border-radius: 14px; }
.row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(var(--kb), 0.32); background: rgba(var(--kb), 0.14);
  color: #e6f1ff; font: 500 13.5px/1 var(--ui); letter-spacing: -0.01em; padding: 10px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s; }
.btn:hover { background: rgba(var(--kb), 0.26); border-color: rgba(var(--kb), 0.55); }

.toast { position: fixed; left: 50%; top: 72px; transform: translate(-50%, -6px); z-index: 20; opacity: 0; pointer-events: none;
  font: 600 15px/1 var(--ui); padding: 11px 16px; border-radius: 999px; background: rgba(12, 14, 28, 0.82); color: #fff;
  border: 1px solid rgba(140, 190, 255, 0.2); transition: opacity .25s, transform .25s; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .hud { top: 12px; left: 12px; right: 12px; }
  .pill { font-size: 12.5px; padding: 8px 11px; }
  .rule canvas { width: 104px; height: 57px; }
}

/* ?shot: the scene only, for the lobby's card captures */
body.shot .hud, body.shot .kbar, body.shot .title, body.shot .toast { display: none; }


/* 3D games: the WebGL scene sits under the 2D overlay canvas (pops, meters, Nathan) */
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#gl + canvas#game { pointer-events: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, rgba(60, 24, 30, 0.28)); }
body.shot canvas#gl + .vignette + canvas#game { display: none; }
.vignette.dark { background: radial-gradient(ellipse 70% 65% at 50% 48%, transparent 45%, rgba(12, 6, 3, 0.6)); }
@media (pointer: coarse) { .sheet > .x { width: 44px; height: 44px; } }
