/* The Reef design system.
   Tokens taken directly from the approved brand guide: the named palette,
   Sora + DM Sans typography, an 8px spacing system, and the 12 / 8 / 4 radii.
   Light Pearl surfaces with pops of reef color. Mobile first. */

:root {
  /* Core palette (brand guide, section 4) */
  --midnight-reef: #102a43; /* primary text, nav, high-contrast surfaces */
  --lagoon: #00b4d8; /* interactive: links, highlights */
  --coral-pop: #ff7a59; /* celebration, calls to action, delight */
  --kelp-green: #2a9d8f; /* supportive accents, growth cues */
  --pearl: #f8fafc; /* page backgrounds, cards, calm surfaces */

  /* Status */
  --success: #2ecc71;
  --warning: #ffb020;
  --error: #e74c3c;
  --info: #0077cc;
  --disabled: #cbd5e1;

  /* Neutrals derived for surfaces + borders */
  --white: #ffffff;
  --ink: var(--midnight-reef);
  --ink-soft: #4a5f74;
  --line: #e7eef5;
  --lagoon-tint: #e5f7fb;
  --coral-tint: #ffeae3;
  --kelp-tint: #e6f5f2;

  /* Semantic */
  --bg: var(--pearl);
  --surface: var(--white);
  --text: var(--midnight-reef);
  --text-soft: var(--ink-soft);
  --accent: var(--coral-pop);

  /* Type */
  --font-display: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Spacing: 8px base system (8, 16, 24, 32, 48, 64) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;

  /* Radii (brand guide, layout basics) */
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-input: 4px;
  --radius-pill: 999px;

  --shadow-card: 0 6px 20px rgba(16, 42, 67, 0.08);
  --shadow-soft: 0 2px 8px rgba(16, 42, 67, 0.06);
  --ring: 0 0 0 3px rgba(0, 180, 216, 0.35);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  /* Pearl base with faint kelp + coral light blooms in the corners for
     reef energy, kept low-opacity so content stays clean and scannable. */
  background:
    radial-gradient(
      560px 420px at 10% 6%,
      rgba(42, 157, 143, 0.1),
      transparent 62%
    ),
    radial-gradient(
      620px 460px at 94% 2%,
      rgba(255, 122, 89, 0.1),
      transparent 60%
    ),
    var(--pearl);
  background-attachment: fixed;
}

/* Layered reef waves behind the top of the page. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 280px;
  z-index: 0;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 280' preserveAspectRatio='none'>\
<path fill='%23d9f1f7' d='M0,0 L1440,0 L1440,168 C1180,236 980,120 700,158 C420,196 210,168 0,132 Z'/>\
<path fill='%23e6f5f2' fill-opacity='0.75' d='M0,0 L1440,0 L1440,120 C1200,182 900,86 600,120 C360,146 150,120 0,86 Z'/>\
<path fill='%23fff1ec' fill-opacity='0.55' d='M0,0 L1440,0 L1440,72 C1160,120 860,44 560,74 C320,98 140,74 0,50 Z'/>\
</svg>") no-repeat top center / cover;
  pointer-events: none;
}

/* A soft coral-reef silhouette anchors the bottom of the page. */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  z-index: 0;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'>\
<path fill='%23eaf3ee' d='M0,120 L0,70 C60,64 78,30 120,32 C150,33 156,58 196,54 C214,52 220,20 250,26 C286,33 280,66 330,64 C520,58 560,88 760,78 C1010,66 1120,96 1440,72 L1440,120 Z'/>\
</svg>") no-repeat bottom center / cover;
  pointer-events: none;
}

/* ---- typography scale (brand guide, section 5) ---- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
}
.h1,
h1 {
  font-weight: 700;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.h2,
h2 {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.25px;
}
.h3,
h3 {
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
}
.caption {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.25px;
  color: var(--text-soft);
}

@media (min-width: 640px) {
  .h1,
  h1 {
    font-size: 48px;
  }
  .h2,
  h2 {
    font-size: 32px;
  }
  .h3,
  h3 {
    font-size: 24px;
  }
}

/* ---- brand mark ---- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
  color: var(--ink);
}
.brand-mark img {
  height: 30px;
  width: auto;
  display: block;
}
.brand-mark .brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.25px;
}

/* ---- centered layout for welcome / sign-in ---- */
.auth-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-4) var(--sp-2);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  text-align: center;
}
.auth-card .brand-mark {
  margin-bottom: var(--sp-3);
}

/* ---- copy ---- */
.title {
  margin-bottom: var(--sp-1);
}
.subtitle {
  color: var(--text-soft);
  font-size: 1rem;
  margin: 0 auto var(--sp-3);
  max-width: 34ch;
}
.help {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-top: var(--sp-2);
}
.help a,
a.link {
  color: var(--lagoon);
  font-weight: 500;
}

/* ---- form ---- */
.field {
  text-align: left;
  margin-bottom: var(--sp-2);
}
.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder {
  color: #93a4b3;
}
.field input:focus {
  outline: none;
  border-color: var(--lagoon);
  box-shadow: var(--ring);
}
.field-hint {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 6px;
}

/* ---- buttons (primary / secondary / ghost / disabled) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: 44px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-btn);
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: 0.25px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--coral-pop);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover {
  filter: brightness(0.96);
}
.btn-secondary {
  background: var(--white);
  color: var(--lagoon);
  border-color: var(--lagoon);
}
.btn-secondary:hover {
  background: var(--lagoon-tint);
}
.btn-ghost {
  /* Quiet, but VISIBLE (owner, July 17): a transparent ghost on the
     wave art read as bare text. A solid surface, a mid-tone border,
     and the soft shadow keep it clearly a button while staying the
     quietest one in the family. */
  background: var(--white);
  color: var(--ink);
  border-color: var(--disabled);
  box-shadow: var(--shadow-soft);
}
.btn-ghost:hover {
  background: var(--pearl);
  border-color: var(--ink-soft);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--disabled);
  color: var(--white);
  border-color: var(--disabled);
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}

/* ---- chips ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-1);
  margin-top: var(--sp-3);
}
.chip {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--kelp-green);
  background: var(--kelp-tint);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
}

/* ---- flash messages ---- */
.flashes {
  width: 100%;
  max-width: 420px;
  margin: 0 auto var(--sp-2);
  padding: 0;
  list-style: none;
}
.flash {
  padding: 12px 14px;
  border-radius: var(--radius-btn);
  margin-bottom: var(--sp-1);
  font-weight: 500;
  font-size: 0.92rem;
  text-align: left;
  border: 1px solid transparent;
}
.flash-info {
  background: var(--lagoon-tint);
  color: #075e72;
  border-color: #bfeaf3;
}
.flash-success {
  background: #e4f8ec;
  color: #12683f;
  border-color: #bfead0;
}
.flash-error {
  background: var(--coral-tint);
  color: #b23a22;
  border-color: #ffd3c6;
}

/* ---- signed-in app chrome ---- */
.app-header {
  position: relative;
  /* Above .wrap/.hero content (z-index 1) so the Reef switcher dropdown
     is not painted behind the page. */
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  max-width: 760px;
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-2);
}
.wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--sp-2) var(--sp-6);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--sp-4);
  margin-bottom: var(--sp-2);
}
.card h1 {
  margin-bottom: var(--sp-1);
}
.card h2 {
  margin-bottom: var(--sp-1);
}
.muted {
  color: var(--text-soft);
}
.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--lagoon-tint);
  color: #075e72;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.9rem;
}
.emoji-lg {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: var(--sp-1);
}

/* ---- auth card accent + tagline ---- */
.auth-card {
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--kelp-green) 0%,
    var(--lagoon) 45%,
    var(--coral-pop) 100%
  );
}
.tagline {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--kelp-green);
  font-size: 0.9rem;
  margin: calc(-1 * var(--sp-1)) 0 var(--sp-3);
  letter-spacing: 0.01em;
}

/* ---- hero banner (colored, illustrated) ---- */
.hero-banner {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: var(--radius-card);
  padding: var(--sp-4);
  margin-bottom: var(--sp-2);
  color: var(--white);
  background:
    radial-gradient(
      420px 220px at 88% -20%,
      rgba(0, 180, 216, 0.55),
      transparent 60%
    ),
    linear-gradient(135deg, #0d3350 0%, var(--midnight-reef) 55%, #0a4a63 100%);
  box-shadow: var(--shadow-card);
}
/* gentle wave along the bottom of the banner */
.hero-banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 46' preserveAspectRatio='none'>\
<path fill='%2300b4d8' fill-opacity='0.30' d='M0,20 C240,46 480,2 720,20 C960,38 1200,46 1440,22 L1440,46 L0,46 Z'/>\
</svg>") no-repeat bottom center / cover;
  pointer-events: none;
}
.hero-banner h1 {
  color: var(--white);
  position: relative;
  z-index: 1;
}
.hero-banner .hero-sub {
  color: rgba(255, 255, 255, 0.85);
  margin: 6px 0 var(--sp-2);
  position: relative;
  z-index: 1;
}
.hero-banner .stat {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  position: relative;
  z-index: 1;
}
.hero-wave {
  width: 26px;
  height: 26px;
  color: rgba(255, 255, 255, 0.9);
  vertical-align: -0.15em;
  margin-left: 6px;
}

/* Large decorative icon for empty / confirmation / error states. */
.icon-lg {
  width: 52px;
  height: 52px;
  color: var(--lagoon);
  margin-bottom: var(--sp-1);
}

/* ---- game preview cards ---- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin: var(--sp-3) 0 var(--sp-2);
}
.section-head h2 {
  margin: 0;
}
.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
}
@media (min-width: 620px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.game-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.game-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.game-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}
.game-icon.kelp {
  background: var(--kelp-tint);
  color: var(--kelp-green);
}
.game-icon.lagoon {
  background: var(--lagoon-tint);
  color: var(--lagoon);
}
.game-icon.coral {
  background: var(--coral-tint);
  color: var(--coral-pop);
}

/* Small inline icons that sit inside text/pills and inherit the text color. */
.inline-ico {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
  flex: none;
}
.game-card h3 {
  margin: 0;
}
.game-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}
/* The whole card is a link now; keep text colors and add a hover lift. */
a.game-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift, 0 8px 24px rgba(16, 42, 67, 0.12));
}
a.game-card:focus-visible {
  outline: 2px solid var(--lagoon);
  outline-offset: 2px;
}

.rules-list {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-soft);
}

/* Header: the Reef switcher lives beside Sign out. */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.reef-switcher {
  position: relative;
}
.reef-switcher > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 180px;
}
.reef-switcher > summary::-webkit-details-marker {
  display: none;
}
.reef-switcher > summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reef-switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift, 0 8px 24px rgba(16, 42, 67, 0.12));
  padding: 6px;
  z-index: 10;
  display: flex;
  flex-direction: column;
}
.reef-switcher-menu a {
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}
.reef-switcher-menu a:hover {
  background: var(--lagoon-tint);
}
.reef-switcher-menu a.is-current {
  font-weight: 700;
  color: var(--lagoon);
}
.switcher-label {
  margin: 4px 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}
.switcher-new {
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

/* ---- badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.badge-soon {
  background: #fff4e0;
  color: #9a6a00;
}
.badge-live {
  background: #e4f8ec;
  color: #12683f;
}

/* ---- Phase 1: roster, profile, invites ---------------------------------- */

.wrap-narrow {
  max-width: 640px;
}

.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input, 4px);
  resize: vertical;
}
.field textarea:focus {
  outline: none;
  border-color: var(--lagoon);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar svg {
  width: 24px;
  height: 24px;
}
.avatar.lagoon {
  background: var(--lagoon-tint);
  color: var(--lagoon);
}
.avatar.kelp {
  background: var(--kelp-tint);
  color: var(--kelp-green);
}
.avatar.coral {
  background: var(--coral-tint);
  color: var(--coral-pop);
}
.avatar-photo {
  overflow: hidden;
  background: var(--line, #e7eef5);
}
.avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar.avatar-lg {
  width: 96px;
  height: 96px;
}
.avatar.avatar-lg svg {
  width: 52px;
  height: 52px;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
}
.avatar-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--sp-1);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card, 12px);
  cursor: pointer;
  text-align: center;
}
.avatar-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.avatar-option:has(input:checked) {
  border-color: var(--lagoon);
  background: var(--lagoon-tint);
}

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.roster-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card, 12px);
  padding: var(--sp-1) var(--sp-2);
}
.roster-row.is-inactive {
  opacity: 0.65;
}
.roster-who {
  flex: 1;
  min-width: 0;
}
.roster-bio {
  margin: 2px 0 0;
  font-size: 0.9rem;
}
.roster-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-danger {
  color: var(--error);
}

.invite-link code {
  display: block;
  padding: var(--sp-1) var(--sp-2);
  background: var(--lagoon-tint);
  border-radius: var(--radius-input, 4px);
  word-break: break-all;
  user-select: all;
}

/* ---- Phase 2: rounds -------------------------------------------------- */

.field select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input, 4px);
}
.field select:focus {
  outline: none;
  border-color: var(--lagoon);
}

.live-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: space-between;
  flex-wrap: wrap;
  border-left: 4px solid var(--coral-pop);
  margin-bottom: var(--sp-3);
}

.fact-card {
  margin-bottom: var(--sp-2);
}
.fact-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 var(--sp-1);
}

.winner-banner {
  text-align: center;
  border-top: 4px solid var(--coral-pop);
}
.winner-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-soft);
  width: 1.5em;
  text-align: center;
  flex-shrink: 0;
}

/* ---- Phase 3: Mimic ------------------------------------------------------ */

.game-picker {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.game-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-1) var(--sp-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card, 12px);
  cursor: pointer;
}
.game-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.game-option {
  position: relative;
}
.game-option:has(input:checked) {
  border-color: var(--lagoon);
  background: var(--lagoon-tint);
}

.lie-pick {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input, 4px);
  cursor: pointer;
  font-size: 0.95rem;
}
.lie-pick:has(input:checked) {
  border-color: var(--coral-pop);
  background: var(--coral-tint);
}

.lie-revealed {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--coral-pop);
  font-weight: 700;
}

/* ---- Phase 5: polish ------------------------------------------------------ */

/* Accessibility: a visible focus ring everywhere, once, consistently. */
:focus-visible {
  outline: 3px solid var(--lagoon);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Landing page */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-2);
  padding-bottom: var(--sp-2);
}
.hero {
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-4);
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  margin-bottom: var(--sp-2);
}
.hero-sub {
  max-width: 560px;
  margin: 0 auto var(--sp-3);
  color: var(--text-soft);
  font-size: 1.1rem;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}
/* ---- Shark: role banner, night guide, end-of-game popup ---------------- */

.role-banner {
  text-align: center;
  border-width: 2px;
}
.role-banner.role-shark {
  border-color: var(--coral-pop);
  background: var(--coral-tint);
}
.role-banner.role-school {
  border-color: var(--lagoon);
  background: var(--lagoon-tint);
}
#guide-steps li.guide-current {
  color: var(--midnight-reef);
  font-weight: 600;
}
#guide-steps li.guide-done {
  color: var(--ink-soft);
}

.endcard-dismiss {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.endcard-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2);
  background: rgba(16, 42, 67, 0.55);
}
.endcard-dismiss:checked ~ .endcard-overlay {
  display: none;
}
.endcard-card {
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
}
.endcard-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  text-align: left;
  margin: var(--sp-2) 0;
}
@media (max-width: 480px) {
  .endcard-teams {
    grid-template-columns: 1fr;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--sp-1);
}
.landing section {
  padding-bottom: var(--sp-4);
}
.landing h2 {
  margin-bottom: var(--sp-2);
}
.faq {
  display: grid;
  gap: var(--sp-2);
}
@media (min-width: 720px) {
  .faq {
    grid-template-columns: repeat(3, 1fr);
  }
}
.closing-cta .winner-banner {
  padding: var(--sp-4);
}
.landing-footer {
  padding: var(--sp-3) var(--sp-2) var(--sp-4);
  text-align: center;
}

/* Ripples feed */
.ripple-row {
  color: var(--text-soft);
}
.ripple-row .inline-ico {
  color: var(--lagoon);
  flex-shrink: 0;
}

/* Winner celebration: pearls rising from the deep. */
.celebrate {
  position: relative;
  overflow: hidden;
}
.trophy-pop {
  animation: trophy-pop 700ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bubbles span {
  position: absolute;
  bottom: -20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lagoon-tint);
  border: 2px solid var(--lagoon);
  opacity: 0;
  animation: bubble-rise 3.2s ease-in infinite;
}
.bubbles span:nth-child(1) { left: 8%;  animation-delay: 0s; }
.bubbles span:nth-child(2) { left: 22%; animation-delay: 0.9s; width: 8px; height: 8px; }
.bubbles span:nth-child(3) { left: 35%; animation-delay: 0.4s; }
.bubbles span:nth-child(4) { left: 48%; animation-delay: 1.4s; width: 16px; height: 16px; border-color: var(--coral-pop); background: var(--coral-tint); }
.bubbles span:nth-child(5) { left: 61%; animation-delay: 0.2s; width: 8px; height: 8px; }
.bubbles span:nth-child(6) { left: 74%; animation-delay: 1.1s; }
.bubbles span:nth-child(7) { left: 86%; animation-delay: 0.6s; width: 10px; height: 10px; border-color: var(--kelp-green); background: var(--kelp-tint); }
.bubbles span:nth-child(8) { left: 94%; animation-delay: 1.8s; width: 8px; height: 8px; }

@keyframes bubble-rise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translateY(-260px); opacity: 0; }
}
@keyframes trophy-pop {
  from { transform: scale(0.3) rotate(-12deg); }
  to { transform: scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .bubbles span,
  .trophy-pop {
    animation: none;
  }
  .bubbles {
    display: none;
  }
}

/* ---- Phase 4: Fry --------------------------------------------------------- */

.fry-photo {
  display: block;
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius-card, 12px);
  border: 1.5px solid var(--line);
  margin-bottom: var(--sp-1);
}

.field input[type="file"] {
  width: 100%;
  padding: 12px;
  font: inherit;
  color: var(--text-soft);
  background: var(--lagoon-tint);
  border: 1.5px dashed var(--lagoon);
  border-radius: var(--radius-btn);
  cursor: pointer;
}
.field input[type="file"]:hover {
  background: var(--white);
}
.field input[type="file"]:focus {
  outline: none;
  box-shadow: var(--ring);
}
/* The browser's own "Choose file" button, dressed as one of ours. */
.field input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 500;
  margin-right: 12px;
  padding: 8px 16px;
  color: var(--lagoon);
  background: var(--white);
  border: 1.5px solid var(--lagoon);
  border-radius: var(--radius-btn);
  cursor: pointer;
}
.field input[type="file"]::file-selector-button:hover {
  background: var(--lagoon-tint);
}
