/* ============================================================
   Bluffio — card-table look: the whole screen is green felt, cards
   are classic white playing cards, controls are white pill buttons.
   ============================================================ */

/* ============ Tokens ============ */
:root {
  color-scheme: light;
  --font: "Nunito", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* felt */
  --felt-hi: #33903d;
  --felt-mid: #22702d;
  --felt-lo: #154c1e;
  --on-felt: #ffffff;
  --on-felt-soft: rgba(255, 255, 255, 0.74);
  --slot: rgba(255, 255, 255, 0.11);
  --slot-line: rgba(255, 255, 255, 0.14);
  --chip: rgba(0, 0, 0, 0.2);

  /* cards */
  --card: #ffffff;
  --card-edge: rgba(0, 0, 0, 0.16);
  --card-ink: #1b1b1b;
  --card-red: #d42a2a;
  --back-hi: #3768c8;
  --back-lo: #1e468f;
  --card-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 3px 8px rgba(0, 0, 0, 0.22);

  /* controls */
  --btn: #ffffff;
  --btn-ink: #245324;
  --btn-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
  --green: #38a336;
  --green-hi: #43b541;

  /* clues */
  --correct: #38a336;
  --present: #e8b21c;
  --present-ink: #3b2a00;
  --absent: #56635b;
  --on-clue: #ffffff;
  --win: #2f6fd0;
  --lose: #d64541;
  --tie: #7a5cc6;

  /* panels */
  --panel: #ffffff;
  --panel-ink: #1d2b1f;
  --panel-soft: #5c6d60;
  --panel-line: #e3e9e3;
  --overlay: rgba(4, 28, 9, 0.55);
  --toast-bg: #0f2c14;
  --toast-fg: #ffffff;
  --panel-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

/* Night table: darker felt and menus. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --felt-hi: #1f5a2b;
  --felt-mid: #143f1d;
  --felt-lo: #0a2410;
  --btn: #eef3ee;
  --panel: #142219;
  --panel-ink: #e8f0e9;
  --panel-soft: #9fb3a4;
  --panel-line: #24382a;
  --overlay: rgba(0, 0, 0, 0.6);
  --toast-bg: #eef3ee;
  --toast-fg: #0f2c14;
  --absent: #3d4842;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--on-felt);
  background-color: var(--felt-mid);
  /* felt: soft light pool in the middle + fine grain (inline SVG noise) */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 90% at 50% 28%, var(--felt-hi) 0%, var(--felt-mid) 55%, var(--felt-lo) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border-radius: 6px;
  background: var(--panel-line);
  color: var(--panel-ink);
  font: 800 0.82em/1.4 var(--font);
  text-align: center;
}

#app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ============ Header ============ */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  height: 56px;
  padding: 0 12px;
}
.brand { display: flex; align-items: center; gap: 6px; }
.logo { width: 34px; height: 34px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.title {
  margin: 0;
  font: 900 26px/1 var(--font);
  letter-spacing: 0.01em;
  color: var(--on-felt);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.bar-side { display: flex; gap: 6px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: var(--btn-ink);
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s;
}
.icon-btn:hover { filter: brightness(0.96); }
.icon-btn:active { transform: translateY(1px); box-shadow: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.small { width: 34px; height: 34px; border-radius: 11px; }
.icon-btn.small svg { width: 19px; height: 19px; }
.icon-btn[hidden] { display: none; }

/* ============ Mode bar ============ */
.modebar {
  flex: none;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0 10px;
}
.daily-chip {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ============ Table (opponent + board) ============ */
.table {
  --pc-w: min(58px, calc((100vw - 96px) / 7), 6.6vh);
  flex: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  padding: 2px 0 4px;
}
.seat-label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--on-felt-soft);
}
.cards { display: flex; gap: 6px; }
.table-divider {
  width: 2px;
  align-self: stretch;
  margin-top: 18px;
  border-radius: 2px;
  background: var(--slot-line);
}

/* Playing card */
.pcard {
  position: relative;
  flex: none;
  width: var(--pc-w);
  height: calc(var(--pc-w) * 1.4);
  perspective: 700px;
}
.pcard .face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--pc-w) * 0.1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.7s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.pcard .front {
  background: var(--card);
  color: var(--card-ink);
  box-shadow: inset 0 0 0 1px var(--card-edge), var(--card-shadow);
}
.pcard .front.red { color: var(--card-red); }
.pc-idx {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
}
.pc-idx b { font-weight: 900; font-size: calc(var(--pc-w) * 0.3); letter-spacing: -0.04em; }
.pc-idx i { font-style: normal; font-size: calc(var(--pc-w) * 0.22); }
.pc-idx.tl { top: 6%; left: 7%; }
.pc-idx.br { right: 7%; bottom: 6%; transform: rotate(180deg); }
.pc-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--pc-w) * 0.5);
  line-height: 1;
}
.pcard .back {
  transform: rotateY(-180deg);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 1.5px, transparent 1.5px 6px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.16) 0 1.5px, transparent 1.5px 6px),
    linear-gradient(160deg, var(--back-hi), var(--back-lo));
  border: calc(var(--pc-w) * 0.07) solid #fff;
  box-shadow: inset 0 0 0 2px var(--back-lo), inset 0 0 0 3px rgba(255, 255, 255, 0.55), 0 0 0 1px var(--card-edge), var(--card-shadow);
}
.pcard.down .front { transform: rotateY(180deg); }
.pcard.down .back { transform: rotateY(0deg); }
.pcard.instant .face { transition: none; }
.pcard.placeholder {
  border-radius: calc(var(--pc-w) * 0.1);
  background: var(--slot);
  box-shadow: inset 0 0 0 1px var(--slot-line);
}

/* ============ Guess grid ============ */
.grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0 6px;
  container-type: size;
}
.grid {
  --gap: 7px;
  --rows: 5;
  --tile-h: clamp(32px, 7.4vh, 70px);
  --tile-w: calc(var(--tile-h) * 0.74);
  display: grid;
  grid-template-rows: repeat(var(--rows), var(--tile-h));
  gap: var(--gap);
}
@supports (container-type: size) {
  .grid { --tile-h: clamp(30px, calc((100cqh - (var(--rows) - 1) * var(--gap)) / var(--rows)), 72px); }
}
.row { display: flex; gap: var(--gap); }
@keyframes pending { 50% { opacity: 0.55; } }
.row.pending .tile { animation: pending 0.9s ease-in-out infinite; }

.tile {
  height: var(--tile-h);
  border-radius: calc(var(--tile-h) * 0.12);
  user-select: none;
}

/* A guessed card: white playing card; its bottom band carries the suit clue. */
.tile.card {
  width: var(--tile-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--slot);
  box-shadow: inset 0 0 0 1px var(--slot-line);
  color: var(--card-ink);
}
.tile.card.active { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 3px rgba(255, 255, 255, 0.12); }
.tile.card[data-state="tbd"],
.tile.card[data-state="revealed"] {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--card-edge), var(--card-shadow);
}
.tile.card .half { display: grid; place-items: center; line-height: 1; font-weight: 900; }
.tile.card .top { flex: 1.25 1 0; font-size: calc(var(--tile-h) * 0.36); letter-spacing: -0.04em; }
.tile.card .bottom { flex: 1 1 0; font-size: calc(var(--tile-h) * 0.3); }
.tile.card.red .rank,
.tile.card .suit.red { color: var(--card-red); }
.tile .ph { color: #9aa79d; }

.tile.card[data-state="revealed"] .bottom { color: var(--on-clue); }
.half.bottom.present { background: var(--present); color: var(--present-ink); }
.tile.card[data-state="revealed"] .half.bottom.present { color: var(--present-ink); }
.half.bottom.absent { background: var(--absent); }
.half.bottom.correct { background: var(--correct); }
.tile.card.exact { box-shadow: 0 0 0 3px var(--correct), var(--card-shadow); }
.tile.card.exact .top { background: color-mix(in srgb, var(--correct) 14%, #fff); }

.tile.result {
  width: calc(var(--tile-h) * 2.3);
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 6px;
  border-radius: calc(var(--tile-h) * 0.2);
  background: var(--slot);
  box-shadow: inset 0 0 0 1px var(--slot-line);
  color: var(--on-clue);
  text-align: center;
}
.res-label {
  font-weight: 900;
  font-size: calc(var(--tile-h) * 0.3);
  letter-spacing: 0.06em;
  line-height: 1;
}
.res-hand {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: max(10px, calc(var(--tile-h) * 0.18));
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0.95;
}
.tile.result[data-state="revealed"] {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 0 rgba(0, 0, 0, 0.22), 0 4px 10px rgba(0, 0, 0, 0.18);
}
.tile.result[data-result="win"] { background: var(--win); }
.tile.result[data-result="lose"] { background: var(--lose); }
.tile.result[data-result="tie"] { background: var(--tie); }
.tile.result[data-result="match"] { background: var(--correct); }

/* ============ Hint line ============ */
.hint {
  flex: none;
  min-height: 22px;
  font-size: 14px;
  font-weight: 700;
  color: var(--on-felt-soft);
  text-align: center;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-felt);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

/* ============ Keyboard ============ */
.keyboard {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  user-select: none;
}
.kb-row { display: flex; gap: 6px; justify-content: center; }
.kb-spacer { flex: 0.5 1 0; }
.key {
  flex: 1 1 0;
  min-width: 0;
  height: clamp(42px, 6.2vh, 56px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: var(--btn-ink);
  box-shadow: var(--btn-shadow);
  font-weight: 900;
  font-size: 20px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s, transform 0.06s;
}
.key:hover { filter: brightness(0.97); }
.key:active { transform: translateY(2px); box-shadow: none; }
.key.wide { flex: 1.6 1 0; font-size: 13px; letter-spacing: 0.04em; }
.key.wide svg { width: 24px; height: 24px; }
.key.suit { font-size: 26px; color: var(--card-ink); }
.key.suit.red { color: var(--card-red); }
/* Clue states win over the suit colours. */
.key.key[data-state="correct"] { background: var(--correct); color: #fff; }
.key.key[data-state="present"] { background: var(--present); color: var(--present-ink); }
.key.key[data-state="absent"] { background: rgba(0, 0, 0, 0.32); color: rgba(255, 255, 255, 0.55); box-shadow: none; }

/* ============ Animations ============ */
@keyframes pop {
  0% { transform: scale(0.88); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes flip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
@keyframes bounce {
  0%, 20% { transform: translateY(0); }
  40% { transform: translateY(-28%); }
  50% { transform: translateY(5%); }
  60% { transform: translateY(-14%); }
  80% { transform: translateY(2%); }
  100% { transform: translateY(0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.tile.pop { animation: pop 0.12s ease-out; }
.tile.flip { animation: flip 0.5s ease-in-out; }
.row.shake, .tile.shake { animation: shake 0.6s; }
.tile.bounce { animation: bounce 1s ease; }

@media (prefers-reduced-motion: reduce) {
  .tile.pop, .tile.flip, .row.shake, .tile.shake, .tile.bounce, .modal { animation-duration: 1ms !important; }
  .pcard .face { transition-duration: 1ms; }
}

/* ============ Toasts ============ */
.toasts {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s;
}
.toast.hide { opacity: 0; }

/* ============ Modals ============ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--overlay);
}
.overlay[hidden] { display: none; }
.modal {
  position: relative;
  overscroll-behavior: contain;
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 26px 24px 24px;
  border-radius: 20px;
  background: var(--panel);
  color: var(--panel-ink);
  box-shadow: var(--panel-shadow);
  animation: fade-up 0.22s ease-out;
}
.modal-close { position: absolute; top: 12px; right: 12px; box-shadow: none; background: var(--panel-line); }
.modal h2 { margin: 0 0 4px; font: 900 26px/1.2 var(--font); color: var(--panel-ink); }
.modal h3 {
  margin: 20px 0 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--panel-soft);
}
.modal p, .modal li { font-size: 15px; line-height: 1.45; }
.modal ul { padding-left: 20px; margin: 8px 0; }
.modal li { margin: 6px 0; }
.modal .lead { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.modal hr { border: 0; border-top: 1px solid var(--panel-line); margin: 18px 0; }
.modal .fine { color: var(--panel-soft); font-size: 13px; }
.modal a { color: #1f6a2a; font-weight: 800; }
:root[data-theme="dark"] .modal a { color: #7fd38a; }
.modal .callout p { margin: 0; }

/* Help examples sit on a small piece of felt so the tiles look like in the game. */
.example { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
.example .tiles {
  --tile-h: 54px;
  --tile-w: 40px;
  display: flex;
  gap: 5px;
  flex: none;
  padding: 7px;
  border-radius: 12px;
  background: radial-gradient(120% 120% at 50% 20%, var(--felt-hi), var(--felt-mid));
}
.example .tile.result { min-width: 0; width: 88px; }
.example p { margin: 0; font-size: 14px; }

/* Stats */
.stats-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0 4px; text-align: center; }
.stats-nums .num { font-size: 32px; font-weight: 900; line-height: 1.1; }
.stats-nums .lbl { font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--panel-soft); }
.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.dist-row > span { width: 12px; text-align: right; }
.dist-bar {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--absent);
  color: #fff;
  text-align: right;
  font-size: 13px;
}
.dist-bar.hl { background: var(--green); }
.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: radial-gradient(130% 150% at 50% 0%, var(--felt-hi), var(--felt-lo));
  color: #fff;
}
.answer .cards { --pc-w: 42px; }
.answer .what { font-weight: 900; }
.answer .sub { font-size: 13px; font-weight: 700; color: var(--on-felt-soft); }
.stats-footer { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.stats-footer .next { flex: 1; text-align: center; }
.stats-footer .next .lbl { font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--panel-soft); }
.stats-footer .next .clock { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 0 #23741f;
  cursor: pointer;
}
.btn:hover { background: var(--green-hi); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #23741f; }
.btn.secondary { background: var(--panel); color: var(--btn-ink); box-shadow: inset 0 0 0 2px var(--panel-line), 0 3px 0 var(--panel-line); }
:root[data-theme="dark"] .btn.secondary { color: var(--panel-ink); }
.btn.small { flex: none; height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
/* Google sign-in button (Google's colors on white, per their branding guidance) */
.btn.google {
  background: #fff;
  color: #1f1f1f;
  box-shadow: inset 0 0 0 1px #c9cdd1, 0 2px 0 #c9cdd1;
  letter-spacing: 0;
  text-transform: none;
}
.btn.google:hover { background: #f7f8f8; }
.btn.google svg { width: 20px; height: 20px; flex: none; }
.signin-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--green) 10%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 30%, transparent);
}
.signin-card .s-title { font-size: 17px; font-weight: 900; }
.signin-card .s-desc { margin-top: 2px; font-size: 13px; color: var(--panel-soft); }
/* flex: none — .btn's flex: 1 would override its 48px height inside this column and squash it. */
.signin-card .btn { flex: none; width: 100%; }

/* Cookie banner (js/analytics.js). It sits under modals (50) and toasts (60), so on a first visit the
   help dialog comes first. Accept and Reject look the same on purpose: rejecting must be as easy as accepting. */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel);
  color: var(--panel-ink);
  box-shadow: 0 0 0 1px var(--panel-line), var(--panel-shadow); /* the outline separates it from white guide cards */
  animation: fade-up 0.22s ease-out;
}
.cookie-text { flex: 1; margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; }
.cookie-text a { color: #1f6a2a; font-weight: 800; }
:root[data-theme="dark"] .cookie-text a { color: #7fd38a; }
.cookie-now { color: var(--panel-soft); }
.cookie-actions { display: flex; flex: none; gap: 8px; }
.cookie-actions .btn { flex: none; min-width: 96px; height: 42px; font-size: 15px; }
@media (max-width: 520px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 12px; }
  .cookie-actions .btn { flex: 1; }
}

/* Bottom ad (AdSense). Hidden until configured in js/ads.js, so it takes no space until then. */
.ad-slot {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  max-height: 100px;
  margin-top: 8px;
  overflow: hidden;
}
.ad-slot[hidden] { display: none; }
.ad-slot .adsbygoogle { display: block; width: 100%; max-width: 728px; height: 60px; }

/* Settings */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--panel-line);
}
.setting .s-title { font-size: 17px; font-weight: 800; }
.setting .s-desc { margin-top: 2px; font-size: 13px; color: var(--panel-soft); }
.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c3ccc5;
  cursor: pointer;
  transition: background-color 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ============ Footer link (game) ============ */
.site-foot { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding-top: 6px; font-size: 12px; font-weight: 700; }
.site-foot a { color: var(--on-felt-soft); text-decoration: none; }
.site-foot a:hover { color: var(--on-felt); text-decoration: underline; }

/* ============ Home: section below the game ============ */
/* The game fills the first screen; scrolling down reveals what Bluffio is. */
body.home { overflow-y: auto; }
.home-more { max-width: 780px; margin: 0 auto; padding: 18px 16px 48px; }
.home-more .doc-card h2 { margin-top: 0; font-size: 26px; }
.link-list { columns: 2 260px; column-gap: 24px; }
.doc-card .link-list li { break-inside: avoid; }

/* ============ Text pages (guides, about, privacy) ============ */
.doc-body { overflow: auto; }
.doc { max-width: 780px; margin: 0 auto; padding: 18px 16px 56px; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand-link { display: flex; align-items: center; gap: 6px; color: var(--on-felt); text-decoration: none; }
.doc-head .btn { flex: none; text-decoration: none; }
/* "Bluffio.com" plus "Play today's hand" doesn't fit small phones: the button becomes "Play". */
@media (max-width: 380px) { .doc-head .wide-only { display: none; } }
.doc-card {
  padding: 26px 24px 30px;
  border-radius: 20px;
  background: var(--panel);
  color: var(--panel-ink);
  box-shadow: var(--panel-shadow);
}
.doc-card h1 { margin: 0 0 4px; font: 900 30px/1.2 var(--font); }
.doc-card h2 { margin: 28px 0 8px; font-size: 19px; font-weight: 900; }
.doc-card p, .doc-card li { font-size: 15.5px; line-height: 1.6; }
.doc-card ul { padding-left: 22px; }
.doc-card li { margin: 6px 0; }
.doc-card a { color: #1f6a2a; font-weight: 800; }
:root[data-theme="dark"] .doc-card a { color: #7fd38a; }
.doc-meta { margin-top: 0; color: var(--panel-soft); font-size: 13px; }
.doc-card h3 { margin: 18px 0 6px; font-size: 16px; font-weight: 900; }
.doc-card ol { padding-left: 22px; }
.doc-card ol li { margin: 8px 0; }
.doc-card .lead { font-size: 17.5px; line-height: 1.55; }
.doc-card dt { margin-top: 14px; font-weight: 900; }
.doc-card dd { margin: 4px 0 0; font-size: 15.5px; line-height: 1.6; }
.doc-card .btn { text-decoration: none; color: #fff; }
.doc-card .btn.secondary { color: var(--btn-ink); }
.doc-card .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.doc-card .cta .btn { flex: 1 1 200px; }

/* Guide links under the page header */
.doc-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.doc-nav a {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--on-felt);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.doc-nav a:hover { background: rgba(0, 0, 0, 0.32); }
.doc-nav a[aria-current="page"] { background: var(--panel); color: var(--btn-ink); }
.doc-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 22px; font-size: 13px; font-weight: 700; }
.doc-foot a { color: var(--on-felt-soft); text-decoration: none; }
.doc-foot a:hover { color: var(--on-felt); text-decoration: underline; }

/* Mini playing cards inside text. Red suits get .r; cards outside the best five get .dim. */
.mc {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.3em;
  height: 3.15em;
  margin: 0 1px;
  vertical-align: middle;
  border-radius: 0.35em;
  background: var(--card);
  color: var(--card-ink);
  box-shadow: inset 0 0 0 1px var(--card-edge), 0 1px 2px rgba(0, 0, 0, 0.18);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.mc i { margin-top: 0.12em; font-style: normal; font-size: 0.95em; }
.mc.r { color: var(--card-red); }
.mc.dim { opacity: 0.4; }
.cards-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.cards-row .plus { margin: 0 4px; font-weight: 900; }

/* A small piece of table: felt with labelled groups of cards */
.felt-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: radial-gradient(120% 120% at 50% 20%, var(--felt-hi), var(--felt-mid));
  color: var(--on-felt);
}
.felt-box .grp-label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-felt-soft);
}
.felt-box .note { flex-basis: 100%; margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.45; }

/* Hand rankings, best first */
.doc-card .ranking { list-style: none; margin: 12px 0; padding: 0; counter-reset: rank; }
.doc-card .ranking li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--panel-line);
}
.ranking li::before {
  counter-increment: rank;
  content: counter(rank);
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}
.ranking .rk-name { font-size: 16px; font-weight: 900; }
.ranking .rk-desc { color: var(--panel-soft); font-size: 14.5px; line-height: 1.45; }

.callout {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--green) 10%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 30%, transparent);
}
.doc-card .callout p { margin: 6px 0; }

/* Worked example steps */
.step { margin: 14px 0; padding: 14px 16px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--panel-line); }
.doc-card .step h3 { margin-top: 0; }
.doc-card .step p { margin: 8px 0 0; }
.doc-card .example p { font-size: 15px; }

/* Tables (comparison, odds). Wide tables scroll sideways inside their box on phones. */
.table-wrap { margin: 14px 0; overflow-x: auto; }
.doc-card table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.4; }
.doc-card th, .doc-card td { padding: 9px 10px; border-bottom: 1px solid var(--panel-line); text-align: left; vertical-align: top; }
.doc-card thead th { font-size: 12px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--panel-soft); }
.doc-card tbody th { font-weight: 900; white-space: nowrap; }
.doc-card table.num td { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* A few guess rows, as they look in the game */
.demo-grid { --tile-h: 50px; --tile-w: 37px; display: flex; flex-direction: column; gap: 5px; }
.demo-grid .tiles { display: flex; gap: 5px; }
.demo-grid .tile.result { min-width: 0; width: 112px; }

/* "Who wins?" practice quiz */
.quiz {
  margin: 16px 0;
  padding: 16px;
  border-radius: 16px;
  background: radial-gradient(120% 120% at 50% 20%, var(--felt-hi), var(--felt-mid));
  color: var(--on-felt);
}
.quiz-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.quiz-top b { font-size: 16px; }
.quiz-score { font-size: 14px; font-weight: 800; color: var(--on-felt-soft); }
.quiz .grp-label { margin: 12px 0 6px; font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-felt-soft); }
.quiz-hands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quiz-hand { padding: 10px; border-radius: 12px; background: var(--chip); }
.quiz-hand.won { box-shadow: 0 0 0 3px #ffd54a; }
.quiz-hand .grp-label { margin-top: 0; }
.quiz-name { margin-top: 8px; font-size: 13.5px; font-weight: 800; }
.quiz-best { margin-top: 6px; }
.quiz-best .mc { font-size: 12px; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.quiz-actions .btn { flex: 1 1 130px; height: 44px; font-size: 15px; }
.quiz-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  color: var(--panel-ink);
  font-size: 15px;
  line-height: 1.5;
}
.quiz-feedback b { font-weight: 900; }
.quiz-feedback .right { color: #1f7a1d; }
.quiz-feedback .wrong { color: #c0392b; }

/* Small phones */
@media (max-width: 360px) {
  .title { font-size: 22px; }
  .icon-btn { width: 34px; height: 34px; }
}
