*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0F1117;
  color: #fff;
  font-family: system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
}

#app {
  position: relative;
  width: min(540px, 100vw);
  height: min(680px, 100vh);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #1A1D27;
  cursor: crosshair;
}

#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(15,17,23,0.88);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  z-index: 5;
}

.hud-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.hud-col.right { align-items: flex-end; }
.hud-label { font-size: 10px; font-weight: 700; color: #305CDE; letter-spacing: 1px; }
.hud-score { font-size: 1.5rem; font-weight: 800; }
.hud-darts { font-size: 13px; }

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
#turnLabel { font-size: 12px; font-weight: 700; color: #FFD700; letter-spacing: 1px; }
#lastThrow { font-size: 18px; font-weight: 800; color: #fff; min-height: 22px; }
#checkoutHint { font-size: 11px; color: #aaa; }

#overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,17,23,0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 10;
}
#overlay.active { opacity: 1; pointer-events: all; }

h1 { font-size: 2.2rem; font-weight: 800; }
p { color: #aaa; text-align: center; line-height: 1.6; }
.hint { font-size: 12px; color: #555; }

button {
  background: #305CDE;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
button:hover { background: #4a70e8; transform: translateY(-2px); }
