:root {
  --ink: #17152e;
  --muted: #68657d;
  --paper: #f7f4ed;
  --card: #fffdfa;
  --line: #ddd8cd;
  --violet: #5b46d8;
  --violet-dark: #31248d;
  --coral: #ff6c5f;
  --gold: #f1bd54;
  --mint: #b9ead9;
  --shadow: 0 22px 55px rgba(34, 28, 85, .11);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 4%, rgba(185,234,217,.55), transparent 25rem),
    radial-gradient(circle at 94% 8%, rgba(255,108,95,.14), transparent 22rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.site-header, .shell, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23,21,46,.1);
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 12px 12px 12px 3px; color: #fff; background: var(--violet); transform: rotate(-5deg); }
nav { display: flex; align-items: center; gap: 8px; }
.nav-link, .language-button { border: 0; background: transparent; padding: 10px 13px; color: var(--muted); font-weight: 700; }
.nav-link { text-decoration: none; border-radius: 999px; }
.nav-link:hover { color: var(--violet); background: rgba(91,70,216,.07); }
.nav-link.active { color: var(--ink); }
.language-control { position: relative; }
.language-button { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--violet); border-radius: 999px; background: var(--card); color: var(--ink); box-shadow: 0 4px 14px rgba(91,70,216,.12); }
.language-button strong { color: var(--violet); }
.language-button small { margin-left: 3px; padding-left: 8px; border-left: 1px solid var(--line); color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.language-button:hover { color: #fff; background: var(--violet); }
.language-button:hover strong, .language-button:hover small { color: #fff; }
.language-button:hover small { border-left-color: rgba(255,255,255,.35); }
.language-menu { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; min-width: 180px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.language-menu[hidden] { display: none; }
.language-menu button { width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; font-weight: 750; }
.language-menu button:hover, .language-menu button.active { color: var(--violet-dark); background: #f0edff; }
.language-menu button.active::after { content: '✓'; float: right; color: var(--violet); }

.game-switcher { width: min(1180px, calc(100% - 40px)); margin: 16px auto 0; display: grid; grid-template-columns: auto repeat(3, 1fr); align-items: center; gap: 8px; }
.game-switcher > span { padding-right: 9px; color: var(--muted); font-size: .68rem; letter-spacing: .13em; font-weight: 900; }
.game-switcher a { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.5); text-decoration: none; font-weight: 800; }
.game-switcher a strong { color: var(--violet); font-size: .7rem; letter-spacing: .08em; }
.game-switcher a:hover { border-color: var(--violet); }
.game-switcher a.active { color: #fff; border-color: var(--violet); background: var(--violet); box-shadow: 0 8px 22px rgba(91,70,216,.18); }
.game-switcher a.active strong { color: var(--mint); }

.shell { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(290px, .8fr); gap: 34px; padding-block: 46px 38px; }
.game-column { min-width: 0; }
.eyebrow-row, .title-row, .section-heading, .action-row, .result-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.eyebrow { margin: 0; font-size: .75rem; line-height: 1.4; letter-spacing: .13em; font-weight: 850; color: var(--violet); }
.streak-pill { display: flex; gap: 7px; align-items: center; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); color: var(--muted); font-size: .85rem; }
.streak-pill span:first-child { color: var(--coral); }
.title-row { align-items: flex-end; margin: 20px 0 28px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 7vw, 5.7rem); line-height: .88; letter-spacing: -.06em; margin: 0; font-weight: 600; }
h1 em { color: var(--violet); font-weight: inherit; }
.intro { color: var(--muted); margin: 18px 0 0; font-size: 1.04rem; }
.score-dial { flex: 0 0 104px; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--ink); color: #fff; box-shadow: 0 0 0 7px var(--mint); }
.score-dial span { font: 700 1.7rem/1 Georgia, serif; }
.score-dial small { font-size: .57rem; letter-spacing: .12em; margin-top: 5px; color: var(--mint); }

.puzzle-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 30px; box-shadow: var(--shadow); overflow: hidden; }
.trail-line { height: 5px; border-radius: 99px; background: #ebe7df; overflow: hidden; margin-bottom: 24px; }
.trail-progress { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, var(--violet), var(--coral)); transition: width .35s ease; }
.clues { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 11px; counter-reset: clues; }
.clues li { counter-increment: clues; display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; padding: 13px 14px; border-radius: 14px; background: #f3f0e9; color: var(--ink); line-height: 1.45; animation: clueIn .35s ease both; }
.clues li::before { content: counter(clues); display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 800; }
@keyframes clueIn { from { opacity: 0; transform: translateY(8px); } }
.guess-form label { display: block; font-weight: 800; margin-bottom: 10px; }
.guess-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input { min-width: 0; border: 1px solid #c9c4b9; border-radius: 13px; background: #fff; padding: 15px 16px; color: var(--ink); font-size: 1rem; outline: none; }
input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(91,70,216,.14); }
.primary-button, .secondary-button, .reveal-button { border-radius: 13px; padding: 13px 17px; font-weight: 800; }
.primary-button { border: 1px solid var(--violet); color: #fff; background: var(--violet); }
.primary-button:hover { background: var(--violet-dark); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.reveal-button { border: 0; color: var(--violet); background: transparent; padding-inline: 0; }
.action-row { margin-top: 12px; }
.attempts, .feedback { color: var(--muted); font-size: .88rem; margin: 0; }
.feedback { min-height: 1.3em; margin-top: 13px; font-weight: 700; }
.feedback.error { color: #b02d3c; }
.result-panel { padding: 22px; border-radius: 17px; background: #eeebe5; }
.result-panel h2 { font: 600 2rem/1.1 Georgia, serif; margin: 5px 0 10px; }
.result-panel p { line-height: 1.55; color: var(--muted); }
.result-kicker { color: var(--violet) !important; font-size: .75rem; font-weight: 900; letter-spacing: .13em; }
.result-actions { justify-content: flex-start; margin-top: 17px; }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.48); }
.stats-strip div { padding: 17px; text-align: center; border-right: 1px solid var(--line); }
.stats-strip div:last-child { border-right: 0; }
.stats-strip strong { display: block; font: 700 1.45rem Georgia, serif; }
.stats-strip span { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }

.personal-column { display: grid; align-content: start; gap: 18px; }
.gallery-card, .quote-card, .day-card, .tasks-card, .sponsor-card { border-radius: 22px; padding: 22px; }
.gallery-card { background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.gallery-card h2 { font: 600 1.6rem Georgia, serif; margin: 5px 0 0; }
.lock-badge { border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 9px; font-size: .7rem; color: #ddd9f5; }
.gallery-placeholder { min-height: 225px; margin-top: 18px; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 16px; background:
  radial-gradient(circle at 25% 20%, rgba(185,234,217,.65), transparent 30%),
  radial-gradient(circle at 75% 38%, rgba(255,108,95,.7), transparent 31%),
  linear-gradient(145deg, #6753df, #2a216f); overflow: hidden; }
.photo-symbol { font-size: 2rem; margin-bottom: auto; color: var(--gold); }
.gallery-placeholder p { font-size: .9rem; line-height: 1.5; color: #fff; }
.gallery-placeholder .secondary-button { align-self: flex-start; font-size: .78rem; padding: 9px 11px; }
.user-gallery-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:auto; width:100%; }
.user-gallery-grid img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:9px; }
.quote-card { background: var(--gold); color: #2d2108; }
.quote-card .eyebrow { color: #735311; }
blockquote { font: 500 1.35rem/1.35 Georgia, serif; margin: 16px 0; }
cite { font-style: normal; font-size: .82rem; font-weight: 800; }
.day-card { display: block; border: 1px solid var(--line); background: var(--card); }
.day-summary { display: flex; align-items: center; gap: 17px; }
.day-copy { min-width: 0; flex: 1; }
.today-date-badge { flex: 0 0 auto; align-self: flex-start; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #f7f4ed; text-align: right; }
.today-date-badge span { display: block; font-size: .56rem; line-height: 1.2; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.today-date-badge strong { display: block; margin-top: 3px; color: var(--ink); font-size: .68rem; white-space: nowrap; }
.day-date { flex: 0 0 65px; height: 72px; display: grid; place-content: center; text-align: center; border-radius: 17px; background: var(--mint); color: var(--violet-dark); }
.day-date strong { font: 700 1.85rem/1 Georgia, serif; }
.day-date span { margin-top: 5px; font-size: .63rem; letter-spacing: .13em; font-weight: 900; }
.day-copy h2, .tasks-card h2 { margin: 4px 0 0; font: 600 1.35rem/1.15 Georgia, serif; }
.day-copy p:last-child { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }
.calendar-toolbar { display: grid; grid-template-columns: 34px 1fr auto 34px; align-items: center; gap: 7px; margin-top: 20px; }
.calendar-toolbar strong { text-align: center; font: 600 1rem/1.2 Georgia, serif; text-transform: capitalize; }
.calendar-toolbar button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--violet); background: #fff; font-size: 1.35rem; }
.calendar-toolbar .today-button { width: auto; padding-inline: 9px; font-size: .7rem; font-weight: 850; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-weekdays { margin-top: 12px; color: var(--muted); font-size: .66rem; font-weight: 850; text-align: center; }
.calendar-grid { margin-top: 5px; }
.calendar-day { position: relative; aspect-ratio: 1; min-width: 0; border: 0; border-radius: 9px; color: var(--ink); background: transparent; font-size: .76rem; }
.calendar-day:hover { background: #f0edff; }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--violet); }
.calendar-day.selected { color: #fff; background: var(--violet); box-shadow: none; }
.calendar-day.has-items::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--coral); transform: translateX(-50%); }
.calendar-day.selected.has-items::after { background: var(--gold); }
.schedule-form { display: grid; grid-template-columns: 1fr 38px; gap: 7px; margin-top: 16px; }
.schedule-form input { padding: 10px 11px; border-radius: 10px; font-size: .82rem; }
.schedule-form button { border: 0; border-radius: 10px; color: #fff; background: var(--violet); font-size: 1.2rem; }
.schedule-list { list-style: none; display: grid; gap: 6px; margin: 10px 0 0; padding: 0; }
.schedule-list li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 2px; border-bottom: 1px solid #ece8df; font-size: .82rem; }
.schedule-list span { flex: 1; overflow-wrap: anywhere; }
.schedule-list button { border: 0; color: #9a4350; background: transparent; }
.schedule-empty { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.tasks-card { border: 1px solid var(--line); background: var(--card); }
.task-count { display: grid; place-items: center; min-width: 30px; height: 30px; padding-inline: 8px; border-radius: 999px; background: #eeebe5; color: var(--muted); font-size: .76rem; font-weight: 850; }
.task-form { display: grid; grid-template-columns: 1fr 40px; gap: 8px; margin-top: 17px; }
.task-form input { padding: 11px 12px; font-size: .86rem; border-radius: 11px; }
.task-form button { border: 0; border-radius: 11px; color: #fff; background: var(--violet); font-size: 1.35rem; line-height: 1; }
.task-list { list-style: none; display: grid; gap: 8px; margin: 13px 0 0; padding: 0; }
.task-list li { display: flex; align-items: flex-start; gap: 9px; padding: 9px 2px; border-bottom: 1px solid #ece8df; font-size: .86rem; line-height: 1.35; }
.task-list li:last-child { border-bottom: 0; }
.task-list input { width: 17px; height: 17px; min-width: 17px; margin-top: 1px; accent-color: var(--violet); }
.task-list span { flex: 1; overflow-wrap: anywhere; }
.task-list li.done span { color: var(--muted); text-decoration: line-through; }
.task-list button { border: 0; background: transparent; color: #9a4350; padding: 0 3px; font-size: 1rem; }
.task-empty { margin: 13px 0 0; color: var(--muted); font-size: .82rem; }
.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; }
.sponsor-card { border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.48); }
.sponsor-card span { font-size: .63rem; letter-spacing: .12em; font-weight: 850; }
.sponsor-card p { margin: 10px 0 0; line-height: 1.45; font-size: .82rem; }
.sponsor-name { margin: 8px 0 0; color: var(--ink); font: 700 1.35rem/1.1 Georgia, serif; }
.sponsor-action { display: inline-flex; margin-top: 14px; padding: 9px 12px; border-radius: 10px; color: #fff; background: var(--violet); text-decoration: none; font-size: .78rem; font-weight: 850; }
.sponsor-action:hover { background: var(--violet-dark); }
.sponsor-disclosure { display: block; margin-top: 11px; color: var(--muted); font-size: .67rem; line-height: 1.4; }
footer { display: flex; justify-content: space-between; padding: 24px 0 35px; border-top: 1px solid rgba(23,21,46,.1); color: var(--muted); font-size: .8rem; }
.redirect { display: flex; gap: 18px; justify-content: center; align-items: center; min-height: 100vh; }
.redirect a { color: #fff; background: var(--violet); border-radius: 14px; padding: 14px 18px; text-decoration: none; font-weight: 800; }

.mode-switch { display: inline-flex; gap: 5px; margin: 0 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); }
.mode-button { border: 0; border-radius: 999px; padding: 9px 14px; background: transparent; color: var(--muted); font-weight: 800; }
.mode-button.active { color: #fff; background: var(--violet); }
.picture-card { padding: 18px; }
.picture-stage { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 18px; background: #242037; }
.picture-stage img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease, filter .4s ease; }
.picture-stage.reveal-1 img { transform: scale(4.2); transform-origin: 48% 60%; }
.picture-stage.reveal-2 img { transform: scale(3); transform-origin: 48% 57%; }
.picture-stage.reveal-3 img { transform: scale(2.05); transform-origin: 50% 52%; }
.picture-stage.reveal-4 img { transform: scale(1.4); transform-origin: 50% 50%; }
.picture-stage.reveal-5 img, .picture-stage.where-mode img { transform: scale(1); transform-origin: center; }
.picture-level { position: absolute; left: 14px; top: 14px; padding: 7px 10px; border-radius: 999px; color: #fff; background: rgba(23,21,46,.76); backdrop-filter: blur(7px); font-size: .72rem; font-weight: 850; letter-spacing: .06em; }
.picture-hint { min-height: 3.1rem; margin: 16px 2px 13px; padding: 12px 14px; border-radius: 13px; color: var(--ink); background: #f3f0e9; line-height: 1.45; }
.picture-hint:empty { display: none; }
.photo-credit { margin: 10px 3px 2px; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.photo-credit a { color: inherit; }

.quiz-card { padding: 28px; }
.quiz-progress { display: flex; gap: 8px; margin-bottom: 20px; }
.quiz-progress span { flex: 1; height: 6px; border-radius: 99px; background: #e6e1d7; }
.quiz-progress span.active { background: var(--violet); }
.quiz-progress span.done { background: var(--mint); }
.quiz-category { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: var(--violet-dark); background: var(--mint); font-size: .72rem; font-weight: 900; letter-spacing: .1em; }
.quiz-question { margin: 18px 0 22px; font: 600 clamp(1.65rem, 4vw, 2.45rem)/1.15 Georgia, serif; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-option { min-height: 54px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; text-align: left; font-weight: 750; }
.quiz-option:hover:not(:disabled) { border-color: var(--violet); background: #f3f0ff; }
.quiz-option.correct { color: #174f3b; border-color: #68b397; background: #dcf5eb; }
.quiz-option.incorrect { color: #8a2633; border-color: #d88b95; background: #fdecef; }
.quiz-hint { margin: 14px 0 0; color: var(--muted); line-height: 1.5; }
.quiz-answer { margin-top: 18px; padding: 16px; border-radius: 14px; background: #f3f0e9; }
.quiz-answer p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.quiz-answer a { color: var(--violet); font-size: .8rem; font-weight: 800; }
.quiz-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.quiz-finish { text-align: center; padding: 20px 4px 5px; }
.quiz-finish h2 { margin: 9px 0; font: 600 2.25rem/1.1 Georgia, serif; }
.quiz-finish p { color: var(--muted); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding-top: 30px; }
  .personal-column { grid-template-columns: 1fr 1fr; }
  .sponsor-card { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .site-header, .shell, footer { width: min(100% - 24px, 1180px); }
  .site-header { height: auto; min-height: 68px; padding-block: 10px; flex-wrap: wrap; gap: 6px; }
  .nav-link { display: block; padding: 7px 8px; font-size: .78rem; }
  .site-header nav .nav-link { display: none; }
  .game-switcher { width: min(100% - 24px, 1180px); grid-template-columns: 1fr; margin-top: 12px; }
  .game-switcher > span { padding: 2px 2px 0; }
  .game-switcher a { min-height: 43px; }
  .title-row { align-items: center; }
  h1 { font-size: clamp(3rem, 16vw, 4.4rem); }
  .score-dial { flex-basis: 80px; }
  .score-dial span { font-size: 1.35rem; }
  .puzzle-card { border-radius: 20px; padding: 20px; }
  .guess-row { grid-template-columns: 1fr; }
  .primary-button { min-height: 48px; }
  .action-row { align-items: flex-start; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stats-strip div:nth-child(2) { border-right: 0; }
  .stats-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .personal-column { grid-template-columns: 1fr; }
  .quiz-options { grid-template-columns: 1fr; }
  .sponsor-card { grid-column: auto; }
  footer { gap: 15px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.user-gallery-image { display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: transparent; cursor: zoom-in; }
.user-gallery-image:focus-visible { outline: 3px solid #f7c44f; outline-offset: 3px; }
.user-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.user-gallery-image:hover img { transform: scale(1.035); }
body.lightbox-open { overflow: hidden; }
.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(10,8,30,.88); backdrop-filter: blur(8px); }
.gallery-lightbox-panel { position: relative; display: grid; gap: 10px; max-width: min(92vw,1100px); max-height: 92vh; }
.gallery-lightbox-image { display: block; max-width: 100%; max-height: 82vh; margin: auto; border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.45); object-fit: contain; }
.gallery-lightbox-close { position: absolute; top: -16px; right: -16px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.65); border-radius: 999px; color: #17132f; background: #fff; font-size: 28px; line-height: 1; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.gallery-lightbox-close:focus-visible { outline: 3px solid #f7c44f; outline-offset: 3px; }
.gallery-lightbox-caption { margin: 0; color: white; text-align: center; font-size: 14px; }
@media (max-width: 600px) { .gallery-lightbox { padding: 16px; } .gallery-lightbox-close { top: 8px; right: 8px; } }
