* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #14171c;
  color: #e8e8e8;
}

body { display: flex; flex-direction: column; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #1d2128;
  border-bottom: 1px solid #2c323c;
}
header h1 { margin: 0; font-size: 20px; }
.ver { font-size: 12px; color: #8a93a3; font-weight: normal; }
.bankroll { font-size: 18px; }
.room-links { margin-left: auto; margin-right: 24px; font-size: 14px; color: #8a93a3; }
.room-links a { color: #7cc4ff; text-decoration: none; }
.bankroll strong { color: #ffd166; }

main { flex: 1; display: flex; min-height: 0; }

#scene {
  width: 45%;
  min-width: 300px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  border-right: 1px solid #2c323c;
}

.round-label { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: #8a93a3; }
.round-row { display: flex; align-items: center; gap: 10px; }
.tier {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  color: #14171c;
}
.timer { margin-left: auto; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: #e8e8e8; }
.timer.over { color: #ff7a6b; }
.seen-note { font-size: 13px; color: #ffd166; margin-top: -8px; }
.tier-1 { background: #5fd38d; }
.tier-2 { background: #ffd166; }
.tier-3 { background: #ff7a6b; }

#result .session {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
}
.pos { color: #5fd38d; }
.neg { color: #ff7a6b; }

.pano-wrap {
  position: relative;
  height: 50vh;
  min-height: 280px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
#pano { position: absolute; inset: 0; }
.pano-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: #1d2128;
  color: #aab2c0;
  font-size: 15px;
}
.pano-msg[hidden] { display: none; }

.target { font-size: 26px; line-height: 1.3; margin: 0; }
.hint { color: #aab2c0; font-size: 14px; margin: 0 0 8px; }

.circle-info {
  padding: 10px 12px;
  background: #1d2128;
  border-radius: 6px;
  font-size: 15px;
}
.circle-info b { color: #7cc4ff; }

.stake-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
#stakes { display: flex; gap: 8px; flex-wrap: wrap; }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #3a4250;
  background: #252a33;
  color: #e8e8e8;
  border-radius: 6px;
  padding: 8px 14px;
}
button:hover:not(:disabled) { background: #2f3540; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.no-move {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding-left: 12px;
  border-left: 1px solid #3a4250;
  font-size: 14px;
  color: #aab2c0;
  cursor: pointer;
}

.stake.selected { background: #ffd166; color: #14171c; border-color: #ffd166; }
.primary { background: #2e7dd7; border-color: #2e7dd7; font-weight: 600; padding: 12px 18px; font-size: 16px; }
.primary:hover:not(:disabled) { background: #3a8ce8; }
.warn { background: #b5542d; border-color: #b5542d; font-weight: 600; padding: 12px 18px; }
.small { font-size: 13px; padding: 6px 10px; }
.bad-spot { align-self: flex-start; }

#result {
  padding: 16px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.6;
}
#result.win { background: #173d26; border: 1px solid #2f9e5a; }
#result.loss { background: #45201d; border: 1px solid #c4473a; }
#result.pass { background: #1d2128; border: 1px solid #3a4250; }
.ante-note { font-size: 13px; color: #aab2c0; margin: 0 0 10px; }
.bet-buttons { display: flex; gap: 10px; align-items: center; }
#result h2 { margin: 0 0 8px; font-size: 24px; }

.footer-tools { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #8a93a3; }
.build-version { margin-left: auto; font-size: 11px; opacity: 0.7; font-variant-numeric: tabular-nums; }

#map-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.map-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: #1d2128;
  border-bottom: 1px solid #2c323c;
}
.mode.active { background: #7cc4ff; color: #14171c; border-color: #7cc4ff; }
#drag-radius { margin-left: auto; font-weight: 600; color: #7cc4ff; }
#map { flex: 1; }
#map.drawing { cursor: crosshair; touch-action: none; }
.map-msg { display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: #aab2c0; }

@media (max-width: 800px) {
  main { flex-direction: column; }
  #scene { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid #2c323c; }
  #map-wrap { min-height: 60vh; }
}
