:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef3ff;
  --text: #101828;
  --muted: #5d6678;
  --line: #d9e2f1;
  --navy: #0a2342;
  --blue: #1f67ff;
  --blue-2: #dbe7ff;
  --green: #1f8f5f;
  --yellow: #c98200;
  --gray: #667085;
  --red: #d92d20;
  --shadow: 0 20px 60px rgba(16, 24, 40, 0.10);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #dfeaff 0, rgba(223, 234, 255, 0) 34%), var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(246, 248, 252, 0.82);
  border-bottom: 1px solid rgba(217, 226, 241, 0.8);
}

.nav {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.25rem;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--navy);
  color: white;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(10, 35, 66, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 999px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--navy);
  background: var(--blue-2);
}

.hero,
.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 64px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 32px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

h1 {
  margin: 18px 0;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0 0 14px;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.17rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button,
button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 850;
  font-size: 0.98rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button.primary,
button.primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(31, 103, 255, 0.25);
}

.button.secondary,
button.secondary {
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.score-preview {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.preview-row {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 0.78fr);
  gap: 8px;
}

.preview-cell {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 12px;
  background: #edf1f7;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.preview-cell.green,
.cell.green {
  color: #fff;
  background: var(--green);
}

.preview-cell.yellow,
.cell.yellow {
  color: #211400;
  background: #ffd166;
}

.preview-cell.gray,
.cell.gray {
  color: #fff;
  background: var(--gray);
}

.section {
  padding: 40px 0;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 22px;
  align-items: start;
}

.game-card,
.info-card,
.mode-card,
.faq-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 36px rgba(16, 24, 40, 0.06);
}

.game-card {
  padding: 22px;
}

.game-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.mode-pill {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--blue);
  font-weight: 850;
  font-size: 0.85rem;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 14px 0 12px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcff;
  color: var(--text);
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 103, 255, 0.12);
}

.status {
  min-height: 28px;
  color: var(--muted);
  font-weight: 700;
}

.board {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.board-head,
.guess-row {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.9fr 0.85fr 0.7fr 0.8fr 0.9fr;
  gap: 8px;
  min-width: 760px;
}

.head-cell,
.cell {
  border-radius: 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-weight: 850;
  font-size: 0.82rem;
}

.head-cell {
  color: var(--muted);
  background: #f1f5fb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cell {
  background: #edf1f7;
  color: var(--navy);
  border: 1px solid rgba(217, 226, 241, 0.7);
}

.game-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.info-card {
  padding: 20px;
  position: sticky;
  top: 92px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.stat {
  background: #f5f8ff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 1.55rem;
  color: var(--navy);
}

.stat span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.mode-card,
.faq-card {
  padding: 20px;
}

.mode-card p,
.faq-card p,
.section-copy {
  color: var(--muted);
  line-height: 1.7;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 28px 0 42px;
  color: var(--muted);
}

.footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.small {
  font-size: 0.9rem;
  color: var(--muted);
}

.mini-grid-preview {
  display: grid;
  grid-template-columns: 0.92fr repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.mini-grid-preview > div {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 12px;
  background: #edf1f7;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.mini-grid-preview > div:nth-child(-n + 4),
.mini-grid-preview > div:nth-child(4n + 1) {
  background: var(--navy);
  color: #fff;
}

.wide-game-shell {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.55fr);
}

.tiki-game-card {
  overflow: hidden;
}

.tiki-scorebar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 18px;
}

.tiki-puzzle-title {
  margin-top: 8px;
}

.tiki-grid-wrap {
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.tiki-col-labels {
  display: grid;
  grid-template-columns: 150px repeat(3, minmax(150px, 1fr));
  gap: 10px;
  min-width: 680px;
  margin-bottom: 10px;
}

.tiki-board-row {
  display: grid;
  grid-template-columns: 150px minmax(480px, 1fr);
  gap: 10px;
  min-width: 680px;
}

.tiki-row-labels,
.tiki-board {
  display: grid;
  grid-template-rows: repeat(3, minmax(128px, auto));
  gap: 10px;
}

.tiki-board {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.tiki-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 14px;
  border-radius: 18px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 10px 22px rgba(10, 35, 66, 0.18);
}

.row-label {
  min-height: 128px;
}

.tiki-cell {
  width: 100%;
  min-height: 128px;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  box-shadow: none;
}

.tiki-cell strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.tiki-cell small,
.cell-coordinates {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.tiki-cell.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 103, 255, 0.12);
}

.tiki-cell.solved {
  background: #e8f8f0;
  border-color: rgba(31, 143, 95, 0.35);
}

.tiki-cell.solved strong {
  color: var(--green);
}

.selected-clue {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--navy);
  font-weight: 850;
}

.status[data-type="success"] {
  color: var(--green);
}

.status[data-type="error"] {
  color: var(--red);
}

.rank-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.rank-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rank-list strong {
  color: var(--navy);
  margin-right: 8px;
}

.rank-list span {
  display: inline-flex;
  margin-right: 8px;
  color: var(--navy);
  font-weight: 800;
}

.rank-list small {
  display: block;
  margin-top: 4px;
}

.mini-reveal {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  list-style: none;
  padding: 0;
}

.mini-reveal li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #edf1f7;
  font-weight: 850;
}

.mini-reveal span {
  color: var(--muted);
  font-size: 0.85rem;
}

.mini-reveal strong {
  color: var(--navy);
}

.who-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin: 16px 0;
  align-items: stretch;
}

.who-photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px;
  border-radius: 22px;
  background: var(--navy);
  color: #fff;
  text-align: center;
}

.who-silhouette {
  font-size: 4.2rem;
  line-height: 1;
  filter: blur(var(--blur, 14px));
  transition: filter 0.4s ease;
  user-select: none;
}

.who-photo-label {
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.who-show-photo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  color: rgba(255, 255, 255, 0.82);
}

.who-show-photo input {
  width: auto;
  accent-color: var(--blue);
}

.who-reveal h3,
.who-guesses h3 {
  margin: 0 0 12px;
}

.reveal-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reveal-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.reveal-item.hidden {
  background: #f1f4fa;
  color: var(--muted);
}

.reveal-item.shown {
  background: #e8f8f0;
  border-color: rgba(31, 143, 95, 0.32);
}

.reveal-label {
  font-weight: 800;
  color: var(--muted);
}

.reveal-item.shown .reveal-label {
  color: var(--navy);
}

.reveal-value {
  font-weight: 900;
  color: var(--navy);
}

.reveal-item.hidden .reveal-value {
  color: #aab2c2;
  letter-spacing: 0.1em;
}

.who-progress {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.who-guesses {
  margin-top: 18px;
}

.guess-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.guess-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.guess-item.correct {
  background: #e8f8f0;
  border-color: rgba(31, 143, 95, 0.32);
}

.guess-item.wrong {
  background: #fdf2f1;
  border-color: rgba(217, 45, 32, 0.18);
}

.guess-mark {
  font-weight: 900;
  font-size: 1.1rem;
}

.guess-item.correct .guess-mark {
  color: var(--green);
}

.guess-item.wrong .guess-mark {
  color: var(--red);
}

.guess-name {
  font-weight: 850;
  color: var(--navy);
}

.guess-item small {
  color: var(--muted);
  font-weight: 750;
}

.guess-empty {
  color: var(--muted);
  padding: 10px 0;
}

.mode-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.toggle-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 850;
  font-size: 0.85rem;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 920px) {
  .hero,
  .game-shell,
  .grid-3,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 38px;
  }

  .info-card {
    position: static;
  }
}

@media (max-width: 620px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .game-card,
  .info-card {
    padding: 16px;
  }
}
