/* Robot Referee Mobile Stylesheet */
:root {
  --ref-navy: #001256;
  --ref-navy-dark: #000a30;
  --ref-cyan: #06b6d4;
  --ref-emerald: #10b981;
  --ref-rose: #f43f5e;
  --ref-amber: #f59e0b;
  --ref-bg: #090e1a;
  --ref-card: rgba(18, 25, 44, 0.95);
  --ref-border: rgba(255, 255, 255, 0.1);
  --font-thai: 'IBM Plex Sans Thai', 'Kanit', sans-serif;
  --font-num: 'Space Grotesk', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body.referee-body {
  background-color: var(--ref-bg);
  color: #f8fafc;
  font-family: var(--font-thai);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
}

/* Header */
.referee-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ref-card);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--ref-border);
}

.referee-badge {
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
  display: block;
}

.referee-title {
  font-size: 16px;
  font-weight: 700;
}

.conn-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.conn-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 6px #34d399;
}

/* Team Select Card */
.team-select-card {
  background: var(--ref-card);
  border: 1px solid var(--ref-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.team-dropdown {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--ref-border);
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  font-family: var(--font-thai);
  outline: none;
}

.team-dropdown option {
  background: #0f172a;
  color: #fff;
}

.current-team-summary {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}

.summary-name {
  font-size: 16px;
  font-weight: 800;
  color: #38bdf8;
}

.summary-school {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.summary-past-times {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #cbd5e1;
}

.text-gold {
  color: #facc15;
}

/* Round Picker */
.round-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.round-picker label {
  font-size: 13px;
  color: #94a3b8;
}

.round-buttons {
  display: flex;
  gap: 8px;
}

.btn-round {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ref-border);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-round.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
}

/* Stopwatch Card */
.stopwatch-card {
  background: var(--ref-card);
  border: 1px solid var(--ref-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.stopwatch-display {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(6, 182, 212, 0.3);
  border-radius: 16px;
  padding: 18px 10px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) inset;
}

.stopwatch-time {
  font-family: var(--font-num);
  font-size: clamp(52px, 14vw, 76px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 2px;
  line-height: 1;
  display: block;
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.stopwatch-unit {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

/* Actions (Start / Stop / Reset) */
.stopwatch-actions {
  display: flex;
  gap: 10px;
}

.btn-timer {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.btn-start {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  flex: 2;
}

.btn-stop {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
  flex: 2;
}

.btn-reset {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--ref-border);
  color: #cbd5e1;
}

.btn-timer:active {
  transform: scale(0.96);
}

/* Penalty Section */
.penalty-section {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.penalty-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.penalty-total {
  color: #f87171;
  font-family: var(--font-num);
  font-size: 14px;
}

.penalty-buttons {
  display: flex;
  gap: 6px;
}

.btn-pen {
  flex: 1;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
}

.btn-pen.clear {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--ref-border);
  color: #94a3b8;
  flex: 1.2;
}

.btn-pen:active {
  transform: scale(0.95);
}

/* Status Options */
.status-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-options label {
  font-size: 12px;
  color: #94a3b8;
}

.status-radio-group {
  display: flex;
  gap: 6px;
}

.btn-status {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ref-border);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-status.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
  color: #34d399;
}
.btn-status.dnf.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #fbbf24;
  color: #fbbf24;
}
.btn-status.dq.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: #f87171;
  color: #f87171;
}

/* Final Calculation Box */
.final-calc-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
}

.final-label {
  font-size: 12px;
  color: #bae6fd;
  font-weight: 600;
}

.final-value {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 800;
  color: #38bdf8;
}

/* Submit Button */
.btn-submit-leaderboard {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
  transition: all 0.15s;
}

.btn-submit-leaderboard:active {
  transform: scale(0.97);
  filter: brightness(1.2);
}

/* Footer Nav */
.referee-footer-nav {
  display: flex;
  gap: 10px;
}

.nav-link-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ref-border);
  color: #94a3b8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  transition: all 0.2s;
}

.nav-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
