/*
 * ez-az-shell.css — EZ-AZ shared design system
 *
 * This file owns the design tokens and reusable shell components that wrap
 * every EZ-AZ game: store banner, exit button, phone join/lobby/gameover
 * surfaces, and the TV title-screen primitives (QR box, slot cards,
 * leaderboard, score cards).
 *
 * Game-specific layout, canvas, and gameplay UI lives in each game file.
 * This file touches only the surfaces AROUND the game.
 *
 * Usage (phone join pages and TV game HTML files):
 *   <link rel="stylesheet" href="/ez-az-shell.css">
 *
 * All shared classes use the .ezaz- prefix to avoid collisions with
 * game-specific styles.
 */

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Brand colours */
  --ez-teal:    #00ffc8;
  --ez-yellow:  #ffe44d;
  --ez-pink:    #ff6ec7;
  --ez-red:     #ff4757;
  --ez-gold:    #ffd23b;

  /* Surface colours */
  --ez-bg:      #0a0a12;
  --ez-surface: #13131f;
  --ez-border:  rgba(255,255,255,0.08);

  /* Typography */
  --ez-font:    'Courier New', monospace;

  /* 4-slot character palette (consistent across all games) */
  --ez-slot-0:  #00ffaa;   /* GREEN */
  --ez-slot-1:  #ff3b6b;   /* PINK  */
  --ez-slot-2:  #3aa0ff;   /* BLUE  */
  --ez-slot-3:  #ffd23b;   /* GOLD  */
}


/* ── Store Banner ──────────────────────────────────────────────────────── */
/*
 * Fixed top strip on every page. The EZ-AZ link is always the same brand
 * gradient regardless of the game's own colour scheme.
 */
.ezaz-store-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,18,0.92);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.1em;
  font-family: var(--ez-font);
}
.ezaz-store-banner a {
  background: linear-gradient(90deg, #ff6ec7, #00ffc8, #ffe44d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  font-weight: 700;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.ezaz-store-banner a:hover { opacity: 1; }


/* ── Exit Button ───────────────────────────────────────────────────────── */
/*
 * Fixed top-right. Frees the player's slot and sends them back to the store.
 * Required on every phone screen by Phone Contract clause 4.
 */
.ezaz-exit-btn {
  position: fixed; top: 6px; right: 10px; z-index: 101;
  background: transparent;
  border: 1px solid rgba(255,71,87,0.4);
  border-radius: 6px;
  color: rgba(255,71,87,0.7);
  font-family: var(--ez-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ezaz-exit-btn:hover { color: var(--ez-red); border-color: rgba(255,71,87,0.7); }


/* ── Primary Action Button ─────────────────────────────────────────────── */
/*
 * The main CTA on phone join screens (JOIN GAME, START THE PIT, KICK OFF).
 * Games may override --ez-btn-bg to use their own accent colour.
 */
.ezaz-btn-primary {
  width: 100%; max-width: 280px;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--ez-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--ez-btn-bg, var(--ez-teal));
  color: var(--ez-btn-fg, var(--ez-bg));
  transition: opacity 0.15s, transform 0.1s;
}
.ezaz-btn-primary:hover:not(:disabled) { transform: scale(1.03); }
.ezaz-btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }


/* ── Outline Button ────────────────────────────────────────────────────── */
/*
 * Secondary actions on game-over and lobby screens (BACK TO LOBBY, BACK TO
 * STORE). Replaces the old near-invisible rgba(255,255,255,0.2) treatment.
 */
.ezaz-btn-outline {
  padding: 14px 32px;
  border: 2px solid rgba(0,255,200,0.35);
  border-radius: 10px;
  background: transparent;
  color: var(--ez-teal);
  font-family: var(--ez-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.15s, background 0.15s;
}
.ezaz-btn-outline:hover {
  border-color: var(--ez-teal);
  background: rgba(0,255,200,0.08);
}


/* ── Label ─────────────────────────────────────────────────────────────── */
.ezaz-label {
  font-size: 11px;
  color: #678;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--ez-font);
}


/* ── Name Input ────────────────────────────────────────────────────────── */
.ezaz-name-input {
  width: 100%;
  background: var(--ez-surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--ez-font);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  outline: none;
}
.ezaz-name-input:focus { border-color: var(--ez-teal); }
.ezaz-name-input::placeholder { color: #334; }


/* ── Error Message ─────────────────────────────────────────────────────── */
.ezaz-error-msg {
  color: var(--ez-red);
  font-size: 12px;
  text-align: center;
  min-height: 16px;
  font-family: var(--ez-font);
}


/* ── Character Badge (phone lobby avatar circle) ───────────────────────── */
.ezaz-char-badge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  border: 4px solid rgba(255,255,255,0.2);
  background: var(--ez-surface);
}


/* ── Char Name ─────────────────────────────────────────────────────────── */
.ezaz-char-name {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-family: var(--ez-font);
}


/* ── Waiting / Status Text ─────────────────────────────────────────────── */
.ezaz-waiting {
  font-size: 13px;
  color: #667;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.6;
  font-family: var(--ez-font);
}


/* ── Phone Lobby Wrapper ───────────────────────────────────────────────── */
.ezaz-lobby-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  padding: 20px;
}


/* ── Phone Game Over Wrapper ───────────────────────────────────────────── */
.ezaz-gameover-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  padding: 24px 20px;
  text-align: center;
}

.ezaz-go-rank {
  font-size: 56px;
  font-weight: 900;
  font-family: var(--ez-font);
  line-height: 1;
}

.ezaz-go-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: var(--ez-font);
}

.ezaz-go-score {
  font-size: 16px;
  color: var(--ez-teal);
  letter-spacing: 0.06em;
  font-family: var(--ez-font);
}


/* ── TV: QR Join Box ───────────────────────────────────────────────────── */
/*
 * The scan-to-join panel on TV title screens. Always teal-bordered —
 * the scan action is a brand-level interaction, not a game-level one.
 */
.ezaz-qr-box {
  background: rgba(0,255,200,0.06);
  border: 1px solid rgba(0,255,200,0.3);
  border-radius: 10px;
  padding: 10px 18px;
  margin-bottom: 14px;
  max-width: 640px;
  width: 100%;
}
.ezaz-qr-label {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 8px;
  color: #889;
  margin-bottom: 5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ezaz-qr-url {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 11px;
  color: var(--ez-teal);
  word-break: break-all;
}
.ezaz-qr-code {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 20px;
  color: var(--ez-gold);
  letter-spacing: 3px;
  margin-top: 6px;
}


/* ── TV: Slot Card ─────────────────────────────────────────────────────── */
/*
 * Player slot in the 4-up grid on the title screen.
 * JS adds .filled and sets --slot-colour when a player joins.
 */
.ezaz-slot-card {
  border: 2px solid #242424;
  border-radius: 10px;
  padding: 12px 8px;
  transition: border-color 0.3s, background 0.3s;
}
.ezaz-slot-card.filled {
  border-color: var(--slot-colour, rgba(255,255,255,0.3));
  background: color-mix(in srgb, var(--slot-colour, rgba(255,255,255,0.05)) 7%, transparent);
}
.ezaz-slot-tag {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 9px;
  margin-bottom: 6px;
}
.ezaz-slot-name {
  font-size: 11px;
  color: #444;
  line-height: 1.6;
  font-family: 'Press Start 2P', var(--ez-font);
  transition: color 0.3s;
}
.ezaz-slot-card.filled .ezaz-slot-name { color: #fff; }


/* ── TV: Score Card (end screen) ───────────────────────────────────────── */
.ezaz-score-card {
  border: 2px solid #242424;
  border-radius: 10px;
  padding: 12px 10px;
  transition: border-color 0.3s, background 0.3s;
}
.ezaz-score-card.winner {
  border-color: var(--ez-gold);
  background: rgba(255,210,59,0.07);
}
.ezaz-score-tag {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 10px;
  margin-bottom: 5px;
}
.ezaz-score-val {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 13px;
  color: var(--ez-teal);
  margin-bottom: 3px;
}
.ezaz-score-rank {
  font-size: 10px;
  color: var(--ez-gold);
  font-family: 'Press Start 2P', var(--ez-font);
}


/* ── TV: Leaderboard ───────────────────────────────────────────────────── */
.ezaz-lb-wrap { margin: 10px auto; max-width: 340px; width: 100%; text-align: left; }
.ezaz-lb-title {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 9px;
  color: var(--ez-gold);
  margin-bottom: 8px;
  text-align: center;
}
.ezaz-lb-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  font-size: 10px;
  color: #9ab;
  font-family: 'Press Start 2P', var(--ez-font);
}
/* Empty slots on a board padded out to ten (renderLeaderboard fill). */
.ezaz-lb-row.placeholder { color: #34324f; }
.ezaz-lb-row.highlight {
  color: var(--ez-teal);
  background: rgba(0,255,200,0.08);
  border-radius: 4px;
}
.ezaz-lb-empty {
  color: #456;
  font-size: 11px;
  text-align: center;
  padding: 8px;
  font-family: 'Press Start 2P', var(--ez-font);
}
.ezaz-lb-name-input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  width: 130px;
  font-family: 'Press Start 2P', var(--ez-font);
  text-transform: uppercase;
  outline: none;
}
.ezaz-lb-name-input:focus { border-color: var(--ez-teal); }
.ezaz-btn-save {
  padding: 6px 14px;
  font-size: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(0,255,200,0.15);
  color: var(--ez-teal);
  font-weight: 700;
  font-family: 'Press Start 2P', var(--ez-font);
  transition: background 0.15s;
}
.ezaz-btn-save:hover { background: rgba(0,255,200,0.28); }


/* ── TV: Hint Text ─────────────────────────────────────────────────────── */
.ezaz-hint {
  color: #456;
  font-size: 9px;
  margin-bottom: 10px;
  font-family: 'Press Start 2P', var(--ez-font);
  line-height: 1.7;
}


/* ── Pause Overlay ─────────────────────────────────────────────────────── */
/*
 * The standard Escape-to-pause screen: Resume and Quit to Store, per the
 * standard game features in CLAUDE.md. Built and wired by
 * ArcadeShell.pause() in /arcade-shell.js -- games do not hand-roll it.
 */
.ezaz-pause {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(10,10,18,0.88);
  backdrop-filter: blur(3px);
  font-family: var(--ez-font);
}
.ezaz-pause.open { display: flex; }

.ezaz-pause-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 32px 40px;
  background: var(--ez-surface);
  border: 1px solid var(--ez-border);
  border-radius: 14px;
  min-width: 260px;
  text-align: center;
}

.ezaz-pause-title {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: 18px;
  color: var(--ez-teal);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}


/* ── TV: Title Screen ──────────────────────────────────────────────────── */
/*
 * The start overlay that stops a game auto-playing. Sits above the canvas and
 * holds the game title, controls, leaderboard and start button. Clears the
 * fixed store banner so the two never overlap.
 */
.ezaz-title {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  padding: 56px 20px 28px;
  background: var(--ez-bg);
  overflow-y: auto;
  font-family: var(--ez-font);
  text-align: center;
}
.ezaz-title.hidden { display: none; }

.ezaz-title-name {
  font-family: 'Press Start 2P', var(--ez-font);
  font-size: clamp(20px, 4.5vw, 40px);
  letter-spacing: 0.06em;
  color: var(--ez-title-colour, var(--ez-teal));
  text-shadow: 0 0 18px rgba(0,255,200,0.35);
  margin-bottom: 2px;
}

.ezaz-title-tag {
  color: #8a8aa0;
  font-size: 13px;
  font-style: italic;
  margin-bottom: 10px;
}
