/* Name 100 Women - bright editorial game UI */

:root {
  --paper: #fff8ee;
  --paper-warm: #ffe9c6;
  --ink: #241019;
  --muted: #705d63;
  --soft: #f9d7dc;
  --panel: #fffdf8;
  --panel-strong: #fff2d6;
  --line: #251019;
  --accent: #d3165f;
  --accent-dark: #8b0d3e;
  --accent-soft: #ffd5e4;
  --gold: #f5b82e;
  --success: #087f5b;
  --danger: #b4233a;
  --radius: 24px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --maxw: 1160px;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --display: Impact, "Arial Black", "Avenir Next Condensed", var(--font);
  --mono: "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  background:
    radial-gradient(circle at 8% 8%, rgba(211, 22, 95, 0.18), transparent 30%),
    radial-gradient(circle at 90% 4%, rgba(245, 184, 46, 0.32), transparent 28%),
    linear-gradient(135deg, var(--paper), #fff 48%, #ffe8ef 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(36, 16, 25, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 16, 25, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--accent); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

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

/* navigation */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 2px solid rgba(36, 16, 25, 0.14);
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brandmark:hover {
  color: var(--ink);
  text-decoration: none;
}

.brandmark .mark {
  width: 46px;
  height: 46px;
  display: block;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(3px 3px 0 rgba(36, 16, 25, 0.22));
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--ink);
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.topbar nav a:hover,
.topbar nav a.top-lead {
  border-color: var(--line);
  background: #fff;
  box-shadow: 3px 3px 0 rgba(36, 16, 25, 0.18);
}

/* hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: clamp(18px, 3vw, 28px);
  align-items: start;
  padding-top: clamp(24px, 4vw, 44px);
  padding-bottom: clamp(28px, 4vw, 44px);
  text-align: center;
}

.leaderboard-hero,
.leaderboard-page .hero,
.simple-page .hero {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
  justify-items: center;
  align-items: start;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  max-width: 860px;
}

.hero-head {
  display: grid;
  justify-items: center;
  max-width: 780px;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 18px;
  padding: 8px 13px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.035em;
  line-height: 0.94;
}

h1 {
  max-width: 9.5ch;
  font-family: var(--display);
  font-size: clamp(4rem, 7.2vw, 6.8rem);
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-hero h1,
.leaderboard-page h1,
.simple-page h1 {
  max-width: 12ch;
  font-size: clamp(3.5rem, 8vw, 6.8rem);
  margin-inline: auto;
}

.hero-sub {
  max-width: 38rem;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 650;
}

.hero-sub b,
.section strong { color: var(--ink); }

.rules-intro {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(100%, 900px);
}

.rules-intro h2 {
  font-size: clamp(2.3rem, 3.8vw, 3.4rem);
  text-transform: uppercase;
}

.play-btn {
  width: min(100%, 280px);
  min-width: 220px;
  margin-top: clamp(12px, 2.5vw, 26px);
  font-size: 1.45rem;
}

/* game panel */
.game-section {
  scroll-margin-top: 18px;
  padding-top: clamp(24px, 5vw, 54px);
  padding-bottom: clamp(32px, 6vw, 70px);
}

.game-shell {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  border: 3px solid var(--line);
  border-radius: 34px;
  background: var(--panel);
  box-shadow: 14px 14px 0 var(--ink);
  overflow: hidden;
  transform: rotate(1deg);
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(211, 22, 95, 0.07), transparent 30%),
    radial-gradient(circle at 95% 0%, rgba(245, 184, 46, 0.28), transparent 34%);
}

.score-ribbon {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 3px solid var(--line);
  background: var(--accent);
  color: #fff;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 18px 22px;
}

.stat + .stat { border-left: 3px solid var(--line); }

.label {
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.value {
  font-family: var(--mono);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-progress {
  background: var(--gold);
  color: var(--ink);
}

.stat-progress .label { color: rgba(36, 16, 25, 0.72); }

.game {
  position: relative;
  padding: 24px;
}

.game-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 28px;
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#best-score:empty { display: none; }

#guess-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

input {
  min-width: 0;
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 18px;
  font: 800 1rem var(--font);
  outline: none;
  box-shadow: inset 0 -4px 0 rgba(36, 16, 25, 0.08);
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

#name-input {
  padding: 18px 18px;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}

input::placeholder { color: #6e5660; }

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), inset 0 -4px 0 rgba(36, 16, 25, 0.08);
}

input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: #f4ecec;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 22px;
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: 18px;
  font: 950 1rem var(--font);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
}

.btn:hover { transform: translate(-1px, -1px); }

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
}

.btn-primary:hover { background: #ffd76c; }

.btn.play-btn {
  min-height: 76px;
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
}

.play-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 36px;
  margin-top: 14px;
}

#feedback {
  color: var(--muted);
  font-weight: 850;
}

#feedback:not(:empty) {
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
}

#give-up {
  flex: none;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  font: 900 0.9rem var(--font);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

#give-up:hover { color: var(--danger); }

#give-up:disabled {
  cursor: not-allowed;
  color: rgba(112, 93, 99, 0.58);
  text-decoration: none;
}

#found-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 12px;
  margin-top: 18px;
}

#found-list span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--accent-soft);
  border: 2px solid rgba(36, 16, 25, 0.82);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 850;
  animation: chip-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#result[hidden] { display: none; }

#result {
  margin-top: 22px;
  padding: 22px;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--line);
  border-radius: 24px;
  box-shadow: 8px 8px 0 rgba(211, 22, 95, 0.6);
}

#result h2,
#result-title {
  color: #fff;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  text-transform: uppercase;
}

#result-time {
  margin: 10px 0 18px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 950;
}

#share-preview {
  margin: 0 0 14px;
  color: #fff;
  font-weight: 850;
  line-height: 1.45;
}

.share-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.share-panel .btn {
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  border-color: #fff;
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.22);
  font-size: 0.92rem;
  white-space: nowrap;
}

.share-panel .share-link {
  min-width: 92px;
}

.share-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(36, 16, 25, 0.35);
}

.share-icon-x {
  background: #111;
  font-family: var(--mono);
}

.share-icon-reddit {
  background: #ff4500;
  font-size: 0.68rem;
}

.share-icon-facebook {
  background: #1877f2;
  font-family: Arial, sans-serif;
  font-size: 1rem;
}

.share-icon-whatsapp {
  background: #25d366;
  font-size: 0.58rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-actions #nickname-input {
  flex: 1 1 190px;
  padding: 14px 15px;
  border-color: #fff;
}

#submit-status {
  display: block;
  min-height: 22px;
  margin-top: 12px;
  color: #ffe8a8;
  font-weight: 850;
}

.ad-slot {
  min-height: 92px;
  margin-top: 34px;
  border: 2px dashed rgba(36, 16, 25, 0.24);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.35);
}

.hero > .ad-slot {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

/* content sections */
.content {
  padding: 42px 0 58px;
}

.about-page .content {
  max-width: 920px;
}

.about-page .section {
  text-align: center;
}

.about-page .section h2,
.about-page .section p {
  margin-inline: auto;
}

.section {
  padding: clamp(42px, 7vw, 74px) 0;
  border-top: 2px solid rgba(36, 16, 25, 0.14);
}

.section:first-child { border-top: 0; }

.section h2 {
  max-width: 780px;
  margin-bottom: 18px;
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 900;
  text-transform: uppercase;
}

.section p {
  max-width: 68ch;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.13rem);
  font-weight: 620;
}

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  gap: 24px;
  align-items: stretch;
}

.callout-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--gold);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(-2deg);
}

.callout-panel strong {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.callout-panel span {
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 8px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.rules-grid li {
  min-height: 132px;
  padding: 14px 16px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 22px;
  box-shadow: 5px 5px 0 rgba(36, 16, 25, 0.18);
  line-height: 1.25;
  font-weight: 950;
}

.rules-grid li strong {
  color: var(--ink);
}

.rules-grid li:nth-child(2n) { background: var(--panel-strong); }
.rules-grid li:nth-child(3n) { background: var(--accent-soft); }

.rules-grid li span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.rules-note {
  max-width: 72ch;
  margin: 2px auto 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.5vw, 1.08rem);
  font-weight: 700;
  line-height: 1.55;
}

.origin-section {
  min-height: 360px;
  display: grid;
  justify-items: center;
  align-items: center;
  padding-inline: clamp(24px, 7vw, 96px);
  text-align: center;
  border: 3px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(211, 22, 95, 0.9), rgba(211, 22, 95, 0.72)),
    var(--accent);
  box-shadow: 12px 12px 0 var(--ink);
}

.origin-section h2,
.origin-section p {
  color: #fff;
}

.origin-section p {
  max-width: 62ch;
  margin-inline: auto;
  color: #fff;
}

.named-section {
  text-align: center;
}

.named-section h2 {
  max-width: 880px;
  margin-inline: auto;
}

.ranked {
  counter-reset: rank;
  display: grid;
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.ranked li {
  counter-increment: rank;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 14px 20px 14px 68px;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 24px;
  box-shadow: 5px 5px 0 rgba(36, 16, 25, 0.18);
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  font-weight: 950;
  text-align: left;
}

.ranked li::before {
  content: counter(rank);
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.faq {
  max-width: 820px;
  margin-inline: auto;
}

.faq h2 {
  margin-inline: auto;
  text-align: center;
}

.faq details {
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 22px;
  box-shadow: 5px 5px 0 rgba(36, 16, 25, 0.14);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary:focus-visible {
  outline: 0;
  background: var(--accent-soft);
}

.faq summary::after {
  content: "+";
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-family: var(--mono);
  transition: transform 180ms ease;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p {
  max-width: 62ch;
  padding: 0 20px 18px;
  line-height: 1.65;
}

/* leaderboard */
.board-section {
  padding-top: 12px;
}

.leaderboard-list {
  display: grid;
  gap: 12px;
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: board;
}

.leaderboard-list li {
  counter-increment: board;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 20px;
  box-shadow: 5px 5px 0 rgba(36, 16, 25, 0.16);
  font-weight: 950;
}

.leaderboard-list li::before {
  content: counter(board);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.leaderboard-list .score-time {
  margin-left: auto;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* footer */
footer {
  padding: 30px 0 44px;
  border-top: 2px solid rgba(36, 16, 25, 0.14);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.footer-inner nav a {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.footer-inner nav a:hover { color: var(--accent); }

.copyright {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .game-shell {
    transform: none;
  }

  .callout-panel {
    transform: none;
  }
}

@media (max-width: 1020px) {
  h1 {
    max-width: 12ch;
  }

  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .wrap { padding-inline: 16px; }

  .topbar {
    min-height: 66px;
  }

  .brandmark .mark {
    width: 40px;
    height: 40px;
  }

  .topbar nav a:not(.top-lead) { display: none; }

  .hero {
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(3.8rem, 18vw, 5.8rem);
  }

  .hero-sub {
    max-width: 24rem;
  }

  .score-ribbon,
  #guess-form {
    grid-template-columns: 1fr;
  }

  .stat + .stat {
    border-left: 0;
    border-top: 3px solid var(--line);
  }

  .game {
    padding: 18px;
  }

  .game-topline,
  .play-meta,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .rules-grid li {
    min-height: auto;
  }

  .callout-panel,
  .origin-section,
  .game-shell {
    box-shadow: 7px 7px 0 var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
