/* Slitherlink — Playnesta original (MIT). Dots, edges, clues, buttons. */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: radial-gradient(circle at 50% 18%, #182444, #0b1020 70%);
  color: #e8ecfa;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: calc(var(--pn-vh, 1vh) * 100);
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  gap: 8px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.65;
  margin-left: 6px;
  text-transform: lowercase;
}
.meta {
  display: flex;
  gap: 10px;
}
.meta span {
  font-size: 14px;
  opacity: 0.9;
}
.modes {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.boardwrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.boardbox {
  position: relative;
  touch-action: manipulation;
}
svg.board {
  display: block;
  overflow: visible;
}
.edge {
  cursor: pointer;
}
.edge.hit {
  stroke: transparent;
}
.edge.on {
  stroke: #8ea2e0;
  stroke-linecap: round;
}
.edge.on.bad {
  stroke: #ff5b5b;
}
.dot {
  pointer-events: none;
}
.clue {
  pointer-events: none;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.clue.bad {
  fill: #ff5b5b;
}
.mark {
  pointer-events: none;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  fill: rgba(232, 236, 250, 0.5);
}
.msg {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: 24px;
}
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #5568a8;
  background: #24306a;
  color: #e8ecfa;
  cursor: pointer;
}
.btn.primary {
  background: #5568a8;
  color: #fff;
  border-color: #8ea2e0;
}
.btn.mode.on {
  background: #5568a8;
  color: #fff;
  border-color: #8ea2e0;
}
.btn:active {
  transform: scale(0.97);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay.hidden {
  display: none;
}
.panel {
  background: #141d3a;
  border: 1px solid #5568a8;
  border-radius: 16px;
  padding: 18px;
  max-width: 420px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.panel p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
.panel-wide {
  max-width: 520px;
}
.rules-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}
.rules-list li {
  margin-bottom: 8px;
}
