:root {
  color-scheme: dark;
  --page: #100d25;
  --panel: #1b1634;
  --ink: #f5f1ff;
  --muted: #c3bad8;
  --cyan: #86f6df;
  --line: #413760;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }
button { font: inherit; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid #ffe3a2; outline-offset: 4px; }
.shell { width: min(1220px, calc(100% - 64px)); margin-inline: auto; }
.mast { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 77px; gap: 16px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 850; font-size: 1.17rem; letter-spacing: -.035em; }
.brand img { border-radius: 9px; }
.brand span { font-size: .8rem; color: var(--muted); font-weight: 650; }
nav { display: flex; gap: clamp(14px, 3vw, 34px); }
nav a { text-decoration: none; font-weight: 750; font-size: .92rem; }
nav a:hover, .questions a:hover { color: var(--cyan); }
.console { display: grid; grid-template-columns: .95fr 1.05fr; min-height: 572px; border: 1px solid #65528d; border-radius: 23px; background: #19142e; box-shadow: 0 14px 65px #08051b75; overflow: hidden; }
.splash { position: relative; min-height: 100%; isolation: isolate; }
.splash-art, .splash-art img { position: absolute; display: block; inset: 0; width: 100%; height: 100%; }
.splash-art img { object-fit: cover; object-position: 50% 67%; }
.splash::after { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg,#130e2ae8 0%,#18103360 36%,transparent 58%); pointer-events: none; }
.splash-title { position: relative; z-index: 2; padding: clamp(27px, 4vw, 51px); }
.splash-title p, .training-top, .eyebrow { color: var(--cyan); font: 750 .8rem/1.35 system-ui, sans-serif; letter-spacing: .11em; text-transform: uppercase; }
h1, h2 { font-family: ui-rounded, "Avenir Next", system-ui, sans-serif; font-weight: 900; }
h1 { font-size: clamp(3.65rem, 7.5vw, 7.35rem); line-height: .83; letter-spacing: -.075em; margin-top: 16px; text-shadow: 0 3px #2b1849; }
h1 em { font-style: normal; color: var(--cyan); }
.training { padding: clamp(25px, 4vw, 47px); background: radial-gradient(ellipse at 70% 10%,#2e2252,#1c1734 62%); }
.training-top { display: flex; justify-content: space-between; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid #544570; }
#round-count { color: #e1cef9; font-family: ui-monospace, monospace; }
.training h2 { font-size: clamp(1.75rem, 3vw, 2.55rem); letter-spacing: -.045em; line-height: 1.05; }
#exercise-instruction, .no-script { font-size: .96rem; color: var(--muted); margin-top: 9px; line-height: 1.55; }
.board { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; max-width: 348px; margin: 21px auto 0; padding: 8px; background: #17102b; border: 1px solid #4f4080; border-radius: 14px; }
.cell { display: grid; place-items: center; aspect-ratio: 1.12; min-width: 0; padding: 0; border: 1px solid #534278; border-radius: 8px; background: #34274e; box-shadow: inset 0 2px #62538060, 0 2px #110d22; color: var(--ink); }
.cell:nth-child(5n+2), .cell:nth-child(5n+3) { background: #392d59; }
.cell.placed { background: #225958; border-color: #57bbb0; }
.cell.candidate { background: #594183; border-color: #c4a2ff; cursor: pointer; box-shadow: 0 0 10px #a783ff50, inset 0 2px #d3baff60; }
.cell.candidate[aria-disabled="true"] { cursor: default; }
.cell.candidate:not([aria-disabled]):hover { background: #7156aa; }
.cell.candidate::before { content: ""; width: 19%; aspect-ratio: 1; border: 1px solid #e2c9ff; border-radius: 28%; transform: rotate(45deg); }
.cell.blocked { background: #66354c; border-color: #f09ab0; }
.cell.blocked::before { content: "×"; color: #ffe0e7; border: 0; aspect-ratio: auto; width: auto; transform: none; font-size: 1.35rem; }
.cell.solved { background: #256763; border-color: var(--cyan); }
.cell.solved::before { display: none; }
.cat-mark { position: relative; display: block; width: 47%; height: 40%; border-radius: 36% 36% 48% 48%; background: radial-gradient(circle at 35% 53%,#23434c 0 7%, transparent 8%), radial-gradient(circle at 65% 53%,#23434c 0 7%, transparent 8%), #b6f5df; }
.cat-mark::before, .cat-mark::after { content: ""; position: absolute; width: 39%; height: 45%; top: -22%; background: #b6f5df; }
.cat-mark::before { left: 0; clip-path: polygon(0 0,100% 90%,12% 100%); }
.cat-mark::after { right: 0; clip-path: polygon(100% 0,88% 100%,0 90%); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; color: #e1d4ef; font-size: .82rem; margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.placed-key { background: var(--cyan); }
.target-key { background: #ba9bf7; }
.feedback { min-height: 47px; font-size: .89rem; line-height: 1.55; color: #ddd0f1; margin-top: 18px; }
.feedback[data-state="success"] { color: var(--cyan); }
.feedback[data-state="retry"] { color: #ffc2ce; }
.feedback[data-state="hint"] { color: #ffe3a2; }
.controls { display: flex; justify-content: space-between; gap: 12px; }
.controls button, .store { min-height: 45px; padding: 10px 15px; border-radius: 9px; font-size: .88rem; font-weight: 800; }
.secondary { background: #33284d; color: #f7edff; border: 1px solid #74638e; cursor: pointer; }
.advance { background: var(--cyan); color: #142c33; border: 1px solid var(--cyan); cursor: pointer; }
.controls button:disabled { opacity: .5; cursor: default; }
.section { scroll-margin-top: 22px; }
.rules { padding-block: 78px 68px; }
.section-head { display: grid; grid-template-columns: 1.05fr 1fr; align-items: end; gap: 25px 55px; margin-bottom: 28px; }
h2 { font-size: clamp(2.2rem,4.2vw,4rem); line-height: 1.01; letter-spacing: -.065em; text-wrap: balance; }
.eyebrow { margin-bottom: 14px; }
.section-head > p, .rule-list p, .workbench p:not(.eyebrow), .walk p, .questions p { color: var(--muted); line-height: 1.7; }
.rule-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.rule-list article { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.rule-list p { margin-top: 9px; }
h3 { font-size: 1.14rem; line-height: 1.3; }
.rule-icon { width: 44px; height: 41px; display: grid; place-items: center; border-radius: 10px; margin-bottom: 18px; font-size: 1.55rem; font-weight: 800; color: #191731; box-shadow: 0 4px #50425d; }
.region { background: #c4adff; }
.line.rule-icon { background: var(--cyan); }
.corner.rule-icon { background: #ffcaa5; }
.workbench { display: grid; grid-template-columns: 1.12fr .88fr; align-items: center; gap: clamp(28px, 5vw, 78px); padding-block: 4px 73px; }
.workbench img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 19px; }
.workbench p:not(.eyebrow) { margin-top: 15px; }
.walk { display: grid; grid-template-columns: .85fr 1.15fr; gap: 32px 69px; border-top: 1px solid var(--line); padding-block: 55px 62px; }
.walk ol { margin: 0; padding-left: 1.8em; }
.walk li { padding: 13px 0 13px 7px; border-bottom: 1px solid var(--line); }
.walk li::marker { color: var(--cyan); font-weight: 850; }
.walk p:not(.eyebrow) { margin-top: 5px; }
.faq { display: grid; grid-template-columns: .72fr 1.28fr; gap: 31px 56px; padding-bottom: 65px; }
.questions { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 56px; padding-block: 12px; font-weight: 800; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.28rem; color: var(--cyan); }
details[open] summary::after { content: "−"; }
.questions p { padding-bottom: 15px; }
.questions a { text-underline-offset: 4px; }
.store { display: inline-flex; align-items: center; justify-self: end; gap: 9px; text-decoration: none; background: var(--cyan); color: #142c33; }
.store:hover { background: #b0fae9; }
.store-icon { width: 15px; height: 17px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.store-label { display: block; line-height: 1.15; }
.store-label small { display: block; margin-bottom: 2px; font-size: .75rem; font-weight: 700; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px; padding-block: 29px; color: var(--muted); }
.footer .brand { font-size: .94rem; color: var(--ink); }
.footer p, .footer > a:last-child { font-size: .84rem; }
.missing { padding-block: 80px; }
.missing p { margin-top: 25px; }
@media (max-width: 1000px) {
  .shell { width: calc(100% - 42px); }
  .training { padding: 25px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .mast { grid-template-columns: 1fr auto; gap: 10px; min-height: 68px; padding-block: 12px; }
  .mast .store { grid-column: 1 / -1; justify-self: center; }
  .brand span { display: none; }
  .console, .section-head, .workbench, .walk, .faq { grid-template-columns: 1fr; }
  .splash { min-height: clamp(290px, 78vw, 515px); }
  .splash-title { padding: 23px; }
  .splash-title p { font-size: .75rem; }
  h1 { font-size: clamp(3.3rem, 10vw, 5.7rem); }
  .splash-art img { object-position: 50% 60%; }
  .training { padding: 24px 19px; }
  .rules { padding-block: 52px 46px; }
  .rule-list { grid-template-columns: 1fr; gap: 10px; }
  .workbench { padding-bottom: 49px; }
  .walk { padding-block: 39px 45px; }
  .faq { padding-bottom: 45px; }
}
@media (max-width: 360px) {
  nav { gap: 10px; }
  nav a { font-size: .8rem; }
  .brand { font-size: 1rem; }
}
