:root {
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --pink: #ec4899;
  --violet: #8b5cf6;
  --cream: #fff8e7;
  --ink: #1e1b4b;
  --ink-soft: #4c4787;
  --muted: #6b6892;
  --white: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.78);
  --card-border: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 4px 12px rgba(35, 25, 90, 0.08);
  --shadow-md: 0 10px 30px rgba(35, 25, 90, 0.12);
  --shadow-lg: 0 20px 50px rgba(35, 25, 90, 0.18);
  --shadow-3d: 0 6px 0 rgba(0,0,0,0.12), 0 14px 30px rgba(99, 102, 241, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 50%, #dbeafe 100%);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Background blobs */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite;
}
.blob-a {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--violet), transparent 70%);
  top: -120px; left: -80px;
}
.blob-b {
  width: 380px; height: 380px;
  background: radial-gradient(circle, var(--pink), transparent 70%);
  bottom: -80px; right: -60px;
  animation-delay: -6s;
}
.blob-c {
  width: 340px; height: 340px;
  background: radial-gradient(circle, #60a5fa, transparent 70%);
  top: 40%; left: 60%;
  animation-delay: -12s;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.05); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

/* Topbar */
.topbar {
  padding: 1rem 0 0.25rem;
}
.games-nav {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
}
.games-nav-inner {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.55rem 0;
  scrollbar-width: thin;
}
.games-nav-inner::-webkit-scrollbar { height: 6px; }
.games-nav-inner::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25); border-radius: 3px;
}
.games-nav-inner a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.games-nav-inner a:hover {
  color: var(--indigo-dark);
  background: rgba(99, 102, 241, 0.08);
}
.games-nav-inner a.active {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}
.topbar-inner {
  display: flex;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-tile {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  color: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  box-shadow: 0 4px 0 rgba(99, 102, 241, 0.5), 0 10px 18px rgba(99, 102, 241, 0.35);
  transform: rotate(-4deg);
}
.brand-text {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand-text span {
  color: var(--indigo-dark);
}

/* Hero */
.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.hero-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--indigo-dark) 0%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.4),
    0 6px 14px rgba(99, 102, 241, 0.18);
}
.hero-sub {
  margin: 0.6rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* Tabs */
.tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 0.35rem;
  margin: 0.5rem auto 1.5rem;
  box-shadow: var(--shadow-sm);
  gap: 0.25rem;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.tab:hover { color: var(--ink); }
.tab-active {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}
.tab-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
}
.tab-active .tab-icon {
  background: rgba(255, 255, 255, 0.3);
}

/* Panels */
.panel {
  animation: fadeIn 0.3s ease;
}
.panel[hidden] { display: none !important; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tilt:hover {
  transform: translateY(-3px) rotateX(1deg);
  box-shadow: 0 30px 70px rgba(35, 25, 90, 0.22);
}

/* Input row */
.input-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.input-wrap {
  flex: 1 1 320px;
  position: relative;
}
.input-wrap input {
  width: 100%;
  padding: 0.95rem 2.5rem 0.95rem 1.1rem;
  border: 2px solid rgba(99, 102, 241, 0.15);
  border-radius: 14px;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(35, 25, 90, 0.04);
}
.input-wrap input::placeholder { color: #a8a4d1; }
.input-wrap input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(99, 102, 241, 0.1);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.15s;
}
.clear-btn:hover {
  background: var(--indigo);
  color: #fff;
}

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  color: #fff;
  border: none;
  padding: 0 1.6rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Fredoka", sans-serif;
  cursor: pointer;
  min-height: 52px;
  box-shadow: var(--shadow-3d);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0,0,0,0.12), 0 18px 38px rgba(99, 102, 241, 0.42);
}
.primary-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12), 0 6px 14px rgba(99, 102, 241, 0.35);
}
.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.primary-btn-lg {
  padding: 0 2.2rem;
  min-height: 60px;
  font-size: 1.1rem;
}
.primary-btn-alt {
  background: linear-gradient(135deg, var(--pink) 0%, #f97316 100%);
  box-shadow: 0 6px 0 rgba(0,0,0,0.12), 0 14px 30px rgba(236, 72, 153, 0.35);
}
.primary-btn-alt:hover {
  box-shadow: 0 8px 0 rgba(0,0,0,0.12), 0 18px 38px rgba(236, 72, 153, 0.45);
}

.oracle-mode-choice {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.ghost-btn {
  background: transparent;
  border: 2px solid rgba(99, 102, 241, 0.3);
  color: var(--indigo-dark);
  padding: 0 1.3rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: "Fredoka", sans-serif;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.15s;
}
.ghost-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--indigo);
}

/* Advanced options */
.advanced-options {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(99, 102, 241, 0.2);
}
.advanced-options summary {
  cursor: pointer;
  color: var(--indigo-dark);
  font-weight: 600;
  list-style: none;
  padding: 0.25rem 0;
  font-family: "Fredoka", sans-serif;
}
.advanced-options summary::-webkit-details-marker { display: none; }
.advanced-options summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.2s;
  color: var(--indigo);
}
.advanced-options[open] summary::before { content: "▾ "; }

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}
.options-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 0.3rem;
  font-weight: 500;
}
.options-grid label span { font-weight: 600; color: var(--ink-soft); }
.options-grid input,
.options-grid select {
  padding: 0.6rem 0.75rem;
  border: 2px solid rgba(99, 102, 241, 0.12);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
}
.options-grid input:focus,
.options-grid select:focus {
  outline: none;
  border-color: var(--indigo);
}

/* Results */
.results {
  margin-top: 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 1.5rem;
  min-height: 90px;
  box-shadow: var(--shadow-md);
}
.results-placeholder {
  color: var(--muted);
  margin: 0;
  text-align: center;
  font-style: italic;
}
.results-summary {
  margin: 0 0 0.6rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.length-group { margin-top: 1.1rem; }
.length-group h3 {
  margin: 0 0 0.55rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: var(--indigo-dark);
}
.word-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.word-list li {
  background: linear-gradient(135deg, #eef2ff 0%, #fae8ff 100%);
  color: var(--indigo-dark);
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: transform 0.15s;
}
.word-list li:hover {
  transform: translateY(-2px) scale(1.05);
}
.loading {
  color: var(--muted);
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* ORACLE */
.oracle-card {
  text-align: center;
}
.oracle-intro h2,
.reading-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.85rem;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--violet) 0%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.oracle-blurb {
  color: var(--ink-soft);
  margin: 0 auto 1.5rem;
  max-width: 460px;
}
.oracle-orb {
  width: 110px;
  height: 110px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, #c7d2fe 30%, var(--violet) 70%, var(--indigo-dark) 100%);
  box-shadow:
    inset -10px -10px 25px rgba(35, 25, 90, 0.35),
    0 18px 35px rgba(139, 92, 246, 0.5);
  position: relative;
  animation: orbPulse 3s ease-in-out infinite;
}
.orb-inner {
  position: absolute;
  top: 18%;
  left: 22%;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, rgba(255,255,255,0.85), transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); box-shadow: inset -10px -10px 25px rgba(35, 25, 90, 0.35), 0 18px 35px rgba(139, 92, 246, 0.5); }
  50%      { transform: scale(1.04); box-shadow: inset -10px -10px 25px rgba(35, 25, 90, 0.35), 0 22px 45px rgba(236, 72, 153, 0.55); }
}

.oracle-step {
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}
.oracle-words {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}
.oracle-row {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.oracle-row.solved {
  background: linear-gradient(135deg, #d1fae5 0%, #ecfccb 100%);
  border-color: rgba(16, 185, 129, 0.4);
}
.oracle-row.wrong {
  background: linear-gradient(135deg, #fee2e2 0%, #fef3c7 100%);
  border-color: rgba(239, 68, 68, 0.35);
}
.scrambled-tiles {
  display: flex;
  gap: 0.35rem;
  perspective: 600px;
}
.tile {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 44px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 100%);
  border-radius: 8px;
  border: 1px solid rgba(180, 140, 50, 0.25);
  box-shadow:
    inset 0 -3px 0 rgba(180, 140, 50, 0.25),
    0 4px 0 rgba(180, 140, 50, 0.35),
    0 8px 14px rgba(180, 140, 50, 0.2);
  transform: rotateX(8deg);
  transition: transform 0.2s;
}
.tile:nth-child(odd)  { transform: rotateX(8deg) rotate(-2deg); }
.tile:nth-child(even) { transform: rotateX(8deg) rotate(2deg); }
.tile:hover { transform: rotateX(0deg) translateY(-2px) scale(1.05); }

.oracle-row input {
  flex: 1 1 200px;
  padding: 0.7rem 0.9rem;
  border: 2px solid rgba(99, 102, 241, 0.18);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  text-transform: lowercase;
}
.oracle-row input:focus { border-color: var(--indigo); }
.oracle-row.solved input { background: #f0fdf4; border-color: rgba(16, 185, 129, 0.4); }
.oracle-row .check-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.oracle-row.solved .check-mark {
  background: #10b981; color: #fff;
}
.oracle-row.wrong .check-mark {
  background: #f59e0b; color: #fff;
}

.oracle-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Decode-mine inputs */
.read-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.read-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.read-row.decoded-ok {
  background: linear-gradient(135deg, #d1fae5 0%, #ecfccb 100%);
  border-color: rgba(16, 185, 129, 0.4);
}
.read-row.decoded-fail {
  background: linear-gradient(135deg, #fee2e2 0%, #fef3c7 100%);
  border-color: rgba(239, 68, 68, 0.3);
}
.read-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  color: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.read-input {
  flex: 1 1 180px;
  padding: 0.6rem 0.8rem;
  border: 2px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.read-input:focus { border-color: var(--indigo); }
.read-row.decoded-ok .read-input { background: #f0fdf4; border-color: rgba(16, 185, 129, 0.4); }
.decoded {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--indigo-dark);
  min-width: 90px;
  text-align: right;
}
.decoded.fail { color: #b91c1c; font-size: 0.85rem; }

.oracle-reading {
  animation: revealUp 0.6s ease;
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.reading-block {
  padding: 1.2rem;
  border-radius: 18px;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transform: perspective(800px) rotateX(2deg);
  transition: transform 0.3s;
}
.reading-block:hover { transform: perspective(800px) rotateX(0) translateY(-3px); }
.reading-mood {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.reading-future {
  background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
  border: 1px solid rgba(124, 58, 237, 0.2);
}
.reading-awareness {
  background: linear-gradient(135deg, #bae6fd 0%, #a5f3fc 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
}
.reading-label {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.reading-block p {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.5;
  font-weight: 500;
}
.reading-score {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
  font-style: italic;
}

.oracle-statement {
  margin: 0.5rem auto 1.25rem;
  max-width: 620px;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(237,233,254,0.85) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 18px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
  position: relative;
}
.oracle-statement::before {
  content: "“";
  position: absolute;
  top: -0.4rem;
  left: 0.6rem;
  font-family: "Fredoka", serif;
  font-size: 3rem;
  line-height: 1;
  color: rgba(139, 92, 246, 0.35);
}
.oracle-statement .stmt-intro {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: var(--indigo-dark);
  margin: 0 0 0.6rem;
}
.oracle-statement .stmt-line {
  margin: 0.15rem 0;
  color: var(--ink-soft);
}
.oracle-statement .stmt-line strong {
  color: var(--ink);
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
}
.oracle-statement .stmt-close {
  margin: 0.75rem 0 0;
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  color: var(--ink);
}

/* Ad slot — fixed-size, neutral container. Invisible until an ad
   serves so the page never looks like it has an overlay. Sized to
   the standard 728x90 leaderboard on desktop and 320x50 banner on
   narrow screens. */
.ad-slot {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 1.75rem auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-slot ins.adsbygoogle {
  display: block;
  width: 728px;
  height: 90px;
}
@media (max-width: 740px) {
  .ad-slot { max-width: 320px; height: 50px; }
  .ad-slot ins.adsbygoogle { width: 320px; height: 50px; }
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 2rem;
}
.footer-links {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.footer-links a:hover { color: var(--indigo-dark); }
.copyright {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Policy pages */
.policy h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.25rem;
  color: var(--indigo-dark);
  margin: 1.4rem 0 0.5rem;
}
.policy h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 1rem 0 0.4rem;
}
.policy p, .policy ul, .policy ol { color: var(--ink); }
.policy a { color: var(--indigo-dark); font-weight: 600; }
.policy code {
  background: rgba(99,102,241,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--indigo-dark);
}
.policy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
}
.policy-table th, .policy-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(99,102,241,0.12);
  vertical-align: top;
}
.policy-table thead th {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(99,102,241,0.06);
}
.policy-table tbody tr:nth-child(even) td { background: rgba(99,102,241,0.03); }
.policy .muted { color: var(--muted); font-size: 0.88rem; }

/* Game helpers */
.game-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.game-row label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--ink-soft);
  gap: 0.25rem;
  font-weight: 600;
}
.game-row input,
.game-row select {
  padding: 0.7rem 0.85rem;
  border: 2px solid rgba(99, 102, 241, 0.15);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.game-row input:focus,
.game-row select:focus { border-color: var(--indigo); }

.help {
  margin: 0 0 0.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Wordle-style cells */
.wordle-row {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.5rem 0 1rem;
  perspective: 600px;
}
.wordle-cell {
  width: 52px;
  height: 60px;
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  background: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
  outline: none;
  box-shadow: 0 3px 0 rgba(0,0,0,0.06);
  transform: rotateX(4deg);
}
.wordle-cell:focus { border-color: var(--indigo); }

/* Spelling Bee (audio) — big speak button */
.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--pink) 0%, var(--violet) 100%);
  color: #fff;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: "Fredoka", sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0,0,0,0.12), 0 14px 30px rgba(236, 72, 153, 0.35);
  transition: transform 0.15s;
}
.speak-btn:hover { transform: translateY(-2px); }
.speak-btn .ico {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  font-size: 1rem;
}

/* Hangman gallows + alphabet */
.hangman-figure {
  font-family: "Fredoka", monospace;
  white-space: pre;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}
.hangman-word {
  text-align: center;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 0.4em;
  margin: 0.5rem 0 1rem;
  color: var(--ink);
}
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  gap: 0.35rem;
  max-width: 520px;
  margin: 0 auto;
}
.alpha-btn {
  padding: 0.5rem 0;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s;
}
.alpha-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--indigo);
}
.alpha-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(99, 102, 241, 0.05);
}
.alpha-btn.hit {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #10b981;
  color: #047857;
}
.alpha-btn.miss {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #ef4444;
  color: #b91c1c;
}

/* Ladder result */
.ladder-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.ladder-list li {
  background: linear-gradient(135deg, #eef2ff 0%, #fae8ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.4rem 1.2rem;
  border-radius: 10px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--indigo-dark);
  text-transform: uppercase;
}

/* Mini crossword */
.crossword-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 640px) {
  .crossword-wrap { grid-template-columns: 1fr; justify-items: center; }
}
.crossword-grid {
  --cell: clamp(28px, calc(min(420px, 90vw) / var(--cw-cols, 5)), 48px);
  display: grid;
  grid-template-columns: repeat(var(--cw-cols, 5), var(--cell));
  grid-template-rows: repeat(var(--cw-rows, 5), var(--cell));
  gap: 2px;
  background: rgba(99,102,241,0.25);
  padding: 2px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.cw-cell {
  background: #fff;
  position: relative;
  border-radius: 4px;
}
.cw-cell.cw-black { background: #1e1b4b; }
.cw-num {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--ink-soft);
  pointer-events: none;
}
.cw-cell input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: calc(var(--cell, 48px) * 0.55);
  text-transform: uppercase;
  color: var(--ink);
  outline: none;
  padding: 0;
}
.cw-num { font-size: calc(var(--cell, 48px) * 0.22); }
.cw-cell input.cw-active-word { background: rgba(99,102,241,0.12); }
.cw-cell input.cw-right { color: #047857; }
.cw-cell input.cw-wrong { color: #b91c1c; background: #fee2e2; }
.cw-cell input:focus { background: rgba(99,102,241,0.22); }

.crossword-clues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 0.92rem;
}
@media (max-width: 640px) {
  .crossword-clues { grid-template-columns: 1fr; }
}
.clue-group h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
  color: var(--indigo-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.clue-group ol {
  list-style: none;
  margin: 0; padding: 0;
}
.clue-group li {
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  border-radius: 6px;
  color: var(--ink);
}
.clue-group li:hover { background: rgba(99,102,241,0.08); }
.clue-group .cl-num { font-family: "Fredoka", sans-serif; font-weight: 700; color: var(--indigo-dark); margin-right: 0.25rem; }
.cw-status { text-align: center; margin: 0.75rem 0 0; min-height: 1.5rem; }

/* Status pills */
.pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
}
.pill-ok { background: #d1fae5; color: #047857; }
.pill-bad { background: #fee2e2; color: #b91c1c; }
.pill-info { background: #dbeafe; color: #1e40af; }

/* Mobile */
@media (max-width: 600px) {
  .card { padding: 1.25rem; }
  .input-wrap input { font-size: 1rem; }
  .primary-btn { width: 100%; }
  .tab { padding: 0.5rem 0.9rem; font-size: 0.9rem; }
  .tile { width: 32px; height: 38px; font-size: 1.1rem; }
}
