/* Zugwunder website — f97.be/zugwunder
   Cool, light palette around the app's teal accent; Manrope throughout. */

:root {
  --bg: #F7F9F8;
  --bg-tint: #ECF4F0;
  --surface: #FFFFFF;
  --ink: #13211E;
  --ink-soft: #566663;
  --line: #DCE4E0;
  --line-strong: #C5D1CB;
  --accent: #1F7A6B;
  --accent-deep: #155A4F;
  --accent-soft: #D7EFE8;
  --mint: #8FE0CB;
  --dark: #0F1F1C;
  --dark-2: #15302B;
  --on-dark: #E8F2EE;
  --on-dark-soft: #9DB5AE;
  --square-light: #EDEBDD;
  --square-dark: #7A9B5C;
  --piece-white: #FBFAF4;
  --piece-black: #1C1C1C;
  --warn: #C8663A;
  --arrow: #E8932C;

  --sans: "Manrope", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 64ch;
  --page: 1160px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(19, 33, 30, .05), 0 12px 32px -12px rgba(19, 33, 30, .16);
  --shadow-lg: 0 2px 4px rgba(19, 33, 30, .06), 0 32px 64px -24px rgba(19, 33, 30, .30);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.03em; }
h3 { font-size: 1.22rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.25em; max-width: var(--measure); }
li { margin-bottom: .5em; }
li::marker { color: var(--accent); }
a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }
strong { font-weight: 700; }
em { font-style: italic; }
small { font-size: .9em; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--accent-soft); color: var(--accent-deep); padding: .1em .4em; border-radius: 6px; }
pre {
  background: var(--surface); color: var(--ink); padding: 1rem 1.2rem; border-radius: 12px; border: 1px solid var(--line);
  overflow-x: auto; line-height: 1.55; max-width: 100%; box-shadow: var(--shadow);
}
pre code { background: none; padding: 0; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff;
  padding: .5rem 1rem; z-index: 100; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

.wrap { width: min(var(--page), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: .85rem max(var(--gutter), calc((100% - var(--page)) / 2));
  background: rgba(247, 249, 248, .82); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink);
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .97rem;
  padding: .45rem .8rem; border-radius: 999px; transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-deep); }
.site-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.lang {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-tint); border: 1px solid var(--line);
  font-weight: 700; font-size: .78rem;
}
.lang a, .lang span { padding: .28rem .6rem; border-radius: 999px; color: var(--ink-soft); text-decoration: none; line-height: 1; }
.lang a:hover { color: var(--accent-deep); background: #fff; }
.lang [aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.35rem; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  font-family: var(--sans); font-weight: 700; font-size: 1rem; line-height: 1;
  box-shadow: 0 1px 2px rgba(19,33,30,.06);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  cursor: pointer;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(19,33,30,.25); color: var(--ink); border-color: var(--accent); }
.button:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(19,33,30,.06); }
.button-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 6px 18px -8px rgba(31,122,107,.7); }
.button-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; box-shadow: 0 10px 24px -8px rgba(31,122,107,.7); }
.button-gold { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-soft); }
.button-gold:hover { background: #C6E8DE; color: var(--accent-deep); border-color: var(--accent); }
.button small { font-weight: 500; opacity: .8; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 1rem; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem);
}
.hero-copy h1 { margin-bottom: .55em; }
.hero-lede { font-size: 1.18rem; line-height: 1.55; max-width: 34em; color: var(--ink-soft); }
.hero-meta { color: var(--ink-soft); font-size: .92rem; }

/* The board */
.board-figure { margin: 0; display: grid; gap: 1rem; justify-items: start; }
.board {
  width: 100%; max-width: 520px; aspect-ratio: 1; display: block;
  border-radius: 14px; background: var(--square-light);
  box-shadow: var(--shadow-lg); border: 1px solid rgba(19,33,30,.12);
}
.board .light { fill: var(--square-light); }
.board .dark { fill: var(--square-dark); }
.board .coord { font: 700 .3px var(--sans); fill: var(--square-dark); }
.board .coord.on-dark { fill: var(--square-light); }
.board .arrow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.board .arrow.white { stroke: var(--arrow); stroke-width: .16; }
.board .arrow.black { stroke: var(--ink); stroke-width: .09; }
.board .arrow-outline { stroke: #fff; stroke-width: .24; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.board .arrow-halo { stroke: #fff; stroke-width: .17; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.board .head-white { fill: var(--arrow); }
.board .head-white-outline { fill: #fff; stroke: #fff; stroke-width: .09; stroke-linejoin: round; opacity: .9; }
.board .head-black { fill: var(--ink); }
.board .head-black-halo { fill: #fff; stroke: #fff; stroke-width: .09; stroke-linejoin: round; opacity: .9; }
.board .step { font: 800 .32px var(--sans); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.board .step-bg { fill: var(--arrow); stroke: #fff; stroke-width: .05; }
.board .solution { opacity: 0; transition: opacity .25s ease; }
.board.show-solution .solution { opacity: 1; }
.board-caption { font-size: .98rem; color: var(--ink-soft); max-width: 36em; }
.board-caption strong { color: var(--ink); }
.solution-line {
  font-weight: 800; font-size: 1.12rem; margin: .25rem 0 0; letter-spacing: -0.01em;
  display: none; align-items: baseline; gap: .6rem; flex-wrap: wrap;
}
.solution-line .note { font-weight: 500; font-size: .92rem; color: var(--ink-soft); letter-spacing: 0; }
.board-figure.revealed .solution-line { display: flex; }

/* Piece glyphs: fills inherit through <use>; details use currentColor. */
.wpiece { fill: var(--piece-white); stroke: #2A2A2A; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; color: #2A2A2A; }
.bpiece { fill: var(--piece-black); stroke: var(--piece-black); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; color: #E9E9E9; }
.piece-row { display: inline-flex; gap: .2rem; vertical-align: middle; }
.piece-row svg { width: 40px; height: 40px; }

/* ---------- sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem 3rem; margin-bottom: 2.2rem; align-items: end; }
.section-head p { font-size: 1.08rem; color: var(--ink-soft); max-width: 48em; }
@media (min-width: 860px) {
  .section-head.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Scoresheet (measured facts): a dark band on the front page, a plain table elsewhere. */
.scoresheet { width: 100%; border-collapse: collapse; }
.scoresheet th, .scoresheet td { text-align: left; vertical-align: top; padding: 1rem 1.2rem 1rem 0; border-top: 1px solid var(--line); }
.scoresheet tr:first-child th, .scoresheet tr:first-child td { border-top: 0; }
.scoresheet th { font-weight: 700; font-size: .98rem; width: 22%; white-space: nowrap; color: var(--ink-soft); }
.scoresheet td.value { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; line-height: 1.1; width: 30%; }
.scoresheet td.value small { display: block; font-weight: 500; font-size: .82rem; letter-spacing: 0; color: var(--ink-soft); margin-top: .3rem; }
.scoresheet td.note { color: var(--ink-soft); font-size: .95rem; }
.section.measured { background: var(--bg-tint); border-top: 0; }
.section.measured + .section { border-top: 0; }
.section.measured .scoresheet th, .section.measured .scoresheet td { border-top-color: var(--line-strong); }
.section.measured .scoresheet td.value { color: var(--accent-deep); }
.section.measured code { background: var(--surface); }
@media (max-width: 720px) {
  .scoresheet, .scoresheet tbody, .scoresheet tr, .scoresheet th, .scoresheet td { display: block; width: auto; }
  .scoresheet tr { padding: 1rem 0; border-top: 1px solid var(--line); }
  .section.measured .scoresheet tr { border-top-color: var(--line-strong); }
  .scoresheet tr:first-child { border-top: 0; }
  .scoresheet th, .scoresheet td { padding: 0; border: 0 !important; }
  .scoresheet td.value { margin: .2rem 0 .35rem; }
}

/* Three programs */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.trio > article { padding: 1.8rem 1.6rem 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem; }
.trio img, .trio .glyph { width: 64px; height: 64px; border-radius: 16px; margin-bottom: .7rem; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.trio .glyph { background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 1.1rem; }
.trio h3 { font-size: 1.45rem; margin-bottom: .15rem; letter-spacing: -0.02em; }
.trio .role { font-weight: 600; color: var(--accent); margin: 0 0 .5rem; font-size: .95rem; }
.trio p { font-size: .96rem; color: var(--ink-soft); }
.trio .more { margin-top: auto; padding-top: .9rem; font-weight: 700; text-decoration: none; }
.trio .more:hover { text-decoration: underline; }
@media (max-width: 860px) { .trio { grid-template-columns: 1fr; } }

/* Modes: four columns with line icons */
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 2.2rem; }
.modes article h3 { display: flex; align-items: center; gap: .6rem; }
.modes svg { width: 38px; height: 38px; flex: none; padding: 7px; border-radius: 11px; background: var(--accent-soft); stroke: var(--accent-deep); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.modes svg .gold { fill: var(--accent); stroke: none; }
.modes p { font-size: .96rem; color: var(--ink-soft); }
@media (max-width: 960px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .modes { grid-template-columns: 1fr; } }

/* Dated changelog */
.log { list-style: none; padding: 0; margin: 0; max-width: none; }
.log li { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1rem 2rem; padding: 1.2rem 0; border-top: 1px solid var(--line); margin: 0; }
.log li:first-child { border-top: 0; }
.log time { font-weight: 700; color: var(--accent); font-size: .95rem; padding-top: .15rem; }
.log h3 { font-size: 1.12rem; margin-bottom: .3rem; }
.log p { font-size: .96rem; color: var(--ink-soft); max-width: 72ch; }
.log .tag { display: inline-block; font-weight: 700; font-size: .72rem; letter-spacing: .02em; background: var(--accent); color: #fff; border-radius: 999px; padding: .15rem .55rem; margin-left: .55rem; vertical-align: middle; }
@media (max-width: 640px) { .log li { grid-template-columns: 1fr; gap: .2rem; } }

/* Two-column prose block with a sticky heading */
.chapter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.5rem 4rem; padding: clamp(2rem, 5vw, 3.5rem) 0; border-top: 1px solid var(--line); }
.chapter:first-of-type { border-top: 0; }
.chapter-head { position: sticky; top: 5rem; align-self: start; }
.chapter-head h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); }
.chapter-head p { color: var(--ink-soft); font-size: 1rem; }
.chapter-head .pieces { display: flex; gap: .3rem; margin-top: 1rem; }
.chapter-head .pieces svg { width: 42px; height: 42px; }
.chapter-body h3 { margin-top: 1.6rem; }
.chapter-body h3:first-child { margin-top: 0; }
.chapter-body ul { padding-left: 1.2em; }
.chapter-body dl { margin: 0 0 1.2rem; max-width: var(--measure); }
.chapter-body dt { font-weight: 700; margin-top: 1rem; }
.chapter-body dd { margin: .15rem 0 0; color: var(--ink-soft); }
.chapter-body p, .chapter-body li { color: var(--ink); }
.icon-frame { border-radius: 20px; box-shadow: var(--shadow); }
@media (max-width: 860px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter-head { position: static; }
}

/* Dialog mock (puzzle generator options) */
.dialog {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg);
  padding: 1.3rem 1.4rem; max-width: 460px;
}
.dialog h4 { margin: 0 0 .9rem; font-size: 1.08rem; display: flex; align-items: center; gap: .5rem; }
.dialog .row { display: grid; grid-template-columns: 6rem 1fr; align-items: center; gap: .6rem; margin: .55rem 0; font-weight: 600; font-size: .88rem; color: var(--ink-soft); }
.dialog .seg { display: inline-flex; border-radius: 8px; background: var(--bg-tint); padding: 2px; font-size: .8rem; color: var(--ink); }
.dialog .seg span { padding: .22rem .55rem; border-radius: 6px; }
.dialog .seg .on { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 700; }
.dialog .select { border: 1px solid var(--line-strong); border-radius: 8px; padding: .25rem .6rem; font-size: .82rem; display: inline-flex; gap: .6rem; color: var(--ink); background: var(--surface); }
.dialog .foot { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.dialog .foot span { border: 1px solid var(--line-strong); border-radius: 9px; padding: .4rem .85rem; font-size: .88rem; font-weight: 700; }
.dialog .foot .primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Download page */
.pkg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.6rem; }
.pkg-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2rem; align-items: center; padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--line); background: var(--bg-tint); }
.pkg-head img, .pkg-head .glyph { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.pkg-head .glyph { background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 1rem; }
.pkg-head h2 { font-size: 1.6rem; margin: 0; }
.pkg-head p { margin: .15rem 0 0; color: var(--ink-soft); font-size: .98rem; }
.pkg-body { padding: 1.4rem 1.6rem; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.5rem 3rem; }
.pkg-body h3 { font-size: 1.02rem; margin-bottom: .4rem; }
.pkg-body p, .pkg-body ul { font-size: .96rem; }
.files { list-style: none; padding: 0; margin: 0; max-width: none; }
.files li { margin: 0; padding: .85rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; align-items: center; }
.files li:first-child { border-top: 0; padding-top: 0; }
.files .name { font-weight: 700; }
.files .meta { color: var(--ink-soft); font-size: .88rem; grid-column: 1; }
.files .sha { font-family: var(--mono); font-size: .7rem; color: var(--ink-soft); word-break: break-all; grid-column: 1 / -1; background: var(--bg); padding: .3rem .5rem; border-radius: 6px; }
.files .button { padding: .55rem .95rem; font-size: .92rem; }
.aside-heads h2 { font-size: 1.4rem; }
@media (max-width: 760px) {
  .pkg-body { grid-template-columns: 1fr; }
  .pkg-head { grid-template-columns: auto minmax(0, 1fr); }
  .pkg-head .button { grid-column: 1 / -1; justify-self: start; }
}

/* Closing call */
.closing { padding: clamp(3rem, 7vw, 6rem) 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
.closing h2 { margin-bottom: .3em; }
.closing .actions { margin: 0; }
@media (max-width: 760px) { .closing { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; font-size: .92rem; color: var(--ink-soft); background: var(--bg-tint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0; }

/* Small helpers */
.muted { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.lead { font-size: 1.18rem; line-height: 1.55; max-width: 40em; color: var(--ink-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--surface); border-radius: 10px; padding: .9rem 1.1rem; font-size: .95rem; max-width: var(--measure); color: var(--ink-soft); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .board { max-width: 100%; }
}
@media (max-width: 700px) {
  .site-header { gap: .7rem .8rem; padding-top: .7rem; padding-bottom: .7rem; }
  .site-nav { order: 3; width: 100%; gap: .1rem; }
  .site-nav a { font-size: .92rem; padding: .35rem .6rem; }
  .lang { order: 2; margin-left: auto; font-size: .74rem; }
  .brand { font-size: 1.1rem; }
  .brand img { width: 30px; height: 30px; }
}

/* ---------- play page ---------- */
.play-intro h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: .4em; }
.play-intro .lead { font-size: 1.08rem; }
.play { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; padding: 1.5rem 0 3.5rem; }
.play-board-wrap { position: relative; max-width: 640px; }
.pboard {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1; width: 100%;
  border-radius: 14px; overflow: hidden; border: 1px solid rgba(19,33,30,.12);
  background: var(--square-light); box-shadow: var(--shadow-lg);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.pboard .square { position: relative; display: grid; place-items: center; cursor: pointer; }
.pboard .square.light { background: var(--square-light); }
.pboard .square.dark { background: var(--square-dark); }
.pboard .square.last::before { content: ""; position: absolute; inset: 0; background: rgba(255, 220, 90, .5); }
.pboard .square.selected::before { content: ""; position: absolute; inset: 0; background: rgba(255, 220, 90, .75); }
.pboard .square.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(230, 30, 30, .95) 0%, rgba(230, 30, 30, .5) 40%, rgba(230, 30, 30, 0) 75%); }
.pboard .square.target::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(19, 33, 30, .28); }
.pboard .square.target.occupied::after { width: 90%; height: 90%; background: transparent; border: 5px solid rgba(19, 33, 30, .3); }
.pboard .coord { position: absolute; font: 700 clamp(9px, 1.4vw, 12px)/1 var(--sans); pointer-events: none; }
.pboard .coord.file { right: 4px; bottom: 3px; }
.pboard .coord.rank { left: 4px; top: 3px; }
.pboard .square.light .coord { color: var(--square-dark); }
.pboard .square.dark .coord { color: var(--square-light); }
.pboard .piece { width: 90%; height: 90%; position: relative; z-index: 1; pointer-events: none; }
.drag-ghost { position: fixed; z-index: 10; pointer-events: none; transform: translate(-50%, -50%); }
.promotion { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(247, 249, 248, .6); border-radius: 14px; z-index: 5; }
.promotion.open { display: flex; }
.promotion > div { display: flex; gap: 8px; background: var(--surface); padding: 10px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.promotion button { width: 64px; height: 64px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.promotion button:hover { background: var(--accent-soft); border-color: var(--accent); }
.promotion button svg { width: 100%; height: 100%; display: block; }

.play-side { display: grid; gap: 1.2rem; }
.play-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.4rem; display: grid; gap: 1rem; }
.play-status { font-weight: 800; font-size: 1.35rem; line-height: 1.15; min-height: 1.3em; letter-spacing: -0.02em; }
.play-eval { color: var(--ink-soft); font-size: .92rem; min-height: 1.3em; margin-top: -.5rem; }
.play-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.play-fields label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .3rem; color: var(--ink-soft); }
.play-fields select {
  width: 100%; font: 600 .95rem var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: .55rem 2rem .55rem .75rem; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23566663' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 12px 8px;
}
.play-fields select:focus { border-color: var(--accent); }
.play-actions { display: flex; flex-wrap: wrap; gap: .6rem .7rem; }
.play-actions .button { padding: .6rem .95rem; font-size: .92rem; }
.play-actions .button:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.play-moves { border-top: 1px solid var(--line); padding-top: .6rem; max-height: 280px; overflow-y: auto; font-size: .96rem; }
.play-moves ol { margin: 0; padding: 0; list-style: none; counter-reset: move; max-width: none; }
.play-moves li { counter-increment: move; display: grid; grid-template-columns: 2.4rem 1fr 1fr; padding: .3rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.play-moves li::before { content: counter(move) "."; color: var(--ink-soft); font-weight: 600; }
.play-moves li span { font-weight: 700; }
.play-moves:has(ol:empty) { display: none; }
.thinking::after { content: " …"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.play-help { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1.4rem; }
.play-help summary { cursor: pointer; font-weight: 700; padding: .2rem 0; }
.play-help p, .play-help dd { font-size: .94rem; color: var(--ink-soft); }
.play-help p:first-of-type { margin-top: .8rem; }
.play-help dl { margin: .6rem 0; }
.play-help dt { font-weight: 700; margin-top: .7rem; }
.play-help dd { margin: .1rem 0 0; }
.play-note { font-size: .9rem; color: var(--ink-soft); max-width: none; }
@media (max-width: 860px) {
  .play { grid-template-columns: 1fr; }
  .play-board-wrap { max-width: 100%; }
}
