/* Bengbington Referee UI — Sportovní design */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  background: radial-gradient(ellipse at 50% 0%, #0d1a2b 0%, #050a12 100%);
  color: #f0f4f8;
  min-height: 100vh; padding: 12px;
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; -webkit-user-select: none; user-select: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header {
  text-align: center; margin-bottom: 16px; margin-top: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ref-logo { height: 6vh; width: auto; object-fit: contain; }
.header h1 { font-size: 22px; font-weight: 800; color: #f0f4f8; letter-spacing: 0.05vw; }
.header p { font-size: 11px; color: rgba(255,255,255,0.4); }

.container { width: 100%; max-width: 900px; }

/* ── Panels ── */
.panel {
  background: linear-gradient(180deg, rgba(15,25,40,0.95) 0%, rgba(20,35,55,0.9) 100%);
  border: 1px solid rgba(79,163,255,0.15);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  position: relative; overflow: hidden;
}
.panel::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(79,163,255,0.3), transparent);
}
.panel h2 {
  font-size: 13px; margin-bottom: 10px; color: rgba(255,255,255,0.6);
  font-weight: 700; letter-spacing: 0.1vw;
}

/* ── Score Grid ── */
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-score {
  background: rgba(0,0,0,0.25); border-radius: 12px; padding: 12px;
  text-align: center; border: 1px solid rgba(255,255,255,0.05);
}
.team-score.a { border-top: 3px solid #4fa3ff; }
.team-score.b { border-top: 3px solid #e85d5d; }
.team-name { font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15vw; color: rgba(255,255,255,0.7); }
.sets-display { font-size: 11px; color: rgba(255,255,255,0.35); margin: 4px 0; }
.score-display { font-size: 56px; font-weight: 900; line-height: 1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.team-score.a .score-display { color: #4fa3ff; text-shadow: 0 0 15px rgba(79,163,255,0.2); }
.team-score.b .score-display { color: #e85d5d; text-shadow: 0 0 15px rgba(232,93,93,0.2); }
.score-buttons { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }

/* ── Visual Sets (in referee too) ── */
.sets-visual { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }
.ref-set-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.15); background: transparent; transition: all 0.3s; }
.ref-set-dot.won { background: #f0c040; border-color: #f0c040; box-shadow: 0 0 6px rgba(240,192,64,0.4); }
.ref-set-dot.lost { opacity: 0.2; }

/* ── Buttons ── */
button {
  padding: 10px 16px; font-size: 14px; font-weight: 700;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06); color: #f0f4f8;
  cursor: pointer; transition: all 0.15s; touch-action: manipulation;
  letter-spacing: 0.03vw;
}
button:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
button:active { transform: scale(0.96); }
button.big { font-size: 22px; padding: 12px 28px; min-width: 80px; }
button.primary { background: rgba(79,163,255,0.2); border-color: rgba(79,163,255,0.4); color: #4fa3ff; }
button.primary:hover { background: rgba(79,163,255,0.3); }
button.danger { background: rgba(232,93,93,0.15); border-color: rgba(232,93,93,0.3); color: #e85d5d; }

/* ── Team Form ── */
.team-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.team-form input {
  padding: 10px 14px; font-size: 15px; font-weight: 600;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #f0f4f8; outline: none;
  transition: border-color 0.2s;
}
.team-form input:focus { border-color: #4fa3ff; }
.control-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.control-buttons button { flex: 1; min-width: 100px; }

/* ── Timer ── */
.timer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-display-box { text-align: center; background: rgba(0,0,0,0.2); border-radius: 10px; padding: 10px; }
.timer-label { font-size: 10px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.15vw; margin-bottom: 4px; }
.timer-display {
  font-size: 36px; font-weight: 800; font-family: 'SF Mono', 'Monaco', monospace;
  font-variant-numeric: tabular-nums; color: #4fa3ff;
}
.match-status { font-size: 18px; font-weight: 700; color: #f0c040; letter-spacing: 0.1vw; }
.timer-controls { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.timer-controls button { flex: 1; min-width: 100px; }

/* ── Replay ── */
.replay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.replay-box { background: rgba(0,0,0,0.2); border-radius: 10px; padding: 10px; text-align: center; }
.replay-status { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 8px; }

/* ── Suggestions ── */
.suggestions-list { display: flex; flex-direction: column; gap: 6px; }
.suggestion-item { background: rgba(0,0,0,0.2); border-radius: 8px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; }
.suggestion-item.warn { border-left: 3px solid #f0c040; }
.suggestion-text { font-size: 12px; color: rgba(255,255,255,0.6); }
.suggestion-level { font-size: 10px; text-transform: uppercase; color: rgba(255,255,255,0.3); }

/* ── Status bar ── */
.status-bar {
  text-align: center; margin-top: 8px; margin-bottom: 4px;
  font-size: 11px; color: rgba(255,255,255,0.3);
  font-family: 'SF Mono', 'Monaco', monospace;
}

/* ── Keyboard hint ── */
.keyboard-hint {
  text-align: center; font-size: 11px; color: rgba(255,255,255,0.25);
  padding: 8px; line-height: 1.6;
}
.keyboard-hint strong { color: rgba(255,255,255,0.5); }

@media (max-width: 768px) {
  .header h1 { font-size: 18px; }
  .score-display { font-size: 44px; }
  .timer-display { font-size: 28px; }
  .timer-grid, .score-grid, .replay-grid, .team-form { grid-template-columns: 1fr; }
  button.big { font-size: 18px; padding: 10px 20px; }
  .ref-logo { height: 5vh; }
}
@media (max-width: 480px) {
  .header h1 { font-size: 16px; }
  .score-display { font-size: 36px; }
  .timer-display { font-size: 24px; }
  button { padding: 8px 12px; font-size: 13px; }
  .ref-logo { height: 4vh; }
}
