:root{--bg:#10151b;--surface:#1b232c;--surface2:#222d37;--border:#34404c;--text:#f4f1e9;--muted:#96a0aa;--gold:#f2aa3d;--purple:#8e5cc7;--teal:#46b8a9;--green:#5fc98a;--red:#e06c75;--font:'Inter',system-ui,sans-serif;--display:'Unbounded',system-ui,sans-serif}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 50% -20%,#29323c 0,#10151b 46%);color:var(--text);font-family:var(--font);min-height:100vh}.page-shell,.game-page{max-width:1180px;margin:auto;padding:0 24px 70px}.topbar{height:86px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;border-bottom:1px solid var(--border)}.back-link{color:var(--muted);text-decoration:none;font-weight:600}.brand{text-decoration:none;font-family:var(--display);font-size:23px;letter-spacing:-1px}.brand span{color:white}.brand strong{color:var(--gold);margin-left:5px}.brand.compact{font-size:19px}.auth-slot{justify-self:end}.btn-signin,.user-chip button{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px;padding:8px 11px;cursor:pointer}.user-chip{display:flex;align-items:center;gap:8px;font-size:13px}.user-chip[hidden]{display:none}.user-chip span{color:var(--muted)}
.landing-main{max-width:940px;margin:auto}.hero{text-align:center;padding:74px 20px 48px}.hero-kicker{font-size:12px;font-weight:800;letter-spacing:.17em;color:var(--teal);margin-bottom:18px}.hero h1{font-family:var(--display);font-size:clamp(36px,6vw,65px);line-height:1.05;margin:0}.hero h1 span{color:var(--gold)}.hero p{max-width:660px;margin:22px auto 0;color:var(--muted);font-size:17px;line-height:1.7}.fixture-card{background:linear-gradient(145deg,#202a34,#171e26);border:1px solid var(--border);border-radius:18px;padding:28px;box-shadow:0 24px 60px rgba(0,0,0,.25)}.fixture-top,.fixture-footer,.matchup{display:flex;align-items:center;justify-content:space-between;gap:20px}.fixture-label,.team-label{font-size:10px;letter-spacing:.13em;font-weight:800;color:var(--teal)}.fixture-top h2{margin:5px 0 0;font-size:22px}.sport-badge{background:#293541;border-radius:999px;padding:9px 13px;font-weight:700}.matchup{margin:30px 0;padding:28px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}.matchup>div{flex:1}.matchup strong{display:block;font-size:clamp(22px,4vw,35px);margin-top:5px}.matchup .away{text-align:right}.versus{flex:0!important;text-align:center!important;color:var(--gold);font-family:var(--display);font-size:16px}.fixture-footer>div span{display:block;color:var(--muted);font-size:11px}.fixture-footer>div strong{display:block;margin-top:4px}.play-btn{margin-left:auto;background:var(--gold);border:0;border-radius:9px;padding:13px 18px;font-weight:800;color:#17130c;cursor:pointer;font-size:14px}.how-it-works{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:22px}.how-it-works>div{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:18px}.how-it-works b{color:var(--gold);font-size:11px}.how-it-works strong,.how-it-works span{display:block}.how-it-works strong{margin:7px 0 4px}.how-it-works span{color:var(--muted);font-size:13px;line-height:1.5}
.game-main{max-width:1180px;margin:32px auto}.game-summary{display:flex;justify-content:space-between;align-items:center;gap:30px;margin-bottom:20px}.live-pill{display:inline-block;color:var(--teal);font-size:10px;font-weight:800;letter-spacing:.15em;margin-bottom:7px}.game-info h1{margin:0;font-size:clamp(22px,4vw,34px)}.game-info p{margin:7px 0 0;color:var(--muted);font-size:16px}.score-panel{display:flex;background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow:hidden}.score-panel>div{min-width:105px;padding:13px 16px;border-left:1px solid var(--border);text-align:center}.score-panel>div:first-child{border-left:0}.score-panel span,.score-panel small{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.score-panel strong{font-size:24px}.score-panel small{display:inline}.legend{display:flex;align-items:center;gap:20px;padding:14px 16px;background:#151c23;border:1px solid var(--border);border-radius:10px;margin-bottom:16px;font-size:15px;color:var(--muted)}.legend span{display:flex;align-items:center;gap:6px}.legend i{width:10px;height:10px;border-radius:3px}.legend-player{background:var(--purple)}.legend-team{background:var(--teal)}.legend-free{background:var(--gold)}.legend-note{margin-left:auto}.status-message{text-align:center;padding:70px;color:var(--muted)}.status-message button{margin-left:8px;background:var(--gold);border:0;border-radius:6px;padding:7px 10px;font-weight:700}.board-section{max-width:1120px;margin:auto}.bingo-headings,.bingo-board{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.bingo-headings{margin-bottom:8px}.bingo-headings span{text-align:center;font-family:var(--display);font-size:clamp(24px,4vw,40px);color:var(--gold)}.bingo-tile{position:relative;aspect-ratio:1/1;min-width:0;overflow:hidden;border:1px solid #414a52;border-radius:11px;padding:0;font-family:var(--font);display:grid;grid-template-rows:25% 50% 25%;align-items:stretch;text-align:center;cursor:pointer;transition:transform .15s,border-color .15s,filter .15s}
.bingo-tile:hover:not(:disabled){transform:translateY(-2px);border-color:#78838d}
.tile-player{background:#07090b;color:#fff}
.tile-team{background:#f26522;color:#fff;border-color:#ff7a3b}
.tile-identity,.tile-event,.tile-points{position:relative;z-index:2;min-width:0;display:flex;align-items:center;justify-content:center;padding-left:8px;padding-right:8px}
.tile-identity{align-items:flex-start;padding-top:9px;font-size:clamp(16px,1.75vw,23px);line-height:1.02;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile-event{font-size:clamp(15px,1.55vw,21px);line-height:1.08;font-weight:800;text-wrap:balance;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;align-content:center}
.tile-points{gap:6px;border-top:1px solid rgba(255,255,255,.18);line-height:1}
.tile-points strong{font-size:clamp(25px,2.65vw,36px);font-weight:950;letter-spacing:-.03em}
.tile-points span{padding-top:5px;font-size:clamp(11px,1vw,15px);font-weight:900;letter-spacing:.04em}
.tile-free{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:linear-gradient(145deg,#ffc653,#e99923);color:#111;border-color:#ffd476}
.free-star{font-size:clamp(16px,1.8vw,24px);line-height:1}.free-text{font-family:var(--display);font-size:clamp(26px,3vw,42px);line-height:1;font-weight:950}
.bingo-tile.completed:not(.tile-free){background:#dedede;color:#333;border-color:#bcbcbc;filter:none;box-shadow:none}
.bingo-tile.completed:not(.tile-free) .tile-points{border-top-color:rgba(45,45,45,.24)}
.bingo-tile.completed:not(.tile-free)::after{content:"";position:absolute;inset:0;z-index:1;background:rgba(255,255,255,.10);border-radius:10px}
.completed-x{position:absolute;inset:0;z-index:4;pointer-events:none}
.completed-x::before,.completed-x::after{content:"";position:absolute;left:8%;top:50%;width:84%;height:4px;border-radius:4px;background:rgba(85,85,85,.45);transform-origin:center}
.completed-x::before{transform:rotate(24deg)}.completed-x::after{transform:rotate(-24deg)}
.pending{opacity:.55}.game-toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);opacity:0;background:#eaf9f0;color:#173522;padding:12px 18px;border-radius:999px;font-weight:800;box-shadow:0 10px 35px rgba(0,0,0,.35);transition:.2s;z-index:50}.game-toast.error{background:#ffe8e8;color:#5b2020}.game-toast.show{transform:translate(-50%,0);opacity:1}
@media(max-width:760px){.page-shell,.game-page{padding-left:12px;padding-right:12px}.topbar{height:68px;grid-template-columns:auto 1fr auto}.brand{justify-self:center;font-size:17px}.user-chip #btnEditTag,.user-chip #btnSignOut{display:none}.hero{padding:46px 8px 32px}.fixture-card{padding:18px}.fixture-top{align-items:flex-start}.matchup{gap:8px}.matchup strong{font-size:19px}.fixture-footer{display:grid;grid-template-columns:1fr 1fr}.play-btn{grid-column:1/-1;width:100%;margin:8px 0 0}.how-it-works{grid-template-columns:1fr}.game-summary{display:block}.score-panel{margin-top:16px;width:100%}.score-panel>div{flex:1;min-width:0;padding:10px 5px}.score-panel strong{font-size:19px}.legend{gap:10px;flex-wrap:wrap}.legend-note{width:100%;margin-left:0!important}.bingo-headings,.bingo-board{gap:4px}.bingo-tile{border-radius:7px}.tile-identity{padding-top:5px;padding-left:3px;padding-right:3px;font-size:clamp(10px,3vw,14px)}.tile-event{padding-left:3px;padding-right:3px;font-size:clamp(9px,2.65vw,13px);line-height:1.05}.tile-points{gap:3px;padding-left:2px;padding-right:2px}.tile-points strong{font-size:clamp(16px,4.6vw,24px)}.tile-points span{font-size:clamp(7px,2vw,10px);padding-top:2px}.completed-x::before,.completed-x::after{height:3px}}


/* ============================================================
   SHARED AUTH MODAL
   auth-modal.js injects the dialog markup into <body>.
   These styles keep it as a centered overlay instead of
   normal page content.
   ============================================================ */

.auth-backdrop[hidden] {
  display: none !important;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 9, 13, 0.76);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.auth-modal {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 34px 30px 30px;
  background: #1b232c;
  border: 1px solid #44515e;
  border-radius: 16px;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.auth-modal h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-family: var(--font);
  font-size: 25px;
  font-weight: 800;
}

.auth-modal p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.auth-close:hover {
  border-color: var(--border);
  background: var(--surface2);
  color: var(--text);
}

.auth-social-btn {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7f7f7;
  color: #202124;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.auth-social-btn:hover {
  filter: brightness(0.96);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.auth-divider hr {
  flex: 1;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.auth-divider span {
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 17px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #141b22;
}

.auth-tab {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.auth-input {
  width: 100%;
  min-height: 47px;
  margin-bottom: 11px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #121920;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

.auth-input::placeholder {
  color: #75808a;
}

.auth-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242,170,61,.16);
}

.auth-submit {
  width: 100%;
  min-height: 47px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--gold);
  color: #18130a;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.auth-submit:hover {
  filter: brightness(1.06);
}

.auth-link-row {
  margin-top: 14px;
  text-align: center;
}

.auth-link-row a {
  color: var(--gold);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.auth-link-row a:hover {
  text-decoration: underline;
}

.auth-error {
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: rgba(224,108,117,.12);
  color: #ffadb4;
  font-size: 14px;
  line-height: 1.4;
}

.auth-tag-wrap {
  position: relative;
  margin-bottom: 9px;
}

.auth-tag-wrap .auth-input {
  margin-bottom: 4px;
}

.auth-tag-hint {
  display: block;
  min-height: 18px;
  padding-left: 2px;
  color: var(--muted);
  font-size: 12px;
}

.auth-tag-hint--ok {
  color: var(--green);
}

.auth-tag-hint--error {
  color: #ff9da5;
}

@media (max-width: 520px) {
  .auth-backdrop {
    align-items: flex-end;
    padding: 12px;
  }

  .auth-modal {
    width: 100%;
    max-height: 92vh;
    padding: 30px 20px 24px;
    border-radius: 16px 16px 12px 12px;
  }

  .auth-modal h2 {
    font-size: 23px;
  }

  .auth-modal p,
  .auth-input,
  .auth-submit,
  .auth-social-btn {
    font-size: 15px;
  }
}

/* ============================================================
   PHASE 1: STRUCTURED TILE RENDERING + TRUE TEXT FITTING
   JavaScript now measures each region and selects the largest
   font size that actually fits the rendered tile.
   ============================================================ */

.tile-identity {
  gap: 0.28em;
  justify-content: center;
  align-items: center;
  padding-top: 0;
  white-space: nowrap;
  text-overflow: clip;
}

.tile-number,
.tile-name {
  min-width: 0;
  white-space: nowrap;
}

.tile-event {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  text-wrap: balance;
}

.tile-points {
  white-space: nowrap;
}

.tile-points strong,
.tile-points span {
  font-size: inherit;
}

@media (max-width: 760px) {
  .tile-identity,
  .tile-event,
  .tile-points {
    font-size: inherit;
  }
}


/* ============================================================
   PHASE 1A: MOBILE IDENTITY WRAPPING + FREE TILE FITTING
   ============================================================ */

.tile-identity.identity-wrapped {
  flex-wrap: wrap;
  align-content: center;
  row-gap: 0;
  line-height: 1;
}

.tile-identity.identity-wrapped .tile-number,
.tile-identity.identity-wrapped .tile-name {
  flex: 0 0 100%;
  width: 100%;
  text-align: center;
}

.free-star,
.free-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .tile-identity.identity-wrapped {
    line-height: 0.95;
  }

  .tile-free {
    padding-left: 3px;
    padding-right: 3px;
  }
}


/* ============================================================
   PHASE 2 - LONG-PRESS UNDO
   ============================================================ */

.bingo-tile.completed:not(.tile-free) {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.bingo-tile.undo-hold:not(.tile-free) {
  transform: scale(.97);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 177, 50, .35);
}

.bingo-tile.undo-hold:not(.tile-free)::before {
  content: "";
  position: absolute;
  z-index: 8;
  left: 0;
  bottom: 0;
  height: 5px;
  width: 0;
  background: var(--gold);
  animation: bingoUndoHoldProgress 2s linear forwards;
  pointer-events: none;
}

@keyframes bingoUndoHoldProgress {
  from { width: 0; }
  to { width: 100%; }
}

/* ============================================================
   PHASE 3: PARTICIPANT SETUP
   ============================================================ */

.participant-setup[hidden],
.welcome-backdrop[hidden] {
  display: none !important;
}

.participant-setup {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow-y: auto;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(32,72,105,.62), transparent 36%),
    linear-gradient(180deg, #07111a 0%, #0a1219 52%, #0d151b 100%);
}

.participant-card {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #4b5b69;
  border-radius: 20px;
  background: rgba(12, 22, 31, .94);
  box-shadow: 0 30px 90px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.04);
}

.setup-brand {
  margin-bottom: 28px;
  text-align: center;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -1px;
}
.setup-brand span { color: #fff; }
.setup-brand strong { margin-left: 6px; color: var(--gold); }
.participant-card h1 {
  margin: 0 0 9px;
  text-align: center;
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1.08;
}
.participant-card > p {
  max-width: 440px;
  margin: 0 auto 22px;
  color: #d2d8de;
  text-align: center;
  line-height: 1.45;
}

.roster-panel {
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid #4d5c68;
  border-radius: 14px;
  background: #111b24;
}
.roster-title {
  padding: 13px 16px 10px;
  color: #ff9d24;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .06em;
}
.roster-choices {
  max-height: 385px;
  overflow-y: auto;
  padding: 0 10px 10px;
}
.roster-choice {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 58px 1fr 28px;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding: 7px 10px;
  border: 1px solid #3a4956;
  border-radius: 9px;
  background: linear-gradient(180deg,#1c2934,#17232d);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.roster-choice:hover { border-color: #758594; }
.roster-choice.selected {
  border-color: #ff8317;
  background: linear-gradient(180deg,#26323c,#1b2832);
  box-shadow: inset 3px 0 0 #ff8317, 0 0 0 1px rgba(255,131,23,.16);
}
.roster-jersey {
  color: #ff9d24;
  font-size: 20px;
  font-weight: 900;
}
.roster-person { display: flex; flex-direction: column; min-width: 0; }
.roster-person strong { font-size: 17px; line-height: 1.1; }
.roster-person small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.roster-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #9eabb6;
  border-radius: 50%;
}
.roster-choice.selected .roster-radio {
  border: 6px solid #ff8317;
  background: #fff;
}

.participant-name-label {
  display: block;
  margin-top: 18px;
  color: #ff9d24;
  font-weight: 900;
  font-size: 14px;
}
.participant-name-label span { color: #d5dbe0; font-weight: 500; }
.participant-name-help { margin: 4px 0 9px !important; text-align: left !important; color: var(--muted) !important; font-size: 13px; }
.participant-name-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #52616e;
  border-radius: 9px;
  outline: 0;
  background: #101a23;
  color: #fff;
  font: inherit;
  font-size: 16px;
}
.participant-name-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,170,61,.14); }
.participant-preview { min-height: 25px; padding: 8px 2px 0; color: #cfd7de; font-size: 13px; }
.start-bingo-btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 13px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg,#ff8b08,#e96700);
  color: white;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(232,103,0,.18);
}
.start-bingo-btn:disabled { opacity: .45; cursor: not-allowed; }
.start-bingo-btn span { font-size: 24px; line-height: 1; }
.setup-error { margin-top: 10px; color: #ff9da5; text-align: center; font-size: 13px; }

/* ============================================================
   PHASE 3: HOW TO PLAY WELCOME MODAL
   ============================================================ */

.welcome-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3,8,12,.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.welcome-modal {
  width: min(480px,100%);
  padding: 26px;
  border: 1px solid #52616e;
  border-radius: 18px;
  background: linear-gradient(180deg,#15212b,#0e171f);
  box-shadow: 0 30px 90px rgba(0,0,0,.58);
}
.welcome-icon { text-align: center; font-size: 38px; }
.welcome-modal h2 { margin: 8px 0 6px; text-align: center; font-size: 26px; }
.welcome-lead { margin: 0 0 19px; color: #c5cdd4; text-align: center; }
.welcome-rules { display: grid; gap: 9px; }
.welcome-rules > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #34434f;
  border-radius: 10px;
  background: #111c25;
  color: #dce1e5;
  font-size: 14px;
  line-height: 1.35;
}
.welcome-rules i { flex: 0 0 auto; width: 13px; height: 13px; border-radius: 3px; }
.welcome-rules .welcome-action { display: block; border-color: #72531e; background: rgba(242,170,61,.08); }

/* ============================================================
   PHASE 3: PARTICIPANT IDENTITY IN GAME HEADER
   ============================================================ */

.participant-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: fit-content;
  min-width: 250px;
  margin-top: 10px;
  padding: 8px 10px 8px 11px;
  border: 1px solid #44525f;
  border-radius: 10px;
  background: #101922;
}
.participant-copy { min-width: 0; }
.participant-copy > span { display: block; font-weight: 800; }
.participant-copy small { display: block; margin-top: 2px; color: var(--muted); }
.participant-copy small strong { color: var(--gold); }
.participant-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.participant-actions button {
  position: static;
  transform: none;
  min-height: 30px;
  border: 1px solid #3a4651;
  border-radius: 999px;
  background: #151c23;
  color: #c8d0d7;
  padding: 5px 9px;
  font: 700 11px var(--font);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.participant-actions button:hover {
  color: #fff;
  border-color: #66737f;
  background: #1a232c;
}
.participant-actions .header-help-btn {
  margin-left: 0;
  color: var(--gold);
}

/* ============================================================
   PHASE 3: HIGH-CONTRAST BOARD + TILE BORDERS
   ============================================================ */

.board-section {
  padding: 10px;
  border: 1px solid #25323d;
  border-radius: 14px;
  background: linear-gradient(180deg,rgba(4,10,15,.70),rgba(8,15,21,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.bingo-tile {
  border-width: 2px;
  border-color: #8d969d;
  box-shadow: 0 2px 7px rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.04);
}
.tile-player { border-color: #a7afb5; }
.tile-team {
  border-color: #ff922e;
  box-shadow: 0 2px 7px rgba(0,0,0,.42), 0 0 0 1px rgba(255,139,25,.23), inset 0 0 0 1px rgba(255,255,255,.10);
}
.tile-free {
  border-width: 2px;
  border-color: #ffd75a;
  box-shadow: 0 2px 7px rgba(0,0,0,.42), 0 0 0 1px rgba(255,196,39,.28), inset 0 0 0 1px rgba(255,255,255,.18);
}
.bingo-tile:hover:not(:disabled) { border-color: #fff; }

/* Keep Phase 2 progress animation, now calibrated to two seconds. */
.bingo-tile.undo-hold::before { animation-duration: 2s !important; }

@media (max-width: 760px) {
  .participant-setup { padding: 10px 8px 18px; }
  .participant-card { padding: 17px 13px; border-radius: 14px; }
  .setup-brand { margin-bottom: 19px; font-size: 20px; }
  .participant-card h1 { font-size: 27px; }
  .roster-choices { max-height: 43vh; }
  .roster-choice { min-height: 52px; grid-template-columns: 50px 1fr 24px; }
  .roster-jersey { font-size: 18px; }
  .roster-person strong { font-size: 16px; }
  .welcome-modal { padding: 20px 16px; }
  .welcome-modal h2 { font-size: 22px; }
  .board-section { padding: 5px; border-radius: 10px; }
  .bingo-headings { margin-left: 1px; margin-right: 1px; }
  .bingo-tile { border-width: 1.5px; }
  .participant-identity { min-width: 0; width: 100%; }
}


/* ============================================================
   GAMEPLAY UX: HELP, STATUS, FIVE-LINE MOBILE TILES
   ============================================================ */

/* Legend colors now match the real board. */
.legend-player { background: #070a0d !important; border: 1px solid #b9c0c5; }
.legend-team { background: #ff641f !important; border: 1px solid #ff9a62; }
.legend-free { background: #f5b63e !important; border: 1px solid #ffd875; }

.live-pill { padding: 4px 8px; border-radius: 999px; width: fit-content; }
.status-scheduled { color: #f2aa3d; background: rgba(242,170,61,.10); }
.status-live { color: #48d597; background: rgba(72,213,151,.10); }
.status-completed { color: #aeb8c1; background: rgba(174,184,193,.10); }
.status-cancelled { color: #ff7474; background: rgba(255,116,116,.10); }

.score-panel > button.score-help {
  min-width: 105px; padding: 13px 16px; border: 0; border-left: 1px solid var(--border);
  background: transparent; color: #fff; font-family: var(--font); text-align: center; cursor: pointer;
}
.score-panel > button.score-help span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.08em; }
.score-panel > button.score-help strong { display:block; font-size:24px; line-height:1.05; color:var(--gold); }
.score-panel > button.score-help:hover { background: rgba(255,255,255,.035); }

/* The permanent legend/instruction panel is intentionally removed from play. */
.game-main { margin-top: 22px; }
.board-section { margin-top: 12px; }

/* Five equal content bands. Player number/name each receive a guaranteed line,
   event receives two lines, and points own the final line. */
.bingo-tile {
  aspect-ratio: 1 / 1.12;
  grid-template-rows: repeat(5, 20%) !important;
}
.tile-player .tile-number,
.tile-player .tile-name,
.tile-team .tile-team-name,
.tile-event,
.tile-points {
  position: relative; z-index: 2; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding-left: 7px; padding-right: 7px; overflow: hidden;
}
.tile-player .tile-number { grid-row: 1; font-weight: 900; white-space: nowrap; line-height:1; }
.tile-player .tile-name { grid-row: 2; font-weight: 800; white-space: nowrap; line-height:1; }
.tile-player .tile-event { grid-row: 3 / 5; }
.tile-team .tile-team-name { grid-row: 1 / 3; font-weight: 900; line-height:1.05; text-align:center; }
.tile-team .tile-event { grid-row: 3 / 5; }
.tile-event {
  font-weight: 800; line-height: 1.08; text-align:center; text-wrap: balance;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  align-content:center;
}
.tile-points { grid-row: 5; border-top: 1px solid rgba(255,255,255,.20); gap:4px; line-height:1; }
.tile-points strong { line-height:1; }
.tile-points span { font-size:.55em; font-weight:800; }
.tile-free { display:grid !important; grid-template-rows: 42% 58% !important; align-items:stretch; justify-items:stretch; gap:0; }
.free-star { grid-row:1; align-self:end; justify-self:center; }
.free-text { grid-row:2; align-self:start; justify-self:center; }

/* Read-only state is communicated visually but tiles stay pointer-active so a
   tap can explain why play is unavailable. */
.game-readonly .bingo-tile:not(.tile-free) { cursor:not-allowed; }
.game-readonly .bingo-tile:not(.tile-free):not(.completed) { filter:saturate(.82) brightness(.92); }

.game-state-modal { max-width: 420px; }

@media (max-width: 760px) {
  .game-main { margin-top: 14px; }
  .game-summary { margin-bottom: 8px; }
  .score-panel { margin-top: 10px; }
  .score-panel > div,
  .score-panel > button.score-help { min-width:0; flex:1; padding:8px 2px; }
  .score-panel strong,
  .score-panel > button.score-help strong { font-size:18px; }
  .score-panel > button.score-help span { font-size:9px; }

  .board-section { margin-top: 6px; padding:4px; }
  .bingo-headings { margin-bottom:5px; }
  .bingo-headings span { font-size:clamp(22px,8vw,32px); }
  .bingo-board { gap:3px; }

  /* Portrait tiles create the vertical room required by the five-line model. */
  .bingo-tile { aspect-ratio: 1 / 1.34; border-radius:6px; }
  .tile-player .tile-number,
  .tile-player .tile-name,
  .tile-team .tile-team-name,
  .tile-event,
  .tile-points { padding-left:2px; padding-right:2px; }
  .tile-player .tile-number { font-size:clamp(10px,3.2vw,14px); }
  .tile-player .tile-name { font-size:clamp(9px,3vw,13px); }
  .tile-team .tile-team-name { font-size:clamp(9px,3vw,13px); }
  .tile-event { font-size:clamp(9px,2.8vw,13px); }
  .tile-points strong { font-size:clamp(15px,4.5vw,21px); }
  .tile-points span { font-size:clamp(7px,1.8vw,9px); }
}

/* ============================================================
   ADMIN GAME CONTROL
   ============================================================ */
.admin-main { max-width: 980px; margin: 34px auto; }
.admin-heading { margin-bottom: 22px; }
.admin-heading h1 { margin: 4px 0 6px; font-size: clamp(28px,4vw,42px); }
.admin-heading p { margin: 0; color: var(--muted); }
.admin-games { display: grid; gap: 12px; }
.admin-game-card {
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:18px 20px;
}
.admin-game-copy h2 { margin:8px 0 5px; font-size:20px; }
.admin-game-copy p { margin:0; color:var(--muted); }
.admin-game-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.admin-action { border:1px solid var(--border); border-radius:8px; padding:10px 14px; font:700 12px var(--font); cursor:pointer; }
.admin-action.primary { background:#f5831f; border-color:#ff9a40; color:#fff; }
.admin-action.danger { background:#291316; border-color:#7d3339; color:#ff9797; }
.admin-terminal { color:var(--muted); font-size:13px; }
@media(max-width:760px) {
  .admin-main { margin:18px auto; }
  .admin-game-card { align-items:flex-start; flex-direction:column; padding:15px; }
  .admin-game-actions { width:100%; justify-content:stretch; }
  .admin-action { flex:1; }
}

/* ============================================================
   GAME LEADERBOARD
   ============================================================ */
.leaders-control strong{color:var(--gold)!important}.leaderboard-modal{width:min(560px,calc(100vw - 24px));max-height:min(78vh,720px);overflow:hidden;background:#111820;border:1px solid #3d4751;border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.55);padding:0;display:flex;flex-direction:column}.leaderboard-header{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:20px 20px 14px;border-bottom:1px solid var(--border)}.leaderboard-kicker{font-size:10px;font-weight:800;letter-spacing:.15em;color:var(--gold)}.leaderboard-header h2{margin:3px 0 2px;font-size:26px}.leaderboard-header p{margin:0;color:var(--muted);font-size:13px}.modal-close-btn{width:42px;height:42px;flex:0 0 42px;border:1px solid var(--border);border-radius:50%;background:#19212a;color:#fff;font-size:26px;line-height:1;cursor:pointer}.leaderboard-status{padding:28px 20px;text-align:center;color:var(--muted)}.leaderboard-list{overflow:auto;padding:8px 12px 12px}.leaderboard-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px 10px;border-bottom:1px solid rgba(255,255,255,.07);border-radius:10px}.leaderboard-row.current-player{background:rgba(245,184,47,.09);border:1px solid rgba(245,184,47,.45)}.leaderboard-rank{font-family:var(--display);font-size:19px;color:var(--muted);text-align:center}.leaderboard-row.rank-1 .leaderboard-rank,.leaderboard-row.rank-2 .leaderboard-rank,.leaderboard-row.rank-3 .leaderboard-rank{color:var(--gold)}.leaderboard-player{min-width:0}.leaderboard-name{font-weight:800;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.leaderboard-support{margin-top:3px;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.leaderboard-detail{margin-top:4px;display:flex;gap:6px;align-items:center;flex-wrap:wrap;color:#aeb7c0;font-size:10px}.leaderboard-badge{padding:2px 6px;border-radius:999px;background:rgba(245,184,47,.14);color:var(--gold);font-weight:800}.leaderboard-score{text-align:right}.leaderboard-score strong{display:block;font-family:var(--display);font-size:21px;color:#fff}.leaderboard-score span{display:block;color:var(--muted);font-size:9px;letter-spacing:.1em}.leaderboard-footer{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:11px 20px;border-top:1px solid var(--border);color:var(--muted);font-size:11px}.leaderboard-footer small{font-size:9px;text-align:right}.leaderboard-empty{padding:36px 16px;text-align:center;color:var(--muted)}
@media(max-width:760px){.participant-identity{flex-wrap:nowrap;align-items:center}.participant-actions{margin-left:auto}.header-help-btn{margin-left:0}.leaderboard-modal{width:calc(100vw - 16px);max-height:82vh;border-radius:14px}.leaderboard-header{padding:16px 14px 12px}.leaderboard-header h2{font-size:22px}.leaderboard-list{padding:6px 7px 10px}.leaderboard-row{grid-template-columns:34px minmax(0,1fr) 62px;gap:7px;padding:11px 7px}.leaderboard-rank{font-size:16px}.leaderboard-name{font-size:14px}.leaderboard-score strong{font-size:18px}.leaderboard-footer{padding:10px 14px}.leaderboard-footer small{display:none}}


/* ============================================================
   LANDING PAGE: GAME CARD STATUS STATES
   ============================================================ */

/* LIVE — highest-priority game on the landing page. */
.fixture-card.status-live {
  border-color: rgba(70, 184, 169, .82);
  box-shadow:
    0 24px 60px rgba(0,0,0,.25),
    0 0 0 1px rgba(70,184,169,.08),
    0 0 26px rgba(70,184,169,.10);
}
.fixture-card.status-live .fixture-label {
  color: #62d7c8;
}
.fixture-card.status-live .fixture-label::before {
  content: "● ";
  color: #ff6868;
}

/* SCHEDULED — normal/default actionable card. */
.fixture-card.status-scheduled {
  opacity: 1;
}

/* COMPLETED — readable, but visually archival/read-only. */
.fixture-card.status-completed {
  opacity: .68;
  background: linear-gradient(145deg,#1b232b,#151b22);
  border-color: #303a45;
  box-shadow: none;
}
.fixture-card.status-completed .fixture-label,
.fixture-card.status-completed .team-label {
  color: #84909b;
}
.fixture-card.status-completed .fixture-top h2,
.fixture-card.status-completed .matchup strong,
.fixture-card.status-completed .fixture-footer strong {
  color: #c0c7ce;
}
.fixture-card.status-completed .versus {
  color: #8c97a3;
}
.fixture-card.status-completed .sport-badge {
  opacity: .65;
}
.fixture-card.status-completed .play-btn {
  background: transparent;
  border: 1px solid #697581;
  color: #c2cad2;
  box-shadow: none;
}
.fixture-card.status-completed .play-btn:hover {
  background: rgba(255,255,255,.05);
}

/* CANCELLED — intentionally subdued and non-actionable. */
.fixture-card.status-cancelled {
  opacity: .48;
  background: linear-gradient(145deg,#181e25,#13191f);
  border-color: rgba(224,108,117,.55);
  box-shadow: none;
}
.fixture-card.status-cancelled .fixture-label {
  color: #ff7474;
}
.fixture-card.status-cancelled .fixture-label::before {
  content: "✕ ";
}
.fixture-card.status-cancelled .team-label,
.fixture-card.status-cancelled .fixture-top h2,
.fixture-card.status-cancelled .matchup strong,
.fixture-card.status-cancelled .fixture-footer strong,
.fixture-card.status-cancelled .versus {
  color: #87919d;
}
.fixture-card.status-cancelled .sport-badge {
  filter: grayscale(1);
  opacity: .55;
}
.fixture-card.status-cancelled .play-btn,
.fixture-card.status-cancelled .play-btn:disabled {
  background: #303841;
  color: #89939e;
  border: 1px solid #414a54;
  box-shadow: none;
  cursor: default;
  opacity: 1;
}


/* 2026-09 responsive sizing + logo */
.setup-brand img{display:block;width:110px;max-height:90px;object-fit:contain;margin:0 auto 8px;border-radius:8px}
.game-main{max-width:1040px!important;margin:24px auto!important}
.board-section{max-width:960px!important}
.game-info h1{font-size:clamp(21px,2.1vw,30px)!important;line-height:1.12}
.game-info p{font-size:clamp(13px,1.1vw,15px)!important}
.bingo-headings span{font-size:clamp(23px,3vw,34px)!important}
.tile-identity{font-size:clamp(14px,1.35vw,20px)!important}.tile-event{font-size:clamp(13px,1.25vw,18px)!important}.tile-points strong{font-size:clamp(22px,2.2vw,31px)!important}
@media(max-width:760px){
 .game-main{margin:18px auto!important}.board-section{max-width:100%!important}
 .tile-identity{font-size:clamp(10px,3vw,14px)!important}.tile-event{font-size:clamp(9px,2.65vw,13px)!important}.tile-points strong{font-size:clamp(16px,4.6vw,24px)!important}
}
