.play-site { background: linear-gradient(160deg, rgba(16, 18, 29, .72), rgba(38, 48, 74, .36)); }
.play-main { width: min(1180px, calc(100vw - 32px)); }
.play-shell { padding: 24px 0 56px; }
.play-topline { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.play-topline h1 { font-size: clamp(2.8rem, 7vw, 5.7rem); }
.level-picker { display: grid; gap: .35rem; min-width: min(100%, 260px); color: var(--muted); font-weight: 850; }
.level-picker select { min-height: 46px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .26); color: var(--paper); padding: .65rem .75rem; font: inherit; font-weight: 850; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1rem; align-items: start; }
.board-panel, .side-panel { border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .24); }
.board-panel { padding: clamp(1rem, 3vw, 1.4rem); }
.side-panel { display: grid; gap: 1rem; padding: 1rem; }
.board-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.board-heading h2, .tool-group h2 { margin: 0; font-size: 1.45rem; line-height: 1.1; }
.kicker { margin: 0 0 .3rem; color: var(--mint); font-size: .78rem; font-weight: 950; text-transform: uppercase; }
.progress { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; min-height: 38px; border-radius: 8px; background: var(--accent); color: var(--ink); font-weight: 950; }
.target-ribbon { display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.target-token { min-height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 247, 232, .08); color: var(--paper); font-size: 1.2rem; font-weight: 950; }
.target-token[data-filled="true"] { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.weave-board { display: grid; grid-template-columns: repeat(var(--weave-columns), minmax(0, 1fr)); gap: clamp(.45rem, 1.4vw, .75rem); inline-size: 100%; max-inline-size: 620px; margin-inline: auto; }
.cell { position: relative; aspect-ratio: 1; min-width: 0; border: 2px solid rgba(255, 247, 232, .28); border-radius: 8px; background: rgba(255, 247, 232, .09); color: var(--paper); font: 950 clamp(1.35rem, 6vw, 2.4rem)/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
.cell:hover, .cell:focus-visible { border-color: var(--accent); outline: none; }
.cell.is-start { box-shadow: inset 0 0 0 3px var(--mint); }
.cell.is-end { box-shadow: inset 0 0 0 3px var(--rose); }
.cell.is-start.is-end { box-shadow: inset 0 0 0 3px var(--mint), inset 0 0 0 6px var(--rose); }
.cell.is-required::before, .cell.is-forbidden::before, .cell.is-selected::after { position: absolute; display: grid; place-items: center; border-radius: 999px; font-size: .72rem; font-weight: 950; line-height: 1; }
.cell.is-required::before { content: "!"; inset: .25rem auto auto .25rem; width: 1.1rem; height: 1.1rem; background: var(--accent); color: var(--ink); }
.cell.is-forbidden::before { content: "x"; inset: .25rem auto auto .25rem; width: 1.1rem; height: 1.1rem; background: var(--rose); color: var(--ink); }
.cell.is-selected { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.cell.is-selected::after { content: attr(data-order); inset: .25rem .25rem auto auto; width: 1.25rem; height: 1.25rem; background: var(--ink); color: var(--paper); }
.cell.is-blocked { opacity: .5; background: repeating-linear-gradient(135deg, rgba(255, 247, 232, .08), rgba(255, 247, 232, .08) 8px, rgba(255, 111, 124, .16) 8px, rgba(255, 111, 124, .16) 16px); }
.cell-empty { border-style: dashed; background: rgba(255, 247, 232, .03); cursor: default; }
.tool-group { border: 1px solid var(--line); border-radius: 8px; padding: .9rem; background: rgba(255, 247, 232, .05); }
.constraint-list { display: grid; gap: .45rem; margin: .75rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.selected-path { min-height: 3rem; margin: .75rem 0 1rem; color: var(--paper); font-weight: 850; overflow-wrap: anywhere; }
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.controls button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .28); color: var(--paper); font: inherit; font-weight: 900; cursor: pointer; }
.controls button:hover:not(:disabled), .controls button:focus-visible { border-color: var(--accent); outline: none; }
.controls button:disabled { opacity: .45; cursor: not-allowed; }
.controls .primary-action { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.status { margin: 0; padding: 1rem; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, .24); color: var(--paper); font-weight: 900; }
.status[data-result="Accepted"] { background: color-mix(in srgb, var(--mint), black 70%); border-color: var(--mint); }
.status[data-result$="Failed"], .status[data-result="WrongSymbol"], .status[data-result="NonAdjacent"], .status[data-result="ReusedCell"], .status[data-result="BlockedCell"], .status[data-result="UnknownCell"] { background: color-mix(in srgb, var(--rose), black 72%); border-color: var(--rose); }
@media (max-width: 860px) {
  .play-topline { align-items: stretch; flex-direction: column; }
  .game-layout { grid-template-columns: 1fr; }
  .weave-board { max-inline-size: 100%; }
}
@media (max-width: 430px) {
  .play-main { width: min(100vw - 20px, 1180px); }
  .board-panel, .side-panel { padding: .75rem; }
  .cell { border-width: 1px; }
  .controls { grid-template-columns: 1fr; }
}
