:root {
  color-scheme: dark;
  --bg: #17151b;
  --panel: #211f27;
  --text: #f5f1f7;
  --muted: #b9b2c2;
  --accent: #f18a35;
  --line: #ffffff20;
  --display: Georgia, serif;
  --body: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
}
a { color: inherit; }
button, input { font: inherit; }

.site-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: #17151bdc;
  backdrop-filter: blur(12px);
}
.brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  text-decoration: none;
}
.brand span { color: var(--accent); }
.header-link {
  color: var(--muted);
  font-size: .92rem;
  text-decoration: none;
}
.header-link:hover, .back-link:hover { color: var(--text); }
.header-actions { display:flex; align-items:center; gap:18px; }
.language-picker select { max-width:180px; padding:8px 30px 8px 10px; border:1px solid var(--line); border-radius:3px; background:var(--panel); color:var(--text); cursor:pointer; }
.language-picker select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.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; }

main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px) 80px;
}
.loading, .error-message { padding: 60px 0; color: var(--muted); }
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 490px;
  align-items: flex-end;
  overflow: hidden;
  margin: 34px 0 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--hero-bg, #29202a);
}
.hero::before, .detail-hero::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background: var(--hero-art);
  background-position: center;
  background-size: cover;
  opacity: .84;
}
.hero::after, .detail-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, #0a080eeb 0%, #0a080eb8 48%, #0a080e14 100%),
              linear-gradient(0deg, #0a080e80, transparent 65%);
}
.hero-content { max-width: 780px; padding: clamp(25px, 5vw, 62px); }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.hero h1, .detail-hero h1 {
  margin: 0 0 22px;
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .98;
}
.hero-copy { max-width: 540px; margin: 0 0 28px; color: #e5dfe9; }
.countdown { display: flex; flex-wrap: wrap; gap: clamp(9px, 2vw, 22px); margin: 24px 0 30px; }
.time-unit { min-width: 68px; }
.time-unit strong {
  display: block;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1.2;
}
.time-unit span { color: #d1c8d8; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: #171218;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button.secondary { border-color: #ffffff70; background: transparent; color: var(--text); }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -.045em;
  line-height: 1.1;
}
.section-head p { margin: 8px 0 0; color: var(--muted); }
.search {
  width: min(100%, 280px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff08;
  color: var(--text);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.unofficial-toggle-label { display: flex; width: fit-content; align-items: center; gap: 9px; margin: 0 0 22px; color: var(--muted); font-size: .9rem; cursor: pointer; }
.unofficial-toggle-label input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.filter {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
}
.filter[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.event-card {
  display: flex;
  min-height: 225px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--card-accent);
  background: var(--panel);
  text-decoration: none;
}
.event-card:hover { border-color: var(--card-accent); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.event-icon { font-size: 1.6rem; }
.event-type { color: var(--muted); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.event-card h3 {
  margin: 16px 0 8px;
  font-family: var(--card-font, var(--display));
  font-size: 1.55rem;
  line-height: 1.15;
}
.event-card p { margin: 0 0 20px; color: var(--muted); font-size: .9rem; }
.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
}
.card-bottom strong { color: var(--card-accent); font-variant-numeric: tabular-nums; }
.empty { padding: 30px 0; color: var(--muted); }
.fine-print { color: var(--muted); font-size: .8rem; }

.detail { padding-top: 34px; }
.back-link { display: inline-block; margin: 0 0 18px; color: var(--muted); text-decoration: none; }
.detail-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 330px;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: 30px;
  padding: clamp(24px, 5vw, 58px);
  border: 1px solid var(--line);
  background: var(--hero-bg);
}
.detail-hero::before { opacity: .72; }
.detail-hero::after { background: linear-gradient(90deg, #100e16ed, transparent 120%); }
.detail-hero h1 { margin-bottom: 15px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(230px, .8fr); gap: 20px; }
.info-panel { margin-bottom: 16px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); background: var(--panel); }
.info-panel h2 { margin: 0 0 12px; font-family: var(--display); font-size: 1.65rem; letter-spacing: -.03em; }
.info-panel p { margin: 0 0 14px; color: #d0cad6; }
.info-panel p:last-child { margin-bottom: 0; }
.fact-list { padding-left: 20px; color: #d0cad6; }
.fact-list li { padding: 4px 0; }
.not-found { padding: 100px 0; text-align: center; }
.not-found h1 { margin: 0; font-family: var(--display); font-size: 4rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

@media (max-width: 850px) {
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .hero { min-height: 450px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
}
@media (max-width: 520px) {
  .event-grid { grid-template-columns: 1fr; }
  .event-card { min-height: 185px; }
  .hero { min-height: 440px; margin-top: 18px; }
  .hero::after { background: linear-gradient(0deg, #0a080ef2, #0a080e40); }
  .site-header { height: auto; min-height: 62px; padding-top:10px; padding-bottom:10px; }
  .header-actions { gap:8px; }
  .header-link { display:none; }
  .language-picker select { max-width:145px; }
  .time-unit { min-width: 57px; }
  .site-footer { flex-direction: column; gap: 5px; }
}


/* Event-specific minigames only render on their matching event detail pages. */
.minigame-panel {
  margin: 0 0 30px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--line);
  background: var(--panel);
}
.minigame-panel > h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -.04em;
  line-height: 1.1;
}
.game-objective { max-width: 760px; margin: 0 0 22px; color: var(--muted); }
.game-objective strong { color: var(--text); }
.game-surface { padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); background: #100e14; }
.game-surface button, .game-surface textarea { font: inherit; }
.pi-prefix { margin: 0 0 12px; font-family: Georgia, serif; font-size: 2.2rem; font-weight: 700; }
.pi-prefix span { color: var(--muted); }
.pi-game label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .9rem; }
.pi-game textarea {
  display: block; width: 100%; resize: vertical; min-height: 100px;
  padding: 14px; border: 1px solid #ffffff35; border-radius: 2px;
  background: #1d1922; color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.05rem; line-height: 1.65;
}
.pi-game textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.game-status { min-height: 1.6em; margin: 14px 0 0; color: var(--muted); }
.game-surface .button.secondary { color: var(--text); }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tool-button {
  padding: 8px 12px; border: 1px solid #ffffff30; border-radius: 2px;
  background: #211b25; color: var(--text); cursor: pointer;
}
.tool-button.is-selected, .tool-button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #171218; }
#pumpkin-canvas { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 auto; border: 1px solid #ffffff20; cursor: crosshair; touch-action: manipulation; }
.turkey-game { text-align: center; }
.turkey-art { min-height: 160px; display: grid; place-items: center; font-size: clamp(6rem, 18vw, 10rem); line-height: 1.2; transform-origin: center; transition: transform .06s linear, opacity .06s linear; }
.turkey-track { width: 100%; height: 12px; overflow: hidden; border: 1px solid #ffffff30; background: #29232e; }
#turkey-progress { width: 0; height: 100%; background: var(--accent); transition: width .06s linear; }
.turkey-bite { margin-top: 18px; }
.turkey-bite:disabled { opacity: .6; cursor: default; }
#turkey-reset { margin-top: 10px; }
@media (max-width: 520px) {
  .minigame-panel { padding: 16px; }
  .game-meta { align-items: flex-start; }
  .tool-button { flex: 1 1 calc(50% - 8px); }
}


/* Additional event minigames */
.quiz-game h3 { min-height: 3em; margin: 0 0 18px; font-size: clamp(1.25rem, 3vw, 1.7rem); line-height: 1.35; }
.quiz-game .tool-button:disabled, .sort-game .tool-button:disabled { opacity: .55; cursor: default; }
.sort-item { display: flex; min-height: 130px; align-items: center; justify-content: center; gap: 14px; margin: 12px 0 20px; padding: 18px; border: 1px solid var(--line); background: #211b25; font-size: clamp(1.25rem, 4vw, 2rem); font-weight: 700; text-align: center; }
.fireworks-game { text-align: center; }
.firework-display { display: grid; min-height: 150px; place-items: center; font-size: clamp(5rem, 16vw, 8rem); }
.firework-pop { animation: firework-pop .18s ease-out; }
.firework-track { height: 12px; overflow: hidden; border: 1px solid #ffffff30; background: #29232e; }
#firework-progress { width: 0; height: 100%; background: var(--accent); transition: width .08s linear; }
.firework-launch { margin-top: 18px; }
@keyframes firework-pop { 50% { transform: scale(1.16); } }
@media (prefers-reduced-motion: reduce) { .firework-pop { animation: none; } }

/* One-day GTA VI launch banner */
.gta-live-banner {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 34px 0 -10px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid #f0b44c88;
  background: radial-gradient(ellipse at 82% 0%, #f0b44c30, transparent 48%), linear-gradient(115deg, #171b20, #30291f 65%, #17151b);
  color: #fff8e9;
}
.gta-live-icon { flex: 0 0 auto; font-size: clamp(2.6rem, 6vw, 4.5rem); }
.gta-live-copy { min-width: 0; }
.gta-live-kicker { margin: 0 0 4px; color: #f0b44c; font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.gta-live-copy h2 { margin: 0; font-size: clamp(1.4rem, 3.6vw, 2.5rem); line-height: 1.12; letter-spacing: -.04em; }
.gta-live-copy > p:last-child { margin: 8px 0 0; color: #d5cbbb; }
.gta-live-badge { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #f0b44c; color: #f0b44c; font-size: .72rem; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
@media (max-width: 600px) {
  .gta-live-banner { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
  .gta-live-copy { flex: 1 1 calc(100% - 70px); }
  .gta-live-badge { margin-left: 0; }
}

.detail-countdown[hidden],
.detail-countdown-panel[hidden] {
  display: none !important;
}
