:root {
  --ink: #1a1326;
  --panel: #2b2039;
  --panel-dark: #23192f;
  --line: #6a5373;
  --text: #fff1d8;
  --muted: #c9b6d5;
  --gold: #ffcf87;
  --mint: #b7efb3;
  --font: system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: radial-gradient(ellipse at 47% 0, #392544, transparent 68%) fixed,
    linear-gradient(90deg, #23192e 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(#23192e 1px, transparent 1px) 0 0 / 24px 24px, var(--ink);
  font: 16px/1.4 var(--font);
}
body.has-modal { overflow: hidden; }
button, select, a { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .56; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font); line-height: 1; }
h2 { font-size: 27px; }
h3 { font-size: 23px; }
.topbar, .layout { width: min(1440px, calc(100% - 64px)); margin-inline: auto; }
.topbar { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 2px solid #4a3455; }
.brand { display: flex; align-items: center; }
.brand img { width: 174px; height: auto; }
.topbar-actions, .board-actions, .catalog-tabs { display: flex; gap: 8px; }
.ghost-button, .share-button, .clear-selection, .reset-button, .difficulty-tab, .favorite-button, .primary-button {
  min-height: 42px; padding: 5px 12px; display: inline-flex; justify-content: center; align-items: center; gap: 6px;
  background: #342644; border: 2px solid #654a75; border-radius: 3px;
  box-shadow: inset 0 -3px #0003, 0 3px #140f21;
  color: var(--text); font: 600 16px/1 var(--font); text-align: center; text-decoration: none;
}
.ghost-button:hover, .clear-selection:not(:disabled):hover, .reset-button:hover, .difficulty-tab:hover { background: #483357; }
.share-button, .primary-button { background: #ffcd85; color: #30213a; border-color: #ffdba3; box-shadow: inset 0 -4px #d48c65, 0 3px #140f21; }
.share-button:hover, .primary-button:hover { background: #ffe0a6; }
button[aria-pressed='true']:is(.ghost-button, .difficulty-tab) { color: var(--mint); border-color: #89ba97; background: #30423d; }
.layout { display: grid; grid-template-columns: minmax(207px, 245px) minmax(0, 1fr); grid-template-areas: 'intro intro' 'sidebar game'; gap: 20px; padding-bottom: 48px; }
.game-intro { grid-area: intro; display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 23px 0 5px; }
.eyebrow { color: var(--mint); font: 600 15px/1.2 var(--font); letter-spacing: .12em; }
.game-intro h1 { margin-top: 7px; font-size: clamp(43px, 5.8vw, 90px); letter-spacing: -.045em; text-shadow: 3px 4px #110e1b; }
.game-intro h1 span { color: var(--gold); }
.intro-tip { color: var(--muted); width: min(100%, 255px); padding-bottom: 5px; }
.sidebar { grid-area: sidebar; display: flex; flex-direction: column; gap: 17px; }
.game-area { grid-area: game; min-width: 0; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); align-items: start; gap: 18px; }
.profile-card, .achievements-section, .panel {
  min-width: 0; padding: 16px; border: 2px solid var(--line); border-radius: 5px;
  box-shadow: inset 0 2px #ffffff11, inset 0 -4px #0002, 0 5px #130e20; background: var(--panel);
}
.profile-title { font-size: 24px; }
.profile-controls { margin-top: 15px; }
.field-label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.select-control { width: 100%; min-height: 42px; padding: 8px; border: 2px solid #675176; border-radius: 3px; color: var(--text); background: #231a30; }
.difficulty-label { margin-top: 14px; }
.difficulty-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.difficulty-tab { min-height: 40px; padding: 4px 0; font-size: 14px; }
.progress-card { display: flex; align-items: center; gap: 10px; margin: 19px 0 14px; }
.progress-ring {
  position: relative; flex: 0 0 59px; width: 59px; height: 59px; display: grid; place-items: center;
  background: conic-gradient(var(--mint) var(--progress, 0deg), #564164 0deg);
  border-radius: 50%; font-family: var(--font); line-height: 1; text-align: center;
}
.progress-ring::before { content: ''; position: absolute; inset: 4px; border-radius: inherit; background: #241930; }
.progress-ring > div { position: relative; }
.progress-ring strong { display: block; color: var(--gold); font-size: 26px; }
.progress-ring span { color: var(--muted); font-size: 12px; }
.progress-copy { display: grid; gap: 2px; font-size: 13px; }
.progress-copy .label, .muted { color: var(--muted); font-size: 12px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 11px 0; border-block: 1px solid #695276; }
.mini-stats > div { display: grid; justify-items: center; color: var(--muted); font-size: 11px; }
.mini-stat-value { color: var(--gold); font: 700 24px/1 var(--font); }
.reset-button { width: 100%; margin-top: 12px; font-size: 15px; }
.team-note { margin-top: 15px; color: var(--mint); font-size: 14px; }
.achievements-section h2 { font-size: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.section-count, .collection-count { color: var(--muted); font-size: 13px; }
.achievement-list { display: grid; gap: 5px; margin-top: 12px; }
.achievement { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border: 1px solid #4b3958; border-radius: 3px; background: #23192f; }
.achievement.is-done { border-color: #9c765d; background: #433146; }
.achievement-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; background: #9a829f; border-radius: 2px; }
.achievement.is-done .achievement-icon { background: var(--gold); }
.achievement-icon .pixel-symbol { width: 16px; }
.achievement-copy { display: grid; font-size: 12px; }
.achievement-copy span { color: var(--muted); font-size: 11px; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.combo-state { color: var(--mint); font: 600 16px/1.15 var(--font); }
.lab-board {
  --pot-size: 150px;
  margin-top: 13px; min-height: 245px; position: relative; isolation: isolate; display: grid; place-items: center;
  border: 2px solid #6c4b69; border-radius: 3px;
  box-shadow: inset 0 0 0 3px #171022, inset 0 0 35px #100b1ba6;
  background: #211831 url('assets/workshop.png') center / cover no-repeat; image-rendering: pixelated;
}
.cauldron { position: absolute; z-index: -1; left: 50%; top: 44%; width: var(--pot-size); aspect-ratio: 1; transform: translate(-50%, -50%); }
.cauldron img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 13px #83eab338); }
.brew-bubble { position: absolute; left: 48%; top: 40%; width: 6px; height: 6px; background: #79d898; box-shadow: inset 2px 2px #c2ffd2; animation: rise 3s steps(10, end) infinite; }
.bubble-two { left: 35%; width: 8px; height: 8px; animation-delay: -1.65s; }
.bubble-three { left: 62%; width: 5px; height: 5px; animation-delay: -.8s; }
@keyframes rise { 0% { transform: translateY(0); opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-42px); opacity: 0; } }
.lab-board.is-success .cauldron img { animation: brew-success .65s steps(5, end); }
.lab-board.is-fail .cauldron img { animation: brew-fail .37s steps(6, end); }
@keyframes brew-success { 50% { transform: translateY(-7px) scale(1.12); filter: drop-shadow(0 0 16px #bbffaa) brightness(1.3); } }
@keyframes brew-fail { 25%, 75% { transform: translateX(5px); } 50% { transform: translateX(-5px); } }
.selected-slots { width: min(calc(100% - 26px), 435px); margin-bottom: 24px; display: grid; grid-template-columns: minmax(0, 1fr) var(--pot-size) minmax(0, 1fr); align-items: center; gap: 3px; }
.selected-slot {
  min-width: 0; min-height: 70px; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 5px 3px;
  border: 2px dashed #ac809d; border-radius: 4px; background: #1d1329d9; text-align: center; color: var(--text);
  font: 600 15px/1.1 var(--font); overflow-wrap: anywhere;
}
.selected-slot.is-filled { border: 2px solid var(--mint); background: #303c3b; }
.slot-plus { visibility: hidden; }
.slot-placeholder { color: var(--gold); font: 500 31px/1 var(--font); }
.board-hint { position: absolute; bottom: 9px; left: 8px; right: 8px; min-height: 38px; display: grid; place-items: center; padding: 4px 7px; background: #1d1429ec; border: 1px solid #715772; border-radius: 3px; text-align: center; font-size: 14px; line-height: 1.22; }
.lab-board.is-success .board-hint { color: var(--mint); border-color: #7fac8c; }
.lab-board.is-fail .board-hint { color: #ffb5c1; }
.board-actions { margin-top: 9px; }
.elements-heading { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin: 17px 0 10px; }
.element-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; max-height: 321px; overflow: auto; padding: 2px 3px 3px; scrollbar-color: #88627e var(--panel-dark); scrollbar-width: thin; }
.element-card {
  display: grid; position: relative; gap: 5px; align-content: center; justify-items: center; min-height: 78px; padding: 7px 4px;
  border: 2px solid #674d73; border-radius: 4px; background: #382845;
  box-shadow: inset 0 -4px #251a34, 0 2px #1a1225; color: var(--text); text-align: center;
}
.element-card:hover { border-color: var(--gold); background: #493553; }
.element-card.is-selected { border-color: var(--mint); background: #344840; }
.element-card.is-new::after { content: ''; position: absolute; right: 6px; top: 6px; width: 5px; height: 5px; background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.element-copy { min-width: 0; font: 600 16px/1.07 var(--font); overflow-wrap: anywhere; }
.element-glyph, .course-icon, .modal-course-icon { display: grid; place-items: center; background: var(--tone, #c7a2eb); border-radius: 3px; box-shadow: inset 0 -3px #39244945, inset 0 2px #ffffff3b; }
.element-glyph { width: 32px; height: 32px; }
.pixel-symbol { display: block; width: 32px; aspect-ratio: 1; background-image: url('assets/symbols.png'); background-size: 600% 300%; background-repeat: no-repeat; image-rendering: pixelated; }
[data-tone='lime'] { --tone: #ddeb94; }
[data-tone='violet'] { --tone: #c5a7f1; }
[data-tone='cyan'] { --tone: #90e0d6; }
[data-tone='orange'] { --tone: #ffbb81; }
[data-tone='pink'] { --tone: #f6a5c9; }

.catalog-panel { border-color: #88627e; }
.catalog-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin: 10px 0 12px; }
.catalog-tabs button { padding-inline: 8px; }
.toggle-label { display: inline-flex; min-height: 38px; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: 13px; }
.toggle-label input { position: absolute; opacity: 0; }
.toggle { width: 27px; height: 16px; padding: 2px; border: 1px solid #9b7aa5; border-radius: 3px; background: #473650; }
.toggle::after { content: ''; display: block; width: 10px; height: 10px; border-radius: 1px; background: #d8bfe0; }
.toggle-label input:checked + .toggle { background: #3d574c; }
.toggle-label input:checked + .toggle::after { transform: translateX(11px); background: var(--mint); }
.toggle-label input:focus-visible + .toggle { outline: 2px solid var(--mint); outline-offset: 3px; }
.toggle-label:has(input:disabled) { display: none; }
.course-grid { display: grid; gap: 7px; max-height: 565px; overflow: auto; scrollbar-color: #88627e var(--panel-dark); scrollbar-width: thin; padding: 3px; }
.course-card {
  width: 100%; min-height: 83px; display: grid; grid-template-columns: 35px minmax(0, 1fr) 13px; align-items: center;
  gap: 9px; padding: 8px; border: 1px solid #6b4e75; border-radius: 3px; background: #241a31; color: var(--text); text-align: left;
}
.course-card:hover { background: #3e2c46; border-color: var(--gold); }
.course-card.is-unlocked { border-color: #889e79; background: #2e3b36; }
.course-icon { width: 34px; height: 34px; }
.course-copy { min-width: 0; display: grid; gap: 4px; }
.course-copy strong { font-size: 14px; line-height: 1.2; }
.course-copy span { color: var(--muted); font-size: 13px; line-height: 1.25; }
.course-copy .course-grade { width: fit-content; padding: 2px 4px; border-radius: 2px; background: #453653; font-size: 12px; }
.course-copy .course-grade.is-match { color: var(--mint); background: #344942; }
.course-status { display: grid; justify-items: end; color: var(--mint); }
.pixel-lock { position: relative; display: block; width: 11px; height: 7px; background: #bca3bd; margin-top: 5px; border-radius: 1px; }
.pixel-lock::before { content: ''; position: absolute; left: 2px; top: -5px; width: 7px; height: 6px; border: 2px solid #bca3bd; border-radius: 3px 3px 0 0; }
.empty-catalog { padding: 6px; color: var(--muted); }

.toast { position: fixed; bottom: 20px; left: 50%; z-index: 3; width: max-content; max-width: calc(100% - 28px); padding: 11px 15px; border: 2px solid #987297; border-radius: 4px; background: var(--panel); color: var(--text); box-shadow: 0 4px #140f21; text-align: center; opacity: 0; transform: translate(-50%, 12px); transition: transform .2s, opacity .2s; pointer-events: none; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
dialog::backdrop { background: #100a19ca; backdrop-filter: blur(4px); }
.course-modal, .share-modal { width: min(690px, calc(100% - 28px)); max-height: min(820px, calc(100dvh - 28px)); padding: 24px; border: 2px solid #ab82a2; border-radius: 5px; background: var(--panel); color: var(--text); box-shadow: 0 0 0 4px #291d33, inset 0 0 0 3px #5a4162, 0 15px 65px #100918; }
.modal-close { position: absolute; top: 11px; right: 11px; width: 40px; height: 40px; background: #382746; color: var(--text); border: 2px solid #826289; border-radius: 3px; font: 600 23px/1 var(--font); }
.modal-close:hover { border-color: var(--gold); }
.modal-kicker { color: var(--gold); font: 600 16px/1 var(--font); letter-spacing: .09em; padding-right: 37px; }
.modal-course-title-row { display: flex; gap: 11px; align-items: start; margin: 15px 0; }
.modal-course-icon { width: 48px; height: 48px; flex: 0 0 48px; }
.is-discovery[open] .modal-course-icon { animation: reveal-icon .45s steps(5, end); }
@keyframes reveal-icon { 50% { transform: scale(1.18) rotate(-6deg); filter: brightness(1.35); } }
.modal-course-title-row h2 { font-size: clamp(24px, 4vw, 37px); overflow-wrap: anywhere; }
.course-meta { color: var(--muted); padding-top: 5px; font-size: 14px; }
.modal-course-essence { margin: 14px 0; }
.modal-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.modal-columns > div, .share-score-card { padding: 12px; border: 1px solid #654b73; border-radius: 3px; background: var(--panel-dark); }
.modal-label { margin-bottom: 6px; color: var(--gold); font: 600 18px/1.1 var(--font); }
.modal-copy, .entry-note { color: var(--muted); font-size: 14px; }
.modal-recipe, .entry-note { margin-top: 12px; }
.modal-recipe { padding: 8px 10px; color: var(--mint); background: #31463e; border: 1px solid #719478; border-radius: 3px; }
.modal-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.favorite-button { color: #ffc2dc; }
.favorite-button.is-active { background: #70435e; }
.share-modal { width: min(510px, calc(100% - 28px)); }
.share-modal h2 { margin: 0 36px 14px 0; font-size: 34px; }
.share-score-card { display: flex; align-items: center; gap: 12px; }
.share-score { color: var(--gold); font: 700 53px/1 var(--font); white-space: nowrap; }
.share-score span { color: var(--muted); font-size: 25px; }
.share-score-card p { color: var(--muted); font-size: 14px; }
.share-achievements { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.share-achievement { background: #463049; color: var(--gold); padding: 4px 7px; border-radius: 3px; font-size: 13px; }
.share-copy-button { width: 100%; margin-top: 8px; }
.share-text { width: 100%; min-height: 75px; margin-top: 10px; color: var(--text); background: var(--ink); border: 1px solid var(--line); padding: 8px; font: inherit; }

body.team-mode .element-card { min-height: 88px; }
body.team-mode .element-copy { font-size: 18px; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'game' 'sidebar'; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 740px) {
  .topbar, .layout { width: calc(100% - 24px); }
  .topbar { min-height: 64px; }
  .brand img { width: min(145px, 39vw); }
  .topbar-actions { gap: 5px; }
  .topbar-actions button { padding-inline: 7px; font-size: 15px; }
  .game-intro { display: block; padding-top: 13px; }
  .game-intro h1 { font-size: clamp(37px, 9.6vw, 65px); }
  .intro-tip { width: auto; margin-top: 7px; padding-bottom: 0; font-size: 15px; }
  .game-grid, .sidebar { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .panel { padding: 12px; }
  .lab-board { --pot-size: 110px; min-height: 191px; }
  .course-grid { max-height: 426px; }
  .course-modal, .share-modal { padding: 16px; }
  .modal-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .topbar { gap: 6px; }
  .brand img { width: 109px; }
  .topbar-actions button { padding-inline: 5px; font-size: 14px; }
  .game-intro h1 { font-size: 34px; }
  .lab-board { --pot-size: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The artwork carries the pixel style. Gameplay and controls share one font. */
.game-intro h1 { font-size: clamp(39px, 5vw, 71px); }
.intro-tip { width: min(100%, 350px); }
.share-button { color: var(--muted); background: transparent; border-color: #654a75; box-shadow: none; }
.share-button:hover { color: var(--text); background: #483357; }
.play-summary { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.play-summary .field-label { margin: 0; white-space: nowrap; }
.play-summary .select-control { width: auto; min-height: 36px; padding: 4px 7px; font-size: 14px; }
.play-summary output { margin-left: auto; padding: 3px 9px; color: var(--gold); font-weight: 750; font-variant-numeric: tabular-nums; background: #21182e; border: 1px solid #805f87; border-radius: 3px; }
.quest { display: flex; align-items: start; justify-content: space-between; gap: 5px; margin-top: 9px; padding: 7px 9px; color: var(--mint); border-left: 3px solid #91c79b; background: #293639; font-size: 14px; }
.quest p { margin-top: 2px; color: var(--text); }
.quest .ghost-button { min-height: 32px; min-width: 32px; padding: 0; box-shadow: none; }
.element-card.is-hinted { border-color: #f1cd89; background: #514048; box-shadow: inset 0 -3px #38283a, 0 0 0 1px #cda471; }
.element-card.is-selected { border-color: var(--mint); }
.element-card.is-new .element-glyph { animation: reveal-icon .6s steps(5, end); }
#mixFeedback { margin: -3px 0 8px; color: var(--mint); font-size: 14px; font-weight: 600; }
.flying-ingredient { position: fixed; z-index: 10; pointer-events: none; }
.brew-splash { position: absolute; top: 42%; left: 50%; width: 5px; height: 5px; opacity: 0; pointer-events: none; }
.lab-board.is-brewing .brew-splash { animation: splash .21s steps(6, end); }
.lab-board.is-brewing .cauldron { animation: simmer .21s steps(5, end); }
.lab-board.is-brewing .brew-bubble { animation-duration: .29s; }
@keyframes splash {
  0% { opacity: 1; background: #d7ffb2; box-shadow: -6px 0 #a3f6aa, 7px 0 #a3f6aa, 0 -5px #d7ffb2; }
  52% { opacity: 1; background: #c8fb9f; box-shadow: -23px -13px #a3f6aa, 18px -19px #a3f6aa, 0 -27px #f3ffd5, 12px -8px #d7ffb2; }
  100% { opacity: 0; box-shadow: -29px -4px #a3f6aa, 25px -7px #a3f6aa, 0 -30px #f3ffd5, 16px -5px #d7ffb2; }
}
@keyframes simmer {
  45% { filter: brightness(1.24) drop-shadow(0 -3px 9px #9df0a876); }
}
.element-card { cursor: grab; user-select: none; -webkit-user-select: none; }
.element-card .element-glyph { touch-action: none; }
.element-card.is-drag-source { opacity: .55; cursor: grabbing; }
.dragged-ingredient { position: fixed; z-index: 10; top: 0; left: 0; width: 44px; height: 44px; pointer-events: none; outline: 2px solid var(--gold); box-shadow: 0 4px 12px #170f22; }
.lab-board.is-dragging .cauldron::after { content: ''; position: absolute; inset: 19% 5% 4%; border: 2px dashed var(--gold); border-radius: 8px; }
.lab-board.is-drop-target .cauldron::after { border-style: solid; border-color: var(--mint); box-shadow: 0 0 14px #b7efb366; }
.lab-board.is-drop-target .cauldron img { filter: drop-shadow(0 0 13px #83eab3) brightness(1.17); }
.cauldron.has-fallback::before { content: ''; position: absolute; inset: 39% 15% 9%; background: linear-gradient(#a8ed9f 0 15%, #437f72 15% 29%, #746086 29% 38%, #463956 38% 100%); clip-path: polygon(0 0,100% 0,100% 32%,93% 32%,93% 75%,82% 75%,82% 92%,70% 92%,70% 100%,28% 100%,28% 92%,16% 92%,16% 75%,7% 75%,7% 32%,0 32%); }
#officialDetails { margin-top: 12px; color: var(--muted); font-size: 14px; }
#officialDetails summary { cursor: pointer; }
#officialDetails p { margin-top: 5px; }
.modal-footer { flex-wrap: wrap; }
@media (max-width: 740px) {
  .layout { gap: 10px; }
  .game-intro { padding-top: 8px; }
  .game-intro h1 { font-size: clamp(28px, 7.5vw, 45px); text-shadow: 2px 3px #110e1b; }
  .intro-tip { margin-top: 5px; }
  .board-panel .panel-head { display: none; }
  .play-summary { margin-top: 0; }
  .lab-board { min-height: 143px; margin-top: 9px; }
  .board-hint { min-height: 32px; font-size: 13px; bottom: 6px; }
  .selected-slot { min-height: 57px; font-size: 13px; }
  .selected-slots { margin-bottom: 22px; }
  .cauldron { top: 39%; }
  .course-grid { max-height: none; overflow: visible; }
  .element-card { min-height: 65px; }
  .element-copy { font-size: 13px; }
  .elements-heading { margin-block: 12px 6px; }
  .board-actions { margin-top: 7px; }
  .board-actions button { min-height: 36px; font-size: 13px; }
  .modal-footer > * { flex: 1 1 auto; }
}
@media (max-width: 360px) { .game-intro h1 { font-size: 26px; } }

.entrance {
  width: min(1300px, calc(100% - 64px));
  min-height: min(720px, calc(100svh - 78px));
  margin: 0 auto;
  padding-block: 32px;
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(0, 1.35fr);
  gap: clamp(22px, 4vw, 72px);
  align-items: center;
}
.entrance-copy { position: relative; z-index: 1; }
.entrance h1 { max-width: 10ch; font-size: clamp(56px, 6.4vw, 98px); line-height: .95; letter-spacing: -.065em; text-shadow: 0 6px #170e21; }
.entrance h1 span { display: block; color: var(--gold); }
.entrance-copy p { max-width: 35ch; margin-top: 23px; color: #dfcce7; font-size: clamp(16px, 1.5vw, 21px); line-height: 1.55; }
.entrance .entrance-start { margin-top: 29px; min-height: 55px; padding: 10px 19px; font-size: 17px; }
.entrance .entrance-progress { margin-top: 12px; color: var(--mint); font-size: 14px; }
.entrance-art {
  position: relative;
  align-self: center;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 384 / 272;
  border: 3px solid #a27883;
  border-radius: 6px;
  background: #291e35;
  box-shadow: 0 0 0 5px #3d2b48, 0 0 0 7px #644756, 0 20px 70px #0c091855;
}
.entrance-art img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.entrance-art::before {
  content: '';
  position: absolute;
  inset: 32% 22% 15%;
  pointer-events: none;
  background: radial-gradient(ellipse, #c2ffab39, transparent 67%);
  animation: entrance-glow 3.4s ease-in-out infinite alternate;
}
.entrance-spark {
  position: absolute;
  top: 53%;
  width: clamp(3px, .5vw, 7px);
  aspect-ratio: 1;
  background: #b7fbc1;
  box-shadow: 0 0 10px #b7fbc177;
  animation: entrance-rise 2.7s steps(14, end) infinite;
}
.spark-left { left: 45%; animation-delay: -1.6s; }
.spark-center { left: 49%; animation-delay: -.55s; }
.spark-right { left: 53%; animation-delay: -2.3s; }
@keyframes entrance-glow { from { opacity: .32; } to { opacity: 1; } }
@keyframes entrance-rise {
  0% { opacity: 0; transform: translate(0, 6px); }
  16%, 60% { opacity: 1; }
  100% { opacity: 0; transform: translate(12px, -68px) scale(.55); }
}
.in-workshop .layout { animation: open-workshop .24s ease-out both; }
@keyframes open-workshop { from { opacity: .25; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 840px) {
  .entrance { min-height: 0; width: min(550px, calc(100% - 34px)); grid-template-columns: 1fr; padding-block: 21px 26px; gap: 23px; }
  .entrance-art { grid-row: 1; width: 100%; }
  .entrance h1 { max-width: none; font-size: clamp(39px, 8.8vw, 68px); }
  .entrance h1 span { display: inline; }
  .entrance-copy p { margin-top: 12px; font-size: 16px; }
  .entrance .entrance-start { margin-top: 16px; }
}
@media (max-width: 540px) {
  .entrance { gap: 20px; }
  .entrance .entrance-start { width: 100%; }
  .in-workshop .topbar { flex-wrap: wrap; padding-block: 8px; }
  .in-workshop .topbar-actions { flex-wrap: wrap; }
  .in-workshop .topbar-actions button { min-height: 34px; padding-inline: 6px; font-size: 13px; }
}
