.network-game {
  --net-ink: #253f43;
  --net-muted: #536d6c;
  --net-paper: #f7f2e5;
  --net-teal: #2f6b68;
  --net-copper: #a55834;
  color: var(--net-ink);
  font: 500 1rem/1.45 system-ui, sans-serif;
}
.network-game * { box-sizing: border-box; }
.net-shell { max-width: 1160px; margin: 0 auto; padding: clamp(12px, 2vw, 24px); border: 1px solid #d8d3c3; border-radius: 18px; background: var(--net-paper); }
.net-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.net-heading h2 { margin: 0; font: 700 clamp(1.5rem, 3vw, 2.25rem)/1.1 Georgia, serif; }
.net-kicker { margin: 0 0 .3rem; color: var(--net-teal); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.net-memory { max-width: 18rem; margin: 0; color: var(--net-muted); font-size: .84rem; text-align: right; }
.net-instructions { max-width: 78ch; margin: .8rem 0 1rem; color: var(--net-muted); }
.net-toolbar, .net-readouts, .net-actions, .net-panel-actions, .net-dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.net-toolbar { justify-content: space-between; }
.net-readouts { color: var(--net-muted); font-size: .9rem; }
.net-readouts > span { padding: .35rem .65rem; border-radius: 999px; background: #e8eee7; }
.network-game button, .network-game select { min-height: 42px; padding: .45rem .8rem; border: 1px solid #9fb3ad; border-radius: 9px; background: #fff; color: var(--net-ink); font: inherit; cursor: pointer; }
.network-game button:hover:not(:disabled), .network-game select:hover { background: #edf5ee; border-color: var(--net-teal); }
.network-game button:focus-visible, .network-game select:focus-visible, .network-game:focus-visible { outline: 3px solid #c0703f; outline-offset: 2px; }
.network-game button:disabled { opacity: .5; cursor: not-allowed; }
.net-rewards { margin: .6rem 0 1rem; color: var(--net-muted); font-size: .85rem; }
.net-play-area { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(220px, 320px); align-items: start; gap: clamp(1rem, 3vw, 2rem); }
.net-board { --net-tile: clamp(64px, min(10vh, 8vw), 96px); display: grid; grid-template-columns: repeat(var(--net-size), minmax(0, var(--net-tile))); width: max-content; max-width: 100%; margin: 0 auto; overflow: auto; border: 7px solid #596f69; border-radius: 15px; background: #7faaa0; box-shadow: inset 0 0 0 3px #d7e5d8, 0 5px 0 #38534f; }
.net-cell { position: relative; width: var(--net-tile); height: var(--net-tile); border-right: 1px solid #9ebdb1; border-bottom: 1px solid #9ebdb1; background: #d7e7d9; }
.net-cell.is-reachable { background: #ecdfb8; }
.net-cell.is-unreached { background-image: radial-gradient(#8aa9a1 1px, transparent 1px); background-size: 9px 9px; }
.net-cell.is-current-row:not(.is-reachable), .net-cell.is-current-column:not(.is-reachable) { background-color: #e2eee1; }
.net-cell.is-current-row.is-reachable, .net-cell.is-current-column.is-reachable { background-color: #f2e7c7; }
.net-cell.is-selected { z-index: 1; box-shadow: inset 0 0 0 4px #bd6e3f; }
.net-tile { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0 !important; padding: 4px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
.net-tile:hover:not(:disabled) { background: #ffffff45 !important; }
.net-tile:focus-visible { z-index: 2; outline: 4px solid #8f482f !important; outline-offset: -4px; }
.net-pipes { fill: none; stroke: #285a56; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.net-joint { fill: #285a56; stroke: #edf3e7; stroke-width: 2; }
.net-tile svg { display: block; width: 100%; height: 100%; overflow: visible; }
.net-tile.is-locked .net-pipes { stroke: #4a536b; }
.net-tile.is-locked .net-joint { fill: #4a536b; }
.net-hub, .net-lock-mark { position: absolute; display: grid; place-items: center; width: 1.3em; height: 1.3em; border: 2px solid #fff; border-radius: 50%; background: #a94f2f; color: #fff; font-size: clamp(.8rem, 1.8vw, 1.15rem); font-weight: 900; line-height: 1; text-shadow: 0 1px 2px #172d2d; }
.net-hub { right: 3px; top: 3px; }
.net-lock-mark { left: 3px; top: 3px; border-color: #fff; background: #4a536b; font-size: .8rem; }
.net-panel { padding: clamp(.8rem, 2vw, 1.15rem); border: 1px solid #d0d7ca; border-radius: 14px; background: #edf1e8; color: var(--net-muted); }
.net-selection { margin: 0 0 .7rem; color: var(--net-ink); font-weight: 750; }
.net-panel-actions { display: grid; grid-template-columns: 1fr; }
.net-panel-actions button { width: 100%; }
.net-legend { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin: .85rem 0; font-size: .84rem; }
.net-legend-mark { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; color: #fff; font-weight: 900; }
.net-legend-mark.is-hub { background: #a94f2f; }
.net-legend-mark.is-reachable { background: #9a7a2f; }
.net-guide, .net-player-note { margin: .8rem 0 0; font-size: .88rem; }
.net-player-note { padding-top: .75rem; border-top: 1px solid #ccd6cc; }
.net-status { min-height: 1.5em; margin: .9rem 0 .45rem; font-weight: 750; color: var(--net-ink); }
.net-legend, .net-guide, .net-player-note { color: var(--net-muted); }
.net-status.is-success { color: #206546; }
.net-status.is-paused { color: #865920; }
.net-help { margin: 0; color: var(--net-muted); font-size: .86rem; }
.net-dialog { width: min(92vw, 460px); padding: 1.25rem; border: 1px solid #9fb3ad; border-radius: 16px; color: var(--net-ink); background: var(--net-paper); box-shadow: 0 15px 55px #182e2e55; }
.net-dialog::backdrop { background: #172b2a88; }
.net-dialog h3 { margin: 0 0 .4rem; font: 700 1.45rem Georgia, serif; }
.net-dialog p { color: var(--net-muted); }
.net-dialog label { display: grid; gap: .25rem; margin: .8rem 0; font-weight: 700; }
.net-dialog-actions { justify-content: flex-end; margin-top: 1rem; }
@media (max-width: 820px) {
  .net-heading { align-items: flex-start; }
  .net-play-area { grid-template-columns: 1fr; }
  .net-panel { max-width: 580px; width: 100%; margin: 0 auto; }
  .net-panel-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .net-heading { display: block; }
  .net-memory { max-width: none; margin-top: .45rem; text-align: left; }
  .net-board { --net-tile: clamp(48px, 15vw, 70px); border-width: 5px; }
  .net-toolbar { align-items: flex-start; }
  .net-actions { width: 100%; }
  .net-actions button { flex: 1; }
  .net-panel-actions { grid-template-columns: 1fr; }
}
@media (max-height: 720px) and (min-width: 821px) {
  .net-shell { padding-block: 12px; }
  .net-heading { display: none; }
  .net-instructions { font-size: .82rem; line-height: 1.35; }
  .net-readouts, .net-actions { font-size: .8rem; }
  .net-rewards { margin-block: .4rem; }
  .net-panel { padding: 10px; }
  .net-panel p { font-size: .76rem; line-height: 1.35; }
  .net-guide, .net-player-note { margin-top: .5rem; }
  .net-status { margin-block: .4rem; }
  .net-instructions { margin-block: .4rem .7rem; }
  .net-board { --net-tile: clamp(54px, 9vh, 74px); }
}
@media (prefers-reduced-motion: reduce) { .network-game *, .network-game *::before, .network-game *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
