/* ==========================================================
   wasit.css — Stylesheet Khusus Mode Wasit Live Scoring
   Desain mobile-first, kontras tinggi, tombol sentuh besar
   ========================================================== */

:root {
  --court-green: #0d5c3a;
  --court-dark: #073823;
  --court-line: rgba(255, 255, 255, 0.85);
  --court-net: #e2e8f0;
  --server-gold: #f59e0b;
  --server-glow: rgba(245, 158, 11, 0.4);
  --receiver-blue: #0284c7;
  --receiver-glow: rgba(2, 132, 199, 0.4);
}

/* Base Body untuk Wasit */
body.wasit-body {
  background-color: #0b1523;
  color: #f8fafc;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  min-height: 100vh;
}

/* Header Wasit */
.wasit-header {
  background: #06101e;
  border-bottom: 1px solid #1e293b;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.wasit-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto;
}

.wasit-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #f8fafc;
}

.wasit-badge-live {
  background: #ef4444;
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.96); }
}

.wasit-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 14px 24px;
}

/* Kartu / Card Wasit */
.wasit-card {
  background: #111e2f;
  border: 1px solid #1e334d;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.wasit-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f1f5f9;
}

/* Form Kontrol */
.wasit-input, .wasit-select {
  width: 100%;
  background: #1a2a40;
  border: 1px solid #2d4566;
  border-radius: 8px;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.wasit-input:focus, .wasit-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.wasit-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Papan Skor Besar */
.scoreboard-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 12px 0 6px;
}

.team-score-block {
  padding: 8px 4px;
  border-radius: 10px;
  background: #162438;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.team-score-block.is-serving {
  border-color: var(--server-gold);
  background: #1c2e47;
  box-shadow: 0 0 12px var(--server-glow);
}

.team-score-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e2e8f0;
}

.team-score-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  font-family: "Poppins", monospace;
  color: #ffffff;
  margin-top: 4px;
}

.scoreboard-center-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.scoreboard-bola-badge {
  background: #2563eb;
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.scoreboard-bola-badge.bola-2 {
  background: #ea580c;
}

/* Banner Panggilan Wasit */
.panggilan-banner {
  background: #1a2a40;
  border-left: 4px solid var(--server-gold);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 10px 0;
  text-align: center;
}

.panggilan-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.panggilan-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fef08a;
}

/* Visual Lapangan Badminton */
.court-container {
  background: var(--court-green);
  border: 3px solid var(--court-line);
  border-radius: 10px;
  padding: 10px;
  margin: 12px 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}

.court-net-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  margin-left: -2px;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff,
    #ffffff 6px,
    #000000 6px,
    #000000 12px
  );
  z-index: 5;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.court-net-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  background: #000000;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 6;
  letter-spacing: 1px;
}

.court-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.court-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.court-side-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.court-box-pair {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
}

.court-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px dashed var(--court-line);
  border-radius: 6px;
  padding: 10px 8px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
}

.court-box.is-server-box {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--server-gold);
  border-style: solid;
  border-width: 2px;
  box-shadow: 0 0 10px var(--server-glow);
}

.court-box.is-receiver-box {
  background: rgba(2, 132, 199, 0.22);
  border-color: var(--receiver-blue);
  border-style: solid;
  border-width: 2px;
  box-shadow: 0 0 10px var(--receiver-glow);
}

.court-box-pos {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: #cbd5e1;
  font-weight: 600;
}

.court-box-player {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.court-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  width: fit-content;
}

.badge-server {
  background: var(--server-gold);
  color: #000000;
}

.badge-receiver {
  background: var(--receiver-blue);
  color: #ffffff;
}

.court-direction-hint {
  text-align: center;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
}

/* Dua Tombol Reli Raksasa */
.rally-buttons-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 10px;
}

.btn-rally {
  background: #1e3a5f;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 16px 8px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, filter 0.15s ease;
  min-height: 96px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-rally:active {
  transform: scale(0.96);
  filter: brightness(1.2);
}

.btn-rally.rally-serving {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border-color: #34d399;
}

.btn-rally.rally-opponent {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-color: #64748b;
}

.rally-team-title {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.rally-action-hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fef08a;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

/* Tombol Aksi Bawah */
.action-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.btn-tool {
  background: #1a2a40;
  border: 1px solid #334e68;
  border-radius: 8px;
  color: #cbd5e1;
  padding: 10px 4px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-tool:hover {
  background: #243b55;
  color: #ffffff;
}

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

.btn-tool-undo {
  color: #fca5a5;
  border-color: #7f1d1d;
}

.btn-tool-undo:hover {
  background: #450a0a;
  color: #ffffff;
}

/* Modal Overlay */
.wasit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.wasit-modal {
  background: #111e2f;
  border: 1px solid #2d4566;
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.wasit-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fef08a;
  margin-bottom: 10px;
}

.wasit-modal-body {
  font-size: 0.95rem;
  color: #e2e8f0;
  margin-bottom: 20px;
  line-height: 1.5;
}

.wasit-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Wake lock indicator */
.wakelock-pill {
  font-size: 0.72rem;
  color: #34d399;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Utilities */
.is-hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .team-score-number {
    font-size: 3rem;
  }
  .court-box {
    padding: 6px 4px;
    min-height: 58px;
  }
  .court-box-player {
    font-size: 0.85rem;
  }
}
