@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4efe3;
  --bg-deep: #efe7d7;
  --paper: rgba(255, 251, 244, 0.9);
  --paper-strong: #fffaf1;
  --paper-muted: rgba(255, 247, 235, 0.82);
  --paper-soft: rgba(255, 255, 255, 0.64);
  --surface-top: rgba(255, 255, 255, 0.72);
  --surface-mid: rgba(255, 252, 246, 0.64);
  --surface-bottom: rgba(255, 249, 240, 0.56);
  --surface-border: rgba(61, 49, 30, 0.08);
  --ink: #1d1b17;
  --ink-soft: #2b2721;
  --muted: #6f6658;
  --muted-soft: #897d6d;
  --line: rgba(61, 49, 30, 0.12);
  --line-strong: rgba(61, 49, 30, 0.12);
  --line-heavy: rgba(97, 67, 28, 0.16);
  --accent: #9d3c22;
  --accent-deep: #6f2412;
  --accent-soft: rgba(157, 60, 34, 0.11);
  --accent-warm: #a67020;
  --accent-glow: rgba(157, 60, 34, 0.12);
  --success-bg: #edf6ef;
  --success-ink: #214b34;
  --error-bg: #f9e7e3;
  --error-ink: #8a2d20;
  --info-bg: #efe7d7;
  --info-ink: #5f4b2d;
  --shadow: 0 24px 60px rgba(73, 48, 17, 0.08);
  --shadow-soft: 0 16px 32px rgba(83, 59, 23, 0.08);
  --surface-shadow: none;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 12px;
  --layout-width: 1260px;
  --card-pad: 1.4rem;
  --panel-pad: 1rem;
  --stack-gap: 1.15rem;
  --font-display: "Oswald", "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-wordmark: "Oswald", "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-body: "Oswald", "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "Oswald", "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(205, 120, 74, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(166, 112, 32, 0.18), transparent 28%),
    linear-gradient(180deg, #f7eddd 0%, #f1e5d2 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.12), transparent 48%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.page-glow {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.page-glow-left {
  top: -8rem;
  left: -8rem;
  background: rgba(197, 98, 46, 0.38);
}

.page-glow-right {
  right: -8rem;
  bottom: -10rem;
  background: rgba(167, 139, 51, 0.34);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--layout-width));
  margin: 0 auto;
  padding: 1.45rem 1.4rem 2rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-top-actions {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.4rem;
}

.stage-title-block {
  display: grid;
  gap: 0.2rem;
  max-width: 42rem;
}

.stage-meta {
  margin-left: auto;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.75rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.info-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(97, 67, 28, 0.16);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.9);
  color: var(--accent-deep);
  box-shadow: 0 10px 24px rgba(83, 59, 23, 0.08);
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

.info-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.info-action:hover,
.info-action:focus-visible {
  border-color: rgba(111, 36, 18, 0.3);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 28px rgba(111, 36, 18, 0.14);
  transform: translateY(-1px);
}

.info-action:focus-visible {
  outline: 2px solid rgba(111, 36, 18, 0.22);
  outline-offset: 2px;
}

.hero {
  position: relative;
  margin-bottom: 1.5rem;
  animation: fade-in 420ms ease-out;
}

.hero::after {
  display: none;
}

.hero-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hero-copy-block {
  display: grid;
  gap: 0.2rem;
  max-width: 44rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0.7rem 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.58;
}

.menu-button {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 2.85rem;
  height: 2.85rem;
  padding: 0;
  border: 1px solid rgba(61, 49, 30, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 28px rgba(114, 37, 17, 0.08);
  cursor: pointer;
}

.menu-button span {
  width: 1rem;
  height: 1.5px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(104, 90, 70, 0.84) 100%);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  z-index: 10;
  width: min(18.5rem, calc(100vw - 2rem));
  padding: 0.95rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(61, 49, 30, 0.12);
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.menu-panel::before {
  display: none;
}

.menu-section-label {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
}

#app-title {
  margin: 0;
  color: var(--accent-deep);
  font-family: var(--font-wordmark);
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

#app-title::after {
  display: none;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--accent);
  text-shadow: none;
}

.hero h1:not(.hero-title) {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-shadow: none;
}

.top-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.7);
  border: 1px solid rgba(79, 58, 28, 0.08);
  overflow: hidden;
}

.nav-button,
.primary-action,
.secondary-action,
.move-button,
.action-button,
.menu-button,
.modal-close {
  font: inherit;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.nav-button,
.primary-action,
.secondary-action,
.move-button,
.action-button,
.modal-close {
  border-radius: 999px;
  cursor: pointer;
}

.nav-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.7rem 1.15rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
}

.nav-button:hover,
.nav-button:focus-visible,
.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible,
.move-button:hover,
.move-button:focus-visible,
.action-button:hover,
.action-button:focus-visible,
.menu-button:hover,
.menu-button:focus-visible,
.modal-close:hover,
.modal-close:focus-visible {
  transform: translateY(-1px);
}

.nav-button-active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(114, 37, 17, 0.24);
}

.view {
  display: grid;
  gap: var(--stack-gap);
  animation: fade-in 320ms ease-out;
}

.hidden {
  display: none !important;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card::before {
  display: none;
}

.card::after {
  display: none;
}

.puzzle-card {
  display: grid;
  gap: 1.05rem;
  padding: var(--card-pad);
}

.view > .card:not(.puzzle-card) {
  display: block;
  padding: var(--card-pad);
}

.results-view {
  margin-top: 0.95rem;
}

.card-header,
.results-header,
.share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.puzzle-card .card-header {
  min-height: 0.8rem;
  justify-content: space-between;
  margin-bottom: 0;
}

.puzzle-card .metric-row,
.puzzle-card .actions-panel,
.puzzle-card .path-panel,
.puzzle-card .status-panel,
.puzzle-card .share-panel,
.puzzle-card #moves-panel {
  margin-top: 0;
}

.challenge-label,
.graph-meta,
.results-title {
  margin: 0;
}

.challenge-label,
.metric-label,
.summary-label,
.path-label,
.filter-label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.challenge-label {
  color: var(--accent);
  font-weight: 700;
}

.graph-meta {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
  text-align: right;
  text-transform: none;
}

.metric-row,
.summary-grid,
.actions-panel {
  display: grid;
  gap: 1rem;
}

.metric-row,
.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.1rem;
  gap: 1rem;
}

.puzzle-card .metric-row {
  margin-top: 0.1rem;
}

.playfield-layout {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 1rem;
  align-items: stretch;
  margin-top: 0.2rem;
}

.playfield-layout > * {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.playfield-rail {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.9rem;
  align-content: start;
}

.mobile-utility-bar {
  display: none;
}

.playfield-column {
  display: grid;
  gap: 1rem;
}

.support-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr) minmax(0, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.metric-card,
.summary-card,
.result-stat {
  padding: 1rem 1rem 1.05rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(61, 49, 30, 0.07);
  box-shadow: none;
}

.metric-card::before,
.summary-card::before,
.result-stat::before {
  display: none;
}

.metric-label,
.summary-label,
.path-label,
.filter-label {
  margin: 0 0 0.45rem;
}

.filter-label {
  margin-bottom: 0.55rem;
}

.metric-value,
.summary-value {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: normal;
  word-break: break-word;
  color: var(--ink);
}

#metric-left,
#metric-target {
  white-space: nowrap;
  overflow: hidden;
}

#metric-steps {
  font-family: var(--font-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}

.path-panel,
.status-panel,
.share-panel,
#moves-panel,
.results-section {
  margin-top: 1rem;
}

.results-section {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(61, 49, 30, 0.07);
  box-shadow: none;
}

.results-section h3 {
  font-size: 1.12rem;
  line-height: 1.1;
  letter-spacing: normal;
}

.path-panel,
.status-panel,
.share-panel,
#moves-panel {
  display: grid;
  gap: 0.8rem;
  padding: var(--panel-pad);
  border-radius: var(--radius-sm);
  background: rgba(255, 251, 245, 0.88);
  border: 1px solid rgba(97, 67, 28, 0.12);
  box-shadow: 0 18px 38px rgba(79, 52, 20, 0.08);
}

.path-panel::before,
.status-panel::before,
.share-panel::before,
#moves-panel::before,
.results-section::before,
.modal-share-panel::before,
.table-wrap::before {
  display: none;
}

.path-panel::after,
.status-panel::after,
.share-panel::after,
#moves-panel::after,
.results-section::after,
.modal-share-panel::after {
  display: none;
}

.playfield-column > .path-panel,
.playfield-column > .status-panel,
.playfield-column > .share-panel,
.playfield-column > .actions-panel,
.playfield-layout > #moves-panel,
.move-stats-panel,
.move-tools-panel {
  margin-top: 0;
}

.support-panels > .playfield-column {
  grid-column: span 2;
}

.support-panels > .status-panel,
.support-panels > .share-panel,
.support-panels > .actions-panel {
  margin-top: 0;
}

.support-panels > .status-panel {
  grid-column: span 1;
}

.support-panels > .share-panel {
  grid-column: 1 / -1;
}

.support-panels > .actions-panel {
  grid-column: span 2;
}

.stage-meta .graph-meta {
  margin-left: 0;
}

.playfield-layout > #moves-panel,
.move-stats-panel,
.move-tools-panel {
  position: relative;
  overflow: visible;
  min-width: 0;
  border-radius: 1.7rem;
  border: 1px solid rgba(97, 67, 28, 0.14);
  box-shadow:
    0 28px 64px rgba(79, 52, 20, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.playfield-layout > #moves-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 1rem;
  align-content: start;
  min-height: clamp(30rem, 62vh, 42rem);
  padding: 1.35rem;
  background:
    radial-gradient(circle at top center, rgba(201, 129, 79, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(255, 253, 249, 0.99) 0%, rgba(255, 245, 231, 0.98) 100%);
}

.move-tools-panel {
  display: block;
  padding: 0;
  align-self: start;
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.move-stats-panel {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem;
  background:
    radial-gradient(circle at top left, rgba(201, 129, 79, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 245, 0.98) 0%, rgba(251, 241, 228, 0.96) 100%);
}

.move-stats-grid {
  display: grid;
  gap: 0.6rem;
}

.move-context-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.move-context-bar .move-stat-card {
  min-width: 0;
  padding: 1rem 1.05rem;
  overflow: hidden;
  border-color: rgba(157, 60, 34, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(135deg, rgba(255, 251, 245, 0.98), rgba(250, 230, 208, 0.92));
  box-shadow:
    0 16px 30px rgba(111, 36, 18, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.move-context-bar .move-stat-label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.move-context-bar .move-stat-value {
  display: flex;
  align-items: center;
  min-height: 3rem;
  overflow: hidden;
  color: var(--accent-deep);
  font-family: var(--font-wordmark);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: 0.01em;
}

.item-stat-value {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  min-height: 2.45rem;
}

.move-context-bar .item-stat-value,
.move-context-bar .item-stat-value-image,
.move-context-bar .item-stat-value-audio {
  min-width: 0;
  overflow: hidden;
}

.move-context-bar .item-stat-value-image {
  grid-template-columns: 2.85rem minmax(0, 1fr);
  gap: 0.55rem;
}

.item-stat-value-image {
  display: grid;
  grid-template-columns: 3.15rem minmax(0, 1fr);
  align-items: center;
  font-family: var(--font-body);
}

.item-stat-value-audio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  font-family: var(--font-body);
}

.item-stat-thumb {
  flex: 0 0 3.15rem;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 0.72rem;
  object-fit: cover;
  background: rgba(97, 67, 28, 0.1);
  box-shadow: 0 10px 18px rgba(79, 52, 20, 0.1);
}

.move-context-bar .item-stat-thumb {
  flex-basis: 2.85rem;
  width: 2.85rem;
  height: 2.85rem;
}

.item-stat-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.move-context-bar .item-stat-copy {
  min-width: 0;
}

.item-stat-title,
.item-stat-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-stat-title {
  letter-spacing: normal;
  white-space: nowrap;
}

.move-context-bar .item-stat-title {
  font-family: var(--font-wordmark);
  font-size: clamp(1.7rem, 4.2vw, 2.65rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.move-context-bar .item-stat-meta {
  display: none;
}

.item-stat-meta {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.audio-play-button {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid rgba(157, 60, 34, 0.22);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.96);
  color: var(--accent);
  box-shadow:
    0 10px 20px rgba(79, 52, 20, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.audio-play-button::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 0.12rem;
  border-top: 0.36rem solid transparent;
  border-bottom: 0.36rem solid transparent;
  border-left: 0.56rem solid currentColor;
}

.audio-play-button-playing {
  background: var(--accent);
  color: #ffffff;
}

.audio-play-button-playing::before {
  width: 0.58rem;
  height: 0.58rem;
  margin-left: 0;
  border: 0;
  border-radius: 0.08rem;
  background: currentColor;
}

.audio-play-button:hover,
.audio-play-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(79, 52, 20, 0.16);
}

.item-audio-play {
  justify-self: end;
}

.image-preview-host {
  position: relative;
}

.image-preview-host:hover,
.image-preview-host:focus-visible,
.image-preview-host:focus-within {
  z-index: 120;
}

.item-stat-preview-focus:focus-visible {
  outline: 2px solid rgba(157, 60, 34, 0.38);
  outline-offset: 0.25rem;
  border-radius: 0.9rem;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  overflow: hidden;
}

.image-hover-preview {
  position: fixed;
  top: var(--image-preview-top, -100vh);
  left: var(--image-preview-left, -100vw);
  z-index: 1;
  display: grid;
  width: var(--image-preview-width, min(27.5rem, calc(100vw - 1.5rem)));
  gap: 0.62rem;
  padding: 0.72rem;
  border: 1px solid rgba(97, 67, 28, 0.16);
  border-radius: 1.15rem;
  background: rgba(255, 250, 242, 0.98);
  box-shadow:
    0 30px 72px rgba(46, 28, 10, 0.24),
    0 8px 20px rgba(46, 28, 10, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.35rem) scale(0.985);
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    visibility 160ms ease;
  visibility: hidden;
}

.image-preview-overlay-visible .image-hover-preview {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.image-hover-preview-above {
  transform: translateY(-0.35rem) scale(0.985);
}

.image-preview-overlay-visible .image-hover-preview-above {
  transform: translateY(0) scale(1);
}

.image-hover-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(14rem, 58vw, 20rem);
  max-height: min(62vh, 20rem);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.95rem;
  border: 1px solid rgba(97, 67, 28, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.92), rgba(234, 217, 191, 0.76)),
    repeating-linear-gradient(45deg, rgba(97, 67, 28, 0.08) 0 1px, transparent 1px 9px);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  box-shadow:
    0 14px 26px rgba(79, 52, 20, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.image-hover-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 250, 242, 0.9);
}

.image-hover-caption {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
  padding: 0 0.08rem 0.05rem;
  color: var(--ink);
  text-align: left;
}

.image-hover-title,
.image-hover-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-hover-title {
  display: -webkit-box;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.1;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-hover-meta {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.move-stats-grid.move-stats-grid-single {
  grid-template-columns: 1fr;
}

.move-stat-card {
  padding: 0.82rem 0.88rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(61, 49, 30, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.move-stat-card-steps {
  background: rgba(255, 248, 239, 0.88);
}

.move-stat-label {
  margin: 0 0 0.34rem;
  color: var(--muted-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.move-stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--ink);
  word-break: break-word;
}

.move-stat-card-steps .move-stat-value {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.playfield-layout > #moves-panel::before,
.move-stats-panel::before,
.move-tools-panel::before {
  content: "";
  display: block;
  position: absolute;
  top: -4.8rem;
  left: 50%;
  width: 13rem;
  height: 13rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  filter: blur(34px);
  opacity: 0.85;
  transform: translateX(-50%);
  pointer-events: none;
}

.playfield-layout > #moves-panel::after,
.move-stats-panel::after,
.move-tools-panel::after {
  content: "";
  display: block;
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 4.8rem;
  height: 4.8rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(157, 60, 34, 0.12);
  opacity: 0.28;
  pointer-events: none;
}

.move-tools-panel::before,
.move-tools-panel::after {
  display: none;
}

.playfield-layout > #moves-panel > *,
.move-stats-panel > *,
.move-tools-panel > * {
  position: relative;
  z-index: 1;
}

.moves-panel-header {
  display: grid;
  gap: 0.35rem;
}

.moves-kicker {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.moves-copy {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.move-tools-kicker {
  color: var(--ink-soft);
}

.filter-label-quiet {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.move-tools-panel .filter-input {
  width: 100%;
  margin-top: 0;
  min-height: 0;
  padding: 0.78rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(97, 67, 28, 0.12);
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    0 12px 24px rgba(79, 52, 20, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.move-tools-panel .filter-input::placeholder {
  color: rgba(111, 102, 88, 0.8);
}

.move-context-grid {
  display: grid;
  gap: 0.7rem;
}

.move-context-card {
  padding: 0.82rem 0.9rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(61, 49, 30, 0.08);
}

.move-context-label {
  margin: 0 0 0.35rem;
  color: var(--muted-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.move-context-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--ink);
  word-break: break-word;
}

.share-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0;
  border-bottom: 0;
}

.results-header {
  margin-bottom: 1.1rem;
  padding-bottom: 0;
  border-bottom: 0;
}

.results-header > div {
  display: grid;
  gap: 0.16rem;
}

.dashboard-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(23, 18, 12, 0.62);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(92vw, 34rem);
  max-height: min(88vh, 46rem);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(61, 49, 30, 0.12);
  background:
    radial-gradient(circle at top right, rgba(201, 129, 79, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.99) 0%, rgba(252, 246, 237, 0.99) 100%);
  box-shadow:
    0 38px 100px rgba(31, 20, 9, 0.34),
    0 8px 24px rgba(31, 20, 9, 0.12);
  backdrop-filter: none;
  animation: modal-in 180ms ease-out;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border: 1px solid rgba(61, 49, 30, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: none;
  font-size: 1.35rem;
  line-height: 1;
}

.modal-title {
  margin-top: -0.1rem;
  padding-right: 3.25rem;
  font-size: clamp(2rem, 6vw, 3rem);
}

.modal-subtitle {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.modal-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.15rem;
}

.modal-path-panel,
.modal-share-panel {
  margin-top: 0;
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(61, 49, 30, 0.08);
  box-shadow: none;
}

.modal-share-panel h2,
.share-panel h2 {
  font-size: 1.1rem;
  line-height: 1.08;
  letter-spacing: normal;
}

.modal-path-panel .path-label {
  margin-bottom: 0;
}

.intro-modal-card {
  gap: 1.15rem;
}

.intro-kicker {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-rule-grid {
  display: grid;
  gap: 0.75rem;
}

.intro-rule-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding: 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(97, 67, 28, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.intro-rule-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 800;
  line-height: 1;
}

.intro-rule-card h3 {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0;
}

.intro-rule-card p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.intro-start-action {
  width: 100%;
  margin-top: 0.1rem;
}

#win-share-message {
  width: 100%;
  min-height: 5.25rem;
  resize: vertical;
  margin-top: 0;
  padding: 0.9rem 1rem;
  font: inherit;
  border: 1px solid rgba(61, 49, 30, 0.12);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
}

.path-words {
  margin: 0;
  max-width: 70ch;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: normal;
  word-break: break-word;
  color: var(--ink-soft);
}

.banner,
.status-message {
  position: relative;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.banner::before,
.status-message::before {
  display: none;
}

.banner-error,
.status-error {
  background: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid rgba(138, 45, 32, 0.14);
}

.status-success {
  background: var(--success-bg);
  color: var(--success-ink);
  border: 1px solid rgba(31, 92, 56, 0.14);
}

.status-info {
  background: var(--info-bg);
  color: var(--info-ink);
  border: 1px solid rgba(95, 75, 45, 0.14);
}

.status-stack {
  display: grid;
  gap: 0.8rem;
}

#share-message,
#win-share-message,
.filter-input {
  width: 100%;
  font: inherit;
  border: 1px solid rgba(61, 49, 30, 0.12);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  line-height: 1.5;
  box-shadow: none;
}

#share-message {
  min-height: 5.4rem;
  resize: vertical;
  margin-top: 0.75rem;
  padding: 0.85rem 0.95rem;
}

.filter-input {
  margin-top: 0.2rem;
  min-height: 0;
  padding: 0.82rem 0.95rem;
  background: rgba(255, 255, 255, 0.88);
}

.filter-input::placeholder,
#share-message::placeholder,
#win-share-message::placeholder {
  color: var(--muted-soft);
}

.empty-state {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  align-self: start;
  line-height: 1.45;
  color: var(--muted);
}

.move-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.95rem;
  flex-grow: 1;
  min-height: 0;
  align-content: stretch;
}

.move-grid:empty {
  display: none;
}

.move-grid:empty ~ .support-panels {
  flex-grow: 1;
}

.move-choice {
  position: relative;
  min-width: 0;
}

.move-choice .move-button {
  width: 100%;
  height: 100%;
}

.playfield-layout .move-grid {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.82rem;
  margin-top: 0.2rem;
  align-content: start;
  grid-auto-rows: minmax(4.45rem, auto);
}

.playfield-layout .move-grid.move-grid-compact {
  gap: 0.68rem;
  grid-auto-rows: 3.55rem;
}

.playfield-layout .move-grid.move-grid-tight {
  gap: 0.56rem;
  grid-auto-rows: 3rem;
}

.playfield-layout .move-grid.move-grid-compact .move-button,
.playfield-layout .move-grid.move-grid-tight .move-button {
  height: 100%;
  overflow: hidden;
}

.actions-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.move-button,
.action-button {
  border-radius: 1rem;
  min-height: 3.8rem;
  padding: 0.9rem 0.8rem;
  border: 0;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: normal;
}

.move-button::before,
.action-button::before {
  display: none;
}

.action-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.move-button {
  background: var(--paper-strong);
  border: 1px solid rgba(97, 67, 28, 0.12);
  color: var(--ink);
  font-weight: 400;
  box-shadow: none;
}

.playfield-layout .move-button {
  min-height: 4.45rem;
  padding: 1.05rem 0.95rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(97, 67, 28, 0.1);
  box-shadow: 0 12px 24px rgba(79, 52, 20, 0.05);
}

.playfield-layout .move-grid.move-grid-compact .move-button:not(.move-button-image):not(.move-button-audio) {
  min-height: 3.55rem;
  padding: 0.72rem 0.64rem;
  font-size: 0.92rem;
  line-height: 1.15;
}

.playfield-layout .move-grid.move-grid-tight .move-button:not(.move-button-image):not(.move-button-audio) {
  min-height: 3rem;
  padding: 0.58rem 0.52rem;
  font-size: 0.84rem;
  line-height: 1.1;
}

.move-button-image,
.playfield-layout .move-button-image,
.move-button-audio,
.playfield-layout .move-button-audio {
  display: grid;
  grid-template-columns: 5.35rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.78rem;
  min-height: 7rem;
  padding: 0.72rem;
  text-align: left;
  overflow: visible;
}

.playfield-layout .move-grid.move-grid-compact .move-button-image,
.playfield-layout .move-grid.move-grid-compact .move-button-audio {
  gap: 0.58rem;
  min-height: 0;
  padding: 0.56rem;
  border-radius: 1.05rem;
}

.playfield-layout .move-grid.move-grid-tight .move-button-image,
.playfield-layout .move-grid.move-grid-tight .move-button-audio {
  gap: 0.44rem;
  min-height: 0;
  padding: 0.45rem;
  border-radius: 0.96rem;
}

.move-button-audio,
.playfield-layout .move-button-audio {
  grid-template-columns: 3.35rem minmax(0, 1fr);
  padding-right: 3.35rem;
}

.playfield-layout .move-grid.move-grid-compact .move-button-image {
  grid-template-columns: 3.1rem minmax(0, 1fr);
}

.playfield-layout .move-grid.move-grid-tight .move-button-image {
  grid-template-columns: 2.55rem minmax(0, 1fr);
}

.playfield-layout .move-grid.move-grid-compact .move-button-audio {
  grid-template-columns: 2.35rem minmax(0, 1fr);
  padding-right: 2.95rem;
}

.playfield-layout .move-grid.move-grid-tight .move-button-audio {
  grid-template-columns: 1.95rem minmax(0, 1fr);
  padding-right: 2.55rem;
}

.move-thumb {
  display: grid;
  place-items: center;
  min-height: 5.55rem;
  overflow: hidden;
  border-radius: 0.9rem;
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.9), rgba(239, 219, 190, 0.72)),
    repeating-linear-gradient(45deg, rgba(97, 67, 28, 0.08) 0 1px, transparent 1px 8px);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.move-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 5.55rem;
  object-fit: cover;
}

.playfield-layout .move-grid.move-grid-compact .move-thumb,
.playfield-layout .move-grid.move-grid-compact .move-thumb img,
.playfield-layout .move-grid.move-grid-compact .move-audio-mark {
  min-height: 2.9rem;
  border-radius: 0.72rem;
}

.playfield-layout .move-grid.move-grid-tight .move-thumb,
.playfield-layout .move-grid.move-grid-tight .move-thumb img,
.playfield-layout .move-grid.move-grid-tight .move-audio-mark {
  min-height: 2.3rem;
  border-radius: 0.62rem;
}

.move-audio-mark {
  display: grid;
  place-items: center;
  min-height: 5.55rem;
  overflow: hidden;
  border-radius: 0.9rem;
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.94), rgba(239, 219, 190, 0.78)),
    repeating-linear-gradient(90deg, rgba(157, 60, 34, 0.12) 0 2px, transparent 2px 9px);
  color: var(--accent);
}

.move-audio-mark::before {
  content: "";
  width: 0.22rem;
  height: 1.45rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0.42rem -0.26rem 0 currentColor,
    0.84rem 0.18rem 0 currentColor,
    1.26rem -0.1rem 0 currentColor;
  transform: translateX(-0.63rem);
}

.move-audio-play {
  position: absolute;
  top: 0.72rem;
  right: 0.72rem;
  z-index: 2;
}

.playfield-layout .move-grid.move-grid-compact .move-audio-play {
  top: 0.48rem;
  right: 0.48rem;
}

.playfield-layout .move-grid.move-grid-tight .move-audio-play {
  top: 0.38rem;
  right: 0.38rem;
}

.move-copy {
  display: grid;
  align-content: center;
  gap: 0.34rem;
  min-width: 0;
}

.move-title,
.move-meta {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.move-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.08;
  -webkit-line-clamp: 2;
}

.move-meta {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.18;
  -webkit-line-clamp: 2;
}

.playfield-layout .move-grid.move-grid-compact .move-copy {
  gap: 0.24rem;
}

.playfield-layout .move-grid.move-grid-tight .move-copy {
  gap: 0.18rem;
}

.playfield-layout .move-grid.move-grid-compact .move-title {
  font-size: 0.92rem;
  line-height: 1.04;
}

.playfield-layout .move-grid.move-grid-tight .move-title {
  font-size: 0.84rem;
  line-height: 1.02;
}

.playfield-layout .move-grid.move-grid-compact .move-meta {
  font-size: 0.66rem;
  line-height: 1.1;
}

.playfield-layout .move-grid.move-grid-tight .move-meta {
  font-size: 0.62rem;
  line-height: 1.06;
}

.move-button-image-error .move-thumb {
  padding: 0.55rem;
}

.move-button:hover,
.move-button:focus-visible {
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.playfield-layout .move-button:hover,
.playfield-layout .move-button:focus-visible {
  box-shadow: 0 18px 30px rgba(79, 52, 20, 0.1);
}

.move-button:active {
  transform: translateY(0);
}

.context-action {
  padding: 0.46rem 0.86rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.76);
}

.primary-action,
.action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 0;
  padding: 0.8rem 1.15rem;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(114, 37, 17, 0.22);
}

.secondary-action,
.action-secondary {
  min-height: 0;
  padding: 0.8rem 1.15rem;
  border: 1px solid rgba(61, 49, 30, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-shadow: none;
}

.action-primary,
.action-secondary {
  width: 100%;
}

.results-title {
  margin-top: 0;
  font-size: 1.9rem;
  line-height: 1.02;
  letter-spacing: normal;
}

#results-view .card {
  padding: 1.4rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid rgba(61, 49, 30, 0.08);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.results-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 0.9rem 0.95rem;
  border-bottom: 1px solid rgba(61, 49, 30, 0.08);
  text-align: left;
  font-size: 0.95rem;
}

.results-table th {
  color: var(--muted-soft);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.results-table tr:last-child td {
  border-bottom: 0;
}

.nav-button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.move-button:focus-visible,
.action-button:focus-visible,
.menu-button:focus-visible,
.modal-close:focus-visible,
.filter-input:focus-visible,
#share-message:focus-visible,
#win-share-message:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(157, 60, 34, 0.18);
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .playfield-layout {
    grid-template-columns: minmax(0, 1fr) minmax(10.75rem, 12.5rem);
  }

  .playfield-layout .move-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .support-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-panels > .playfield-column,
  .support-panels > .share-panel,
  .support-panels > .actions-panel {
    grid-column: 1 / -1;
  }

  .support-panels > .status-panel {
    grid-column: auto;
  }

}

@media (max-width: 760px) {
  .metric-row,
  .summary-grid,
  .modal-result-grid,
  .move-grid,
  .actions-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-header,
  .results-header,
  .share-header,
  .stage-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero::after {
    display: none;
  }

  .stage-meta {
    margin-left: 0;
    width: 100%;
    justify-items: start;
  }

  .graph-meta {
    margin-left: 0;
    text-align: left;
  }

  .playfield-layout {
    grid-template-columns: 1fr;
  }

  .playfield-rail {
    grid-template-rows: auto;
  }

  .playfield-layout > #moves-panel {
    min-height: auto;
  }

  .playfield-layout .move-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .move-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .support-panels {
    grid-template-columns: 1fr;
  }

  .support-panels > * {
    grid-column: auto;
  }

  body.mobile-game-layout {
    --mobile-move-row-min: 3.2rem;
    --mobile-move-grid-gap: 0.68rem;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
  }

  body.mobile-game-layout .shell {
    min-height: 100dvh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
  }

  body.mobile-game-layout .stage-header,
  body.mobile-game-layout #error-banner {
    margin-bottom: 0;
  }

  body.mobile-game-layout .view {
    min-height: 0;
    gap: 0.8rem;
    grid-template-rows: minmax(0, 1fr) auto auto;
  }

  body.mobile-game-layout .playfield-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  body.mobile-game-layout #playfield-rail,
  body.mobile-game-layout #playfield-column {
    display: none;
  }

  body.mobile-game-layout .playfield-layout > #moves-panel {
    min-height: 0;
    height: 100%;
    padding: 0.92rem 0.9rem 0.82rem;
    gap: 0.72rem;
    overflow: hidden;
  }

  body.mobile-game-layout .move-context-bar {
    gap: 0.55rem;
  }

  body.mobile-game-layout .move-context-bar .move-stat-card {
    padding: 0.72rem 0.78rem;
  }

  body.mobile-game-layout .move-context-bar .move-stat-value {
    font-size: clamp(1.08rem, 4.6vw, 1.38rem);
  }

  body.mobile-game-layout .move-grid {
    min-height: 0;
    margin-top: 0;
    gap: var(--mobile-move-grid-gap);
    grid-auto-rows: var(--mobile-move-row-min);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.18rem;
    padding-bottom: 0.2rem;
    align-content: start;
  }

  body.mobile-game-layout .move-grid.move-grid-rich {
    --mobile-move-row-min: 4.8rem;
  }

  body.mobile-game-layout .move-grid .move-button {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.mobile-game-layout .move-button:not(.move-button-image):not(.move-button-audio) {
    min-height: var(--mobile-move-row-min);
    padding: 0.68rem 0.58rem;
    font-size: 0.94rem;
    line-height: 1.15;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-button-image,
  body.mobile-game-layout .move-grid.move-grid-rich .move-button-audio {
    align-items: center;
    gap: 0.52rem;
    min-height: 0;
    padding: 0.46rem;
    border-radius: 1.02rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-button-image {
    grid-template-columns: 3.2rem minmax(0, 1fr);
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-button-audio {
    grid-template-columns: 2.35rem minmax(0, 1fr);
    padding-right: 2.85rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-thumb,
  body.mobile-game-layout .move-grid.move-grid-rich .move-thumb img,
  body.mobile-game-layout .move-grid.move-grid-rich .move-audio-mark {
    min-height: 0;
    height: 100%;
    border-radius: 0.72rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-audio-play {
    top: 0.38rem;
    right: 0.38rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-copy {
    gap: 0.18rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-title {
    font-size: 0.84rem;
    line-height: 1.04;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-meta {
    font-size: 0.6rem;
    line-height: 1.08;
  }

  body.mobile-game-layout .mobile-utility-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 0.58rem 0.62rem calc(0.58rem + env(safe-area-inset-bottom));
    border-radius: 1.45rem;
    border: 1px solid rgba(97, 67, 28, 0.12);
    background: rgba(255, 249, 240, 0.94);
    box-shadow:
      0 -12px 32px rgba(79, 52, 20, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(20px);
  }

  body.mobile-game-layout .mobile-utility-bar > * {
    flex: 0 0 auto;
    min-width: 0;
    margin-top: 0;
    scroll-snap-align: start;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stats-panel,
  body.mobile-game-layout .mobile-utility-bar .move-tools-panel,
  body.mobile-game-layout .mobile-utility-bar .path-panel {
    min-height: 0;
    padding: 0.54rem 0.56rem;
    border-radius: 1.1rem;
    border-color: rgba(61, 49, 30, 0.08);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: none;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stats-panel {
    width: 7rem;
  }

  body.mobile-game-layout .mobile-utility-bar .move-tools-panel {
    gap: 0.38rem;
    width: min(10.5rem, 60vw);
    padding: 0.44rem;
  }

  body.mobile-game-layout .mobile-utility-bar .path-panel {
    width: min(15rem, 72vw);
  }

  body.mobile-game-layout .mobile-utility-bar .move-stats-panel::before,
  body.mobile-game-layout .mobile-utility-bar .move-stats-panel::after,
  body.mobile-game-layout .mobile-utility-bar .move-tools-panel::before,
  body.mobile-game-layout .mobile-utility-bar .move-tools-panel::after {
    display: none;
  }

  body.mobile-game-layout .mobile-utility-bar .move-tools-panel .filter-input {
    width: 100%;
    padding: 0.5rem 0.66rem;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stat-card {
    padding: 0.52rem 0.58rem;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stat-label,
  body.mobile-game-layout .mobile-utility-bar .filter-label,
  body.mobile-game-layout .mobile-utility-bar .path-label {
    margin-bottom: 0.18rem;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  body.mobile-game-layout .mobile-utility-bar .filter-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body.mobile-game-layout .mobile-utility-bar .path-words {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.08rem;
  }

  body.mobile-game-layout .support-panels {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    min-height: 0;
    max-height: min(16vh, 8rem);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.15rem;
  }

  body.mobile-game-layout .move-grid:empty ~ .support-panels {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .shell {
    width: 100%;
    padding: 0.85rem 0.65rem 1.4rem;
  }

  .summary-grid,
  .modal-result-grid,
  .actions-panel {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.6rem;
  }

  .metric-card {
    padding: 0.55rem 0.6rem;
  }

  .challenge-label,
  .metric-label,
  .summary-label,
  .path-label,
  .filter-label,
  .graph-meta {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }

  .metric-value,
  .summary-value {
    font-size: clamp(1.05rem, 3.6vw, 1.6rem);
  }

  .move-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .path-panel,
  .status-panel,
  .share-panel,
  #moves-panel,
  .results-section,
  .move-tools-panel {
    margin-top: 0.65rem;
  }

  .path-panel,
  .status-panel,
  .share-panel,
  #moves-panel,
  .move-tools-panel {
    padding: 0.7rem;
  }

  .playfield-column > .path-panel,
  .playfield-column > .status-panel,
  .playfield-column > .share-panel,
  .playfield-column > .actions-panel,
  .playfield-layout > #moves-panel,
  .move-tools-panel {
    margin-top: 0;
  }

  .results-section {
    padding: 0.7rem;
  }

  .top-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #app-title {
    font-size: 1.45rem;
    letter-spacing: -0.03em;
  }

  .menu-panel {
    width: min(18rem, calc(100vw - 1rem));
  }

  .hero-title {
    font-size: 2.35rem;
  }

  .subtitle {
    font-size: 0.92rem;
  }

  .playfield-layout {
    gap: 0.7rem;
  }

  .playfield-layout .move-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .move-stats-grid {
    grid-template-columns: 1fr;
  }

  .moves-copy {
    font-size: 0.88rem;
  }

  .move-context-value {
    font-size: 0.98rem;
  }

  .support-panels {
    gap: 0.7rem;
  }

  body.mobile-game-layout .shell {
    gap: 0.7rem;
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
  }

  body.mobile-game-layout {
    --mobile-move-row-min: 2.95rem;
    --mobile-move-grid-gap: 0.6rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich {
    --mobile-move-row-min: 4.35rem;
  }

  body.mobile-game-layout .playfield-layout > #moves-panel {
    padding: 0.82rem 0.76rem 0.74rem;
  }

  body.mobile-game-layout .mobile-utility-bar {
    gap: 0.44rem;
    padding: 0.5rem 0.54rem calc(0.5rem + env(safe-area-inset-bottom));
  }

  body.mobile-game-layout .move-button:not(.move-button-image):not(.move-button-audio) {
    padding: 0.58rem 0.5rem;
    font-size: 0.88rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-button-image,
  body.mobile-game-layout .move-grid.move-grid-rich .move-button-audio {
    gap: 0.42rem;
    padding: 0.4rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-button-image {
    grid-template-columns: 2.8rem minmax(0, 1fr);
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-button-audio {
    grid-template-columns: 2.05rem minmax(0, 1fr);
    padding-right: 2.45rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-title {
    font-size: 0.78rem;
  }

  body.mobile-game-layout .move-grid.move-grid-rich .move-meta {
    font-size: 0.56rem;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stats-panel,
  body.mobile-game-layout .mobile-utility-bar .move-tools-panel,
  body.mobile-game-layout .mobile-utility-bar .path-panel {
    padding: 0.46rem 0.5rem;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stats-panel {
    width: 6.45rem;
  }

  body.mobile-game-layout .mobile-utility-bar .move-tools-panel {
    width: min(9.2rem, 56vw);
  }

  body.mobile-game-layout .mobile-utility-bar .path-panel {
    width: min(12.75rem, 68vw);
  }
}

/* Editorial board redesign */
:root {
  --bg: #f6f0e4;
  --bg-deep: #eadfce;
  --paper: rgba(255, 252, 246, 0.84);
  --paper-strong: #fffcf7;
  --paper-muted: rgba(250, 244, 235, 0.88);
  --ink: #26211b;
  --ink-soft: #4f473b;
  --muted: #6e6659;
  --muted-soft: #887a68;
  --line: rgba(38, 33, 27, 0.18);
  --line-strong: rgba(38, 33, 27, 0.22);
  --accent: #b44b24;
  --accent-deep: #8f3517;
  --accent-soft: rgba(180, 75, 36, 0.12);
  --success-bg: rgba(180, 75, 36, 0.08);
  --success-ink: #26211b;
  --error-bg: rgba(180, 75, 36, 0.12);
  --error-ink: #26211b;
  --info-bg: rgba(234, 223, 206, 0.52);
  --info-ink: #26211b;
  --shadow: none;
  --shadow-soft: none;
  --radius: 20px;
  --radius-sm: 16px;
  --radius-xs: 14px;
  --layout-width: 58rem;
  --card-pad: 1rem;
  --panel-pad: 1rem;
  --stack-gap: 0.9rem;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-wordmark: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Oswald", "Arial Narrow", sans-serif;
  --font-mono: "Oswald", "Arial Narrow", sans-serif;
}

html {
  background: #fff;
}

body {
  background: #fff;
}

body::before {
  display: none;
}

body::after,
.page-glow {
  display: none;
}

.shell {
  width: min(100%, var(--layout-width));
  padding: 1.25rem 1rem 2.75rem;
}

.stage-header {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
  padding-bottom: 0.85rem;
  border-bottom: 1.5px solid var(--line);
  text-align: center;
}

.stage-title-block {
  gap: 0;
  justify-items: center;
  text-align: center;
}

#app-title {
  color: var(--ink);
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-transform: capitalize;
  text-shadow: none;
}

.stage-meta {
  margin-left: 0;
  justify-items: center;
  gap: 0.45rem;
}

.graph-meta {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: lowercase;
}

.view {
  gap: 0.8rem;
}

.playfield-layout {
  grid-template-columns: minmax(0, 1fr) minmax(8.9rem, 10.5rem);
  gap: 0.65rem;
  margin-top: 0;
  align-items: start;
}

.playfield-layout > #moves-panel,
.move-stats-panel,
.move-tools-panel,
.path-panel,
.status-panel,
.share-panel {
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--line);
  background: var(--paper);
  box-shadow: none;
}

.playfield-layout > #moves-panel::before,
.playfield-layout > #moves-panel::after,
.move-stats-panel::before,
.move-stats-panel::after,
.move-tools-panel::before,
.move-tools-panel::after,
.path-panel::before,
.path-panel::after,
.status-panel::before,
.status-panel::after,
.share-panel::before,
.share-panel::after,
.modal-share-panel::before,
.modal-share-panel::after {
  display: none;
}

.playfield-layout > #moves-panel {
  min-height: 0;
  padding: 0.9rem;
  gap: 0.7rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.56)),
    var(--paper);
}

.move-context-bar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.move-context-bar .move-stat-card,
.move-stat-card-steps {
  min-height: 6.15rem;
  padding: 0.7rem 0.8rem 0.78rem;
  overflow: hidden;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--line);
  background: var(--paper-strong);
  box-shadow: none;
}

.move-stat-card-steps {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.move-context-bar .move-stat-label,
.move-stat-label {
  margin: 0 0 0.34rem;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
}

.move-stat-card-steps .move-stat-label {
  margin-bottom: 0.24rem;
  text-align: center;
}

.move-context-bar .move-stat-value,
.move-stat-card-steps .move-stat-value {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 3rem;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-wordmark);
  font-size: clamp(2.15rem, 4vw, 3.15rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-align: center;
}

.move-stat-card-steps .move-stat-value {
  width: 100%;
  min-height: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.item-stat-value {
  align-items: end;
  gap: 0.55rem;
  min-height: 3rem;
}

.move-context-bar .item-stat-value,
.move-context-bar .item-stat-value-image,
.move-context-bar .item-stat-value-audio {
  min-width: 0;
  overflow: hidden;
}

.move-stat-card-word .item-stat-value {
  align-items: center;
  justify-content: center;
}

.move-context-bar .item-stat-value-image {
  grid-template-columns: 2.85rem minmax(0, 1fr);
  gap: 0.55rem;
}

.item-stat-value-image {
  grid-template-columns: 3.6rem minmax(0, 1fr);
}

.item-stat-thumb {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(38, 33, 27, 0.14);
  box-shadow: none;
}

.move-context-bar .item-stat-thumb {
  width: 2.85rem;
  height: 2.85rem;
  flex-basis: 2.85rem;
}

.item-stat-copy {
  gap: 0.08rem;
}

.move-context-bar .item-stat-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  min-width: 0;
  text-align: center;
}

.item-stat-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.3vw, 2.95rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  white-space: normal;
}

.item-stat-meta {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.05;
}

.move-context-bar .item-stat-title {
  font-family: var(--font-wordmark);
  font-size: clamp(2.2rem, 5vw, 3.45rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: 0.01em;
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

.move-context-bar .item-stat-meta {
  display: none;
}

.move-stats-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.move-stats-grid {
  gap: 0;
}

.playfield-rail {
  gap: 0.65rem;
}

.move-tools-panel {
  padding: 0.68rem;
}

.move-tools-panel .filter-input {
  margin-top: 0;
  padding: 0.78rem 0.88rem;
  border-radius: 0.6rem;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.move-tools-panel .filter-input::placeholder {
  color: var(--muted);
}

.filter-input:focus-visible,
#share-message:focus-visible,
#win-share-message:focus-visible,
.item-stat-preview-focus:focus-visible,
.move-button:focus-visible,
.action-button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid rgba(180, 75, 36, 0.38);
  outline-offset: 0.16rem;
}

.board-path-panel {
  gap: 0.15rem;
  padding: 0.05rem 0 0.15rem;
  border: 0;
  background: transparent;
}

.board-path-panel .path-label {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
}

.path-words {
  max-width: none;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 2.8vw, 1.82rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.empty-state {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.3;
}

.playfield-layout .move-grid,
.move-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.38rem;
  margin-top: 0.02rem;
  align-content: start;
  grid-auto-rows: minmax(5.85rem, auto);
}

.playfield-layout .move-grid.move-grid-compact {
  gap: 0.32rem;
  grid-auto-rows: 4.85rem;
}

.playfield-layout .move-grid.move-grid-tight {
  gap: 0.28rem;
  grid-auto-rows: 4.1rem;
}

.move-button,
.action-button {
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--line);
  box-shadow: none;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.move-button {
  min-height: 5.85rem;
  padding: 0.72rem 0.58rem;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.move-button:not(.move-button-image):not(.move-button-audio) {
  font-size: 1.56rem;
}

.playfield-layout .move-button {
  min-height: 5.85rem;
  padding: 0.72rem 0.58rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.playfield-layout .move-grid.move-grid-compact .move-button:not(.move-button-image):not(.move-button-audio) {
  min-height: 4.85rem;
  padding: 0.56rem 0.48rem;
  font-size: 1.26rem;
}

.playfield-layout .move-grid.move-grid-tight .move-button:not(.move-button-image):not(.move-button-audio) {
  min-height: 4.1rem;
  padding: 0.42rem;
  font-size: 1.06rem;
}

.move-button-image,
.playfield-layout .move-button-image,
.move-button-audio,
.playfield-layout .move-button-audio {
  grid-template-columns: 3.95rem minmax(0, 1fr);
  gap: 0.45rem;
  min-height: 5.85rem;
  padding: 0.44rem;
}

.move-button-audio,
.playfield-layout .move-button-audio {
  grid-template-columns: 2.7rem minmax(0, 1fr);
  padding-right: 2.9rem;
}

.playfield-layout .move-grid.move-grid-compact .move-button-image,
.playfield-layout .move-grid.move-grid-compact .move-button-audio {
  gap: 0.35rem;
  padding: 0.34rem;
}

.playfield-layout .move-grid.move-grid-tight .move-button-image,
.playfield-layout .move-grid.move-grid-tight .move-button-audio {
  gap: 0.28rem;
  padding: 0.28rem;
}

.move-thumb,
.move-audio-mark {
  min-height: 4.9rem;
  overflow: hidden;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(38, 33, 27, 0.14);
  box-shadow: none;
}

.move-thumb {
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.92), rgba(239, 224, 200, 0.76)),
    repeating-linear-gradient(45deg, rgba(38, 33, 27, 0.06) 0 1px, transparent 1px 8px);
}

.move-thumb img {
  min-height: 4.9rem;
}

.move-audio-mark {
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.95), rgba(235, 220, 196, 0.86)),
    repeating-linear-gradient(90deg, rgba(180, 75, 36, 0.12) 0 2px, transparent 2px 8px);
}

.playfield-layout .move-grid.move-grid-compact .move-thumb,
.playfield-layout .move-grid.move-grid-compact .move-thumb img,
.playfield-layout .move-grid.move-grid-compact .move-audio-mark {
  min-height: 3.35rem;
  border-radius: var(--radius-xs);
}

.playfield-layout .move-grid.move-grid-tight .move-thumb,
.playfield-layout .move-grid.move-grid-tight .move-thumb img,
.playfield-layout .move-grid.move-grid-tight .move-audio-mark {
  min-height: 2.9rem;
  border-radius: var(--radius-xs);
}

.move-copy {
  gap: 0.1rem;
}

.move-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.move-meta {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.08;
}

.playfield-layout .move-grid.move-grid-tight .move-title {
  font-size: 0.78rem;
}

.playfield-layout .move-grid.move-grid-tight .move-meta {
  font-size: 0.58rem;
}

.move-button:hover,
.move-button:focus-visible,
.action-button:hover,
.action-button:focus-visible,
.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible,
.menu-button:hover,
.menu-button:focus-visible,
.modal-close:hover,
.modal-close:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: none;
}

.move-button:active,
.action-button:active,
.primary-action:active,
.secondary-action:active {
  transform: none;
}

.audio-play-button {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: none;
}

.audio-play-button:hover,
.audio-play-button:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: none;
}

.move-audio-play {
  top: 0.3rem;
  right: 0.3rem;
}

.image-hover-preview {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--paper-strong);
  box-shadow: 0 20px 48px rgba(38, 33, 27, 0.22);
}

.image-hover-frame {
  border-radius: var(--radius-xs);
  border: 1px solid rgba(38, 33, 27, 0.12);
  box-shadow: none;
}

.image-hover-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.board-footnote {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.18;
  max-width: 41rem;
}

.support-panels {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
}

.support-panels > .status-panel,
.support-panels > .share-panel,
.support-panels > .actions-panel {
  grid-column: auto;
}

.status-panel,
.share-panel {
  padding: 0.95rem;
}

.actions-panel {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.status-stack {
  gap: 0.55rem;
}

.status-message,
.banner {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--line);
}

.status-success {
  background: var(--success-bg);
  color: var(--success-ink);
  border-color: rgba(180, 75, 36, 0.34);
}

.status-error {
  background: var(--error-bg);
  color: var(--error-ink);
  border-color: rgba(180, 75, 36, 0.3);
}

.status-info {
  background: var(--info-bg);
  color: var(--info-ink);
  border-color: rgba(38, 33, 27, 0.16);
}

.share-header {
  align-items: center;
  gap: 0.75rem;
}

.share-panel h2,
.modal-share-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: lowercase;
}

#share-message,
#win-share-message {
  min-height: 5.8rem;
  margin-top: 0.55rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(38, 33, 27, 0.24);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.primary-action,
.action-primary,
.context-action {
  min-height: 0;
  padding: 0.78rem 1rem;
  border-radius: 0.55rem;
  border: 1.5px solid var(--accent-deep);
  background: var(--accent);
  color: #fff;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.secondary-action,
.action-secondary {
  min-height: 0;
  padding: 0.78rem 1rem;
  border-radius: 0.55rem;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: none;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.action-primary,
.action-secondary {
  width: 100%;
}

.modal-backdrop {
  background: rgba(34, 28, 22, 0.44);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: min(92vw, 35rem);
  max-height: min(88vh, 48rem);
  gap: 0.9rem;
  padding: 2rem 1.15rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.68)),
    #fbf6ee;
  box-shadow: 0 24px 72px rgba(34, 28, 22, 0.34);
}

.modal-close {
  top: 0.7rem;
  right: 0.7rem;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 0.45rem;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: none;
  font-size: 1.15rem;
}

.modal-title {
  margin-top: 0.35rem;
  padding-right: 2.5rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(3.15rem, 10vw, 4.75rem);
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.055em;
  text-transform: lowercase;
}

.modal-callout {
  padding: 0.88rem 0.96rem;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.modal-subtitle {
  margin: 0;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.22;
}

.modal-path-panel,
.modal-share-panel {
  gap: 0.18rem;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  box-shadow: none;
}

.modal-path-panel .summary-label {
  margin: 0 0 0.08rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.modal-path-panel .path-words {
  color: var(--accent);
  font-size: 1.38rem;
}

.intro-modal-card {
  gap: 1rem;
}

.intro-kicker {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
}

.intro-rule-card {
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.intro-rule-number {
  border-radius: 0.45rem;
  background: var(--accent);
  font-family: var(--font-display);
}

@media (max-width: 900px) {
  .stage-header {
    align-items: center;
    gap: 0.6rem;
  }

  .playfield-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .playfield-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .playfield-layout .move-grid,
  .move-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 0.95rem 0.7rem 2rem;
  }

  .stage-header {
    flex-direction: column;
    align-items: center;
    padding-bottom: 0.7rem;
  }

  .stage-meta {
    align-items: center;
  }

  .graph-meta {
    text-align: center;
  }

  .playfield-layout > #moves-panel {
    padding: 0.72rem;
  }

  .move-context-bar {
    gap: 0.45rem;
  }

  .move-context-bar .move-stat-card,
  .move-stat-card-steps {
    min-height: 4.6rem;
    padding: 0.48rem 0.56rem 0.54rem;
  }

  .move-context-bar .move-stat-label,
  .move-stat-label {
    margin-bottom: 0.22rem;
    font-size: 0.86rem;
  }

  .move-context-bar .move-stat-value,
  .move-stat-card-steps .move-stat-value,
  .item-stat-title {
    min-height: 2.2rem;
    font-size: clamp(1.58rem, 8vw, 2.35rem);
  }

  .move-stat-card-steps .move-stat-value {
    font-size: clamp(1.34rem, 6vw, 1.9rem);
  }

  .item-stat-thumb {
    width: 2.8rem;
    height: 2.8rem;
  }

  .playfield-layout .move-grid,
  .move-grid {
    gap: 0.32rem;
    grid-auto-rows: minmax(4.35rem, auto);
  }

  .playfield-layout .move-button:not(.move-button-image):not(.move-button-audio),
  .move-button:not(.move-button-image):not(.move-button-audio) {
    min-height: 4.35rem;
    padding: 0.48rem 0.38rem;
    font-size: 0.98rem;
    line-height: 1.04;
  }

  body.mobile-game-layout #playfield-rail {
    display: none;
  }

  body.mobile-game-layout .mobile-utility-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
    margin-top: 0;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stats-panel,
  body.mobile-game-layout .mobile-utility-bar .move-tools-panel {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.mobile-game-layout .mobile-utility-bar .move-stat-card {
    min-height: 0;
  }

  body.mobile-game-layout .playfield-layout .move-grid,
  body.mobile-game-layout .move-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
    grid-auto-rows: minmax(4.15rem, auto);
  }

  body.mobile-game-layout .move-button:not(.move-button-image):not(.move-button-audio) {
    padding: 0.44rem 0.34rem;
    font-size: 0.9rem;
    line-height: 1.02;
  }

  body.mobile-game-layout .support-panels {
    max-height: var(--mobile-support-panels-max-height, min(16vh, 8rem));
  }

  .actions-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .share-header {
    align-items: start;
    flex-direction: column;
  }

  .modal-card {
    width: min(96vw, 35rem);
    padding: 1.85rem 0.9rem 1rem;
  }

  .modal-subtitle {
    font-size: 1.08rem;
  }

  .modal-path-panel .summary-label {
    font-size: 1.34rem;
  }

  .modal-path-panel .path-words {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
