* {
  box-sizing:border-box
}
:root {
  --bg:#0b0b0f;--card:#11131a;--muted:#d1d5db;--brand:#22c55e;--brand2:#60a5fa;--danger: #ef4444;
}
html,body{height:100%}
.viewer-body{
  margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial;
  background:var(--bg); color:white; align-items:center; justify-content:center;
}

.admin-body{
  margin:0; 
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial;
  background:var(--bg); 
  color:white; 
  display:flex; 
  flex-direction: column;
  align-items:center; 
  justify-content:center;
  overflow-y: auto;
  height:auto;
  overflow-x: hidden;
}

.admin-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.viewer-page .container {
  width:100%; 
  max-width: 100%;
  margin:0 0 100px 0; 
  padding:clamp(10px, 3vw, 40px);
}

.admin-page .container {
  width:min(1200px,95vw); 
  margin:5px 20px 50px 20px; 
  padding:5px; 
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1;
}

.grid {display:grid; gap:16px}
.card {
  margin: 5px; 
  border-radius:20px; 
  padding:15px; 
  box-sizing: border-box; /* Crucial: includes padding in width calculation */
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.card1 { 
  padding: 5px;
}

.viewer-page .score-wrap {
  display:grid; 
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(20px, 5vw, 120px);
  align-items: stretch;
  margin-top: 60px;
}

.admin-page .score-wrap{display:grid; grid-template-columns:1fr 1fr; gap:100px; margin-top: 50px;}

.viewer-page .team {
  display:flex; 
  flex-direction:column; 
  align-items:center; 
  justify-content:center;
  min-height: clamp(180px, 30vh, 420px);
  
  padding:10px; 
  border-radius:16px; 
  background: rgba(0,0,0,0.5);
}
.admin-page .team{display:flex; flex-direction:column; align-items:center; justify-content:center; padding:10px; border-radius:16px; background: rgba(0,0,0,0.5);}

.viewer-page .team-a{border:5px solid var(--brand)}
.viewer-page .team-b{border:5px solid var(--brand2)}

.admin-page .team-a{border:5px solid var(--brand)}
.admin-page .team-b{border:5px solid var(--brand2)}


.viewer-page .team-name {
  font-size:clamp(40px,7.5vw,80px); 
  font-weight:900;
  text-align:center; 
  margin:0 0 8px;
  padding: clamp(10px, 2vw, 24px); 
  text-transform: uppercase;
  max-width: 100%;
}
.admin-page .team-name{font-size:clamp(20px,4vw,36px); font-weight:700; text-align:center; margin:0 0 8px; padding: 8px; text-transform: uppercase;}

.viewer-page .score {
  font-size:clamp(4rem,12vw,9rem);
  font-weight:800;
  line-height:1;
}

.admin-page .score{font-size:clamp(60px,14vw,160px); font-weight:800; line-height:1; letter-spacing:2px}

.meta{display:flex; gap:12px; justify-content:center; align-items:center; opacity:.9}
.badge{padding:8px 15px; border-radius:50px; background:#1f2937; font-size:20px}
.serving{filter:drop-shadow(0 0 10px rgba(255,255,255,.45));}
.row {
  display:flex; 
  gap:8px; 
  flex-wrap:wrap; 
  align-items:center; 
  justify-content: center;
}

button,input,select{font-size:20px}
button{padding:10px 40px; margin: 10px; border-radius:12px; border:1px solid #374151; background:#111827; color:white; cursor:pointer}
button:active{transform:scale(.98)}
button.primary{background:#16a34a; border-color:#166534}
button.warn{background:#991b1b; border-color:#7f1d1d}
input,select{padding:15px 12px; margin: 10px; border-radius:10px; border:1px solid #374151; background:#0b1220; color:white}
.sep{height:1px; background:#1f2937; margin:12px 0}
.footer{opacity:.7; font-size:14px; text-align:center; margin-top:8px}

/*.fullscreen{position:fixed; top:16px; right:16px}*/


/* Fullscreen button */
#fsBtn {
  position: absolute;
  top: -20px;
  right: 1vw;
  padding: 0.6vw 1.2vw;
  font-size: clamp(14px, 1.8vw, 28px);
  border-radius: 0.8vw;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.35);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: 0.25s ease;
  opacity: 0.25;
}
#fsBtn:hover,
#fsBtn:focus {
  opacity: 0.9;
  color: white;
  background: rgba(40,40,40,0.4);
  border-color: rgba(255,255,255,0.4);
}

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}

#headerBar,
#adminHeader {
  text-align: center;
  border-radius: 10px;
  margin: 5px;
  padding: 15px 0px;

}

#eventTitle {
  font-weight: 900;
  text-transform: uppercase;
  margin: 0;
  white-space: pre-line;
}

#adminHeader h1 {
  margin: 5px;
}

.status-label {
  padding: 8px 15px;
  border-radius: 6px;
}

.status-locked { background: var(--danger); }
.status-unlocked { background: var(--brand); color: black; }

.viewer-page,
.admin-page {
  position: relative;   /* REQUIRED */
  z-index: 1;
}

.mode-btn { 
  padding: 10px 20px; 
  border: 1px solid #ddd; 
  border-radius: 5px; 
  cursor: pointer; 
  font-weight: bold; 
  transition: 0.3s; 
}

.mode-btn.active { 
  background: #1e40af; 
  color: white; 
  border-color: #1e40af; 
}

.admin-controls-card { 
  padding: 5px; 
  border-radius: 12px; 
  box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
  margin-top: 5px; 
}

.set-display-mini {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px; /* Pulls it closer to the main score */
    padding: 10px;
    color: #facc15; /* Professional yellow contrast */
    font-weight: bold;
    font-size: 3.0rem;
  }
  
#setIndicator {
  display: inline-block;
  padding: 8px 24px;       /* Horizontal breathing room */
  margin: 20px 0;          /* Space above and below the badge */
  background: #1e40af;     /* Professional blue */
  color: white;
  border-radius: 50px;     /* Pill shape */
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 2.1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  text-align: center;
}