/* Red Leaf Game House — shared stylesheet */

:root {
  /* palette: pale sky + navy + coral */
  --sky: #eaf3fc;
  --sky-2: #dcebf9;
  --white: #ffffff;
  --navy: #14335f;
  --navy-deep: #0c2140;
  --ink: #0f2748;
  --body: #34496a;
  --coral: #ff5b47;
  --coral-deep: #d8442e;
  --coral-link: #c93a24;
  --coral-tint: #ffe9e4;
  --coral-tint-2: #ffdcd4;
  --gold-soft: #f6c453;

  /* type */
  --font-display: "Baloo 2", "Avenir Next", "Trebuchet MS", sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* spacing scale (8-based) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;

  --wrap: 68rem;
  --radius: 18px;
  --radius-sm: 12px;
  --notch: 10px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--sky);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 var(--s-4);
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.35rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p, ul, ol { margin: 0 0 var(--s-4); }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--coral-link);
  text-decoration: underline;
  text-underline-offset: 3px;

  &:hover { color: var(--coral-deep); }
}

.arrow-link {
  font-weight: 600;
  text-decoration: none;

  &::after { content: " \2192"; }
  &:hover { text-decoration: underline; }
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- age notice bar (very top of every page) ---------- */

.age-bar {
  background: var(--navy-deep);
  color: #cfe0f3;
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
  padding: var(--s-2) var(--s-4);

  & a { color: #ffb4a6; }
}

/* ---------- header & underline-tab nav ---------- */

.site-header {
  background: var(--white);

  & .wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-5);
    padding-block: var(--s-3);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;

  & img { width: 44px; height: 44px; }

  & .brand__name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.22rem;
    line-height: 1.1;
  }
}

.tabs {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  max-width: 100%;

  & a {
    display: block;
    padding: var(--s-2) var(--s-3);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;

    &:hover { border-bottom-color: var(--sky-2); }

    &[aria-current="page"] {
      color: var(--coral-deep);
      border-bottom-color: var(--coral);
    }
  }
}

.coin-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  background: var(--navy);
  color: var(--white);
  padding: var(--s-2) var(--s-4);
  clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch));

  & .coin-chip__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #a9c3e4;
  }

  & strong {
    font-variant-numeric: tabular-nums;
    font-size: 1.02rem;
  }
}

/* ---------- buttons: capsules with small uppercase labels ---------- */

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 0.8em 1.9em;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  background: var(--coral);
  color: var(--white);

  &:hover { background: var(--coral-deep); color: var(--white); }

  &:disabled {
    background: var(--sky-2);
    color: var(--body);
    cursor: not-allowed;
  }
}

.btn--navy {
  background: var(--navy);

  &:hover { background: var(--navy-deep); }
}

.btn--soft {
  background: var(--coral-tint);
  color: var(--coral-deep);

  &:hover { background: var(--coral-tint-2); color: var(--coral-deep); }
}

/* ---------- badges: leading dot ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--sky);
  border-radius: 999px;
  padding: 0.3em 0.9em;

  &::before {
    content: "";
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: var(--coral);
    flex: none;
  }
}

.badge--light {
  background: rgb(255 255 255 / 0.18);
  color: var(--white);

  &::before { background: var(--white); }
}

/* ---------- section bands (alternating tints) ---------- */

.band { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.band--white { background: var(--white); }
.band--sky { background: var(--sky); }
.band--sky2 { background: var(--sky-2); }
.band--coral { background: var(--coral-tint); }
.band--navy { background: var(--navy); color: #d7e5f6;

  & h2, & h3 { color: var(--white); }
  & a { color: #ffb4a6; }
}

.kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-deep);
  background: var(--coral-tint);
  padding: 0.35em 1em;
  margin-bottom: var(--s-4);
  clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch));
}

.band--navy .kicker, .band--coral .kicker { background: var(--white); }

/* ---------- hero: faint concentric arcs, single line ---------- */

.hero {
  background-color: var(--sky);
  background-image: repeating-radial-gradient(
    circle at 50% -28rem,
    transparent 0,
    transparent 7.25rem,
    rgb(20 51 95 / 0.07) 7.25rem,
    rgb(20 51 95 / 0.07) 7.4rem
  );
  text-align: center;
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2.5rem, 5vw, 3.5rem);

  & h1 { max-width: 22ch; margin-inline: auto; }

  & .hero__accent { color: var(--coral-deep); }

  & p {
    max-width: 52ch;
    margin-inline: auto;
    font-size: 1.08rem;
  }
}

/* vivid accent band under the hero: the free-play statement */
.free-band {
  background: var(--coral);
  color: var(--white);
  text-align: center;
  padding: var(--s-4);

  & p {
    margin: 0;
    font-weight: 600;
    font-size: 0.98rem;
    max-width: 75ch;
    margin-inline: auto;
  }

  & a { color: var(--white); }
}

/* ---------- game tiles: rounded, accent header, art left / copy right ---------- */

.tile-stack {
  display: grid;
  gap: var(--s-5);
}

.game-tile {
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid transparent;
  overflow: hidden;

  &:hover { border-color: var(--navy); }
}

.game-tile__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  background: var(--coral);
  padding: var(--s-3) var(--s-5);

  & h3 {
    margin: 0;
    color: var(--white);
    font-size: 1.35rem;
  }
}

.game-tile__body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s-5);
  padding: var(--s-5);
  align-items: center;
}

.game-tile__art {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;

  & img { width: 100%; }
}

.game-tile__copy {
  & p { margin-bottom: var(--s-4); }

  & .game-tile__meta {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s-4);
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    font-size: 0.85rem;

    & li {
      background: var(--sky);
      border-radius: 999px;
      padding: 0.25em 0.9em;
      color: var(--navy);
      font-weight: 600;
    }
  }
}

@media (max-width: 43rem) {
  .game-tile__body { grid-template-columns: 1fr; }
}

/* ---------- scorecards ---------- */

.scorecards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
}

.scorecard {
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid transparent;
  padding: var(--s-5);

  &:hover { border-color: var(--navy); }

  & h3 { margin-bottom: var(--s-2); }

  & .scorecard__note { font-size: 0.92rem; margin-bottom: var(--s-4); }

  & dl {
    margin: 0;
    display: grid;
    gap: var(--s-2);
  }

  & .scorecard__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--s-3);
  }

  & dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--navy);
  }

  & dd { margin: 0; }
}

.dots {
  display: inline-flex;
  gap: 4px;

  & i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sky-2);
  }

  & i.on { background: var(--coral); }
}

@media (max-width: 50rem) {
  .scorecards { grid-template-columns: 1fr; }
}

/* ---------- two-column prose + aside ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.split--even { grid-template-columns: 1fr 1fr; align-items: center; }

@media (max-width: 50rem) {
  .split, .split--even { grid-template-columns: 1fr; }
}

.panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: var(--s-6);
  border: 2px solid transparent;

  &:hover { border-color: var(--sky-2); }
}

.panel--coral { background: var(--coral-tint); }
.panel--navy {
  background: var(--navy);
  color: #d7e5f6;

  & h2, & h3, & h4 { color: var(--white); }
  & a { color: #ffb4a6; }
}

.rounded-img { border-radius: var(--radius); }

/* ---------- prose pages ---------- */

.prose {
  max-width: 46rem;

  & h2 { margin-top: var(--s-7); }
  & h2:first-child { margin-top: 0; }
  & h3 { margin-top: var(--s-6); }

  & table { margin-block: var(--s-4); }
}

.page-head {
  padding-block: clamp(2.5rem, 5vw, 3.75rem) 0;

  & p.lede {
    font-size: 1.12rem;
    max-width: 56ch;
  }
}

/* ---------- tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.95rem;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: var(--s-2);
}

th, td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
}

thead th {
  background: var(--navy);
  color: var(--white);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

tbody tr:nth-child(even) { background: var(--sky); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- FAQ prose blocks ---------- */

.faq-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: var(--s-5) var(--s-6);
  border: 2px solid transparent;
  max-width: 46rem;

  &:hover { border-color: var(--sky-2); }

  & h3 { margin-bottom: var(--s-2); }
  & + .faq-block { margin-top: var(--s-4); }
}

/* ---------- disclaimer block ---------- */

.disclaimer {
  background: var(--sky-2);
  padding-block: var(--s-6);
  font-size: 0.88rem;

  & p { max-width: 75ch; }
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--navy-deep);
  color: #b9cde6;
  font-size: 0.9rem;
  padding-block: var(--s-7) var(--s-6);

  & h4 {
    color: var(--white);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--s-3);
    font-family: var(--font-body);
    font-weight: 700;
  }

  & a { color: #cfe0f3; text-decoration: none;

    &:hover { color: var(--white); text-decoration: underline; }
  }

  & ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--s-2);
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-6);
  margin-bottom: var(--s-6);
}

@media (max-width: 50rem) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 30rem) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-note {
  border-top: 1px solid rgb(255 255 255 / 0.14);
  padding-top: var(--s-5);
  font-size: 0.82rem;
  line-height: 1.6;

  & p { max-width: none; }
}

/* ---------- cookie banner ---------- */

.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  background: var(--white);
  box-shadow: 0 -4px 24px rgb(12 33 64 / 0.18);
  padding: var(--s-4);

  & .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-4);
  }

  & p { margin: 0; flex: 1 1 26rem; font-size: 0.88rem; }
}

/* ---------- game pages ---------- */

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: var(--s-5);
  align-items: start;
}

@media (max-width: 56rem) {
  .game-layout { grid-template-columns: 1fr; }
}

.game-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: var(--s-5);
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.bet-field {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);

  & label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--navy);
  }

  & select {
    font: inherit;
    font-variant-numeric: tabular-nums;
    padding: 0.45em 0.7em;
    border: 2px solid var(--sky-2);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
  }
}

.game-result {
  margin: var(--s-4) 0 0;
  min-height: 1.8em;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;

  &.is-win { color: var(--coral-deep); }
}

.game-balance {
  font-size: 0.9rem;
  color: var(--body);

  & strong { font-variant-numeric: tabular-nums; color: var(--ink); }
}

.rules-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: var(--s-5);
  font-size: 0.93rem;

  & h2 { font-size: 1.25rem; }
  & h3 { font-size: 1rem; margin-top: var(--s-5); }
  & table { font-size: 0.86rem; }
  & th, & td { padding: var(--s-2) var(--s-3); }
}

.coin-note {
  background: var(--sky);
  border-radius: var(--radius-sm);
  padding: var(--s-3) var(--s-4);
  font-size: 0.83rem;
  margin-top: var(--s-5);
}

.noscript-note {
  background: var(--coral-tint);
  border-radius: var(--radius-sm);
  padding: var(--s-4);
  font-weight: 600;
  color: var(--coral-deep);
}

/* --- Lantern Wheel --- */

.wheel-stage {
  position: relative;
  max-width: 26rem;
  margin-inline: auto;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--coral-deep);
  z-index: 2;
}

.wheel-svg {
  width: 100%;
  height: auto;
  display: block;
}

#wheel-rotor { transform-origin: 260px 260px; }

.wheel-legend {
  list-style: none;
  padding: 0;
  margin: var(--s-4) 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2) var(--s-4);
  font-size: 0.85rem;

  & li { display: inline-flex; align-items: center; gap: 0.45em; font-variant-numeric: tabular-nums; }

  & i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: none;
  }
}

/* --- Reef Reels --- */

.reels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-2);
  background: var(--navy);
  border-radius: var(--radius-sm);
  padding: var(--s-3);
}

.reel {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: var(--s-2);
}

.reel-cell {
  background: var(--sky);
  border-radius: 10px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12%;

  & svg { width: 100%; height: 100%; }

  &.is-hit { background: var(--coral-tint); outline: 3px solid var(--coral); outline-offset: -3px; }
}

@media (prefers-reduced-motion: no-preference) {
  .reel.is-spinning .reel-cell svg { filter: blur(1.5px); }
}

.paylines-note { font-size: 0.85rem; margin-top: var(--s-3); }

/* --- Nebula Keno --- */

.keno-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.keno-cell {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--sky);
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover { background: var(--sky-2); }

  &.is-picked { background: var(--navy); color: var(--white); }
  &.is-drawn { box-shadow: inset 0 0 0 3px var(--coral); }
  &.is-hit { background: var(--coral); color: var(--white); box-shadow: none; }

  &:disabled { cursor: default; }
}

@media (max-width: 34rem) {
  .keno-grid { gap: 4px; }
  .keno-cell { font-size: 0.68rem; }
}

.keno-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  font-size: 0.88rem;
  margin-top: var(--s-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- helpline list ---------- */

.help-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s-3);

  & li {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: var(--s-3) var(--s-4);

    & strong { color: var(--ink); display: block; }
    & span { font-size: 0.88rem; }
  }
}

.band--navy .help-links li { background: rgb(255 255 255 / 0.08);

  & strong { color: var(--white); }
}

/* ---------- utility ---------- */

.center { text-align: center; }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}

@media (max-width: 44rem) {
  .grid-2 { grid-template-columns: 1fr; }
}
