/* Darts — Playnesta original (MIT). Board, crosshair, scores, buttons. */
:root {
  --pn-vh: 1vh;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: radial-gradient(circle at 50% 10%, #2a3140, #161b22 78%);
  color: #eef3fb;
  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;
  height: 100vh;
  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;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  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: 8px;
  flex-wrap: wrap;
}
.hud {
  font-size: 13px;
  opacity: 0.95;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
}
.hud b {
  color: #ffd166;
}
.modes {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid #4c8bd4;
  background: #1f3a5c;
  color: #eef3fb;
  cursor: pointer;
}
.btn.primary {
  background: #ffd166;
  color: #3a2c05;
  border-color: #ffe7a8;
}
.btn.on {
  background: #4c8bd4;
  border-color: #a9cdf3;
}
.btn:active {
  transform: scale(0.97);
}
.btn.mode {
  font-size: 13px;
  padding: 8px 10px;
}
.boardwrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.boardbox {
  position: relative;
  width: min(100%, 62vh, 460px);
  aspect-ratio: 1;
  touch-action: manipulation;
  cursor: crosshair;
}
.boardbox svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.45));
}
.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid #ffd166;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 3;
}
.crosshair::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #ffd166;
}
.crosshair.hidden {
  display: none;
}
.visit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 30px;
  flex-wrap: wrap;
}
.visit-label {
  font-size: 14px;
  opacity: 0.85;
}
.dartslot {
  min-width: 52px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  padding: 4px 8px;
}
.dartslot.hit {
  color: #9fe870;
}
.dartslot.bust {
  color: #ff8f96;
}
.checkout {
  font-size: 13px;
  font-weight: 700;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
}
.checkout.hidden {
  display: none;
}
.msg {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: 22px;
}
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay.hidden {
  display: none;
}
.panel {
  background: #1d2531;
  border: 1px solid #4c8bd4;
  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;
}
.rules-list b {
  color: #ffd166;
}
@media (max-height: 640px) {
  .boardbox {
    width: min(100%, 48vh);
  }
}
