/*
 * retrocracker.com: the game's own look. The colours are the game's pixel boxes and gold
 * (meepleandmocha/frontend/src/games/nutcracker/style.css, --nc-pixelbox*, --nc-gold*), a winter night behind,
 * every heading and button in the game's pixel letters (site.ts draws them; the words stay as text for
 * a screen reader and when the script has not run).
 */
:root {
  --night-top: #0c0820;
  --night-low: #2a1850;
  --box: #1a1230;
  --box-edge: #f4dcff;
  --ink: #fff6d8;
  --ink-soft: #d8cbe8;
  --shadow: #4a2e78;
  --gold: #ffd25a;
  --gold-edge: #b9862d;
  --gold-ink: #2a1a08;
  --bezel: #3a2468;
  --bezel-lit: #6a4aa8;
  --snow: #f4faff;
  --drop: #05030c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--night-top); }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font: 17px/1.5 system-ui, sans-serif;
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night-low) 70%, var(--night-top) 100%) fixed;
  display: flex; flex-direction: column; align-items: center; overflow-x: hidden;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
header, main, footer { position: relative; z-index: 1; width: min(100%, 1180px); padding: 0 16px; }

/* Pixel words: an image the script draws, scaled by its height in whole steps, crisp. */
.px { display: block; image-rendering: pixelated; height: var(--h, 22px); width: auto; max-width: 100%; }
[data-pixel].drawn > .said-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The banner: the title in gold, the tag under it, the cast walking along the bottom. */
.banner { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 28px; text-align: center; }
.title { margin: 0; font-size: 44px; letter-spacing: 2px; color: var(--gold); }
.title .px { --h: clamp(44px, 9vw, 110px); }
.tag { margin: 0; color: var(--ink-soft); }
.tag .px { --h: clamp(16px, 2.6vw, 26px); }
.parade { width: 100%; height: clamp(64px, 9vw, 104px); }
.parade canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* The game in a cabinet: the bezel of the game's own frame. */
main { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-bottom: 32px; }
.cabinet { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.screen {
  width: 100%; aspect-ratio: 16 / 10; max-height: calc(100dvh - 120px); background: var(--drop);
  border: 4px solid var(--bezel-lit); border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 6px var(--bezel), 0 10px 0 6px var(--drop), 0 0 60px var(--shadow);
}
.screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.under { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: center; }
.keys { margin: 0; color: var(--ink-soft); }
.keys .px { --h: 14px; }

/* The pixel boxes of the game's cards. */
.box {
  width: min(100%, 760px); padding: 22px 24px; text-align: center; background: var(--box);
  border: 4px solid var(--box-edge); box-shadow: 0 0 0 4px var(--box), 8px 8px 0 4px var(--drop);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.box h2 { margin: 0; color: var(--gold); font-size: 24px; }
.box h2 .px { --h: clamp(24px, 4vw, 34px); }
.box p { margin: 0; max-width: 56ch; color: var(--ink-soft); }

/* Buttons: the game's pixel buttons, gold for the one that matters. */
.pixel-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px;
  background: var(--box); color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; cursor: pointer;
  border: 3px solid var(--box-edge); box-shadow: 4px 4px 0 var(--shadow); transition: transform 0.08s, box-shadow 0.08s;
}
.pixel-button .px { --h: 16px; }
.pixel-button:hover, .pixel-button:focus-visible { background: var(--shadow); outline: 3px solid var(--gold); outline-offset: 2px; }
.pixel-button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.pixel-button.big { min-height: 60px; padding: 12px 26px; }
.pixel-button.big .px { --h: 24px; }
.pixel-button.gold { background: var(--gold); border-color: var(--ink); box-shadow: 5px 5px 0 var(--gold-edge); color: var(--gold-ink); }
.pixel-button.gold:hover, .pixel-button.gold:focus-visible { background: var(--ink); }
.pixel-button.gold { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 5px 5px 0 var(--gold-edge), 0 0 26px var(--gold); } }
.share-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.said { min-height: 1.5em; color: var(--gold); }

footer { padding-bottom: 28px; text-align: center; color: var(--ink-soft); font-size: 14px; }
footer p { margin: 0; }

@media (max-width: 700px) {
  body { font-size: 16px; }
  .banner { padding-top: 18px; }
  .screen { aspect-ratio: 4 / 5; max-height: 70dvh; }
  .box { padding: 18px 14px; }
  .pixel-button .px { --h: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .pixel-button.gold { animation: none; }
  #snow { display: none; }
}

/* On a phone: the screen is a poster with a button to the game, which takes the whole screen of its own. */
.screen.poster {
  aspect-ratio: 16 / 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: url("assets/cracker.png") center 30% / auto 45% no-repeat, radial-gradient(circle at 50% 40%, var(--shadow), var(--drop) 70%);
  image-rendering: pixelated;
}
.screen.poster .pixel-button { margin-top: 38%; }
