/* Shared styles for spectator & admin views */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #000;
  color: #fff;
  min-height: 100vh;
}

/* Header */
header {
  background: #f9ad18;
  color: #000;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 3px solid #000;
}

header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

header .badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: #000;
  color: #f9ad18;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Main layout with bottom padding for status bar */
main {
  padding: 24px;
  padding-bottom: 80px;
  overflow-x: auto;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #f9ad18;
  margin-bottom: 12px;
  border-left: 3px solid #f9ad18;
  padding-left: 8px;
}

.divider {
  border: none;
  border-top: 1px solid #333;
  margin: 28px 0;
}

/* Bracket container and columns layout */
.bracket {
  display: flex;
  flex-direction: row;
  gap: 60px;
  align-items: stretch;
  position: relative;
}

.round {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex-grow: 1;
  position: relative;
  gap: 20px;
  padding: 10px 0;
}

.bracket-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.round-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 4px;
}

/* Match box styling */
.match-box {
  background: #111;
  border: 1px solid #333;
  width: 200px;
  position: relative;
  z-index: 1;
}

.match-box .player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.85rem;
  border-bottom: 1px solid #222;
}

.match-box .player:last-of-type {
  border-bottom: none;
}

.match-box .player.winner {
  background: #f9ad18;
  color: #000;
  font-weight: 700;
}

.player-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.player-name.tbd {
  color: #555;
  font-style: italic;
}

.player-score {
  font-weight: 700;
  min-width: 24px;
  text-align: right;
}

/* Inline score input beside team name */
.player-score-input {
  width: 44px;
  background: #000;
  border: 1px solid #444;
  color: #f9ad18;
  font-weight: 700;
  padding: 2px 4px;
  font-size: 0.85rem;
  text-align: center;
  border-radius: 0;
  -moz-appearance: textfield;
}

.player.winner .player-score-input {
  background: #000;
  color: #f9ad18;
  border-color: #000;
}

.player-score-input:focus {
  outline: 1px solid #f9ad18;
  border-color: #f9ad18;
  background: #141620;
}

.player-score-input::-webkit-inner-spin-button,
.player-score-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.save-row {
  display: flex;
  padding: 4px 6px;
  background: #0d0e14;
  border-top: 1px solid #1e1e1e;
}

.save-row .btn-save {
  width: 100%;
  padding: 5px 0;
  text-align: center;
}

.btn-save {
  background: #f9ad18;
  color: #000;
  border: none;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0;
}

.btn-save:hover {
  background: #e09b00;
}

.btn-save:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* Match ID label for scorekeepers */
.match-id-label {
  font-size: 0.6rem;
  color: #444;
  padding: 3px 10px;
  background: #0a0a0a;
  border-bottom: 1px solid #1e1e1e;
  letter-spacing: 0.08em;
}

/* Status overlay floating card */
#status-bar {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #111;
  border: 1px solid #333;
  padding: 6px 14px;
  font-size: 0.7rem;
  color: #aaa;
  letter-spacing: 0.05em;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#status-bar.ok   { border-color: #f9ad18; color: #f9ad18; }
#status-bar.err  { border-color: #c0392b; color: #c0392b; }

/* Seed list setup rows */
.seed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.seed-label {
  font-size: 0.75rem;
  color: #888;
  letter-spacing: 0.08em;
  min-width: 52px;
}

.team-input {
  background: #000;
  border: 1px solid #444;
  color: #fff;
  padding: 5px 8px;
  font-size: 0.85rem;
  width: 180px;
  border-radius: 0;
}

.team-input:focus {
  outline: 1px solid #f9ad18;
  border-color: #f9ad18;
}

.btn-remove {
  background: none;
  border: 1px solid #444;
  color: #666;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 0;
}

.btn-remove:hover {
  border-color: #c0392b;
  color: #c0392b;
}

.btn-secondary {
  background: none;
  border: 1px solid #f9ad18;
  color: #f9ad18;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0;
}

.btn-secondary:hover {
  background: #f9ad18;
  color: #000;
}

/* Completed and pending reset status style modifiers */
.match-box.completed {
  /* opacity: 0.45; temporarily disabled dimming per user request */
  border-color: #333;
}

.match-box.completed .match-id-label {
  color: #f9ad18;
}

/* FINAL & FINAL (OT) Badges */
.badge-final {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  background: #222;
  color: #bbb;
  border: 1px solid #444;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-final.ot {
  background: #f9ad18;
  color: #000;
  border-color: #f9ad18;
}

.match-box.reset-pending {
  border-color: #444;
  opacity: 0.5;
}

/* Ghost bye placeholder styling */
.player.bye-player {
  background: #0a0a0a;
}

.player.bye-name {
  color: #553a10;
  font-style: italic;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* Drag and Drop visual feedback */
.player[draggable="true"] {
  cursor: grab;
  user-select: none;
}

.player[draggable="true"]:active {
  cursor: grabbing;
}

.player.dragging {
  opacity: 0.35;
  outline: 2px dashed #f9ad18;
  background: rgba(249, 173, 24, 0.1);
}

.player.drag-over {
  outline: 2px solid #f9ad18;
  background: rgba(249, 173, 24, 0.25) !important;
  box-shadow: inset 0 0 10px rgba(249, 173, 24, 0.4);
}

/* Match Schedule Styling */
.schedule-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #0d0e14;
  border-bottom: 1px solid #1e1e1e;
  font-size: 0.7rem;
}

.schedule-row .schedule-icon {
  font-size: 0.75rem;
  opacity: 0.7;
}

.schedule-input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed #444;
  color: #f9ad18;
  font-size: 0.7rem;
  padding: 2px 4px;
  width: 100%;
  font-family: inherit;
}

.schedule-input:focus {
  outline: none;
  border-bottom-color: #f9ad18;
  background: #141620;
}

.match-schedule {
  font-size: 0.65rem;
  color: #f9ad18;
  padding: 3px 10px;
  background: #0b0c10;
  border-bottom: 1px solid #1a1b24;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.match-schedule.tbd-schedule {
  color: #555;
}

/* Tournament Champion Banner Styling */
.champion-banner {
  background: linear-gradient(135deg, #181406 0%, #362800 50%, #181406 100%);
  border: 2px solid #f9ad18;
  box-shadow: 0 0 25px rgba(249, 173, 24, 0.4);
  padding: 18px 24px;
  margin: 20px 24px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  animation: championGlow 2s infinite alternate;
}

@keyframes championGlow {
  from { box-shadow: 0 0 15px rgba(249, 173, 24, 0.3); }
  to   { box-shadow: 0 0 35px rgba(249, 173, 24, 0.7); }
}

.champion-icon {
  font-size: 3rem;
  line-height: 1;
}

.champion-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.champion-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ccc;
  margin-bottom: 2px;
}

.champion-name {
  font-size: 2.2rem;
  font-weight: 900;
  color: #f9ad18;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(249, 173, 24, 0.7);
}

/* Division Tab Navigation Bar */
.division-tabs-nav {
  display: flex;
  background: #0d0e14;
  border-bottom: 2px solid #1e2230;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0 16px;
  gap: 4px;
}

.division-tab {
  padding: 12px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.division-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.division-tab.active {
  color: #f9ad18;
  border-bottom-color: #f9ad18;
  background: rgba(249, 173, 24, 0.08);
}

/* Admin Login Overlay / Card */
.login-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 20px;
}

.login-card {
  background: #141722;
  border: 1px solid #282c3c;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  padding: 32px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.login-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 24px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  background: #0d0e14;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 12px;
  outline: none;
  box-sizing: border-box;
}

.login-input:focus {
  border-color: #f9ad18;
  box-shadow: 0 0 8px rgba(249, 173, 24, 0.4);
}

.login-error {
  color: #ff5555;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}






