/* Styles for verify.html (the public round ledger): the subset of the
   game's base stylesheet that this page actually uses. */

/* ============================================================
   PLUNDER — night-raid aesthetic
   ink sea · lantern gold · crimson vs teal
   ============================================================ */

:root {
  --ink: #070b18;
  --sea-1: #0a1124;
  --sea-2: #13224a;
  --panel: rgba(13, 20, 44, 0.78);
  --panel-solid: #0e1531;
  --line: rgba(245, 197, 66, 0.16);
  /* antique brass, not the bright #f5c542 "AI yellow" */
  --gold: #d3a24b;
  --gold-dim: #8d6a2d;
  --text: #ece3cd;
  --muted: #8b93ad;
  --port: #e2493b;
  --port-soft: rgba(226, 73, 59, 0.16);
  --star: #6ea8e0;
  --star-soft: rgba(110, 168, 224, 0.16);
  --danger: #ff6b5e;
  --radius: 14px;
  /* readable geometric sans (free stand-in for Nexa Heavy — see note in the PR) */
  --display: 'Outfit', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  --sans: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 70% -10%, #1b2a55 0%, transparent 60%),
    radial-gradient(900px 500px at 10% 110%, #101c3d 0%, transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  overflow-x: hidden;
}
a { color: var(--gold); }
button { font-family: inherit; cursor: pointer; }

/* film grain */
#grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* ---------------- topbar ---------------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 12px 6px;
  width: 100%; max-width: 1560px; margin: 0 auto;
}   /* aboard + balance kept tight together */
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { font-size: 22px; filter: drop-shadow(0 0 6px rgba(245,197,66,.5)); }
.brand h1 {
  font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1;
  letter-spacing: 2px; color: var(--gold);
  text-shadow: 0 0 18px rgba(211, 162, 75, 0.35);
}
.brand-sub { color: var(--muted); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; }
@media (max-width: 1100px) { .brand-sub { display: none; } }
.online-pill {
  color: var(--muted); font-size: 12px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
}

/* ---------------- layout ---------------- */
#layout {
  max-width: 1560px; margin: 0 auto; padding: 6px 10px 0;
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
/* PC: two columns — big scene on the left, chat+betting panel on the right */
@media (min-width: 980px) {
  #layout { grid-template-columns: minmax(0, 2.05fr) minmax(320px, 0.95fr); align-items: start; }
}
@media (min-width: 1500px) {
  #layout { grid-template-columns: minmax(0, 2.4fr) minmax(340px, 0.85fr); }
}

/* phase indicator: a slim centered line above the stage. Fixed height + nowrap so
   it never reflows when the label/eta text changes between phases (no height jump). */
#phase-ribbon {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
  height: 30px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden;
}
#phase-label {
  font-family: var(--display); font-size: 17px; letter-spacing: 2px; color: var(--gold);
  text-transform: uppercase; line-height: 1;
}
#phase-clock { font-size: 18px; color: var(--text); }

/* ---------------- stage ---------------- */
#stage {
  position: relative; margin-top: 8px;
  height: clamp(320px, 44vh, 460px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(#0a1c40 0%, #0d2c52 16%, #14507e 22%, #10456f 55%, #0a2b4c 100%);
}

.ship {
  position: absolute; left: 0; top: 0;
  width: clamp(190px, 30vw, 300px);
  will-change: transform;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.45));
}
.ship svg { width: 100%; height: auto; display: block; overflow: visible; }
/* premium ship motion: sails breathe, flags flutter */
.ship .sails { animation: sailBillow 3.4s ease-in-out infinite; }
@keyframes sailBillow {
  0%, 100% { transform: scaleX(1) skewX(0deg); }
  50% { transform: scaleX(1.035) skewX(-1.4deg); }
}

/* animated demo: lighter ship overtakes and plunders the heavy one, on a loop */
.demo {
  display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(#0b1630, #0a1226); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 10px; margin-bottom: 14px; overflow: hidden;
}

/* non-blocking: a small pill, never a modal — the game stays fully visible */
/* ============ v6: spacing, full-height desktop, premium polish ============ */

#controls { display: flex; flex-direction: column; gap: 16px; padding: 6px 2px 2px; }
#phase-label { text-shadow: 0 0 20px rgba(245,197,66,.45); }

#stage { box-shadow: inset 0 0 90px rgba(2,5,14,.85), 0 18px 50px rgba(0,0,0,.35); }

/* PC: fit to the viewport (no scroll). Big scene fills the left column;
   the right panel has chat on top and the betting buttons at the bottom. */
@media (min-width: 980px) {
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; }
  #topbar { flex: 0 0 auto; }
  #layout { flex: 1 1 auto; min-height: 0; width: 100%; padding-bottom: 4px; }
  #stage { flex: 1 1 auto; height: auto; max-height: none; min-height: 300px; }
  .ship { width: clamp(220px, 24vw, 360px); }
}

/* ============ v7: responsive — tablet & phone ============ */

/* Single column (≤979px): SCENE is the star (big) at the top, chat scrolls,
   BETTING BUTTONS at the very bottom. Natural vertical page-scroll is fine;
   only horizontal scroll is forbidden (body has overflow-x: hidden). */
@media (max-width: 979px) {                       /* hide "aboard" on tablet + mobile */
  /* pad the scroll container (a footer margin-bottom is ignored at the scroll end) */
  body { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  #layout { display: block; padding: 6px 10px 14px; }
  #stage { height: 52vh; min-height: 300px; }
}

/* Phones */
@media (max-width: 620px) {
  body { font-size: 14px; }
  /* topbar: everything icon-sized so nothing overlaps */
  #topbar { padding: 8px 8px 4px; gap: 6px; flex-wrap: nowrap; }
  .brand { gap: 5px; min-width: 0; flex-shrink: 0; align-items: center; }
  .brand h1 { font-size: 21px; letter-spacing: 1px; }
  .brand-sub { display: none; }
  .brand-mark { font-size: 17px; }
  .top-right { gap: 6px; min-width: 0; }
  .online-pill { padding: 4px 7px; font-size: 11px; }               /* drop the aboard pill on phones */
  /* tighter everything so the betting + Jump-ship button all fit above the fold */
  #topbar { padding: 6px 8px 2px; }
  /* scene as tall as possible while the betting block + Jump ship still clear the
     fold. We reserve room for topbar+cards+controls+Jump; chat lives below (scroll). */
  /* svh (small viewport height) is FIXED — it does not change when the mobile
     address bar collapses on scroll, so the scene never resizes/reflows mid-scroll */
  /* scene as tall as possible: reserve only topbar + phase + controls + Auto Rebet;
     the chat feed lives entirely below the fold (scroll to reach it) */
  #stage { border-radius: 12px; height: calc(100svh - 403px); max-height: 66svh; min-height: 150px; margin-top: 4px; }
  .ship { width: clamp(160px, 46vw, 220px); }     /* fits two ships + readouts */
  #layout { padding: 3px 8px 10px; gap: 6px; }                   /* scrollable chat, below the betting */
  #controls { gap: 8px; }
}

/* Short phones: the stage is cramped, so shrink the ships (they must never
   overlap each other) and the on-ship readouts. */
@media (max-width: 620px) and (max-height: 740px) {
  .ship { width: clamp(92px, 29vw, 130px); }
}

/* Very small phones */
@media (max-width: 380px) {
  /* Folds (~344px): the wordmark collapses to a P monogram so RULES / I / music
     and the balance all keep their real hit targets on one line. */
  .brand h1 { font-size: 19px; letter-spacing: 0; }
  #phase-ribbon { min-width: 58px; }
}

/* Landscape phones: keep the stage from eating the whole viewport */
@media (max-height: 520px) and (orientation: landscape) {
  #stage { height: 46vh; }
  .brand-sub { display: none; }
}
