/* ==========================================================================
   OSRS BINGO CORE DESIGN SYSTEM & STYLESHEET
   Curated harmonized HSL palettes, glassmorphism, gold trimmings, Cinzel typography.
   ========================================================================== */

/* Font & Color Token Variables */
:root {
  --color-bg-darkest: hsl(220, 15%, 7%);
  --color-bg-darker: hsl(220, 12%, 10%);
  --color-bg-panel: hsla(220, 10%, 13%, 0.85);
  --color-bg-card: hsla(220, 8%, 16%, 0.9);
  
  /* Harmonized OSRS Gold Theme Colors */
  --color-gold-muted: hsl(36, 40%, 40%);
  --color-gold-main: hsl(40, 60%, 55%);
  --color-gold-bright: hsl(42, 80%, 65%);
  --color-gold-glow: hsla(40, 70%, 55%, 0.25);
  
  /* Team specific colors */
  --color-team-blue: hsl(210, 80%, 50%);
  --color-team-blue-glow: hsla(210, 80%, 50%, 0.2);
  --color-team-red: hsl(0, 75%, 50%);
  --color-team-red-glow: hsla(0, 75%, 50%, 0.2);
  --color-team-green: hsl(120, 60%, 45%);
  --color-team-green-glow: hsla(120, 60%, 45%, 0.2);
  
  /* Status states */
  --color-text-main: hsl(210, 15%, 90%);
  --color-text-muted: hsl(210, 10%, 65%);
  --color-border: hsla(40, 40%, 55%, 0.15);
  --color-border-hover: hsla(40, 60%, 55%, 0.35);
  
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Inter', sans-serif;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
  --backdrop-blur: blur(8px);
}

/* Reset and Global Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg-darkest);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Vignette Overlay for Moody RPG atmosphere */
.bg-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 20%, rgba(0,0,0,0.9) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gold-muted);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-main);
}

/* Common Typography & Layout Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-text-main);
}

a {
  color: var(--color-gold-main);
  text-decoration: none;
  transition: var(--transition-smooth);
}
a:hover {
  color: var(--color-gold-bright);
}

.hidden {
  display: none !important;
}

/* Premium Card / Panel Styling */
.card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--backdrop-blur);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold-muted), transparent);
}

/* Premium Button System */
.btn {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.btn-gold {
  background: linear-gradient(135deg, hsl(38, 55%, 45%), hsl(40, 60%, 35%));
  color: #fff;
  border: 1px solid var(--color-gold-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, hsl(40, 65%, 52%), hsl(41, 70%, 42%));
  box-shadow: 0 4px 15px var(--color-gold-glow);
  transform: translateY(-1px);
}
.btn-gold:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-bg-darker);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--color-border-hover);
  color: var(--color-text-main);
}

.btn-red {
  background: linear-gradient(135deg, hsl(0, 65%, 42%), hsl(0, 70%, 32%));
  color: #fff;
  border: 1px solid hsl(0, 70%, 45%);
}
.btn-red:hover:not(:disabled) {
  background: linear-gradient(135deg, hsl(0, 75%, 50%), hsl(0, 80%, 40%));
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
}
.btn-full {
  width: 100%;
}
.btn-center {
  display: flex;
  margin: 0 auto;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms Framework */
.form-group {
  margin-bottom: 1rem;
  width: 100%;
}
.form-group label {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--color-gold-bright);
  margin-bottom: 0.4rem;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-gold-main);
  box-shadow: 0 0 8px var(--color-gold-glow);
}
.form-row-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* APP HEADER */
.app-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: var(--color-bg-panel);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  backdrop-filter: var(--backdrop-blur);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.logo-icon {
  color: var(--color-gold-main);
  font-size: 1.5rem;
  text-shadow: 0 0 10px var(--color-gold-glow);
}
.logo-text {
  font-family: 'Cinzel Decorative', var(--font-serif);
  font-size: 1.5rem;
  background: linear-gradient(to right, #fff 20%, var(--color-gold-main) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.app-nav {
  display: flex;
  gap: 0.5rem;
}
.nav-btn {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-btn:hover {
  color: var(--color-gold-main);
}
.nav-btn.active {
  color: var(--color-gold-bright);
  background: var(--color-bg-darker);
  border-color: var(--color-border);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

/* VIEW: COMMON CONTAINER */
.app-content {
  position: relative;
  z-index: 5;
  width: 90%;
  max-width: 1400px;
  margin: 2rem auto;
  min-height: calc(100vh - 180px);
}
.app-view {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}
.app-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* VIEW: WELCOME PORTAL */
#view-welcome.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 150px);
}
.welcome-card {
  max-width: 550px;
  text-align: center;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.welcome-logo {
  margin-bottom: 1.5rem;
}
.logo-icon-large {
  font-size: 3.5rem;
  color: var(--color-gold-main);
  text-shadow: 0 0 25px var(--color-gold-glow);
  margin-bottom: 0.8rem;
  animation: pulseGold 2s infinite ease-in-out;
}
.welcome-title {
  font-size: 2.2rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.welcome-tagline {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

@keyframes pulseGold {
  0% { transform: scale(1); text-shadow: 0 0 15px var(--color-gold-glow); }
  50% { transform: scale(1.05); text-shadow: 0 0 35px var(--color-gold-bright); }
  100% { transform: scale(1); text-shadow: 0 0 15px var(--color-gold-glow); }
}

/* EVENT BANNER */
.event-banner {
  padding: 1.2rem 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-title {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 0.2rem;
}
.event-description {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* TEAM SELECTOR CARD */
.team-selector-card {
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.selector-title {
  font-size: 1rem;
  color: var(--color-gold-bright);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}
.team-badges-grid {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.team-badge {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  opacity: 0.6;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 700;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}
.team-badge i {
  font-size: 1rem;
}
.team-badge:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-main);
  opacity: 1;
  transform: translateY(-1px);
}
.team-badge.active {
  opacity: 1;
}
.team-badge.active[data-team-id="team_blue"] {
  border-color: var(--color-team-blue);
  background: var(--color-team-blue-glow);
  box-shadow: 0 0 15px var(--color-team-blue-glow);
  color: #fff;
}
.team-badge.active[data-team-id="team_red"] {
  border-color: var(--color-team-red);
  background: var(--color-team-red-glow);
  box-shadow: 0 0 15px var(--color-team-red-glow);
  color: #fff;
}
.team-badge.active[data-team-id="team_green"] {
  border-color: var(--color-team-green);
  background: var(--color-team-green-glow);
  box-shadow: 0 0 15px var(--color-team-green-glow);
  color: #fff;
}
/* Generic active badges if user adds custom teams */
.team-badge.active:not([data-team-id="team_blue"]):not([data-team-id="team_red"]):not([data-team-id="team_green"]) {
  border-color: var(--color-gold-main);
  background: var(--color-gold-glow);
  box-shadow: 0 0 15px var(--color-gold-glow);
  color: #fff;
}

/* BINGO BOARD SCREEN SPLIT LAYOUT */
.board-main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

.board-progress-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.progress-card {
  text-align: center;
}
.score-display {
  margin: 1.5rem 0;
}
.score-num {
  font-size: 3rem;
  font-family: var(--font-serif);
  font-weight: 800;
  color: var(--color-gold-bright);
  line-height: 1;
  display: block;
  text-shadow: 0 0 15px var(--color-gold-glow);
}
.score-label {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.progress-bar-container {
  margin-bottom: 1.5rem;
}
.progress-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}
.progress-bar-track {
  height: 8px;
  background: var(--color-bg-darker);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold-muted), var(--color-gold-main));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--color-gold-glow);
}

.sidebar-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.2rem;
}
.sidebar-stat-box {
  background: var(--color-bg-darker);
  border-radius: 4px;
  padding: 0.6rem;
  border: 1px solid rgba(255,255,255,0.02);
}
.sidebar-stat-box .stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}
.sidebar-stat-box .stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.instructions-card {
  padding: 1.2rem;
}
.card-small-title {
  font-size: 0.9rem;
  color: var(--color-gold-bright);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.instructions-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* BINGO GRID SECTION */
.board-grid-container {
  display: flex;
  flex-direction: column;
}
.grid-header-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--color-gold-bright);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.8rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.board-visual-grid-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--color-bg-darker);
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.3);
}

/* GRID LAYOUTS IN CSS GRID */
.board-visual-grid {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  max-width: 600px;
}


/* Dynamic grid columns injection class helper */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid-cols-7 { grid-template-columns: repeat(7, 1fr); }
.grid-cols-8 { grid-template-columns: repeat(8, 1fr); }
.grid-cols-9 { grid-template-columns: repeat(9, 1fr); }
.grid-cols-10 { grid-template-columns: repeat(10, 1fr); }


/* BINGO TILE COMPONENT */
.bingo-tile {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  overflow: hidden;
  user-select: none;
}
.bingo-tile::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  pointer-events: none;
}

.tile-icon-container {
  width: 55%;
  height: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.tile-icon-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.tile-name-label {
  position: absolute;
  bottom: 0.35rem;
  left: 0.3rem;
  right: 0.3rem;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.tile-pts-badge {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--color-gold-muted);
  border-radius: 2px;
  padding: 1px 4px;
  font-size: 0.55rem;
  color: var(--color-gold-bright);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

/* Hover effects */
.bingo-tile:hover {
  transform: scale(1.04);
  border-color: var(--color-gold-main);
  box-shadow: 0 0 15px var(--color-gold-glow);
  z-index: 2;
}
.bingo-tile:hover .tile-icon-container {
  transform: scale(1.08);
}
.bingo-tile:hover .tile-name-label {
  color: var(--color-gold-bright);
}

/* COMPLETED BINGO TILE STATE STYLE */
.bingo-tile.completed {
  border-color: var(--color-team-green);
  background: radial-gradient(circle, rgba(120, 200, 120, 0.08) 0%, rgba(120, 200, 120, 0.02) 100%), var(--color-bg-card);
}
.bingo-tile.completed::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 48%, var(--color-team-green) 50%, transparent 52%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}
.bingo-tile.completed .tile-icon-container {
  opacity: 0.5;
  filter: grayscale(40%);
}
.bingo-tile.completed .tile-pts-badge {
  border-color: var(--color-team-green);
  color: var(--color-team-green);
}
.bingo-tile.completed::after {
  content: '✓';
  position: absolute;
  top: 0.35rem;
  left: 0.4rem;
  font-size: 1rem;
  font-weight: 900;
  color: var(--color-team-green);
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}

/* EMPTY BINGO TILE PLACEHOLDER */
.bingo-tile.empty-placeholder {
  background: rgba(0,0,0,0.15);
  border: 1px dashed rgba(255,255,255,0.06);
  cursor: default;
  box-shadow: none;
}
.bingo-tile.empty-placeholder:hover {
  transform: none;
  border-color: rgba(255,255,255,0.06);
  box-shadow: none;
}

/* VIEW: STANDINGS & LEADERBOARD */
.standings-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
}
.standings-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  font-size: 1.2rem;
  color: var(--color-gold-bright);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Score Leaderboard Bar Chart */
.leaderboard-chart-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.chart-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.chart-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-family: var(--font-serif);
  font-weight: 700;
}
.chart-bar-track {
  height: 22px;
  background: var(--color-bg-darker);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.03);
  position: relative;
}
.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.1, 0.8, 0.3, 1);
  box-shadow: 0 0 12px rgba(255,255,255,0.05);
}
.chart-bar-fill[data-team-id="team_blue"] {
  background: linear-gradient(90deg, hsl(210, 60%, 35%), var(--color-team-blue));
  box-shadow: 0 0 10px var(--color-team-blue-glow);
}
.chart-bar-fill[data-team-id="team_red"] {
  background: linear-gradient(90deg, hsl(0, 60%, 35%), var(--color-team-red));
  box-shadow: 0 0 10px var(--color-team-red-glow);
}
.chart-bar-fill[data-team-id="team_green"] {
  background: linear-gradient(90deg, hsl(120, 50%, 30%), var(--color-team-green));
  box-shadow: 0 0 10px var(--color-team-green-glow);
}
/* Generic dynamic teams chart fallback */
.chart-bar-fill:not([data-team-id="team_blue"]):not([data-team-id="team_red"]):not([data-team-id="team_green"]) {
  background: linear-gradient(90deg, var(--color-gold-muted), var(--color-gold-main));
  box-shadow: 0 0 10px var(--color-gold-glow);
}

/* Leaderboard Tables */
.leaderboard-table-container {
  overflow-x: auto;
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.leaderboard-table th {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--color-gold-bright);
  padding: 0.8rem;
  border-bottom: 2px solid var(--color-border);
}
.leaderboard-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.leaderboard-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}
.rank-badge.rank-1 {
  background: linear-gradient(135deg, #ffd700, #c5a059);
  border: 1px solid #ffe875;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
  color: #000;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.rank-badge.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #7a7a7a);
  border: 1px solid #dcdcdc;
  color: #000;
}
.rank-badge.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #8c5d3b);
  border: 1px solid #e5a975;
}
.rank-badge.rank-other {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* Real-time History completion logs */
.completion-logs-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.log-row {
  background: var(--color-bg-darker);
  border-left: 3px solid var(--color-gold-muted);
  border-radius: 0 4px 4px 0;
  padding: 0.8rem 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.log-row[data-team-id="team_blue"] { border-left-color: var(--color-team-blue); }
.log-row[data-team-id="team_red"] { border-left-color: var(--color-team-red); }
.log-row[data-team-id="team_green"] { border-left-color: var(--color-team-green); }

.log-item-thumb {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.log-item-thumb img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}
.log-text-content {
  flex-grow: 1;
}
.log-header-info {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.1rem;
}
.log-header-info strong {
  color: var(--color-text-main);
}
.log-desc-msg {
  font-size: 0.85rem;
  color: var(--color-gold-bright);
  font-weight: 500;
}
.log-time-stamp {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.2rem;
}

/* Empty log placeholder */
.no-logs-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem 1rem;
}
.no-logs-state i {
  font-size: 2.2rem;
  color: var(--color-border);
  margin-bottom: 0.8rem;
}

/* VIEW: PRIVATE ADMIN SUITE */
.admin-auth-card {
  max-width: 480px;
  margin: 3rem auto;
  text-align: center;
  padding: 2.5rem 2rem;
}
.auth-icon {
  font-size: 2.5rem;
  color: var(--color-gold-main);
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--color-gold-glow);
}
.admin-auth-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.admin-auth-card p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.auth-input-wrapper {
  display: flex;
  gap: 0.5rem;
}
.auth-input-wrapper input {
  flex-grow: 1;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
}
.auth-error-msg {
  display: block;
  color: var(--color-team-red);
  font-size: 0.8rem;
  margin-top: 0.8rem;
}

/* MAIN ADMIN DASHBOARD */
.admin-dashboard-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease forwards;
}

.admin-sidebar {
  padding: 1rem;
  height: fit-content;
}
.admin-info-badge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.admin-badge-icon {
  font-size: 1.8rem;
  color: var(--color-gold-main);
}
.badge-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.badge-status {
  font-size: 0.7rem;
  color: var(--color-team-green);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.admin-nav-btn {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: left;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-nav-btn:hover {
  color: var(--color-gold-main);
  background: rgba(255,255,255,0.02);
}
.admin-nav-btn.active {
  color: var(--color-gold-bright);
  background: var(--color-bg-darker);
  border-color: var(--color-border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}
.admin-nav-btn.danger {
  color: hsl(0, 60%, 65%);
  margin-top: 1rem;
}
.admin-nav-btn.danger:hover {
  background: rgba(255, 0, 0, 0.05);
}

.admin-tab-content-wrapper {
  min-width: 0; /* Prevents overflow */
}
.admin-tab-content {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}
.admin-tab-content.active {
  display: block;
}

.tab-header-card {
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}
.tab-header-card.space-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tab-header-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}
.tab-header-card p {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.admin-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.settings-column {
  height: fit-content;
}
.settings-section-title {
  font-size: 1rem;
  color: var(--color-gold-bright);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.section-hint-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Event Teams Inline management */
.add-team-inline-form {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.add-team-inline-form input {
  flex-grow: 1;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
}
.admin-teams-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}
.admin-team-row {
  background: var(--color-bg-darker);
  border: 1px solid rgba(255,255,255,0.02);
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.team-name-label {
  font-size: 0.85rem;
  font-weight: 600;
}
.admin-team-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-team-actions select {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 2px;
}
.btn-delete-team {
  background: transparent;
  color: hsl(0, 60%, 65%);
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.btn-delete-team:hover {
  color: var(--color-team-red);
}

.settings-column.full-width {
  grid-column: 1 / -1;
}
.danger-card {
  border-color: rgba(255, 0, 0, 0.15);
}
.danger-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,0,0,0.3), transparent);
}
.danger-row-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.danger-text strong {
  font-family: var(--font-serif);
  color: hsl(0, 60%, 65%);
  font-size: 0.95rem;
}
.danger-text p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* TAB: MANAGE TILES - CARDS GRID */
.tiles-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.tile-admin-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}
.tile-admin-card:hover {
  border-color: var(--color-border-hover);
}
.tile-admin-header {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.tile-admin-thumb {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-admin-thumb img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}
.tile-admin-meta h4 {
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
}
.tile-admin-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
  flex-grow: 1;
}
.tile-admin-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.03);
  padding-top: 0.6rem;
}
.tile-admin-pts {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-gold-bright);
}
.tile-admin-actions {
  display: flex;
  gap: 0.4rem;
}
.btn-icon {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.8rem;
}
.btn-icon:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-main);
}
.btn-icon.edit-btn:hover {
  color: var(--color-gold-bright);
}
.btn-icon.delete-btn:hover {
  color: var(--color-team-red);
}

/* TAB: MANAGE BOARDS VISUAL EDITOR */
.boards-split-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}
.boards-profiles-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: fit-content;
}
.board-profile-row {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}
.board-profile-row:hover {
  border-color: var(--color-border-hover);
}
.board-profile-row.active {
  border-color: var(--color-gold-main);
  background: var(--color-gold-glow);
}
.board-profile-row h4 {
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}
.board-profile-row p {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}
.board-profile-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.03);
  padding-top: 0.4rem;
}

.board-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  animation: fadeIn 0.3s ease forwards;
}
.editor-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.8rem;
}
.editor-board-title {
  font-size: 1.1rem;
  color: var(--color-gold-bright);
}
.editor-header-actions {
  display: flex;
  gap: 0.4rem;
}
.editor-metadata-form {
  background: var(--color-bg-darker);
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.02);
}

.editor-visual-canvas {
  background: var(--color-bg-darker);
  border-radius: 4px;
  padding: 1.2rem;
  border: 1px solid rgba(0,0,0,0.3);
  text-align: center;
}
.canvas-title {
  font-size: 0.95rem;
  color: var(--color-text-main);
  margin-bottom: 0.2rem;
}
.canvas-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.editor-grid-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}
.editor-grid {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  max-width: 480px;
}


/* EDITOR TILE CONTAINER (For grid design placement) */
.editor-tile-container {
  background: var(--color-bg-card);
  border: 1px dashed rgba(212, 163, 115, 0.2);
  border-radius: 4px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}
.editor-tile-container:hover {
  border-color: var(--color-gold-main);
  background: rgba(255,255,255,0.02);
}
.editor-tile-plus-icon {
  font-size: 1.4rem;
  color: var(--color-gold-muted);
}
.editor-tile-container.populated {
  border-style: solid;
  border-color: var(--color-border);
}
.editor-tile-container.populated img {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
}
.editor-tile-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.editor-tile-remove-btn:hover {
  color: var(--color-team-red);
  background: #000;
}
.editor-tile-container.populated:hover .editor-tile-remove-btn {
  display: flex;
}

/* TAB: PROGRESS TRACKER SPREADSHEET */
.tracker-matrix-card {
  padding: 1.2rem;
}
.tracker-filters {
  display: flex;
  margin-bottom: 1.2rem;
}
.tracker-filters .form-group {
  width: 250px;
  margin-bottom: 0;
}
.tracker-table-wrapper {
  overflow-x: auto;
}
.tracker-matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.tracker-matrix-table th {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--color-gold-bright);
  padding: 0.8rem;
  border-bottom: 2px solid var(--color-border);
}
.tracker-matrix-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  vertical-align: middle;
}
.tracker-matrix-table tbody tr:hover {
  background: rgba(255,255,255,0.01);
}
.tracker-checkbox-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}
.tracker-checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-team-green);
}
.tracker-row-thumb {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.tracker-row-thumb-icon {
  width: 28px;
  height: 28px;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tracker-row-thumb-icon img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}
.tracker-row-thumb-name {
  font-weight: 600;
}
.tracker-status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}
.tracker-status-tag.completed {
  background: rgba(120, 200, 120, 0.1);
  color: var(--color-team-green);
  border: 1px solid rgba(120, 200, 120, 0.2);
}
.tracker-status-tag.pending {
  background: rgba(255,255,255,0.03);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.tracker-notes-inline-form {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}
.tracker-notes-inline-form input {
  flex-grow: 1;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* MODAL SYSTEM AND BLOCKS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-gold-muted);
  box-shadow: var(--glass-shadow);
  border-radius: 6px;
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  animation: modalSlideUp 0.3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.modal-close-btn:hover {
  color: var(--color-team-red);
}

/* SPECIFIC MODAL LAYOUTS */
/* Tile details modal */
.tile-inspector-summary {
  display: flex;
  gap: 1.2rem;
  background: var(--color-bg-darker);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.2rem;
  align-items: center;
}
.tile-inspector-icon-frame {
  width: 58px;
  height: 58px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-inspector-icon-frame img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}
.tile-points-tag {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gold-bright);
}
.tile-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.2rem;
}
.tile-status-badge.completed {
  background: rgba(120, 200, 120, 0.1);
  color: var(--color-team-green);
  border: 1px solid rgba(120, 200, 120, 0.2);
}
.tile-status-badge.pending {
  background: rgba(255,255,255,0.03);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.inspector-section {
  margin-bottom: 1.2rem;
}
.inspector-section label {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--color-gold-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}
.inspector-description {
  background: var(--color-bg-darker);
  padding: 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid rgba(255,255,255,0.01);
}

.inspector-items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--color-bg-darker);
  padding: 0.8rem;
  border-radius: 4px;
}
.item-thumb-badge {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  padding: 0.4rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
}
.item-thumb-badge img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.inspector-log-card {
  background: rgba(120, 200, 120, 0.05);
  border: 1px solid rgba(120, 200, 120, 0.15);
  border-radius: 4px;
  padding: 0.8rem;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}
.log-success-icon {
  color: var(--color-team-green);
  font-size: 1.1rem;
  margin-top: 0.1rem;
}
.log-note {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
}
.log-date {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.2rem;
}

/* Tile Builder Form specific rules */
.tile-builder-card {
  max-width: 650px;
}
.icon-selector-preview-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
}
.tile-icon-preview-box {
  width: 48px;
  height: 48px;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-icon-preview-box img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}
.tile-icon-preview-box .default-placeholder {
  font-size: 1.2rem;
  color: var(--color-border);
}

.builder-items-list {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 180px;
  overflow-y: auto;
}
.builder-item-row {
  background: var(--color-bg-panel);
  border: 1px solid rgba(255,255,255,0.02);
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.builder-item-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
}
.builder-item-meta img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.btn-remove-builder-item {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-remove-builder-item:hover {
  color: var(--color-team-red);
}

.builder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.2rem;
}

/* OSRS wiki Search popup */
.item-search-card {
  max-width: 480px;
}
.search-input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}
.search-spinner-icon {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--color-gold-muted);
  font-size: 1rem;
}
.search-spinner-icon.spinning {
  animation: spin 1s infinite linear;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.search-results-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--color-bg-darker);
  border-radius: 4px;
  padding: 0.4rem;
}
.search-result-row {
  background: var(--color-bg-panel);
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.search-result-row:hover {
  border-color: var(--color-gold-main);
  background: rgba(255,255,255,0.02);
}
.search-result-thumb {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-result-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.search-result-name {
  font-size: 0.85rem;
  font-weight: 500;
}
.search-placeholder-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem 1rem;
}
.search-decor-icon {
  font-size: 1.8rem;
  color: var(--color-border);
  margin-bottom: 0.5rem;
}

/* Place Tile Picker Modal */
.place-tile-picker-card {
  max-width: 480px;
}
.place-tile-search-wrapper {
  margin-bottom: 1rem;
}
.place-tile-search-wrapper input {
  width: 100%;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
}
.place-tile-picker-list {
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.place-tile-picker-row {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.place-tile-picker-row:hover {
  border-color: var(--color-gold-main);
  background: var(--color-gold-glow);
}
.place-tile-picker-thumb {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.place-tile-picker-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.place-tile-picker-meta h5 {
  font-size: 0.75rem;
  line-height: 1.2;
}
.place-tile-picker-meta span {
  font-size: 0.6rem;
  color: var(--color-gold-bright);
  font-weight: 700;
}

/* TOAST SYSTEM (SLIDE OUT IN RIGHT-BOTTOM) */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
}
.toast {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  box-shadow: var(--glass-shadow);
  border-radius: 4px;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 280px;
  max-width: 380px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--color-team-green); }
.toast.error { border-left: 3px solid var(--color-team-red); }
.toast.info { border-left: 3px solid var(--color-gold-main); }

.toast-icon {
  font-size: 1.2rem;
}
.toast-icon.success { color: var(--color-team-green); }
.toast-icon.error { color: var(--color-team-red); }
.toast-icon.info { color: var(--color-gold-bright); }

.toast-message {
  font-size: 0.85rem;
  color: #fff;
  font-weight: 500;
}

/* RESPONSIVE DESIGN MEDIA QUERY SCREEN CAPACITIES */
@media screen and (max-width: 1024px) {
  .board-main-layout {
    grid-template-columns: 1fr;
  }
  .standings-layout {
    grid-template-columns: 1fr;
  }
  .admin-dashboard-container {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    height: auto;
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

}

@media screen and (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .admin-settings-grid {
    grid-template-columns: 1fr;
  }
  .boards-split-container {
    grid-template-columns: 1fr;
  }
  .editor-grid {
    max-width: 100%;
  }
}

/* ==========================================================================
   TEAM LOCK STATUS & UPLOADS PIPELINE STYLES
   ========================================================================== */

.team-sidebar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  width: 100%;
}

#team-auth-status-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-auth-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.team-auth-badge.locked {
  background: rgba(239, 83, 80, 0.1);
  color: var(--color-team-red);
  border: 1px solid rgba(239, 83, 80, 0.2);
}

.team-auth-badge.unlocked {
  background: rgba(102, 187, 106, 0.1);
  color: var(--color-team-green);
  border: 1px solid rgba(102, 187, 106, 0.2);
}

.btn-team-lock-action {
  background: transparent;
  color: var(--color-gold-main);
  border: 1px solid var(--color-gold-muted);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-team-lock-action:hover {
  background: var(--color-gold-main);
  color: #000;
  border-color: var(--color-gold-bright);
}

/* Dynamic proof slots grid */
.inspector-proofs-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.proof-slot-card {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.proof-slot-card:hover {
  border-color: var(--color-border-hover);
}

.proof-slot-card.populated {
  aspect-ratio: auto !important;
  height: auto !important;
  padding: 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
  align-items: stretch;
}

.btn-admin-undo {
  background: #3e3e3e !important;
  color: #ffffff !important;
  border: 1px solid #5a5a5a !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
  transition: var(--transition-smooth);
}

.btn-admin-undo:hover {
  background: #505050 !important;
  border-color: #707070 !important;
  color: #ffffff !important;
}

.proof-slot-card.empty-dashed {
  border: 2px dashed rgba(212, 163, 115, 0.2);
}

.proof-slot-card.empty-dashed:hover {
  border-color: var(--color-gold-main);
  background: rgba(255,255,255,0.01);
}

.proof-slot-card.locked {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--color-bg-darker);
}

.proof-slot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.proof-slot-card:hover img {
  transform: scale(1.05);
}

.proof-slot-slot-num {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.7);
  color: var(--color-text-muted);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  z-index: 2;
}

.proof-slot-card.locked .proof-slot-slot-num {
  color: rgba(255,255,255,0.3);
}

.proof-slot-status-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  z-index: 2;
}

.proof-slot-status-label.pending { background: rgba(212, 163, 115, 0.9); }
.proof-slot-status-label.approved { background: rgba(76, 175, 80, 0.9); }
.proof-slot-status-label.rejected { background: rgba(244, 67, 54, 0.9); }

.proof-slot-withdraw-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: rgba(244, 67, 54, 0.85);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  border: none;
  cursor: pointer;
  z-index: 3;
  transition: var(--transition-smooth);
}

.proof-slot-withdraw-btn:hover {
  background: rgb(244, 67, 54);
  transform: scale(1.1);
}

/* Paste to upload zone styles */
.paste-zone:hover {
  border-color: var(--color-gold-main) !important;
  background: rgba(212, 163, 115, 0.02) !important;
}

.paste-zone.drag-active {
  border-color: var(--color-gold-bright) !important;
  background: rgba(212, 163, 115, 0.05) !important;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Glowing red badge for review queue sidebar tab */
.reviews-count-badge {
  background: var(--color-team-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  position: absolute;
  right: 12px;
  box-shadow: 0 0 8px rgba(239, 83, 80, 0.5);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 83, 80, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 83, 80, 0); }
}

/* Reviews List Container Layout */
.review-queue-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.review-group-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.2rem;
}

.review-group-card.has-pending {
  border-color: var(--color-gold-muted);
  box-shadow: 0 0 10px rgba(212, 163, 115, 0.05);
}

.review-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.review-group-title-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.review-group-team-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-gold-bright);
}

.review-group-tile-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.review-slots-row {
  display: flex;
  flex-wrap: wrap !important;
  gap: 1.2rem;
  padding-bottom: 0.5rem;
  overflow-x: visible !important;
}

.admin-review-slot-card {
  width: 110px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-review-img-wrapper {
  width: 100px;
  height: 75px;
  border-radius: 4px;
  background: #000;
  border: 2px solid var(--color-border);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.admin-review-img-wrapper.pending { border-color: rgba(212, 163, 115, 0.7); }
.admin-review-img-wrapper.approved { border-color: var(--color-team-green); }
.admin-review-img-wrapper.rejected { border-color: var(--color-team-red); }

.admin-review-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-review-slot-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
}

.admin-slot-reject-btn {
  background: var(--color-team-red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}

.admin-slot-reject-btn:hover {
  background: hsl(0, 75%, 45%);
}

.admin-slot-status-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.admin-slot-status-label.approved { color: var(--color-team-green); }
.admin-slot-status-label.rejected { color: var(--color-team-red); }

/* Grid dot completion trackers (Subtle completion indicator directly inside main grid cells) */
.tile-completions-dots {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  justify-content: center;
}

.tile-completion-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.tile-completion-dot.pending { background: #d4a373; }
.tile-completion-dot.approved { background: #4caf50; }
.tile-completion-dot.rejected { background: #f44336; }

/* Global Team Icon Picker Grid Styles */
.grid-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: var(--transition-smooth);
}
.grid-icon-btn:hover {
  background: var(--color-gold-glow);
  border-color: var(--color-gold-main);
  transform: scale(1.15);
}
.grid-icon-btn.selected {
  background: rgba(76, 175, 80, 0.15) !important;
  border-color: var(--color-team-green) !important;
}
.icon-picker-popover {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ==========================================================================
   TEAM ROSTER / PARTICIPANTS STYLES
   ========================================================================== */
.teams-participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.team-participants-card {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.2rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.team-participants-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
  font-family: 'Cinzel', serif;
  color: var(--color-gold-bright);
  font-size: 1rem;
  font-weight: 700;
}

.team-participants-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.team-participant-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--color-text);
  padding: 0.2rem 0;
}

.team-participant-item.captain {
  color: var(--color-gold-bright) !important;
  font-weight: 700 !important;
}

.player-roster-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-bg-dark);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.player-roster-name-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text);
  outline: none;
  font-size: 0.85rem;
  padding: 0.2rem;
}

.player-roster-name-input:focus {
  border-bottom: 1px solid var(--color-gold-muted);
}

