/* MAONO Sport Console - Thème Salle & Kiosque Haute Fidélité */
:root {
  --bg-main: #090d16;
  --bg-card: #151c2c;
  --bg-card-hover: #1e293b;
  --border-color: #27354f;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body.theme-salle {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 12px;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 1.25rem;
  color: #fff;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.offline-badge {
  background: #064e3b;
  color: #34d399;
  border: 1px solid #059669;
}

.match-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.select-input {
  background: #0b1120;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  min-height: 48px;
}

.period-pill {
  background: #1e293b;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.referee-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #0f172a;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.referee-indicator svg {
  color: #10b981;
}

/* Boutons universels (minimum 48dp de cible tactile) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 8px 16px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.1s ease, transform 0.05s ease;
  font-size: 0.95rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #1e293b;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-warning {
  background: #78350f;
  color: #fde68a;
  border-color: #b45309;
}

.btn-warning:hover {
  background: #92400e;
}

.btn-start {
  background: #065f46;
  color: #a7f3d0;
  border-color: #059669;
  font-size: 1.1rem;
}

.btn-start.running {
  background: #881337;
  color: #fecdd3;
  border-color: #be123c;
}

/* Clock Deck */
.clock-deck {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.main-clock-card, .shot-clock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clock-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.clock-digits {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent-amber);
  line-height: 1;
  margin: 6px 0;
}

.shot-digits {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--accent-red);
  line-height: 1;
  margin: 6px 0;
}

.clock-controls, .shot-controls {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.btn-shot {
  background: #27272a;
  color: #fff;
  border: 1px solid #3f3f46;
  flex: 1;
  font-size: 1.1rem;
}

/* Teams Grid */
.teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
}

.team-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.team-name-input {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  outline: none;
  width: 60%;
}

.score-display {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 900;
  color: #fff;
}

.team-a .score-display {
  color: var(--accent-blue);
}

.team-b .score-display {
  color: var(--accent-green);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.btn-score {
  min-height: 80px;
  font-size: 1.25rem;
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.btn-score:hover {
  background: #334155;
}

.team-footer {
  display: flex;
  gap: 16px;
  justify-content: space-around;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.counter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.counter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.counter-val {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
}

.btn-small {
  min-height: 40px;
  padding: 4px 12px;
  background: #27272a;
  color: #e4e4e7;
  border: 1px solid #3f3f46;
  font-size: 0.85rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-size: 0.95rem;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.hidden {
  display: none !important;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
}

.modal-card h3 {
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.pin-field {
  width: 100%;
  padding: 12px;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 8px;
  background: #090d16;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  margin-bottom: 16px;
  outline: none;
  font-family: var(--font-mono);
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.numpad-key {
  background-color: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.1s ease;
}

.numpad-key:active {
  background-color: #334155;
}

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

.modal-actions .btn {
  flex: 1;
}

/* Modale de Configuration Match & Compétition */
.modal-card-wide {
  max-width: 540px;
  width: 95%;
  text-align: left;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #fff;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 {
  flex: 1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.text-input, .full-width {
  width: 100%;
}

.text-input {
  background: #090d16;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.text-input:focus {
  border-color: var(--accent-blue);
}

.radio-group {
  display: flex;
  gap: 16px;
  padding: 4px 0;
}

.radio-label {
  font-size: 0.875rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}


