/* Guessname's playful light world, inspired by the broad visual rhythm of Funbrain.
   This stylesheet is loaded after legacy page styles so every game shares one system. */
/* Nunito legacy boards use the local faces in showtime.css; no remote font request. */

:root {
  color-scheme: light;
  --bg: #72a5a0;
  --panel: #f8f5ef;
  --panel2: #fffdf8;
  --panel-deep: #f2ece2;
  --tile: #fffdf8;
  --tile-dark: #e9e3da;
  --line: #d8d0c5;
  --line-soft: #e5ded4;
  --text: #242221;
  --muted: #57534e;
  --quiet: #635e59;
  --accent: #087b78;
  --accent-ink: #fff;
  --accent-soft: #d7f3ef;
  --accent-border: #a8d9d3;
  --ambient: transparent;
  --error: #a93631;
  --green: #20764c;
  --red: #aa3433;
  --fb-teal: #2fc6bd;
  --fb-gold: #f4b95d;
  --fb-coral: #f16e63;
  --fb-ink: #25201f;
  --fb-paper: #f8f5ef;
  --fb-violet: #ac8cc6;
}
html { background: var(--bg); }
body,
body[data-ui] {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito Sans', 'Trebuchet MS', sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before,
body[data-ui]::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: 82px;
  background: var(--fb-ink);
  opacity: 1;
  mask-image: none;
  pointer-events: none;
}
body.did-win::after { background: radial-gradient(circle at center, rgba(47,198,189,.25), transparent 68%); }
body.did-lose::after { background: radial-gradient(circle at center, rgba(241,110,99,.22), transparent 68%); }
* { scrollbar-color: #4f8782 #e9e3da; }
::selection { background: #f9d475; color: var(--fb-ink); }
a { text-underline-offset: 3px; }
:where(a, button, input, select):focus-visible { outline: 3px solid #e99233; outline-offset: 3px; }
button { touch-action: manipulation; }

/* Persistent top region and page widths */
body[data-ui] :is(.app, .shell) { position: relative; width: min(100% - 32px, 1080px); margin-inline: auto; padding-top: 18px; }
body[data-ui="clue"] .app { max-width: 940px; }
body[data-ui="estimate"] .shell { max-width: 980px; }
body[data-ui] :is(.header, .top) { position: relative; z-index: 2; min-height: 50px; background: var(--fb-ink); }
body[data-ui] :is(.home, .top > .brand) { color: #fff; text-decoration: none; }
body[data-ui] .site-brand,
body[data-ui] :is(.home, .top > .brand) small { color: #7de0d4; font-family: 'Nunito Sans', sans-serif; font-weight: 1000; letter-spacing: .14em; }
body[data-ui="clue"] .header .brand,
body[data-ui="logo-play"] .top .brand strong { color: #fff; text-transform: none; letter-spacing: -.025em; font-family: 'Nunito Sans', sans-serif; }
body[data-ui] :is(.header .game-icon, .top .mark, .top .mark-icon) { box-shadow: none; transform: none; border: 3px solid #fff; border-radius: 13px; background: #fff; }
body[data-ui] .top .mark { color: var(--fb-ink); }
body[data-ui] :is(.language, .language-bar, .language-control) { color: #f2f1ef; }
body[data-ui] :is(.language, .language-bar, .language-control) :is(select, #directoryLanguage) {
  min-height: 39px;
  border: 1px solid #98d9d2;
  border-radius: 10px;
  background: #fffdf8;
  color: var(--fb-ink);
  font-weight: 800;
}
body[data-ui] .top .back { color: #eefaf8; }
body[data-ui] .game-directory-nav { margin-top: 18px; margin-bottom: 16px; }
body[data-ui] .game-directory-nav a {
  background: var(--fb-teal);
  color: var(--fb-ink);
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(24, 67, 65, .15);
}
body[data-ui] .game-directory-nav a:hover { background: #84e3d7; }
body[data-ui] .game-directory-nav a::after { border-color: var(--fb-ink); }

/* The seven ways to play remain visible throughout the site. */
body[data-ui] .section-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  position: relative;
  z-index: 1;
  gap: 8px;
  margin: 23px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}
body[data-ui="clue"] .app > .section-nav { grid-column: 1 / -1; }
body[data-ui="clue"].nav-ready .game-directory-nav { display: none; }
body[data-ui="logo-play"] .section-nav { grid-template-columns: repeat(7, minmax(0, 1fr)); }
body[data-ui] .section-nav a {
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid #235d59;
  border-radius: 999px;
  background: #e6f7ef;
  color: #173c3a;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(32, 75, 72, .12);
}
body[data-ui] .section-nav a:nth-child(2) { background: #fff0bd; color: #524018; }
body[data-ui] .section-nav a:nth-child(3) { background: #f0dff2; color: #4f3755; }
body[data-ui] .section-nav a:nth-child(4) { background: #e6e9ff; color: #343d67; }
body[data-ui] .section-nav a:nth-child(5) { background: linear-gradient(90deg,#ffe1ec 50%,#deedff 50%); color: #402b3d; }
body[data-ui] .section-nav a:nth-child(6) { background:#fff2cf; color:#513c18; }
body[data-ui] .section-nav a:nth-child(7) { background:#def0e9; color:#19483e; }
body[data-ui] .section-nav a:hover { background: #fff; color: var(--fb-ink); transform: translateY(-2px); }
body[data-ui] .section-nav a[aria-current] { background: var(--fb-teal); color: var(--fb-ink); border-color: #154d4a; }

/* Game directory: image-led tiles instead of monochrome rows. */
body[data-ui="directory"] .shell { max-width: 1080px; }
body[data-ui="directory"] .intro,
body[data-ui="logo-directory"] .intro {
  margin: 28px 0 18px;
  padding: 28px 30px;
  border-radius: 17px;
  background: var(--fb-paper);
  box-shadow: 0 12px 28px rgba(39, 71, 68, .14);
}
body[data-ui="directory"] .intro h1,
body[data-ui="logo-directory"] .intro h1 {
  color: var(--fb-ink);
  font-family: 'Nunito Sans', sans-serif;
  font-size: clamp(32px, 5vw, 50px);
  letter-spacing: -.025em;
}
body[data-ui="directory"] .intro p,
body[data-ui="logo-directory"] .intro p { color: #615c55; }
body[data-ui="logo-directory"] .intro .eyebrow { display: none; }
body[data-ui="directory"] .controls {
  padding: 22px;
  border: 0;
  border-radius: 15px;
  background: #f8f5ef;
  box-shadow: 0 9px 24px rgba(39, 71, 68, .11);
}
body[data-ui="directory"] .search-label { color: #514c47; }
body[data-ui="directory"] .search-input,
body[data-ui="directory"] .search-input::placeholder { color: #5c5a57; }
body[data-ui="directory"] .search-input { background: #fff; border: 2px solid #b5d7d1; }
body[data-ui] .results-head,
body[data-ui="directory"] .results-head { margin-top: 28px; color: #fff; }
body[data-ui="directory"] .results-head h2 { font-size: 26px; }
body[data-ui="directory"] #resultCount { color: #eaf8f6; }
body[data-ui="directory"] .game-list { gap: 15px; }
body[data-ui="directory"] .game,
body[data-ui="logo-directory"] .game {
  min-height: 120px;
  border: 0;
  border-radius: 15px;
  background: #f8f5ef;
  color: var(--fb-ink);
  box-shadow: 0 9px 23px rgba(31, 69, 66, .15);
  transition: transform .2s ease, box-shadow .2s ease;
}
body[data-ui="directory"] .game:hover,
body[data-ui="logo-directory"] .game:hover { transform: translateY(-4px); background: #fffdf8; box-shadow: 0 16px 30px rgba(31, 69, 66, .2); }
body[data-ui="directory"] .game-mark,
body[data-ui="logo-directory"] .crest { border-radius: 12px; overflow: hidden; background: #fff; }
body[data-ui="directory"] .game-name,
body[data-ui="logo-directory"] .copy strong { color: var(--fb-ink); font-family: 'Nunito Sans', sans-serif; font-weight: 1000; }
body[data-ui="directory"] .game-type,
body[data-ui="logo-directory"] .copy span { color: #685f59; }
body[data-ui="logo-directory"] .game-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
body[data-ui="logo-directory"] .game { min-height: 134px; }
body[data-ui="logo-directory"] .crest { flex-basis: 96px; width: 96px; height: 96px; }
body[data-ui="logo-directory"] .credit { color: #e7f4f2; }
body[data-ui="logo-directory"] .credit a { color: #fff; }

/* Number-game selection follows the same directory rhythm as the other sections. */
body[data-ui="estimate-directory"] .shell { max-width: 1080px; }
body[data-ui="estimate-directory"] .intro {
  background: var(--fb-paper);
  box-shadow: 0 12px 28px rgba(39, 71, 68, .14);
}
body[data-ui="estimate-directory"] .intro h1 {
  color: var(--fb-ink);
  font-family: 'Nunito Sans', sans-serif;
  font-size: clamp(32px, 5vw, 50px);
  letter-spacing: -.025em;
}
body[data-ui="estimate-directory"] .intro p { color: #615c55; }
body[data-ui="estimate-directory"] .game {
  background: var(--fb-paper);
  color: var(--fb-ink);
  box-shadow: 0 9px 23px rgba(31, 69, 66, .15);
  transition: transform .2s ease, box-shadow .2s ease;
}
body[data-ui="estimate-directory"] .game:hover {
  transform: translateY(-4px);
  background: #fffdf8;
  box-shadow: 0 16px 30px rgba(31, 69, 66, .2);
}
body[data-ui="estimate-directory"] .game::after { color: #46615d; }
body[data-ui="estimate-directory"] .copy strong {
  color: var(--fb-ink);
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 1000;
}
body[data-ui="estimate-directory"] .copy small { color: #685f59; }

/* Clue games use a warm play board inside the light content panel. */
body[data-ui="clue"] .app > section {
  padding: 0 27px 27px;
  border: 0;
  border-radius: 17px;
  background: var(--fb-paper);
  box-shadow: 0 18px 34px rgba(34, 73, 68, .2);
  overflow: hidden;
}
body[data-ui="clue"] .app > section::before { display: none; }
body[data-ui="clue"] .progress {
  margin: 0 -27px 20px;
  padding: 23px 27px;
  background: var(--fb-gold);
  align-items: center;
}
body[data-ui="clue"] .progress h2 { color: var(--fb-ink); font-family: 'Nunito Sans', sans-serif; letter-spacing: -.025em; text-transform: none; }
body[data-ui="clue"] .progress > span { border: 0; background: #fff3d0; color: #573e17; font-family: inherit; }
body[data-ui="clue"] .progress-track { background: #e6dfd5; border-radius: 8px; }
body[data-ui="clue"] .progress-track span { background: var(--fb-teal); box-shadow: none; }
body[data-ui="clue"] .clue {
  border: 1px solid #cfddd7;
  border-radius: 12px;
  background: #eff8f4;
  color: var(--fb-ink);
  box-shadow: none;
}
body[data-ui="clue"] .clue:nth-child(3n+2) { background: #fff1d4; border-color: #e5d8ba; }
body[data-ui="clue"] .clue:nth-child(3n) { background: #f1e8f2; border-color: #e2d5e5; }
body[data-ui="clue"] .clue:not(.locked)::before { display: none; }
body[data-ui="clue"] .clue.locked { background: #eae6df; border-color: #d8d2c9; }
body[data-ui="clue"] .clue.locked::after { background: linear-gradient(45deg, transparent 49%, #cbc5bb 50%); }
body[data-ui="clue"] .clue-number { color: #166d68; font-family: inherit; }
body[data-ui="clue"] .clue.locked .clue-number { color: #6d6861; }
body[data-ui="clue"] .clue-text { color: #282723; }
body[data-ui="clue"] .clue.locked .clue-text { color: #69645d; }
body[data-ui="clue"] .more {
  border: 0;
  border-radius: 999px;
  background: var(--fb-teal);
  color: var(--fb-ink);
  box-shadow: none;
}
body[data-ui="clue"] .more::before { background: #fff; color: #087b78; }
body[data-ui="clue"] .more:hover:not(:disabled) { background: #7ee0d4; border-color: transparent; }
body[data-ui="clue"] #guessForm { background: #fffdf8; border: 1px solid #ded6ca; }
body[data-ui="clue"] .guess-label,
body[data-ui="clue"] .result-status,
body[data-ui="clue"] .identity h3 { color: var(--fb-ink); font-family: 'Nunito Sans', sans-serif; }
body[data-ui="clue"] .guess button,
body[data-ui="clue"] .replay { background: var(--fb-teal); color: var(--fb-ink); box-shadow: 0 6px 16px rgba(16, 105, 99, .18); }
body[data-ui="clue"] .guess button:hover:not(:disabled),
body[data-ui="clue"] .replay:hover { background: #73e0d4; box-shadow: 0 8px 20px rgba(16, 105, 99, .22); }
body[data-ui="clue"] .note,
body[data-ui="clue"] .result-detail,
body[data-ui="clue"] .identity p,
body[data-ui="clue"] .identity a { color: #625c55; }
body[data-ui="clue"] .result-status.win { color: #087b78; }
body[data-ui="clue"] .portrait { max-width: 100%; object-fit: contain; border-color: #fff; box-shadow: 0 16px 34px rgba(49, 67, 59, .22); }
body[data-ui="clue"] .sound-credit,
body[data-ui="clue"] .sound-credit a { color: #fff; }

/* Logo games: a full, intact badge on the gold stage and a clean answer desk. */
body[data-ui="logo-play"] .shell { max-width: 1080px; }
body[data-ui="logo-play"] .hero {
  margin: 28px 0 16px;
  padding: 26px 30px;
  border-radius: 16px;
  background: var(--fb-paper);
}
body[data-ui="logo-play"] .hero .eyebrow { display: none; }
body[data-ui="logo-play"] .hero h1 { color: var(--fb-ink); font-family: 'Nunito Sans', sans-serif; font-size: clamp(31px,5vw,49px); letter-spacing: -.025em; text-transform: none; }
body[data-ui="logo-play"] .hero p:last-child { color: #5e5750; }
body[data-ui="logo-play"] .country-row button { background: #fff8ec; color: #4c3e2e; border: 1px solid #bcaca0; }
body[data-ui="logo-play"] .country-row button[aria-pressed=true] { background: var(--fb-teal); color: var(--fb-ink); border-color: #176c67; }
body[data-ui="logo-play"] .arena {
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 17px;
  background: var(--fb-paper);
  box-shadow: 0 18px 36px rgba(34, 73, 68, .2);
  overflow: hidden;
}
body[data-ui="logo-play"] .badge-stage { min-height: 0; padding: 16px; border: 0; border-radius: 0; background: var(--fb-gold); }
body[data-ui="logo-play"] .badge-stage::before { display: none; }
body[data-ui="logo-play"] .badge-art { width: min(100%, 260px); max-width: 100%; box-shadow: 0 14px 25px rgba(97, 64, 31, .18); }
body[data-ui="logo-play"] .badge-art.landscape { width: min(100%, 360px); }
body[data-ui="logo-play"] .picture {
  position: relative;
  display: block;
  width: min(100%, 420px);
  max-width: 100%;
  height: clamp(190px, 38vh, 320px);
}
body[data-ui="logo-play"] .picture img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}
body[data-ui="logo-play"] .badge-art img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
body[data-ui="logo-play"] .play { padding: 26px; }
body[data-ui="logo-play"] .round,
body[data-ui="logo-play"] .streak,
body[data-ui="logo-play"] .sub { color: #5d554d; }
body[data-ui="logo-play"] .play h2,
body[data-ui="logo-play"] .result h3 { color: var(--fb-ink); font-family: 'Nunito Sans', sans-serif; letter-spacing: -.025em; text-transform: none; }
body[data-ui="logo-play"] .picker input { border: 2px solid #b5d4cf; background: #fff; }
body[data-ui="logo-play"] .submit,
body[data-ui="logo-play"] .next { background: var(--fb-teal); color: var(--fb-ink); }
body[data-ui="logo-play"] .submit:hover,
body[data-ui="logo-play"] .next:hover { background: #7ee0d4; }
body[data-ui="logo-play"] .skip { background: #fff; color: #3d3935; border-color: #bfb8af; }
body[data-ui="logo-play"] .result { background: #e6f7f2; border-color: #b6d9d1; }
body[data-ui="logo-play"] .result p { color: #544f49; }
body[data-ui="logo-play"] :is(.foot,.credit,.foot a,.credit a) { color: #f4fffc; }

/* Number games: visible question, response, score and distribution remain intact. */
body[data-ui="estimate"] .intro {
  margin: 27px 0 18px;
  padding: 24px 28px;
  border-radius: 16px;
  background: var(--fb-paper);
}
body[data-ui="estimate"] .intro h1 { color: var(--fb-ink); font-family: 'Nunito Sans', sans-serif; letter-spacing: -.025em; }
body[data-ui="estimate"] .intro p { color: #5b544d; }
body[data-ui="estimate"] .estimate-mode {
  border: 0;
  border-radius: 13px;
  background: var(--fb-paper);
  color: var(--fb-ink);
  box-shadow: 0 7px 19px rgba(34, 73, 68, .13);
}
body[data-ui="estimate"] .estimate-mode:hover { background: #fff; }
body[data-ui="estimate"] .estimate-mode[aria-current] { background: #fff2ca; box-shadow: inset 0 0 0 3px #d8963b, 0 7px 19px rgba(34, 73, 68, .12); }
body[data-ui="estimate"] .estimate-mode-title { color: #27221d; }
body[data-ui="estimate"] .estimate-mode-desc { color: #625b55; }
body[data-ui="estimate"] .estimate-modes { display: none; }
body[data-ui="estimate"] .game {
  border: 0;
  border-radius: 17px;
  background: var(--fb-paper);
  box-shadow: 0 18px 34px rgba(34, 73, 68, .18);
}
body[data-ui="estimate"] .game-head { background: var(--fb-gold); border-color: #d5a050; color: #3a2c1b; font-weight: 900; }
body[data-ui="estimate"] .progress li { background: #ddd4c8; }
body[data-ui="estimate"] .progress li.done { background: #73c9bd; }
body[data-ui="estimate"] .progress li.current { background: #138c83; }
body[data-ui="estimate"] .topic { border: 0; background: #e5f5f0; color: #136f68; }
body[data-ui="estimate"] .question { color: var(--fb-ink); font-family: 'Nunito Sans', sans-serif; font-weight: 1000; letter-spacing: -.025em; }
body[data-ui="estimate"] :is(.unit-note,.result p,.finish p,.foot) { color: #5c554f; }
body[data-ui="estimate"] .entry { background: #fff; border: 2px solid #a6d2cb; }
body[data-ui="estimate"] .entry input { color: var(--fb-ink); }
body[data-ui="estimate"] .entry .unit { color: #5d554d; }
body[data-ui="estimate"] .input-error { color: #a93631; }
body[data-ui="estimate"] .primary { background: var(--fb-teal); color: var(--fb-ink); }
body[data-ui="estimate"] .primary:hover { background: #7ee0d4; }
body[data-ui="estimate"] .result { border-color: #d8d0c5; }
body[data-ui="estimate"] .result-grid div { border: 0; background: #e8f5ef; }
body[data-ui="estimate"] .result-grid span { color: #5a554d; }
body[data-ui="estimate"] .result-grid strong,
body[data-ui="estimate"] .result h3,
body[data-ui="estimate"] .finish h2,
body[data-ui="estimate"] .finish .final-score { color: var(--fb-ink); }
body[data-ui="estimate"] .source { color: #075b57; font-weight: 800; }
body[data-ui="estimate"] .community { border: 0; background: #e9e4da; }
body[data-ui="estimate"] .community-status,
body[data-ui="estimate"] .stats-note { color: #5e5851; }
body[data-ui="estimate"] .donut { background: #c6c0b4; }
body[data-ui="estimate"] .donut-center { background: var(--fb-paper); }
body[data-ui="estimate"] .donut-center span,
body[data-ui="estimate"] .distribution th { color: #5d5751; }
body[data-ui="estimate"] .distribution td { border-color: #cdc5b9; }
body[data-ui="estimate"] .distribution tr.mine { background: #d7f2ec; }
body[data-ui="estimate"] .foot a { color: #fff; }

@media (max-width: 900px) and (min-width: 521px) {
  body[data-ui] .section-nav,
  body[data-ui="logo-play"] .section-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body[data-ui] :is(.app,.shell) { width: min(100% - 24px,1080px); }
  body[data-ui="directory"] .game-list,
  body[data-ui="logo-directory"] .game-list,
  body[data-ui="estimate-directory"] .game-list { grid-template-columns: 1fr; }
  body[data-ui="logo-play"] .arena { display: block; }
  body[data-ui="logo-play"] .badge-stage { min-height: 0; padding: 12px; }
  body[data-ui="logo-play"] .badge-art { width: min(100%, 230px); }
  body[data-ui="logo-play"] .badge-art.landscape { width: min(100%, 320px); }
  body[data-ui="logo-play"] .picture { width: min(100%, 380px); height: clamp(180px, 32vh, 270px); }
  body[data-ui="logo-play"] .play { padding: 22px; }
}
@media (max-width: 520px) {
  body::before,body[data-ui]::before { height: 113px; }
  body[data-ui] :is(.header,.top) { min-height: 82px; }
  body[data-ui] .section-nav,
  body[data-ui="logo-play"] .section-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 15px; }
  body[data-ui] .section-nav a:nth-child(5) { grid-column: auto; }
  body[data-ui] .section-nav a { min-height: 44px; padding: 7px 5px; font-size: 11px; }
  body[data-ui="clue"] .app > section { padding: 0 15px 17px; }
  body[data-ui="clue"] .progress { margin: 0 -15px 16px; padding: 18px 15px; }
  body[data-ui="clue"] .progress h2 { font-size: 24px; }
  body[data-ui="directory"] .intro,
  body[data-ui="logo-directory"] .intro,
  body[data-ui="estimate-directory"] .intro,
  body[data-ui="logo-play"] .hero,
  body[data-ui="estimate"] .intro { padding: 19px; }
  body[data-ui="logo-directory"] .crest { flex-basis: 82px; width: 82px; height: 82px; }
  body[data-ui="estimate"] .estimate-modes { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-ui] .game,
  body[data-ui="estimate-directory"] .game,
  body[data-ui] .section-nav a { transition: none; }
}

body[data-ui="logo-directory"] .game .copy {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.suggestion-empty {
  padding: 10px 13px;
  color: #4b4b52;
  font-size: 13px;
}
