/* POSSUM DOG — souped-up cooner neon. Mobile-first, blinkin' lights. */
:root {
  --bg: #0b1026;
  --neon: #7CFC00;       /* coon-dog green */
  --neon2: #ffd23f;      /* lantern yellow */
  --hot: #ff5b5b;        /* minus red */
  --ink: #eaf3e4;
  --panel: rgba(6, 14, 22, 0.82);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; user-select: none;
  touch-action: manipulation;
}

.screen { position: fixed; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  text-align: center; }
.screen.active { display: flex; }

/* ---------- TITLE ---------- */
.moon {
  position: absolute; top: 8%; right: 12%;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe0, #e9e3b0);
  box-shadow: 0 0 60px 14px rgba(245,243,200,0.35);
}
#screen-title { background:
  radial-gradient(120% 80% at 50% 0%, #16224a 0%, #0b1026 55%, #061a0e 100%); }

.title-wrap { z-index: 2; }
.logo {
  font-weight: 900; font-size: clamp(48px, 16vw, 120px);
  line-height: 0.9; letter-spacing: 2px; margin: 0 0 6px;
  color: var(--neon);
  text-shadow: 0 0 8px var(--neon), 0 0 28px rgba(124,252,0,0.6), 4px 5px 0 #0a3d0a;
  animation: glow 1.6s ease-in-out infinite alternate;
}
.logo-dog { display: block; color: var(--neon2);
  text-shadow: 0 0 8px var(--neon2), 0 0 26px rgba(255,210,63,0.7), 4px 5px 0 #5a4400; }
@keyframes glow {
  from { filter: brightness(1); }
  to   { filter: brightness(1.25); }
}
.tagline { font-size: clamp(14px, 4.4vw, 20px); font-style: italic;
  color: #cfe6c2; margin: 6px auto 22px; max-width: 520px; }
.subnote { color: #9fb39a; font-size: 13px; margin-top: 14px; max-width: 420px; }

/* ---------- BUTTONS ---------- */
.btn {
  font-family: inherit; font-weight: 800; cursor: pointer;
  border: 3px solid var(--neon); background: #0a1f0a; color: var(--neon);
  border-radius: 14px; padding: 14px 26px; font-size: 18px;
  text-transform: uppercase; letter-spacing: 1px;
  transition: transform 0.06s ease, background 0.15s;
}
.btn:active { transform: scale(0.95); }
.btn-huge { font-size: clamp(22px, 7vw, 34px); padding: 18px 44px; margin-top: 8px;
  box-shadow: 0 0 18px rgba(124,252,0,0.45); }
.btn-sm { padding: 12px 14px; font-size: 18px; }
.btn-ghost { border-color: #44603f; color: #b9d0b1; background: transparent;
  font-size: 14px; padding: 10px 18px; margin-top: 12px; }
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { box-shadow: 0 0 34px rgba(124,252,0,0.95); border-color: #fff; } }

/* ---------- TICKER ---------- */
.ticker { position: absolute; bottom: 0; left: 0; right: 0;
  background: #06120a; border-top: 2px solid var(--neon);
  overflow: hidden; white-space: nowrap; padding: 8px 0; z-index: 3; }
.ticker span { display: inline-block; color: var(--neon2); font-weight: 700;
  font-size: 14px; padding-left: 100%; animation: scroll 16s linear infinite; }
@keyframes scroll { to { transform: translateX(-100%); } }

/* ---------- BUILDER ---------- */
.builder { width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto;
  background: var(--panel); border: 2px solid #2a4d6e; border-radius: 18px;
  padding: 20px; }
.hdr { color: var(--neon2); font-size: clamp(20px, 6vw, 28px); margin: 0 0 16px;
  text-shadow: 0 0 12px rgba(255,210,63,0.5); }
.field { display: block; text-align: left; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; font-weight: 800;
  letter-spacing: 1px; color: #9fb39a; margin-bottom: 6px; }
.field input {
  width: 100%; font-family: inherit; font-size: 17px; padding: 12px 14px;
  border-radius: 10px; border: 2px solid #34557a; background: #08111f;
  color: var(--ink);
}
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.row .btn-huge { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  cursor: pointer; padding: 10px 14px; border-radius: 999px;
  border: 2px solid #34557a; background: #08111f; color: var(--ink);
  font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.chip .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(255,255,255,0.3); }
.chip.selected { border-color: var(--neon); background: #0f2a0f;
  box-shadow: 0 0 12px rgba(124,252,0,0.4); }
.preview { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px;
  padding: 12px; border-radius: 12px; background: #08111f; border: 1px dashed #34557a; }
.preview-sprite { font-size: 44px; }
.preview-text { text-align: left; font-size: 14px; line-height: 1.4; color: #cfe6c2; }

/* ---------- ONLINE LOBBY ---------- */
#screen-lobby { background: radial-gradient(120% 80% at 50% 0%, #16224a 0%, #0b1026 55%, #061a0e 100%); }
.lobby { text-align: center; max-width: 440px; }
.lobby-dog { font-size: 80px; margin: 10px 0; }
.lobby-count { font-size: clamp(20px, 6vw, 28px); font-weight: 900; color: var(--neon); margin: 8px 0; }
.lobby-sub { color: #9fb39a; font-size: 14px; margin: 12px auto 22px; max-width: 360px; }
#btn-online { width: 100%; margin-bottom: 10px; border-color: #5b7ea6; color: #bfe9ff;
  box-shadow: 0 0 18px rgba(91,126,166,0.45); }
.lobby-share { margin: 4px auto 16px; max-width: 360px; }
.ls-label { font-size: 12px; font-weight: 700; color: var(--neon2); margin-bottom: 6px; }
#lobby-link { text-align: center; margin-bottom: 8px; }

/* ---------- GAME ---------- */
#screen-game { padding: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: space-around; padding: 10px 8px;
  background: linear-gradient(#06120acc, transparent); pointer-events: none; }
.hud-item { display: flex; flex-direction: column; align-items: center;
  font-weight: 900; font-size: 26px; }
.hud-label { font-size: 11px; letter-spacing: 1px; color: var(--neon); font-weight: 700; }
#hud-time { color: var(--neon2); }
.patience { position: absolute; top: 56px; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px; padding: 0 14px; pointer-events: none; }
.patience-tag { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #cfe6c2; }
.patience-track { flex: 1; height: 10px; background: #06120a; border: 1px solid #2a4d2a;
  border-radius: 6px; overflow: hidden; }
.patience-fill { height: 100%; width: 100%; background: #7CFC00; border-radius: 6px;
  transition: width 0.12s linear, background 0.2s; }
#cast-windows { position: absolute; top: 82px; right: 5px; z-index: 6;
  display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.cast-window { width: 80px; background: rgba(6,14,10,0.72); border: 1px solid #2a4d2a;
  border-radius: 7px; padding: 3px 3px 1px; }
.cw-name { font-size: 8px; font-weight: 700; color: #cfe6c2; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-canvas { width: 100%; height: 40px; display: block; border-radius: 4px; }
.cw-score { font-size: 12px; font-weight: 900; color: #ffd23f; text-align: right; line-height: 1.2; }
.fire-btn { position: absolute; right: 18px; bottom: 22px; z-index: 7;
  width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--neon);
  background: rgba(15,42,15,0.78); color: var(--neon); font-family: inherit;
  font-weight: 900; font-size: 18px; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 0 22px rgba(124,252,0,0.5); user-select: none; touch-action: none; }
.fire-btn:active { transform: scale(0.92); background: rgba(124,252,0,0.25); }
.big-shout { position: absolute; top: 18%; left: 0; right: 0; z-index: 6;
  text-align: center; font-size: clamp(26px, 9vw, 46px); font-weight: 900;
  pointer-events: none; opacity: 0; }
.big-shout.show { animation: pop 0.7s ease-out; }
@keyframes pop {
  0% { opacity: 0; transform: scale(0.6); }
  20% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1); }
}

/* ---------- RESULTS ---------- */
.results { width: 100%; max-width: 460px; background: var(--panel);
  border: 2px solid #2a4d6e; border-radius: 18px; padding: 26px; }
.bigscore { font-size: clamp(54px, 18vw, 90px); font-weight: 900; color: var(--neon);
  text-shadow: 0 0 18px rgba(124,252,0,0.6); line-height: 1; margin: 6px 0; }
.results-line { color: #cfe6c2; font-size: 15px; margin: 8px 0 4px; }
.results-roast { color: var(--neon2); font-style: italic; font-size: 17px;
  margin: 14px 0 22px; min-height: 24px; }
/* legend picker overlay */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(3,8,4,0.93);
  display: none; align-items: center; justify-content: center; padding: 16px; }
.overlay.active { display: flex; }
.overlay-card { width: 100%; max-width: 460px; max-height: 88%; display: flex;
  flex-direction: column; background: var(--panel); border: 2px solid #2a4d6e;
  border-radius: 16px; padding: 18px; }
.legend-search { width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 2px solid #34557a; background: #08111f; color: var(--ink);
  font-family: inherit; font-size: 15px; margin-bottom: 10px; }
.legend-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-bottom: 12px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 11px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07); cursor: pointer; }
.legend-row:active { background: #0f2a0f; }
.lr-rank { color: var(--neon2); font-weight: 800; width: 38px; flex: none; }
.lr-name { flex: 1; color: var(--ink); font-weight: 700; font-size: 14px; }
.lr-earn { color: #9fb39a; font-size: 12px; flex: none; }
.board-row { display: flex; align-items: center; gap: 9px; padding: 9px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06); }
.board-row.me { background: #0f2a0f; border: 1px solid var(--neon); border-radius: 8px; }
.br-rank { width: 34px; font-weight: 800; color: var(--neon2); flex: none; }
.br-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; border: 1px solid rgba(255,255,255,0.35); }
.br-name { flex: 1; font-weight: 700; font-size: 14px; color: var(--ink); }
.br-dog { color: #9fb39a; font-weight: 400; font-size: 12px; }
.br-score { font-weight: 900; color: var(--neon); flex: none; }
.standings { text-align: left; margin: 4px auto 6px; max-width: 320px; }
.stand-row { display: flex; justify-content: space-between; padding: 6px 12px;
  border-radius: 8px; font-weight: 700; font-size: 15px; color: #cfe6c2;
  border-bottom: 1px solid rgba(255,255,255,0.06); }
.stand-row.me { background: #0f2a0f; color: var(--neon); border: 1px solid var(--neon); }
