/* ABOUTME: Styles for Roux Wars: a light enamel stovetop, index-card ticket, result sheet, and title card. */
/* ABOUTME: Mobile-first single column; every color, size, and easing comes from the tokens in :root. */
/* Crystal Hot Sauce partner edition: Crystal blue pot and ink, Crystal red keys, script mark, cap-green trinity key. */
/* Hallmark · scope: app (single-screen game) · theme: custom · vibe: "Louisiana home kitchen: enamel, index cards, roux"
 * display: Ultra · body: Barlow Semi Condensed · card text: Courier Prime · anchor: enamel blue + bell-pepper green
 * light-only on purpose: brown only reads as brown against lighter surroundings
 * pre-emit critique: P5 H4 E4 S5 R5 V5 */

:root {
  /* Surfaces. Keep these near-neutral: they are what the roux color is judged against. */
  --range: #e5e6e1;
  --card: #fbfbf8;
  --enamel: #efeeea;
  --enamel-lip: #f6f5f2;
  --rule: #d4dfeb;
  --rule-red: #e3a39c;

  /* Ink */
  --ink: #1d2126;
  --ink-hover: #30363e;
  --ink-2: #585e66;
  --ink-shadow: #07090b;
  --on-dark: #ffffff;

  /* Crystal Hot Sauce */
  --crystal-blue: #003f7f;
  --crystal-blue-deep: #002a57;
  --crystal-red: #ab2711;
  --crystal-red-deep: #741a0b;
  --crystal-red-hover: #c0301a;
  --crystal-green: #2f7d32;
  --crystal-sauce: #d2391f;
  --crystal-sauce-deep: #9c2412;
  --crystal-sky: #8fcbe6;
  --crystal-sky-deep: #5aa9d1;
  --crystal-paper: #fbf7ec;
  --script: 'Yellowtail', 'Brush Script MT', cursive;
  --cond: 'Oswald', 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --band: linear-gradient(180deg, #5b86b8, #3f6ea3);
  --gold: #c9a227;
  --iron: #cfdbe9;
  --banner: 'Alegreya SC', Georgia, serif;
  --lift-red: 0 4px 0 var(--crystal-red-deep), 0 10px 16px -10px rgba(0, 0, 0, 0.5);

  /* Kitchen */
  --pot: #0f4a8a;
  --pot-edge: var(--crystal-blue-deep);
  --grate: #a3a6a4;
  --wood: #c4914f;
  --wood-edge: #8e6230;
  --speck: #140e0a;
  --speck-rgb: 20, 14, 10;
  --onion: #efe9d6;
  --celery: #a9c77a;
  --pepper: #3d7a3a;
  --pepper-deep: #2b5a29;
  --pepper-wash: #dde8d9;
  --char: #9b3219;
  --flame-outer: rgba(58, 104, 222, 0.85);
  --flame-inner: rgba(176, 202, 255, 0.95);
  --steam-rgb: 255, 255, 255;
  --smoke-rgb: 88, 82, 76;

  /* Shadows */
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.05), 0 10px 20px -14px rgba(0, 0, 0, 0.45);
  --shadow-chip: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 5px -2px rgba(0, 0, 0, 0.3);
  --shadow-swatch: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-sheet: 0 -12px 32px -14px rgba(0, 0, 0, 0.4);
  --shadow-strip: 0 2px 6px -3px rgba(0, 0, 0, 0.4);
  --lift-ink: 0 4px 0 var(--ink-shadow), 0 10px 16px -10px rgba(0, 0, 0, 0.5);
  --lift-pepper: 0 4px 0 var(--pepper-deep), 0 10px 16px -10px rgba(0, 0, 0, 0.5);

  /* Type */
  --display: 'Ultra', 'Rockwell', Georgia, serif;
  --ui: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --type: 'Courier Prime', ui-monospace, 'Courier New', monospace;
  --text-label: 13px;
  --text-body: 17px;
  --text-lead: 22px;
  --text-score: 60px;
  --text-logo: clamp(64px, 23vw, 108px);

  /* Space and shape */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 22px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-press: 70ms;
  --dur-fade: 200ms;
  --dur-sheet: 360ms;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--range);
  color: var(--ink);
  overscroll-behavior: none;
  overflow-x: clip;
}

body {
  font-family: var(--ui);
  font-size: var(--text-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--pot);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Kitchen layout */

.kitchen {
  position: relative;
  height: 100vh;
  height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: env(safe-area-inset-top, 0px) var(--space-lg) calc(env(safe-area-inset-bottom, 0px) + 14px);
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 48px;
  margin: 0 calc(-1 * var(--space-lg));
  padding: 0 var(--space-lg);
  background: var(--band);
  box-shadow: inset 0 -3px 0 var(--gold);
  color: var(--on-dark);
}

.wordmark {
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--text-lead);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-mark {
  width: 76px;
  height: 38px;
  margin-left: -6px;
  flex: none;
}

.progress {
  margin-left: auto;
  font-family: var(--cond);
  font-weight: 500;
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--on-dark);
}

.mute {
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--on-dark);
}

.mute svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.mute .icon-off,
.mute[aria-pressed='true'] .icon-on {
  display: none;
}

.mute[aria-pressed='true'] .icon-off {
  display: block;
}

/* Target ticket: a recipe index card with a paint chip clipped to it */

.ticket {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--card);
  background-image: linear-gradient(var(--rule-red), var(--rule-red)),
    repeating-linear-gradient(to bottom, transparent 0 25px, var(--rule) 25px 26px);
  background-size: 100% 1.5px, 100% 100%;
  background-position: 0 22px, 0 22px;
  background-repeat: no-repeat;
  box-shadow: var(--shadow-card);
}

/* Crystal's own recipes get a rubber stamp on the card. */
.stamp {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 2px 6px;
  border: 1.5px solid var(--crystal-red);
  border-radius: 3px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crystal-red);
  transform: rotate(-5deg);
  opacity: 0.9;
}

.stamp[hidden] {
  display: none;
}

/* The chip sits on the same enamel that rings the roux in the pot, so both are judged alike. */
.chip-card {
  flex: none;
  padding: 5px 5px 3px;
  background: var(--enamel);
  border-radius: 3px;
  box-shadow: var(--shadow-chip);
  transform: rotate(-2deg);
  text-align: center;
}

.chip {
  width: 80px;
  height: 64px;
  border-radius: 2px;
}

.chip-label {
  display: block;
  margin-top: 2px;
  font-family: var(--type);
  font-size: var(--text-label);
  color: var(--ink-2);
}

.ticket-text {
  min-width: 0;
  padding-top: var(--space-sm);
}

.dish {
  margin: 0;
  font-family: var(--display);
  font-size: var(--text-lead);
  line-height: 1.1;
  overflow-wrap: anywhere;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.target {
  margin: 6px 0 0;
  font-family: var(--type);
  font-size: var(--text-label);
  color: var(--ink-2);
}

/* Pot */

.stove {
  position: relative;
  min-height: 0;
  touch-action: none;
}

/* Heat-o-meter: a cartoon taster in the corner of the stove while the Crystal is out. */
.heat {
  position: absolute;
  top: 6px;
  left: 0;
  z-index: 1;
  width: 92px;
  margin: 0;
  text-align: center;
  pointer-events: none;
  animation: pop 320ms var(--ease-out);
  --skin: #f6d2a8;
}

.heat[hidden] {
  display: none;
}

.heat[data-level='1'] { --skin: #f7c09a; }
.heat[data-level='2'] { --skin: #f4a07c; }
.heat[data-level='3'] { --skin: #ec6f50; }
.heat[data-level='4'] { --skin: #dc3b22; }

.face {
  display: block;
  width: 92px;
  height: 104px;
  overflow: visible;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.face .head,
.face .ear {
  fill: var(--skin);
  stroke: var(--ink);
  stroke-width: 3;
  transition: fill 300ms var(--ease-out);
}

.face .white { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.face .pupil { fill: var(--ink); }
.face .brow { fill: none; stroke: var(--ink); stroke-width: 3.5; }
.face .cheek { fill: #e0452b; opacity: 0; transition: opacity 300ms; }
.face .mouth { fill: #6b1a10; stroke: var(--ink); stroke-width: 3; display: none; }
.face .m0 { fill: none; }
.face .tongue { fill: #f07a8a; stroke: none; }
.face .veins { stroke: #d62a1a; stroke-width: 1.6; opacity: 0; }
.face .sweat path { fill: #8fd0f2; stroke: #3a8fc2; stroke-width: 1.5; }
.face .tears { fill: none; stroke: #6cc0ee; stroke-width: 4; opacity: 0; }
.face .steam { fill: none; stroke: #b9b9b9; stroke-width: 3; opacity: 0; }
.face .fire { display: none; }
.face .fire path { fill: #f5a623; stroke: #d0391c; stroke-width: 2; }
.face .fire .fire-in { fill: #ffe066; stroke: none; }
.face .sweat { opacity: 0; }

.heat[data-level='0'] .m0,
.heat[data-level='1'] .m0 { display: inline; }
.heat[data-level='2'] .m1 { display: inline; }
.heat[data-level='3'] .m2,
.heat[data-level='4'] .m2 { display: inline; }
.heat[data-level='1'] .cheek { opacity: 0.35; }
.heat[data-level='2'] .cheek { opacity: 0.6; }
.heat[data-level='2'] .sweat { opacity: 1; }
.heat[data-level='3'] .sweat,
.heat[data-level='4'] .sweat,
.heat[data-level='3'] .tears,
.heat[data-level='4'] .tears,
.heat[data-level='3'] .veins,
.heat[data-level='4'] .veins,
.heat[data-level='3'] .steam,
.heat[data-level='4'] .steam { opacity: 1; }
.heat[data-level='4'] .fire { display: inline; transform-origin: 50px 94px; transform: scale(1.6); animation: flare 0.18s ease-in-out infinite alternate; }
.heat[data-level='4'] .pupil { r: 2.5; }
.heat[data-level='3'] .steam,
.heat[data-level='4'] .steam { animation: puff 0.6s ease-in-out infinite alternate; }
.heat[data-level='3'] .face,
.heat[data-level='4'] .face { animation: jitter 0.12s linear infinite alternate; }

/* A little jolt on every dash. */
.heat.jolt .face { animation: jolt 260ms var(--ease-out); }

.meter {
  height: 8px;
  margin: 2px 8px 0;
  border-radius: 4px;
  background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #f2c94c, #f08a24, var(--crystal-red));
  transform-origin: left;
  transform: scaleX(var(--fill, 0));
  transition: transform 300ms var(--ease-out);
}

.heat figcaption {
  margin-top: 3px;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--crystal-red);
}

@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
}

@keyframes jolt {
  30% { transform: scale(1.12) rotate(-6deg); }
}

@keyframes jitter {
  to { transform: translate(1.5px, -1px) rotate(1.5deg); }
}

@keyframes flare {
  to { transform: scale(1.75, 1.95); }
}

@keyframes puff {
  to { transform: translateY(-4px); }
}

.stove canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* One fixed line so the pot never resizes when the caption changes. Copy is kept to 27 characters. */
.caption {
  margin: 0;
  height: 1.4em;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  font-family: var(--type);
  font-size: var(--text-body);
  color: var(--ink-2);
}

.caption.warn {
  color: var(--char);
}

.caption.brand {
  color: var(--crystal-red);
  font-weight: 700;
}

.caption.alarm {
  color: var(--char);
  font-weight: 700;
  animation: pulse 0.5s var(--ease-in-out) infinite alternate;
}

/* Buttons */

.controls {
  display: grid;
  gap: var(--space-md);
}

.action {
  width: 100%;
  height: 60px;
  border: 0;
  border-radius: 14px;
  color: var(--on-dark);
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--text-lead);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--crystal-blue);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transform: translateY(-3px);
  box-shadow: 0 4px 0 var(--crystal-blue-deep), 0 10px 16px -10px rgba(0, 0, 0, 0.5);
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out),
    background-color var(--dur-fade) var(--ease-out);
}

.action:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 var(--crystal-blue-deep);
}

/* The Crystal key: red like the sauce, with the bottle beside the label. */
.action[data-kind='crystal'],
.title .action,
#share {
  background: var(--crystal-red);
  box-shadow: var(--lift-red);
}

.action[data-kind='crystal']:active,
.title .action:active,
#share:active {
  box-shadow: 0 0 0 var(--crystal-red-deep);
}

/* While the Crystal is out, "Serve it" sits beside the shake key so the pot never resizes. */
.controls:has(.serve:not([hidden])) {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.serve {
  width: 100%;
  height: 60px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--crystal-blue);
  font-family: var(--cond);
  font-weight: 600;
  font-size: var(--text-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--crystal-blue);
}

.serve[hidden] {
  display: none;
}

/* Once unlocked, "Drop the trinity" is a calm outlined key, not a bright "go" signal. */
.action[data-kind='trinity'] {
  background: var(--card);
  color: var(--pepper-deep);
  box-shadow: inset 0 0 0 2px var(--pepper), var(--lift-pepper);
}

.action[data-kind='trinity']:active {
  box-shadow: inset 0 0 0 2px var(--pepper), 0 0 0 var(--pepper-deep);
}

/* Locked until you've stirred; the fill shows how close you are. */
.action[data-kind='locked'] {
  background: var(--card);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 2px var(--rule);
  transform: none;
  cursor: default;
}

.action[data-kind='locked']:active {
  transform: none;
  box-shadow: inset 0 0 0 2px var(--rule);
}

.action[data-kind='locked']::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--pepper-wash);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  transition: transform var(--dur-fade) var(--ease-out);
}

.action[data-kind='wait'] {
  background: var(--ink-2);
  transform: none;
  box-shadow: none;
  cursor: default;
}

.secondary {
  width: 100%;
  height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font-weight: 700;
  font-size: var(--text-body);
  white-space: nowrap;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

@media (hover: hover) {
  .action:hover {
    background: #0b4d96;
  }
  .action[data-kind='crystal']:hover,
  .title .action:hover,
  #share:hover {
    background: var(--crystal-red-hover);
  }
  .action[data-kind='trinity']:hover {
    background: var(--pepper-wash);
  }
  .action[data-kind='wait']:hover {
    background: var(--ink-2);
  }
  .action[data-kind='locked']:hover {
    background: var(--card);
  }
  .secondary:hover {
    text-decoration-thickness: 3px;
  }
  .mute:hover {
    color: var(--ink);
  }
}

/* Result and menu sheets */

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + var(--space-lg));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--card);
  box-shadow: var(--shadow-sheet);
  animation: rise var(--dur-sheet) var(--ease-out);
}

.sheet[hidden] {
  display: none;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.swatches figure {
  margin: 0;
}

.swatch {
  height: 80px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-swatch);
}

.swatch.specked {
  background-image: radial-gradient(circle, var(--speck) 0 1.6px, transparent 2.2px),
    radial-gradient(circle, var(--speck) 0 1.1px, transparent 1.7px);
  background-size: 29px 23px, 37px 31px;
  background-position: 4px 6px, 17px 13px;
}

.swatches figcaption {
  margin-top: 6px;
  font-family: var(--type);
  font-size: var(--text-label);
  color: var(--ink-2);
}

.score {
  margin: 14px 0 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score .num {
  display: inline-block;
  font-family: var(--display);
  font-size: var(--text-score);
  line-height: 0.9;
}

.score .of {
  font-size: var(--text-lead);
  font-weight: 600;
  color: var(--ink-2);
}

.verdict {
  margin: 10px 0 0;
  font-size: var(--text-lead);
  font-weight: 700;
  line-height: 1.15;
}

.tip {
  margin: 6px 0 0;
  font-size: var(--text-body);
  line-height: 1.3;
  color: var(--ink-2);
}

.stir-line {
  margin: 10px 0 0;
  font-size: var(--text-body);
  color: var(--ink-2);
}

.stir-line strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--text-lead);
  color: var(--ink);
}

.penalty {
  margin: var(--space-sm) 0 0;
  font-size: var(--text-body);
  color: var(--char);
}

.sheet > .action,
.sheet-actions {
  margin-top: 18px;
}

.source {
  margin: 10px 0 0;
  font-size: var(--text-body);
  color: var(--ink-2);
}

.source a,
.row-name a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

@media (hover: hover) {
  .source a:hover,
  .row-name a:hover {
    text-decoration-thickness: 2px;
  }
}

.source a:focus-visible,
.row-name a:focus-visible {
  outline: 3px solid var(--pot);
  outline-offset: 2px;
}

/* The Crystal line on the result and menu sheets. */
.crystal-line {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f3e6e2;
  box-shadow: inset 3px 0 0 var(--crystal-red);
}

.bottle-icon {
  width: 16px;
  height: 48px;
  flex: none;
}

.crystal-line p {
  margin: 0;
  display: grid;
  line-height: 1.2;
}

.crystal-line strong {
  color: var(--crystal-red-deep);
}

.crystal-line span {
  color: var(--ink-2);
}

.kitchen-tag {
  display: inline-block;
  padding: 0 5px;
  border: 1.5px solid var(--crystal-red);
  border-radius: 3px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crystal-red);
  vertical-align: 1px;
}

.shop {
  font-family: var(--cond);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: grid;
  place-items: center;
  height: 48px;
  margin-top: 10px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 2px var(--crystal-red);
  font-weight: 700;
  color: var(--crystal-red);
  text-decoration: none;
}

.menu-title {
  margin: 0 0 10px;
  color: var(--crystal-blue);
  font-family: var(--cond);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: var(--text-lead);
}

.menu-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-rows li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.pair {
  display: flex;
}

.pair i {
  width: 30px;
  height: 36px;
  box-shadow: var(--shadow-swatch);
}

.pair i:first-child {
  border-radius: 3px 0 0 3px;
}

.pair i:last-child {
  border-radius: 0 3px 3px 0;
}

.row-name {
  font-weight: 700;
  font-size: var(--text-body);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.row-name small {
  display: block;
  font-family: var(--type);
  font-weight: 400;
  font-size: var(--text-label);
  color: var(--ink-2);
}

.row-pts {
  font-family: var(--display);
  font-size: var(--text-lead);
}

.share-text {
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: var(--space-sm);
  font-family: var(--ui);
  font-size: var(--text-body);
  resize: none;
  -webkit-user-select: text;
  user-select: text;
}

/* Title card */

.title {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 44px) var(--space-xl)
    calc(env(safe-area-inset-bottom, 0px) + var(--space-xl));
  background: radial-gradient(120% 70% at 50% 0%, #c9e8f4 0%, var(--crystal-sky) 55%, var(--crystal-sky-deep) 100%);
  transition: opacity var(--dur-sheet) var(--ease-out), visibility var(--dur-sheet) var(--ease-out);
}

.title.gone {
  opacity: 0;
  visibility: hidden;
}

/* Crystal's mural: a sky backdrop the card sits on, like a poster pasted to a New Orleans wall. */
.mural {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bunting {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 34px;
}

.fly {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 22px;
  height: 50px;
  transform: rotate(var(--r)) scale(var(--s));
  filter: drop-shadow(0 3px 2px rgba(0, 40, 80, 0.25));
  animation: fly 5s var(--d) ease-in-out infinite alternate;
}

@keyframes fly {
  to {
    transform: translate(6px, -10px) rotate(calc(var(--r) + 18deg)) scale(var(--s));
  }
}

.title-inner {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 26px 20px 20px;
  filter: drop-shadow(0 12px 18px rgba(0, 42, 87, 0.35));
  transform: rotate(-0.6deg);
}

/* The paper lives on its own layer so the bottle and banner can hang past its torn edges. */
.title-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--crystal-paper);
  clip-path: polygon(0 1.4%, 6% 0.3%, 13% 1.2%, 21% 0, 30% 1%, 38% 0.2%, 47% 1.3%, 55% 0.1%, 64% 1.1%, 72% 0.3%, 81% 1.4%, 89% 0.2%, 100% 1%,
    100% 99%, 93% 99.8%, 85% 98.7%, 76% 99.9%, 67% 98.9%, 58% 99.7%, 49% 98.6%, 40% 99.8%, 31% 98.8%, 22% 99.9%, 13% 98.7%, 5% 99.6%, 0 98.8%);
}

/* The torn-paper banner from Crystal's own mural. */
.banner {
  margin: 12px -32px 0;
  text-align: center;
  transform: rotate(-2.5deg);
}

.banner span {
  display: inline-block;
  padding: 8px 22px 10px;
  background: #ffffff;
  clip-path: polygon(0 8%, 4% 0, 30% 6%, 60% 0, 96% 5%, 100% 0, 98% 50%, 100% 100%, 70% 94%, 40% 100%, 8% 95%, 0 100%, 2% 50%);
  font-family: var(--banner);
  font-weight: 800;
  font-size: clamp(16px, 5vw, 26px);
  white-space: nowrap;
  line-height: 1;
  color: #5a3a12;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35);
}

.headline {
  margin: 18px 0 14px;
  display: flex;
  flex-direction: column;
  font-family: var(--cond);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--crystal-blue);
  line-height: 0.95;
  transform: rotate(-5deg);
  transform-origin: left bottom;
}

.hl-big {
  font-size: clamp(28px, 9vw, 42px);
}

.hl-small {
  margin-left: 18%;
  font-size: clamp(18px, 5.6vw, 24px);
  font-weight: 500;
}

/* The Crystal mark tops the poster: "Crystal presents". */
.presents {
  margin: 0 0 6px;
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  font-family: var(--type);
  font-size: var(--text-body);
  color: var(--ink-2);
}

.title-mark {
  width: 180px;
  height: 90px;
  margin: -14px 0 -10px -14px;
}

.presents span {
  padding-bottom: 14px;
}

.logo-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--text-logo);
  line-height: 0.86;
  color: var(--crystal-blue);
}

.title-bottle {
  width: 54px;
  height: 162px;
  flex: none;
  transform: rotate(8deg);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.25));
}

.edition {
  margin: 10px 0 0;
  font-family: var(--cond);
  font-weight: 500;
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crystal-red);
}

.since {
  margin: 18px 0 0;
  text-align: center;
  font-family: var(--cond);
  font-weight: 500;
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crystal-blue);
}

.stages {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  height: 30px;
  margin: 14px 0 22px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow-strip);
}

.intro {
  margin-bottom: 22px;
}

.lead {
  margin: 0;
  font-size: var(--text-lead);
  font-weight: 700;
  line-height: 1.2;
}

.tagline {
  margin: 4px 0 10px;
  font-size: var(--text-body);
  line-height: 1.3;
}

.howto {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-body);
  line-height: 1.3;
  color: var(--ink-2);
}

.howto b {
  color: var(--ink);
}

.menu-label {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 700;
}

.title .action {
  margin-top: var(--space-lg);
}

.keyhint {
  margin: 6px 0 0;
  text-align: center;
  font-size: var(--text-label);
  color: var(--ink-2);
}

@media (hover: none) {
  .keyhint {
    display: none;
  }
}

@keyframes rise {
  from {
    transform: translateY(100%);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pulse {
  to {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet {
    animation: fade 150ms var(--ease-out);
  }
  .caption.alarm,
  .fly,
  .heat,
  .heat .face,
  .heat .fire,
  .heat .steam {
    animation: none !important;
  }
  .title,
  .action,
  .action::before {
    transition: none;
  }
}
