:root{--bg:#080b12;--panel:#111725;--panel2:#171f30;--text:#f4f7fb;--muted:#94a3b8;--line:#263246;--accent:#7c5cff;--good:#2dd4bf;--warn:#fbbf24;--bad:#fb7185;--conf:#4f8cff;--res:#ef5b5b}*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;background:radial-gradient(circle at 50% -20%,#1b2440 0,#080b12 42%);color:var(--text);min-height:100vh}a{color:inherit;text-decoration:none}.wrap{width:min(1100px,92%);margin:auto}.nav{display:flex;justify-content:space-between;align-items:center;padding:24px 0}.brand{font-weight:900;letter-spacing:.12em}.navlinks{display:flex;gap:12px;align-items:center}.btn{border:1px solid var(--line);background:var(--panel2);color:white;border-radius:12px;padding:11px 16px;font-weight:750;cursor:pointer;display:inline-block}.btn.primary{background:var(--accent);border-color:var(--accent)}.btn.good{background:#123b36;border-color:#1f766b}.btn.bad{background:#421923;border-color:#7e293b}.hero{text-align:center;padding:76px 0 50px}.eyebrow{color:#b9abff;font-weight:800;letter-spacing:.15em;font-size:12px}.hero h1{font-size:clamp(42px,7vw,82px);line-height:.95;margin:18px 0}.hero p{color:var(--muted);font-size:18px;max-width:650px;margin:0 auto 28px}.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:18px}.card{background:linear-gradient(180deg,rgba(23,31,48,.92),rgba(13,18,29,.92));border:1px solid var(--line);border-radius:18px;padding:22px}.span4{grid-column:span 4}.span6{grid-column:span 6}.span8{grid-column:span 8}.span12{grid-column:span 12}.metric{font-size:34px;font-weight:900}.muted{color:var(--muted)}.section{padding:30px 0}.section h2{margin:0 0 16px}.field{margin:0 0 16px}.field label{display:block;font-weight:750;margin:0 0 7px}.field input,.field select,.field textarea{width:100%;padding:13px 14px;background:#0b101a;border:1px solid var(--line);border-radius:11px;color:white;font:inherit}.two{display:grid;grid-template-columns:1fr 1fr;gap:16px}.factions{display:grid;grid-template-columns:1fr 1fr;gap:14px}.faction{padding:22px;border:1px solid var(--line);border-radius:15px;background:#0b101a}.faction input{margin-right:8px}.status{padding:20px;border-radius:15px;border:1px solid var(--line);font-weight:800}.status.pending{background:#161b26}.status.selection{background:#3a3011;border-color:#725f19}.status.approved{background:#10332f;border-color:#1e6a60}.status.denied,.status.not_selected{background:#38141c;border-color:#742838}.tag{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:850;background:#222c3d}.tag.confederation{background:#172c53}.tag.resistance{background:#4a1f24}.flash{padding:13px 15px;border-radius:11px;background:#2d2510;border:1px solid #6f5b19;margin-bottom:16px}.table{width:100%;border-collapse:collapse}.table th,.table td{text-align:left;padding:12px 9px;border-bottom:1px solid var(--line);vertical-align:top}.table th{font-size:12px;color:var(--muted);text-transform:uppercase}.actions{display:flex;gap:8px;flex-wrap:wrap}.small{font-size:13px}.draw{font-size:26px;font-weight:900;text-align:center;padding:25px;border:1px dashed #495a77;border-radius:16px;margin:14px 0}.footer{padding:50px 0;color:var(--muted);text-align:center}@media(max-width:760px){.span4,.span6,.span8{grid-column:span 12}.two,.factions{grid-template-columns:1fr}.nav{align-items:flex-start}.navlinks{flex-wrap:wrap;justify-content:flex-end}.table{font-size:13px}.hero{padding-top:45px}}
.badge{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--bad);font-size:11px;margin-left:4px}.replace-row{display:grid;grid-template-columns:1.2fr 1fr 1fr auto;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}.replace-row select,.replace-row input{padding:9px;background:#0b101a;border:1px solid var(--line);border-radius:9px;color:white}.reveal{animation:reveal .8s ease-out}@keyframes reveal{from{opacity:0;transform:scale(.85);filter:blur(8px)}to{opacity:1;transform:scale(1);filter:blur(0)}}@media(max-width:760px){.replace-row{grid-template-columns:1fr}}
.countdown-wrap{margin-top:18px}.countdown{font-size:26px;font-weight:900;margin-top:5px}.schedule-card{display:flex;justify-content:center;gap:80px;text-align:center}.schedule-card strong{display:block;margin-top:5px;font-size:18px}@media(max-width:760px){.schedule-card{flex-direction:column;gap:18px}}

/* AOW visual refresh */
body{background:#070b12 url('/static/tournament-background.jpg') center top/cover fixed no-repeat;position:relative}
.page-backdrop{position:fixed;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(4,8,15,.58),rgba(4,8,15,.76) 45%,rgba(4,8,15,.94)),radial-gradient(circle at 50% 20%,rgba(18,32,55,.12),rgba(4,8,15,.55));backdrop-filter:saturate(.9)}
.wrap{position:relative}.brand span{color:#9fb5d3}.nav{padding-top:22px}.nav .btn{background:rgba(12,19,31,.78);backdrop-filter:blur(10px)}
.card{backdrop-filter:blur(14px);box-shadow:0 18px 55px rgba(0,0,0,.24)}
.registration-section{max-width:1100px;margin:0 auto}.registration-heading{margin:22px 0 18px}.registration-heading h2{font-size:32px;margin:6px 0}.registration-heading p{margin:0}
.registration-card{background:linear-gradient(180deg,rgba(13,21,34,.94),rgba(8,14,24,.96));padding:28px}
.visual-factions{gap:18px}.faction-card{position:relative;display:block;cursor:pointer;border-radius:16px;overflow:hidden;border:1px solid #314056;background:rgba(5,10,18,.82);transition:.2s ease;min-height:126px}.faction-card:hover{transform:translateY(-2px)}
.faction-radio{position:absolute!important;opacity:0!important;pointer-events:none;width:1px!important;height:1px!important}
.faction-content{height:100%;min-height:126px;display:flex;align-items:center;gap:18px;padding:18px 22px;position:relative}.faction-content img{width:88px;height:88px;object-fit:contain;filter:drop-shadow(0 8px 18px rgba(0,0,0,.35))}.faction-copy{display:flex;flex-direction:column;gap:5px}.faction-copy strong{font-size:20px;letter-spacing:.04em}.faction-copy small{color:var(--muted)}.selection-mark{margin-left:auto;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;border:1px solid #53627a;color:transparent;font-weight:900;transition:.2s}
.confederation-card{background:linear-gradient(105deg,rgba(19,60,111,.46),rgba(5,10,18,.9))}.resistance-card{background:linear-gradient(105deg,rgba(105,24,29,.46),rgba(5,10,18,.9))}.confederation-card:hover{border-color:#58a0ff;box-shadow:0 0 26px rgba(79,140,255,.18)}.resistance-card:hover{border-color:#ff5a5a;box-shadow:0 0 26px rgba(239,91,91,.18)}
.confederation-card:has(.faction-radio:checked){border:2px solid #58a0ff;box-shadow:0 0 0 3px rgba(79,140,255,.12),0 0 32px rgba(79,140,255,.24)}.resistance-card:has(.faction-radio:checked){border:2px solid #ff5757;box-shadow:0 0 0 3px rgba(239,91,91,.12),0 0 32px rgba(239,91,91,.24)}.faction-card:has(.faction-radio:checked) .selection-mark{color:white}.confederation-card:has(.faction-radio:checked) .selection-mark{background:#398cff;border-color:#72b1ff}.resistance-card:has(.faction-radio:checked) .selection-mark{background:#e83c42;border-color:#ff777b}
.register-submit{width:100%;font-size:15px;letter-spacing:.04em;margin-top:2px;padding:14px}.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:#6d8fc5;box-shadow:0 0 0 3px rgba(109,143,197,.12)}
@media(max-width:760px){body{background-position:center top}.registration-card{padding:18px}.faction-content{padding:14px}.faction-content img{width:68px;height:68px}.faction-copy strong{font-size:17px}.brand{max-width:48%;font-size:12px}}
.dynamic-roster{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.roster-title{margin:20px 0 10px}.btn:disabled{opacity:.45;cursor:not-allowed}@media(max-width:760px){.dynamic-roster{grid-template-columns:1fr}}
.prewrap{white-space:pre-wrap;line-height:1.65}.rules-box{max-height:260px;overflow:auto;padding:16px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(0,0,0,.22);margin:12px 0}.rules-check{display:flex;gap:10px;align-items:flex-start;font-weight:700}.rules-check input{width:auto;margin-top:4px}.rules-accept{margin:18px 0}

/* Information/rules modal and admin editor refresh */
.info-launchers{padding-top:8px}.info-launch{font:inherit;color:inherit;text-align:left;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:22px;width:100%;transition:.2s ease}.info-launch:hover{transform:translateY(-2px);border-color:#405575}.info-launch h3{font-size:22px;margin:6px 0 5px}.info-launch p{margin:0}.info-launch .btn{white-space:nowrap;pointer-events:none}
.content-modal{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;padding:4vh 4vw}.content-modal.open{display:flex}.modal-backdrop{position:absolute;inset:0;background:rgba(2,6,12,.82);backdrop-filter:blur(8px)}.modal-panel{position:relative;width:min(1000px,88vw);max-height:86vh;overflow:auto;background:linear-gradient(180deg,#151e2f,#0c121e);border:1px solid #34445d;border-radius:20px;padding:34px 38px;box-shadow:0 30px 100px rgba(0,0,0,.65)}.modal-panel h2{font-size:32px;margin:8px 48px 24px 0}.modal-copy{color:#c3cede;font-size:16px;line-height:1.8}.modal-close{position:absolute;right:20px;top:16px;width:42px;height:42px;border-radius:11px;border:1px solid var(--line);background:#111a29;color:#fff;font-size:28px;line-height:1;cursor:pointer}.modal-close:hover{background:#1b2639}.modal-open{overflow:hidden}
.admin-control-card{min-height:100%;align-self:stretch}.admin-content-editor{padding:28px}.admin-editor-head{display:flex;justify-content:space-between;gap:20px;margin-bottom:20px}.admin-editor-head h3{font-size:24px;margin:6px 0}.admin-editor-head p{margin:0;max-width:760px}.field textarea.large-editor{min-height:220px;resize:vertical;line-height:1.55}.field textarea.rules-editor{min-height:300px}.admin-content-editor .actions{justify-content:flex-end;margin-top:8px}
@media(max-width:760px){.info-launch{flex-direction:column;align-items:flex-start}.info-launch .btn{width:100%;text-align:center}.content-modal{padding:0}.modal-panel{width:100vw;max-height:100vh;height:100vh;border-radius:0;padding:70px 22px 30px}.modal-panel h2{font-size:27px}.admin-content-editor{padding:20px}.field textarea.large-editor,.field textarea.rules-editor{min-height:260px}.admin-content-editor .actions{justify-content:stretch}.admin-content-editor .actions .btn{width:100%;text-align:center}}

.hero-subline{display:inline-block;margin-top:8px;font-size:.92em;color:var(--muted)}


/* Tournament Portal custom dialogs / notifications */
.portal-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;padding:24px}
.portal-modal.open{display:flex}
.portal-modal-backdrop{position:absolute;inset:0;background:rgba(3,8,18,.78);backdrop-filter:blur(8px)}
.portal-modal-card{position:relative;width:min(520px,100%);background:#111a2b;border:1px solid #31405c;border-radius:22px;padding:30px;box-shadow:0 30px 90px rgba(0,0,0,.55)}
.portal-modal-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;margin-bottom:18px;background:rgba(126,87,255,.16);border:1px solid rgba(155,125,255,.45);font-size:24px;font-weight:900;color:#b79cff}
.portal-modal-card h2{margin:6px 0 10px}
.portal-modal-actions{justify-content:flex-end;margin-top:24px}
.btn.danger-action,.danger-action{background:#b63b4b!important;border-color:#d95b6a!important;color:#fff!important}
.portal-toast-stack{position:fixed;right:24px;bottom:24px;z-index:10000;display:flex;flex-direction:column;gap:12px;width:min(420px,calc(100vw - 48px))}
.portal-toast{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:start;background:#121c2e;border:1px solid #30415e;border-radius:16px;padding:15px 16px;box-shadow:0 18px 55px rgba(0,0,0,.45);opacity:0;transform:translateY(12px);transition:.22s ease}
.portal-toast.show{opacity:1;transform:translateY(0)}
.portal-toast-mark{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:rgba(86,214,155,.13);border:1px solid rgba(86,214,155,.35);color:#70e5ad;font-weight:900}
.portal-toast strong{font-size:12px;letter-spacing:.08em}
.portal-toast>div>div{margin-top:4px;color:#aebbd0;line-height:1.4}
.portal-toast button{border:0;background:transparent;color:#93a1b8;font-size:22px;cursor:pointer;padding:0 2px}
.portal-toast.error .portal-toast-mark{background:rgba(218,78,94,.13);border-color:rgba(218,78,94,.35);color:#ff7d8b}
@media(max-width:640px){.portal-toast-stack{right:16px;bottom:16px;width:calc(100vw - 32px)}.portal-modal-card{padding:22px}}

.team-result{padding:16px 0;border-top:1px solid rgba(140,160,190,.18)}.team-result:first-of-type{border-top:0}.team-result h3{margin:0 0 4px}.result-roster{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.pill{display:inline-flex;padding:6px 9px;border-radius:999px;border:1px solid rgba(140,160,190,.24);font-size:12px;color:#b9c6da}

.bracket-scroll{overflow-x:auto;padding:8px 0 24px}.bracket-board{display:flex;gap:22px;align-items:flex-start;min-width:max-content}.bracket-round{width:300px}.bracket-round>h3{margin:0 0 14px}.bracket-match{background:#111a2b;border:1px solid #2b3a55;border-radius:16px;padding:14px;margin-bottom:16px}.match-meta{font-size:11px;letter-spacing:.08em;color:#8fa0b9;margin-bottom:10px}.bracket-team{display:flex;justify-content:space-between;gap:12px;padding:10px;border-top:1px solid rgba(140,160,190,.16)}.bracket-team.winner{font-weight:800;color:#7be3ad}.admin-bracket select,.admin-bracket input{width:100%;margin:4px 0 8px}.score-form{border-top:1px solid rgba(140,160,190,.16);margin-top:10px;padding-top:10px}.score-form>div{display:grid;grid-template-columns:1fr 70px;align-items:center;gap:8px}.winner-note{margin-top:10px;color:#7be3ad;font-weight:800}

.admin-back-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  min-height:34px;
  margin:20px 0 10px;
  padding:7px 12px;
  border:1px solid #2b3a55;
  border-radius:10px;
  background:#111a2b;
  color:#f4f6fb;
  font-size:12px;
  font-weight:800;
  line-height:1;
  letter-spacing:.04em;
  text-decoration:none;
}
.admin-back-btn:hover{
  background:#18243a;
  border-color:#435779;
}

.admin-back-topright{
  position:relative;
  display:flex;
  width:max-content;
  min-height:36px;
  margin:18px 0 8px auto;
  padding:0 13px;
  z-index:1;
  border-radius:10px;
  border:1px solid #34445f;
  background:#111a2b;
  color:#f4f6fb;
  box-shadow:none;
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
}
@media (max-width:900px){
  .admin-back-topright{
    position:relative;
    margin:14px 0 8px auto;
  }
}

/* UI repair: authentication/navigation */
.navlinks{display:flex;align-items:center;gap:10px;flex-wrap:nowrap}
.navlinks .btn{white-space:nowrap;flex:0 0 auto}
.discord-login-btn{
  background:#5865F2 !important;
  border-color:#5865F2 !important;
  color:#fff !important;
  display:inline-flex !important;
  align-items:center;
  gap:8px;
}
.discord-login-btn:hover{background:#4752c4 !important;border-color:#4752c4 !important}
.discord-mark{display:inline-flex;align-items:center;justify-content:center}

/* Homepage stat typography: keep values consistent with the rest of the portal */
.stat-value,
.stat-card .value,
.stats .value,
.metric-value{
  font-size:22px !important;
  line-height:1.2 !important;
  font-weight:800 !important;
  letter-spacing:0 !important;
}
@media (max-width:1050px){
  .nav{align-items:flex-start}
  .navlinks{flex-wrap:wrap;justify-content:flex-end}
}

.admin-back-topright:hover{
  transform:translateY(-1px);
  background:#18243a;
  border-color:#566d94;
  box-shadow:0 10px 28px rgba(0,0,0,.26);
}

.telegram-connect-card{margin-top:18px}
.telegram-btn{background:#229ED9!important;border-color:#229ED9!important;color:#fff!important}
.telegram-btn:hover{background:#1b8abd!important;border-color:#1b8abd!important}

/* Landing hero: lock the complete hero stack to the exact content/viewport center. */
.hero{
  width:100%;
  margin-left:auto;
  margin-right:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}
.hero .eyebrow,
.hero h1,
.hero p{
  width:100%;
  text-align:center;
}
.hero h1{
  margin-left:auto;
  margin-right:auto;
  white-space:nowrap;
}
.hero > .btn,
.hero > a.btn{
  align-self:center;
}
@media(max-width:900px){
  .hero h1{white-space:normal}
}

.notification-channel-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.notification-channel,.notification-team-option{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px solid #2b3b55;border-radius:14px;background:#0b1321;cursor:pointer}
.notification-channel input,.notification-team-option input{margin-top:4px;accent-color:#7655ff}
.notification-channel span,.notification-team-option span{display:flex;flex-direction:column;gap:4px}
.notification-channel small,.notification-team-option small{color:#95a4bb}
.notification-team-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:300px;overflow:auto;padding:2px}
@media(max-width:760px){.notification-channel-grid,.notification-team-grid{grid-template-columns:1fr}}

.notification-team-toolbar{display:grid;grid-template-columns:minmax(180px,1fr) auto auto auto;gap:8px;align-items:center;margin-bottom:10px}
.notification-team-toolbar input{min-width:0}.notification-team-option{position:relative;align-items:center!important;min-height:64px}
.notification-team-option>.team-check{position:absolute;opacity:0;pointer-events:none}
.notification-team-option:has(.team-check:checked){border-color:#8058ff;background:linear-gradient(90deg,rgba(119,76,255,.18),rgba(119,76,255,.06));box-shadow:inset 0 0 0 1px rgba(128,88,255,.18)}
.team-copy{flex:1;min-width:0}
.faction-pill{font-size:11px;font-weight:800;text-transform:uppercase;padding:5px 9px;border-radius:999px;border:1px solid #315c94;color:#62aaff;background:#092443}
.faction-pill.resistance{border-color:#8c2b37;color:#ff5b68;background:#35131b}
.team-tick{width:25px;height:25px;border:1px solid #40516d;border-radius:7px;display:grid!important;place-items:center;color:transparent;font-weight:900;flex:0 0 25px}
.team-check:checked~.team-tick{background:#7655ff;border-color:#7655ff;color:white}
@media(max-width:760px){.notification-team-toolbar{grid-template-columns:1fr 1fr}.notification-team-toolbar input{grid-column:1/-1}.faction-pill{display:none}}


/* Compact team recipient rows — faction colored, no faction logos */
.notify-team-row{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  min-height:58px;
  box-sizing:border-box;
  margin:7px 0;
  padding:9px 12px;
  border:1px solid #2a3b55;
  border-radius:10px;
  background:rgba(8,17,30,.82);
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.notify-team-input{
  position:absolute !important;
  opacity:0 !important;
  width:1px !important;
  height:1px !important;
  pointer-events:none;
}
.notify-team-check{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:grid;
  place-items:center;
  border:1px solid #607796;
  border-radius:5px;
  color:transparent;
  font-size:12px;
  font-weight:900;
  line-height:1;
}
.notify-team-info{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.notify-team-info strong{
  color:#f5f7fb;
  font-size:14px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.notify-team-info small{
  color:#93a3ba;
  font-size:12px;
  line-height:1.2;
}
.notify-team-badge{
  flex:none;
  padding:4px 8px;
  border-radius:7px;
  font-size:10px;
  line-height:1;
  font-weight:800;
  letter-spacing:.02em;
  text-transform:uppercase;
}

/* Confederation = blue */
.notify-team-row.faction-confederation{
  border-left:3px solid #268cff;
}
.notify-team-row.faction-confederation .notify-team-badge{
  color:#4aa7ff;
  border:1px solid #176ec4;
  background:rgba(18,82,142,.22);
}
.notify-team-row.faction-confederation:hover{
  border-color:#268cff;
  background:rgba(24,91,160,.11);
}
.notify-team-row.faction-confederation:has(.notify-team-input:checked){
  border-color:#2d95ff;
  background:linear-gradient(90deg,rgba(27,112,203,.22),rgba(12,27,47,.88));
  box-shadow:inset 0 0 0 1px rgba(45,149,255,.12);
}
.notify-team-row.faction-confederation:has(.notify-team-input:checked) .notify-team-check{
  color:#fff;
  border-color:#2d95ff;
  background:#237fd9;
}

/* Resistance = red */
.notify-team-row.faction-resistance{
  border-left:3px solid #e23c49;
}
.notify-team-row.faction-resistance .notify-team-badge{
  color:#ff5b67;
  border:1px solid #a92c37;
  background:rgba(133,28,38,.22);
}
.notify-team-row.faction-resistance:hover{
  border-color:#e23c49;
  background:rgba(148,37,48,.11);
}
.notify-team-row.faction-resistance:has(.notify-team-input:checked){
  border-color:#ef4654;
  background:linear-gradient(90deg,rgba(170,38,51,.22),rgba(12,27,47,.88));
  box-shadow:inset 0 0 0 1px rgba(239,70,84,.12);
}
.notify-team-row.faction-resistance:has(.notify-team-input:checked) .notify-team-check{
  color:#fff;
  border-color:#ef4654;
  background:#c93240;
}

/* Keep team controls aligned instead of letting native controls float */
.notify-team-row + .notify-team-row{margin-top:7px}

/* Notification team list scalability + delivery channel visual polish */
.notify-team-scroll{
  width:100%;
  max-height:355px;
  overflow-y:auto;
  overflow-x:hidden;
  padding:2px 6px 2px 0;
  margin-top:10px;
  scrollbar-width:thin;
  scrollbar-color:#465d7e #0a1423;
}
.notify-team-scroll::-webkit-scrollbar{width:8px}
.notify-team-scroll::-webkit-scrollbar-track{background:#0a1423;border-radius:8px}
.notify-team-scroll::-webkit-scrollbar-thumb{background:#465d7e;border-radius:8px}
.notify-team-scroll::-webkit-scrollbar-thumb:hover{background:#5a7399}

/* Force team rows below the search/action toolbar at full width. */
#notif-teams-wrap{display:block}
#notif-teams-wrap .notify-team-scroll{clear:both}
#notif-teams-wrap .notify-team-row{width:100%;}

/* Channel icons: lightweight, local, no external image dependency. */
.notification-channel-icon{
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:grid;
  place-items:center;
  border-radius:9px;
  font-size:22px;
  font-weight:800;
  line-height:1;
}
.email-icon{
  color:#dce9ff;
  background:rgba(106,151,221,.12);
}
.discord-icon{
  color:#7289da;
  background:rgba(88,101,242,.13);
}
.discord-mark{
  font-size:11px;
  letter-spacing:-2px;
  transform:translateX(-1px);
}
.telegram-icon{
  color:#36aeea;
  background:rgba(54,174,234,.12);
  transform:none;
}

/* V7: selection is indicated by faction glow only; no visible checkbox/check mark */
.notify-team-check{display:none!important}
.notify-team-row{padding-left:14px}
.notify-team-row.faction-confederation:has(.notify-team-input:checked){
  border-color:#2997ff!important;
  background:linear-gradient(90deg,rgba(24,112,205,.30),rgba(17,44,75,.78))!important;
  box-shadow:0 0 0 1px rgba(41,151,255,.35),0 0 18px rgba(41,151,255,.30),inset 0 0 18px rgba(41,151,255,.08)!important;
}
.notify-team-row.faction-resistance:has(.notify-team-input:checked){
  border-color:#f04453!important;
  background:linear-gradient(90deg,rgba(174,37,50,.30),rgba(65,20,27,.72))!important;
  box-shadow:0 0 0 1px rgba(240,68,83,.32),0 0 18px rgba(240,68,83,.28),inset 0 0 18px rgba(240,68,83,.08)!important;
}

/* Clean Discord-style mark, built locally so no broken external icon asset */
.discord-icon{
  color:#fff!important;
  background:#5865F2!important;
}
.discord-logo{
  width:23px;height:16px;position:relative;display:block;
  border:3px solid currentColor;border-top-width:4px;
  border-radius:9px 9px 7px 7px;
  box-sizing:border-box;
}
.discord-logo:before,.discord-logo:after{
  content:"";position:absolute;top:-6px;width:7px;height:5px;
  border-top:3px solid currentColor;
}
.discord-logo:before{left:-3px;transform:rotate(-24deg)}
.discord-logo:after{right:-3px;transform:rotate(24deg)}
.discord-logo i{
  position:absolute;top:4px;width:3px;height:3px;background:currentColor;border-radius:50%;
}
.discord-logo i:first-child{left:4px}.discord-logo i:last-child{right:4px}

/* Hide native channel checkboxes visually; selected channel card itself indicates state. */
.notification-channel-option input[type="checkbox"],
.notification-channel-card input[type="checkbox"]{
  position:absolute!important;opacity:0!important;pointer-events:none!important;
}
.notification-channel-option:has(input:checked),
.notification-channel-card:has(input:checked){
  border-color:#805cff!important;
  background:rgba(128,92,255,.08)!important;
  box-shadow:0 0 0 1px rgba(128,92,255,.10);
}

/* V8 faction logos + glow selections */
.notify-team-badge{display:none!important}
.notify-team-faction-logo{width:52px!important;height:52px!important;max-width:52px!important;max-height:52px!important;object-fit:contain!important;display:block!important;flex:0 0 52px!important;margin-left:auto!important;opacity:.9;transition:.15s}
.notify-team-row.faction-confederation:has(.notify-team-input:checked) .notify-team-faction-logo{opacity:1;filter:drop-shadow(0 0 8px rgba(47,151,255,.6))}
.notify-team-row.faction-resistance:has(.notify-team-input:checked) .notify-team-faction-logo{opacity:1;filter:drop-shadow(0 0 8px rgba(239,68,84,.58))}

/* Hide all delivery checkboxes; selected cards glow gold */
.notification-channel-option input[type="checkbox"],.notification-channel-card input[type="checkbox"]{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important;pointer-events:none!important}
.notification-channel-option:has(input:checked),.notification-channel-card:has(input:checked){border-color:#d7ad4b!important;background:linear-gradient(135deg,rgba(196,150,48,.15),rgba(11,23,40,.95))!important;box-shadow:0 0 0 1px rgba(215,173,75,.18),0 0 18px rgba(215,173,75,.23),inset 0 0 16px rgba(215,173,75,.05)!important}

/* Clean Discord-style icon */
.discord-icon{background:#5865F2!important;color:#fff!important;border-radius:9px!important}
.discord-face{position:relative;display:block;width:24px;height:17px;border:3px solid currentColor;border-radius:10px 10px 8px 8px;box-sizing:border-box}
.discord-face:before,.discord-face:after{content:"";position:absolute;top:-6px;width:8px;height:6px;border-top:3px solid currentColor}
.discord-face:before{left:-4px;transform:rotate(-24deg)}.discord-face:after{right:-4px;transform:rotate(24deg)}
.discord-face i{position:absolute;top:4px;width:3px;height:3px;border-radius:50%;background:currentColor}
.discord-face i:first-child{left:4px}.discord-face i:last-child{right:4px}
.discord-face i:last-child:after{content:"";position:absolute;width:10px;height:4px;left:-7px;top:3px;border-bottom:2px solid currentColor;border-radius:0 0 9px 9px}


/* V9 — compact team rows + reliable gold channel selection */

/* Compact team cards */
.notify-team-row{
  min-height:72px!important;
  height:72px!important;
  padding:10px 14px!important;
  align-items:center!important;
  border-radius:10px!important;
}
.notify-team-row .notify-team-main,
.notify-team-row .notify-team-copy{
  align-self:center!important;
}
.notify-team-row .notify-team-faction-logo{
  width:44px!important;
  height:44px!important;
  max-width:44px!important;
  max-height:44px!important;
  min-width:44px!important;
  flex:0 0 44px!important;
  margin-left:auto!important;
  margin-right:2px!important;
  transform:translateY(-4px)!important;
  object-fit:contain!important;
}
.notify-team-row:hover .notify-team-faction-logo{
  transform:translateY(-4px) scale(1.03)!important;
}

/* Hide ALL native delivery checkboxes, regardless of older card class names. */
.delivery-glow-card{
  position:relative!important;
  cursor:pointer!important;
}
.delivery-glow-card > input[type="checkbox"],
.delivery-glow-card input[type="checkbox"]{
  position:absolute!important;
  opacity:0!important;
  appearance:none!important;
  -webkit-appearance:none!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  min-height:1px!important;
  margin:0!important;
  padding:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
  clip-path:inset(50%)!important;
}

/* Gold selection language for all three delivery cards. */
.delivery-glow-card{
  transition:border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease!important;
}
.delivery-glow-card:hover{
  border-color:rgba(215,173,75,.55)!important;
}
.delivery-glow-card:has(input[type="checkbox"]:checked){
  border-color:#d9b24f!important;
  background:
    radial-gradient(circle at 18% 50%,rgba(218,177,72,.12),transparent 42%),
    linear-gradient(135deg,rgba(168,124,30,.14),rgba(9,20,35,.96))!important;
  box-shadow:
    0 0 0 1px rgba(217,178,79,.24),
    0 0 20px rgba(217,178,79,.25),
    inset 0 0 18px rgba(217,178,79,.055)!important;
}
.delivery-glow-card:has(input[type="checkbox"]:checked) .notification-channel-icon{
  filter:brightness(1.16) drop-shadow(0 0 7px rgba(217,178,79,.28))!important;
}

/* Proper compact Discord mark */
.discord-icon{
  background:#5865F2!important;
  color:#fff!important;
  display:grid!important;
  place-items:center!important;
}
.discord-svg{
  width:23px!important;
  height:18px!important;
  display:block!important;
  overflow:visible!important;
}

.delivery-glow-card.is-selected{
  border-color:#d9b24f!important;
  background:linear-gradient(135deg,rgba(168,124,30,.14),rgba(9,20,35,.96))!important;
  box-shadow:0 0 0 1px rgba(217,178,79,.24),0 0 20px rgba(217,178,79,.25),inset 0 0 18px rgba(217,178,79,.055)!important;
}


/* V10 — keep faction artwork fully inside compact team card */
.notify-team-row{
  position:relative!important;
  overflow:hidden!important;
  min-height:76px!important;
  height:76px!important;
  padding:10px 70px 10px 14px!important;
}
.notify-team-row .notify-team-faction-logo{
  position:absolute!important;
  right:14px!important;
  top:50%!important;
  margin:0!important;
  width:43px!important;
  height:43px!important;
  max-width:43px!important;
  max-height:43px!important;
  min-width:43px!important;
  object-fit:contain!important;
  transform:translateY(-50%)!important;
  z-index:1!important;
}
.notify-team-row:hover .notify-team-faction-logo{
  transform:translateY(-50%) scale(1.03)!important;
}

/* Use the Discord logo supplied by the user, without the hand-built face. */
.discord-face,.discord-svg,.discord-logo,.discord-mark{
  display:none!important;
}
.discord-icon{
  width:34px!important;
  height:34px!important;
  display:grid!important;
  place-items:center!important;
  padding:5px!important;
  box-sizing:border-box!important;
  border-radius:9px!important;
  background:#5865F2!important;
  overflow:hidden!important;
}
.discord-icon img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  margin:0!important;
  padding:0!important;
  filter:none!important;
}


/* V11 — clean Discord brand icon */
.discord-icon{
  width:36px!important;
  height:36px!important;
  padding:6px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:10px!important;
  background:#5865F2!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
.discord-icon img{
  display:block!important;
  width:24px!important;
  height:24px!important;
  object-fit:contain!important;
  margin:0!important;
  padding:0!important;
  filter:brightness(0) invert(1)!important;
}

/* V12 — unified portal navigation */
.portal-nav{
  position:relative;
  z-index:100;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.portal-nav .brand{
  position:relative;
  z-index:102;
}

.menu-toggle{
  display:flex;
  align-items:center;
  gap:11px;
  padding:11px 15px;
  border:1px solid rgba(148,163,184,.25);
  border-radius:12px;
  background:rgba(12,19,31,.82);
  backdrop-filter:blur(12px);
  color:#fff;
  font:inherit;
  font-size:13px;
  font-weight:850;
  letter-spacing:.08em;
  cursor:pointer;
  transition:.2s ease;
}

.menu-toggle:hover{
  border-color:rgba(124,92,255,.75);
  background:rgba(25,29,50,.94);
  box-shadow:0 0 24px rgba(124,92,255,.16);
}

.menu-icon{
  width:18px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.menu-icon i{
  display:block;
  width:100%;
  height:2px;
  border-radius:2px;
  background:#fff;
}

.portal-menu{
  position:fixed;
  inset:0;
  z-index:1000;
  pointer-events:none;
  visibility:hidden;
}

.portal-menu.open{
  pointer-events:auto;
  visibility:visible;
}

.portal-menu-backdrop{
  position:absolute;
  inset:0;
  background:rgba(2,6,12,.66);
  backdrop-filter:blur(5px);
  opacity:0;
  transition:opacity .22s ease;
}

.portal-menu.open .portal-menu-backdrop{
  opacity:1;
}

.portal-menu-panel{
  position:absolute;
  top:0;
  right:0;
  width:min(420px,100%);
  height:100%;
  padding:30px;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(circle at 100% 0%,rgba(124,92,255,.18),transparent 34%),
    linear-gradient(180deg,#111827 0%,#090e17 100%);
  border-left:1px solid rgba(148,163,184,.2);
  box-shadow:-30px 0 80px rgba(0,0,0,.45);
  transform:translateX(100%);
  transition:transform .26s ease;
  overflow-y:auto;
}

.portal-menu.open .portal-menu-panel{
  transform:translateX(0);
}

.portal-menu-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding-bottom:25px;
  border-bottom:1px solid rgba(148,163,184,.16);
}

.portal-menu-head strong{
  display:block;
  margin-top:7px;
  font-size:20px;
  letter-spacing:.05em;
}

.menu-close{
  width:42px;
  height:42px;
  flex:0 0 42px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:12px;
  background:rgba(255,255,255,.04);
  color:#fff;
  font-size:27px;
  line-height:1;
  cursor:pointer;
}

.portal-menu-links{
  display:flex;
  flex-direction:column;
  margin-top:22px;
}

.portal-menu-links a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:64px;
  padding:0 5px;
  border-bottom:1px solid rgba(148,163,184,.13);
  font-size:20px;
  font-weight:800;
  transition:.18s ease;
}

.portal-menu-links a span{
  color:#66758b;
  font-size:11px;
  letter-spacing:.12em;
}

.portal-menu-links a:hover{
  padding-left:12px;
  color:#c4b5fd;
}

.portal-menu-account{
  margin-top:auto;
  padding-top:30px;
}

.menu-account-btn{
  width:100%;
  text-align:center;
  justify-content:center;
}

body.portal-menu-open{
  overflow:hidden;
}

@media(max-width:760px){
  .portal-nav{
    padding:18px 0;
    align-items:center;
  }

  .portal-nav .brand{
    max-width:62%;
    font-size:12px;
    line-height:1.45;
  }

  .menu-toggle{
    padding:10px 13px;
  }

  .portal-menu-panel{
    width:100%;
    padding:24px 22px 28px;
  }

  .portal-menu-links a{
    min-height:60px;
    font-size:19px;
  }
}

/* V13 — Admin tools */
.admin-page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  margin-bottom:22px;
}

.admin-page-head h2{
  margin:6px 0 0;
  font-size:32px;
}

.admin-tools{
  margin-bottom:22px;
  padding:18px;
  border:1px solid rgba(148,163,184,.16);
  border-radius:18px;
  background:
    radial-gradient(circle at 100% 0%,rgba(124,92,255,.08),transparent 38%),
    rgba(12,18,29,.72);
  backdrop-filter:blur(10px);
}

.admin-tools-label{
  margin:0 0 12px 2px;
  color:#8c9bb0;
  font-size:11px;
  font-weight:850;
  letter-spacing:.16em;
}

.admin-tools-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px;
}

.admin-tool{
  min-width:0;
  min-height:70px;
  padding:13px 14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  border:1px solid rgba(148,163,184,.17);
  border-radius:13px;
  background:rgba(19,28,44,.78);
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.admin-tool span{
  overflow:hidden;
  color:#f4f7fb;
  font-size:14px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.admin-tool small{
  color:#718096;
  font-size:9px;
  font-weight:850;
  letter-spacing:.12em;
}

.admin-tool:hover{
  transform:translateY(-2px);
  border-color:rgba(124,92,255,.55);
  background:rgba(29,34,57,.92);
  box-shadow:0 8px 24px rgba(0,0,0,.18);
}

@media(max-width:900px){
  .admin-tools-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:600px){
  .admin-page-head{
    margin-bottom:18px;
  }

  .admin-page-head h2{
    font-size:28px;
  }

  .admin-tools{
    padding:14px;
  }

  .admin-tools-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px;
  }

  .admin-tool{
    min-height:66px;
    padding:11px 12px;
  }

  .admin-tool span{
    font-size:14px;
  }
}

/* V14 — mobile admin table containment */
@media(max-width:760px){

  /* Cards must never become wider than the viewport because of a table */
  .card{
    min-width:0;
    max-width:100%;
  }

  /* Any standard portal table becomes its own horizontal scroll area */
  .card > .table,
  .card > table.table{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
  }

  /* Preserve proper table sizing inside the scrollable table */
  .table thead,
  .table tbody{
    white-space:nowrap;
  }

  .table th,
  .table td{
    white-space:nowrap;
  }

  /* Long audit/details/error text should not force the entire page wider */
  .table td{
    max-width:320px;
  }

  /* Existing explicit table wrappers such as Delivery Log */
  .card > div[style*="overflow-x"]{
    width:100%;
    max-width:100%;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
  }
}

/* V14 — prevent page-level horizontal overflow */
html,
body{
  max-width:100%;
  overflow-x:hidden;
}

.wrap,
.section,
.grid{
  min-width:0;
  max-width:100%;
}

.grid > *,
.section > *{
  min-width:0;
}

/* V15 — remove nested scrolling on mobile */
@media(max-width:760px){
  .notification-team-grid{
    max-height:none !important;
    overflow:visible !important;
  }
}

/* V16 — custom portal selects */
.portal-select{
  position:relative;
  width:100%;
}

.portal-native-select{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

.portal-select-trigger{
  width:100%;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:13px 15px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#0b101a;
  color:#fff;
  font:inherit;
  text-align:left;
  cursor:pointer;
  transition:.18s ease;
}

.portal-select-trigger:hover,
.portal-select.open .portal-select-trigger{
  border-color:rgba(124,92,255,.72);
  box-shadow:0 0 0 3px rgba(124,92,255,.09);
}

.portal-select-value{
  font-weight:700;
}

.portal-select-arrow{
  color:#9caac0;
  font-size:20px;
  line-height:1;
  transition:transform .18s ease;
}

.portal-select.open .portal-select-arrow{
  transform:rotate(180deg);
}

.portal-select-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  z-index:300;
  display:none;
  padding:7px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:15px;
  background:linear-gradient(180deg,#151d2c,#0d131e);
  box-shadow:0 18px 50px rgba(0,0,0,.55);
}

.portal-select.open .portal-select-menu{
  display:block;
}

.portal-select-option{
  width:100%;
  min-height:62px;
  display:flex;
  align-items:center;
  gap:13px;
  padding:11px 12px;
  border:1px solid transparent;
  border-radius:11px;
  background:transparent;
  color:#fff;
  font:inherit;
  text-align:left;
  cursor:pointer;
}

.portal-select-option + .portal-select-option{
  margin-top:3px;
}

.portal-select-option:hover{
  background:rgba(255,255,255,.045);
}

.portal-select-option.selected{
  border-color:rgba(124,92,255,.42);
  background:rgba(124,92,255,.10);
}

.portal-select-radio{
  width:18px;
  height:18px;
  flex:0 0 18px;
  border:2px solid #75839a;
  border-radius:50%;
  position:relative;
}

.portal-select-option.selected .portal-select-radio{
  border-color:#a995ff;
  box-shadow:0 0 12px rgba(124,92,255,.35);
}

.portal-select-option.selected .portal-select-radio::after{
  content:"";
  position:absolute;
  inset:3px;
  border-radius:50%;
  background:#9d87ff;
}

.portal-select-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.portal-select-copy strong{
  font-size:14px;
}

.portal-select-copy small{
  color:#8796ac;
  font-size:11px;
  line-height:1.35;
}

@media(max-width:760px){
  .portal-select-menu{
    top:calc(100% + 6px);
  }

  .portal-select-option{
    min-height:65px;
  }

  .portal-select-copy strong{
    font-size:15px;
  }

  .portal-select-copy small{
    font-size:12px;
  }
}

/* V17 — mobile toast containment */
@media(max-width:760px){
  .portal-toast-stack{
    position:fixed !important;
    left:16px !important;
    right:16px !important;
    bottom:16px !important;
    width:auto !important;
    max-width:none !important;
    z-index:2000 !important;
  }

  .portal-toast{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  .portal-toast > div{
    min-width:0;
  }

  .portal-toast strong,
  .portal-toast div{
    overflow-wrap:anywhere;
    word-break:normal;
  }

  .portal-toast button{
    flex:0 0 auto;
  }
}

/* V18 — Entry Draw replacement rows */
.replace-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(120px,1.15fr);
    gap:8px;
    align-items:center;
    padding:12px 0;
    border-bottom:1px solid var(--line);
    min-width:0;
}

.replace-row > span{
    min-width:0;
    overflow-wrap:anywhere;
}

.replace-row select,
.replace-row input{
    width:100%;
    min-width:0;
    max-width:100%;
}

.replace-row .btn{
    width:100%;
}

/* Team name occupies the first column.
   Replacement controls use a clean second row. */
.replace-row > span{
    grid-column:1 / -1;
}

.replace-row select{
    grid-column:1;
}

.replace-row input{
    grid-column:2;
}

.replace-row .btn{
    grid-column:1 / -1;
}

@media(min-width:900px){
    .replace-row{
        grid-template-columns:minmax(0,.85fr) minmax(120px,1fr) minmax(140px,1.25fr) auto;
    }

    .replace-row > span,
    .replace-row select,
    .replace-row input,
    .replace-row .btn{
        grid-column:auto;
    }

    .replace-row .btn{
        width:auto;
    }
}

@media(max-width:600px){
    .replace-row{
        grid-template-columns:1fr;
    }

    .replace-row > span,
    .replace-row select,
    .replace-row input,
    .replace-row .btn{
        grid-column:1;
        width:100%;
    }
}

/* =========================================================
   V19 — TOURNAMENT BRACKET
   ========================================================= */

.bracket-page{
    max-width:1600px;
    margin:0 auto;
}

.bracket-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin:20px 0 26px;
    padding:12px 14px;
    border:1px solid rgba(130,155,210,.18);
    background:rgba(7,14,28,.72);
    border-radius:14px;
    backdrop-filter:blur(12px);
}

.bracket-status{
    display:flex;
    align-items:center;
    gap:9px;
    font-size:12px;
    font-weight:800;
    letter-spacing:.12em;
    color:#aab7cc;
}

.status-dot{
    width:9px;
    height:9px;
    border-radius:50%;
    background:#8a6cff;
    box-shadow:0 0 12px rgba(138,108,255,.75);
}

.status-dot.published{
    background:#49e39b;
    box-shadow:0 0 12px rgba(73,227,155,.7);
}

.tournament-bracket-scroll{
    width:100%;
    overflow-x:auto;
    overflow-y:visible;
    padding:10px 4px 40px;
    scrollbar-width:thin;
}

.tournament-bracket{
    display:flex;
    align-items:stretch;
    gap:62px;
    min-width:max-content;
    position:relative;
}

.tournament-round{
    width:300px;
    flex:0 0 300px;
    display:flex;
    flex-direction:column;
}

.round-heading{
    height:58px;
    margin-bottom:14px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    border-bottom:1px solid rgba(115,147,204,.2);
}

.round-heading span{
    color:#f5f8ff;
    font-size:18px;
    font-weight:900;
}

.round-heading small{
    margin-top:4px;
    color:#71839f;
    font-size:10px;
    letter-spacing:.14em;
    font-weight:800;
}

.round-matches{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:space-around;
    gap:28px;
}

.tournament-match{
    position:relative;
    width:300px;
    border:1px solid rgba(91,127,188,.32);
    border-radius:13px;
    padding:9px;
    background:
        linear-gradient(145deg,rgba(14,27,48,.97),rgba(5,12,24,.98));
    box-shadow:
        0 12px 30px rgba(0,0,0,.24),
        inset 0 1px rgba(255,255,255,.025);
    transition:.25s ease;
}

.tournament-match::after{
    content:"";
    position:absolute;
    right:-63px;
    top:50%;
    width:63px;
    height:1px;
    background:rgba(98,128,174,.32);
}

.tournament-round:last-of-type .tournament-match::after{
    display:none;
}

.tournament-match-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:1px 3px 8px;
    color:#8091aa;
    font-size:10px;
    font-weight:800;
    letter-spacing:.1em;
}

.bo-chip{
    display:inline-flex;
    justify-content:center;
    align-items:center;
    min-width:38px;
    height:21px;
    padding:0 7px;
    border-radius:6px;
    border:1px solid rgba(124,157,211,.28);
    color:#c5d1e4;
    background:rgba(17,31,53,.8);
}

.team-slot{
    position:relative;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin:4px 0;
    padding:7px 9px;
    border:1px solid transparent;
    border-radius:9px;
    overflow:hidden;
    transition:
        opacity .3s ease,
        filter .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}

.team-slot::before{
    content:"";
    position:absolute;
    inset:0;
    opacity:.75;
    pointer-events:none;
}

.team-identity{
    position:relative;
    z-index:1;
    min-width:0;
    display:flex;
    align-items:center;
    gap:9px;
    font-size:13px;
    font-weight:800;
}

.team-identity img{
    width:30px;
    height:30px;
    object-fit:contain;
    flex:0 0 30px;
    filter:drop-shadow(0 0 6px currentColor);
}

.team-identity span:last-child{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.team-score{
    position:relative;
    z-index:1;
    display:grid;
    place-items:center;
    flex:0 0 30px;
    width:30px;
    height:30px;
    border-radius:7px;
    font-size:15px;
    background:rgba(2,8,17,.52);
    border:1px solid rgba(255,255,255,.12);
}

.faction-conf{
    color:#d8edff;
    border-color:rgba(32,143,255,.38);
    background:
        linear-gradient(90deg,rgba(4,82,166,.58),rgba(4,32,71,.42));
}

.faction-conf::before{
    background:
        radial-gradient(circle at 10% 50%,rgba(28,148,255,.22),transparent 48%);
}

.faction-res{
    color:#ffe0e4;
    border-color:rgba(255,53,77,.38);
    background:
        linear-gradient(90deg,rgba(145,15,37,.62),rgba(58,7,18,.43));
}

.faction-res::before{
    background:
        radial-gradient(circle at 10% 50%,rgba(255,35,66,.22),transparent 48%);
}

.team-tbd{
    color:#75859d;
    border-color:rgba(111,131,164,.17);
    background:rgba(13,23,39,.5);
}

.tbd-emblem{
    width:30px;
    height:30px;
    flex:0 0 30px;
    display:grid;
    place-items:center;
    border:1px dashed rgba(127,149,183,.35);
    border-radius:50%;
    color:#687b99;
}

.team-winner.faction-conf{
    opacity:1;
    border-color:#249cff;
    box-shadow:
        0 0 8px rgba(35,151,255,.85),
        0 0 22px rgba(35,151,255,.32),
        inset 0 0 18px rgba(18,120,255,.15);
}

.team-winner.faction-res{
    opacity:1;
    border-color:#ff304e;
    box-shadow:
        0 0 8px rgba(255,45,75,.85),
        0 0 22px rgba(255,45,75,.32),
        inset 0 0 18px rgba(255,30,60,.15);
}

.team-loser{
    opacity:.28;
    filter:saturate(.28) brightness(.65);
}

.match-complete::after{
    height:2px;
    background:#ffcb55;
    box-shadow:
        0 0 5px #ffb82e,
        0 0 14px rgba(255,183,46,.75);
}

.match-foot{
    min-height:26px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:7px 3px 0;
    color:#71819a;
    font-size:9px;
    font-weight:800;
    letter-spacing:.07em;
}

.match-edit-toggle{
    appearance:none;
    border:0;
    padding:0;
    color:#bda8ff;
    background:none;
    cursor:pointer;
    font:inherit;
    letter-spacing:.07em;
}

.match-edit-toggle:hover{
    color:#fff;
}

.winner-strip{
    margin:7px -2px -2px;
    padding:6px 8px;
    border-radius:6px;
    color:#ffd878;
    background:rgba(109,72,5,.18);
    border:1px solid rgba(255,200,77,.18);
    font-size:9px;
    font-weight:900;
    letter-spacing:.09em;
}

.match-editor{
    display:none;
    margin-top:10px;
    padding-top:11px;
    border-top:1px solid rgba(111,138,181,.2);
}

.match-editor.open{
    display:block;
}

.bracket-edit-form{
    display:grid;
    gap:6px;
}

.bracket-edit-form label{
    margin-top:3px;
    color:#7f91ab;
    font-size:9px;
    font-weight:800;
    letter-spacing:.1em;
}

.bracket-edit-form select,
.bracket-edit-form input,
.bracket-result-form input{
    width:100%;
    min-width:0;
}

.bracket-result-form{
    display:grid;
    gap:7px;
    margin-top:12px;
    padding-top:11px;
    border-top:1px solid rgba(111,138,181,.18);
}

.result-title{
    color:#9bacc3;
    font-size:10px;
    font-weight:900;
    letter-spacing:.1em;
}

.result-team{
    display:grid;
    grid-template-columns:minmax(0,1fr) 58px;
    align-items:center;
    gap:8px;
    font-size:12px;
}

.result-team input{
    text-align:center;
}

.champion-column{
    width:240px;
    flex:0 0 240px;
    display:flex;
    flex-direction:column;
}

.champion-card{
    position:relative;
    margin:auto 0;
    min-height:250px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    border:1px solid #dba93f;
    border-radius:14px;
    background:
        radial-gradient(circle at 50% 30%,rgba(255,183,46,.18),transparent 52%),
        linear-gradient(145deg,rgba(41,27,7,.94),rgba(10,10,13,.98));
    box-shadow:
        0 0 10px rgba(255,187,51,.45),
        0 0 35px rgba(255,164,20,.18),
        inset 0 0 28px rgba(255,185,42,.08);
}

.champion-card img{
    width:76px;
    height:76px;
    object-fit:contain;
}

.champion-crown{
    color:#ffd45e;
    font-size:38px;
    filter:drop-shadow(0 0 8px rgba(255,196,55,.7));
}

.champion-card > span{
    color:#e3b94f;
    font-size:10px;
    font-weight:900;
    letter-spacing:.18em;
}

.champion-card strong{
    max-width:200px;
    text-align:center;
    color:#fff4d1;
    font-size:20px;
    overflow-wrap:anywhere;
}

/* mobile: keep rounds readable rather than shrinking the tree */
@media(max-width:700px){

    .bracket-toolbar{
        align-items:flex-start;
        flex-direction:column;
    }

    .bracket-toolbar .actions{
        width:100%;
    }

    .bracket-toolbar .actions > *{
        flex:1;
    }

    .tournament-bracket{
        gap:28px;
    }

    .tournament-round{
        width:280px;
        flex-basis:280px;
    }

    .tournament-match{
        width:280px;
    }

    .tournament-match::after{
        width:29px;
        right:-29px;
    }
}


/* V20 — compact empty bracket state */
.bracket-empty-actions{
    margin-top:22px;
    padding:16px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    border:1px solid rgba(120,145,195,.2);
    border-radius:13px;
    background:rgba(7,14,27,.65);
    backdrop-filter:blur(10px);
}

.bracket-empty-actions p{
    margin:7px 0 0;
    font-size:13px;
}

@media(max-width:650px){
    .bracket-empty-actions{
        align-items:stretch;
        flex-direction:column;
    }

    .bracket-empty-actions .btn{
        width:100%;
    }
}

/* V22 — round BO controls */
.round-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.round-title-row > span{
    min-width:0;
}

.round-bo-form{
    margin:0;
    flex:0 0 auto;
}

.round-bo-form select{
    appearance:none;
    -webkit-appearance:none;
    width:auto;
    min-width:62px;
    height:29px;
    margin:0;
    padding:0 24px 0 9px;
    border:1px solid rgba(112,155,221,.42);
    border-radius:7px;
    color:#dce9ff;
    background:
        linear-gradient(45deg,transparent 50%,#8fa9cc 50%) calc(100% - 11px) 11px/4px 4px no-repeat,
        linear-gradient(135deg,#8fa9cc 50%,transparent 50%) calc(100% - 7px) 11px/4px 4px no-repeat,
        rgba(11,25,44,.92);
    font-size:10px;
    font-weight:900;
    letter-spacing:.07em;
    cursor:pointer;
    box-shadow:none;
}

.round-bo-form select:hover{
    border-color:#8d72ff;
}

.round-heading-admin{
    height:64px;
}

/* =========================================================
   V23 — BRACKET CUSTOM TEAM PICKER
   ========================================================= */

.bracket-team-picker {
  position: relative;
  width: 100%;
}

.bracket-team-picker-trigger {
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid rgba(122, 92, 255, .32);
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(17,25,43,.98), rgba(9,14,27,.98));
  color: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.bracket-team-picker-trigger:hover {
  border-color: rgba(153, 122, 255, .7);
  box-shadow: 0 0 18px rgba(112, 74, 255, .12);
}

.picker-current {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.picker-current > span:last-child,
.picker-option-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.picker-current strong,
.picker-option-text strong {
  color: #f5f7ff;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-current small,
.picker-option-text small {
  color: #78859f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
}

.picker-chevron {
  color: #9b8cff;
  font-size: 18px;
  transition: transform .18s ease;
}

.bracket-team-picker.open .picker-chevron {
  transform: rotate(180deg);
}

.picker-faction-icon,
.picker-tbd-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.picker-faction-icon img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.picker-faction-icon.confederation {
  background: rgba(26, 133, 255, .13);
  border: 1px solid rgba(48, 153, 255, .38);
  box-shadow: inset 0 0 14px rgba(34,139,255,.12);
}

.picker-faction-icon.resistance {
  background: rgba(255, 54, 76, .12);
  border: 1px solid rgba(255, 72, 91, .36);
  box-shadow: inset 0 0 14px rgba(255,50,72,.1);
}

.picker-tbd-icon {
  color: #8290a8;
  border: 1px dashed rgba(135,148,174,.4);
  background: rgba(110,125,150,.08);
  font-weight: 900;
}

.bracket-team-picker-menu {
  display: none;
  position: absolute;
  z-index: 1000;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid rgba(120, 91, 255, .38);
  border-radius: 13px;
  background: rgba(7, 12, 24, .985);
  box-shadow:
    0 20px 50px rgba(0,0,0,.55),
    0 0 25px rgba(103,71,255,.1);
}

.bracket-team-picker.open .bracket-team-picker-menu {
  display: block;
}

.picker-search-wrap {
  position: sticky;
  top: -7px;
  z-index: 2;
  padding: 6px 2px 9px;
  background: rgba(7,12,24,.985);
}

.bracket-team-picker .picker-search {
  box-sizing: border-box;
  width: 100%;
  height: 39px;
  padding: 0 11px;
  border: 1px solid rgba(120, 135, 165, .22);
  border-radius: 8px;
  outline: none;
  background: #0c1424;
  color: #f5f7ff;
  font-size: 12px;
}

.bracket-team-picker .picker-search:focus {
  border-color: #8069ff;
}

.picker-option {
  width: 100%;
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.picker-option + .picker-option {
  margin-top: 3px;
}

.picker-option:hover {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.07);
}

.picker-option.confederation:hover {
  background: rgba(28,132,255,.09);
  border-color: rgba(46,148,255,.24);
}

.picker-option.resistance:hover {
  background: rgba(255,50,72,.08);
  border-color: rgba(255,70,90,.23);
}

.picker-option-text {
  flex: 1;
}

.picker-check {
  opacity: 0;
  color: #a893ff;
  font-size: 16px;
  font-weight: 900;
}

.picker-option.selected .picker-check {
  opacity: 1;
}

.picker-option.selected {
  background: rgba(120, 87, 255, .1);
  border-color: rgba(137, 107, 255, .34);
}

@media (max-width: 650px) {
  .bracket-team-picker-menu {
    position: fixed;
    z-index: 99999;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-height: min(68vh, 520px);
    border-radius: 17px;
    padding: 9px;
  }

  .picker-option {
    min-height: 57px;
  }

  .picker-current strong,
  .picker-option-text strong {
    font-size: 12px;
  }
}


/* =========================================================
   V24 — COMPACT BRACKET ADMIN TOOLBAR
   ========================================================= */

.bracket-toolbar{
    padding:14px 16px;
    gap:14px;
    min-height:0;
}

.bracket-toolbar .actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex-wrap:wrap;
    gap:8px;
}

.bracket-toolbar .actions form{
    display:flex;
    margin:0;
    padding:0;
    width:auto;
    flex:none;
}

.bracket-toolbar .actions .btn{
    width:auto;
    min-width:0;
    min-height:38px;
    height:38px;
    padding:0 15px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    border-radius:9px;

    font-size:11px;
    font-weight:850;
    line-height:1;
    letter-spacing:.045em;
    white-space:nowrap;

    text-decoration:none;
}

/* Primary publish action */
.bracket-toolbar .actions .btn.primary{
    padding-left:17px;
    padding-right:17px;
    box-shadow:
        0 0 18px rgba(116,78,255,.16),
        inset 0 1px 0 rgba(255,255,255,.08);
}

/* Public bracket */
.bracket-toolbar .actions > a.btn{
    background:rgba(18,27,47,.88);
    border:1px solid rgba(124,145,188,.22);
}

.bracket-toolbar .actions > a.btn:hover{
    border-color:rgba(147,125,255,.55);
    background:rgba(25,34,57,.96);
}

/* Reset should be clearly destructive, but not visually dominant */
.bracket-toolbar .actions .danger-action{
    height:36px;
    padding:0 13px;

    background:rgba(177,48,67,.14);
    border:1px solid rgba(239,75,96,.35);
    color:#ff7f91;

    box-shadow:none;
}

.bracket-toolbar .actions .danger-action:hover{
    background:rgba(204,51,73,.23);
    border-color:rgba(255,87,108,.65);
    color:#ff9aa8;
}

/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media(max-width:700px){

    .bracket-toolbar{
        padding:12px;
        gap:11px;
        align-items:stretch;
        flex-direction:column;
    }

    .bracket-toolbar .bracket-status{
        min-height:24px;
    }

    .bracket-toolbar .actions{
        width:100%;
        display:grid;

        /* Publish gets slightly more room than the others */
        grid-template-columns:1.25fr 1fr auto;

        gap:7px;
        align-items:stretch;
    }

    /* override the older flex:1 rule */
    .bracket-toolbar .actions > *{
        flex:none;
        width:auto;
        min-width:0;
    }

    .bracket-toolbar .actions form{
        width:100%;
    }

    .bracket-toolbar .actions .btn{
        width:100%;
        height:40px;
        min-height:40px;
        padding:0 9px;

        border-radius:9px;

        font-size:9px;
        letter-spacing:.025em;
        line-height:1.05;
        white-space:nowrap;
    }

    .bracket-toolbar .actions .danger-action{
        width:auto;
        min-width:62px;
        padding:0 10px;
    }
}

/* Very narrow phones */
@media(max-width:390px){

    .bracket-toolbar .actions{
        grid-template-columns:1fr 1fr;
    }

    .bracket-toolbar .actions form:last-child{
        grid-column:1 / -1;
        width:auto;
        justify-self:end;
    }

    .bracket-toolbar .actions .danger-action{
        width:auto;
    }
}


/* =========================================================
   V26 — BRACKET NOTIFICATION CONTROL
   ========================================================= */

.bracket-toolbar .bracket-notify-btn{
    white-space:nowrap;
    width:auto;
    min-width:0;
    padding-left:14px;
    padding-right:14px;
}

@media (max-width:700px){
    .bracket-toolbar .bracket-notify-btn{
        width:100%;
        padding-left:10px;
        padding-right:10px;
        font-size:11px;
    }
}

/* =========================================================
   V27 — BRACKET MATCH EDITOR CONTROLS
   ========================================================= */

.bracket-format-picker{
    position:relative;
    width:100%;
}

.bracket-format-trigger{
    width:100%;
    min-height:58px;
    padding:10px 13px;
    border:1px solid rgba(125,92,255,.38);
    border-radius:11px;
    background:rgba(10,18,37,.96);
    color:#f5f7ff;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    text-align:left;
    cursor:pointer;
    font:inherit;
    transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.bracket-format-trigger:hover,
.bracket-format-picker.open .bracket-format-trigger{
    border-color:rgba(132,91,255,.8);
    background:rgba(14,22,44,.98);
    box-shadow:0 0 0 2px rgba(123,78,255,.08);
}

.bracket-format-trigger strong{
    display:block;
    font-size:13px;
    line-height:1.2;
    color:#f7f8ff;
}

.bracket-format-trigger small{
    display:block;
    margin-top:4px;
    color:#77829d;
    font-size:9px;
    font-weight:800;
    letter-spacing:.11em;
    text-transform:uppercase;
}

.format-chevron{
    color:#9b7cff;
    font-size:16px;
    line-height:1;
    transition:transform .18s ease;
}

.bracket-format-picker.open .format-chevron{
    transform:rotate(180deg);
}

.bracket-format-menu{
    position:absolute;
    z-index:80;
    left:0;
    right:0;
    top:calc(100% + 6px);
    display:none;
    padding:6px;
    border:1px solid rgba(125,92,255,.4);
    border-radius:11px;
    background:#0a1225;
    box-shadow:0 16px 35px rgba(0,0,0,.45);
}

.bracket-format-picker.open .bracket-format-menu{
    display:block;
}

.bracket-format-option{
    width:100%;
    min-height:48px;
    padding:8px 10px;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#e9edff;
    display:flex;
    align-items:center;
    justify-content:space-between;
    text-align:left;
    cursor:pointer;
    font:inherit;
}

.bracket-format-option:hover,
.bracket-format-option.selected{
    background:rgba(123,78,255,.12);
}

.bracket-format-option strong{
    display:block;
    font-size:12px;
}

.bracket-format-option small{
    display:block;
    margin-top:2px;
    color:#78849e;
    font-size:9px;
    font-weight:800;
    letter-spacing:.1em;
}

.format-check{
    color:#9c7cff;
    opacity:0;
    font-weight:900;
}

.bracket-format-option.selected .format-check{
    opacity:1;
}


/* Schedule */

.bracket-schedule-field{
    position:relative;
    width:100%;
}

.bracket-schedule-field input[type="datetime-local"]{
    box-sizing:border-box;
    width:100%;
    min-width:0;
    height:48px;
    padding:0 12px;
    border:1px solid rgba(125,92,255,.38);
    border-radius:11px;
    outline:none;
    background:#0a1225;
    color:#eef1ff;
    color-scheme:dark;
    font:inherit;
    font-size:12px;
    font-weight:700;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.bracket-schedule-field input[type="datetime-local"]:focus{
    border-color:#815cff;
    box-shadow:0 0 0 2px rgba(129,92,255,.12);
}

.bracket-schedule-field input[type="datetime-local"]::-webkit-calendar-picker-indicator{
    cursor:pointer;
    opacity:.72;
    filter:invert(1);
}

@media (max-width:700px){
    .bracket-format-trigger{
        min-height:56px;
    }

    .bracket-format-menu{
        max-height:240px;
        overflow-y:auto;
    }

    .bracket-schedule-field input[type="datetime-local"]{
        height:48px;
        font-size:12px;
    }
}

/* =========================================================
   V28 — KEEP MATCH EDITOR COMPLETELY INSIDE MATCH CARD
   ========================================================= */

.tournament-match,
.match-editor,
.bracket-edit-form,
.bracket-result-form{
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}

.match-editor{
    overflow:visible;
}

.bracket-edit-form{
    display:flex;
    flex-direction:column;
    min-width:0;
}

.bracket-edit-form > *{
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
}

.bracket-team-picker,
.bracket-format-picker,
.bracket-schedule-field{
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}

.bracket-team-picker [data-team-trigger],
.bracket-format-trigger,
.bracket-schedule-field input[type="datetime-local"],
.bracket-edit-form > .btn{
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}

/* Custom popup menus may open downward,
   but may never become wider than the match editor. */
.bracket-team-picker [data-team-menu],
.bracket-format-menu{
    box-sizing:border-box;
    left:0;
    right:0;
    width:100%;
    max-width:100%;
}

@media (max-width:700px){
    .tournament-match{
        min-width:0;
    }

    .match-editor{
        width:100%;
        max-width:100%;
        min-width:0;
    }

    .bracket-edit-form{
        width:100%;
        max-width:100%;
        min-width:0;
    }
}

/* =========================================================
   V29 — BRACKET TEAM INFO MODAL
   ========================================================= */

.team-info-clickable{
    cursor:pointer;
    transition:
        transform .16s ease,
        filter .16s ease,
        border-color .16s ease;
}

.team-info-clickable:hover{
    filter:brightness(1.08);
}

.team-info-clickable:active{
    transform:scale(.99);
}

.team-info-modal{
    position:fixed;
    inset:0;
    z-index:5000;
    display:none;
    align-items:center;
    justify-content:center;
    padding:18px;
}

.team-info-modal.open{
    display:flex;
}

.team-info-backdrop{
    position:absolute;
    inset:0;
    background:rgba(2,6,15,.78);
    backdrop-filter:blur(7px);
    -webkit-backdrop-filter:blur(7px);
}

.team-info-card{
    --team-accent:#805dff;
    --team-accent-soft:rgba(128,93,255,.16);

    position:relative;
    z-index:1;
    box-sizing:border-box;
    width:min(430px,100%);
    max-height:min(680px,88vh);
    overflow:auto;

    padding:22px;

    border:1px solid color-mix(in srgb,var(--team-accent) 58%,transparent);
    border-radius:18px;

    background:
        radial-gradient(circle at 15% 0%,var(--team-accent-soft),transparent 38%),
        linear-gradient(160deg,#0d172b 0%,#080f20 100%);

    box-shadow:
        0 25px 70px rgba(0,0,0,.6),
        0 0 28px color-mix(in srgb,var(--team-accent) 12%,transparent);
}

.team-info-card.team-info-conf{
    --team-accent:#3498ff;
    --team-accent-soft:rgba(52,152,255,.15);
}

.team-info-card.team-info-res{
    --team-accent:#ff344f;
    --team-accent-soft:rgba(255,52,79,.14);
}

.team-info-close{
    position:absolute;
    top:12px;
    right:12px;

    width:34px;
    height:34px;

    border:1px solid rgba(255,255,255,.1);
    border-radius:9px;

    background:rgba(5,10,21,.72);
    color:#cbd3e8;

    font-size:21px;
    line-height:1;
    cursor:pointer;
}

.team-info-header{
    display:flex;
    align-items:center;
    gap:14px;
    padding-right:38px;
    margin-bottom:22px;
}

.team-info-emblem{
    display:grid;
    place-items:center;
    width:60px;
    height:60px;
    flex:0 0 60px;

    border:1px solid color-mix(in srgb,var(--team-accent) 55%,transparent);
    border-radius:15px;

    background:color-mix(in srgb,var(--team-accent) 10%,#07101f);
}

.team-info-emblem img{
    width:43px;
    height:43px;
    object-fit:contain;
    filter:drop-shadow(0 0 6px var(--team-accent));
}

.team-info-heading{
    min-width:0;
}

.team-info-heading small{
    display:block;
    margin-bottom:5px;

    color:var(--team-accent);
    font-size:9px;
    font-weight:900;
    letter-spacing:.15em;
    text-transform:uppercase;
}

.team-info-heading h2{
    margin:0;
    color:#f7f9ff;
    font-size:19px;
    line-height:1.15;
    overflow-wrap:anywhere;
}

.team-info-section{
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid rgba(255,255,255,.08);
}

.team-info-label{
    margin-bottom:9px;
    color:#74809b;
    font-size:9px;
    font-weight:900;
    letter-spacing:.14em;
}

.team-info-leader{
    padding:11px 12px;

    border:1px solid color-mix(in srgb,var(--team-accent) 25%,transparent);
    border-radius:9px;

    background:color-mix(in srgb,var(--team-accent) 6%,#08101f);
    color:#f1f4ff;

    font-size:13px;
    font-weight:800;
}

.team-info-roster{
    display:grid;
    gap:7px;
}

.team-info-player{
    display:flex;
    align-items:center;
    gap:10px;

    min-height:42px;
    padding:7px 10px;

    border:1px solid rgba(255,255,255,.07);
    border-radius:9px;

    background:rgba(255,255,255,.025);
}

.team-info-player-number{
    display:grid;
    place-items:center;

    width:27px;
    height:27px;
    flex:0 0 27px;

    border-radius:7px;

    background:var(--team-accent-soft);
    color:var(--team-accent);

    font-size:9px;
    font-weight:900;
}

.team-info-player strong{
    min-width:0;
    color:#e9edfa;
    font-size:12px;
    overflow-wrap:anywhere;
}

body.team-modal-open{
    overflow:hidden;
}

@media(max-width:600px){
    .team-info-modal{
        align-items:flex-end;
        padding:10px;
    }

    .team-info-card{
        width:100%;
        max-height:82vh;
        padding:19px 16px 18px;
        border-radius:18px 18px 13px 13px;
    }

    .team-info-emblem{
        width:54px;
        height:54px;
        flex-basis:54px;
    }

    .team-info-emblem img{
        width:39px;
        height:39px;
    }

    .team-info-heading h2{
        font-size:17px;
    }
}


/* ==========================================================
   V30 — MATCH CHAT
   ========================================================== */

.match-foot{
    gap:8px;
}

.match-foot-status{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
}

.match-chat-button{
    appearance:none;
    border:1px solid rgba(171,116,255,.42);
    background:
        linear-gradient(180deg,
        rgba(130,73,210,.22),
        rgba(73,35,126,.18));
    color:#d9c5ff;
    height:27px;
    padding:0 10px;
    border-radius:6px;
    font:700 10px/1 inherit;
    letter-spacing:.12em;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    cursor:pointer;
    flex:0 0 auto;
    transition:
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.match-chat-button:hover{
    border-color:rgba(190,146,255,.8);
    background:rgba(129,72,211,.30);
    box-shadow:0 0 16px rgba(133,73,220,.18);
    transform:translateY(-1px);
}

.match-chat-icon{
    font-size:8px;
    color:#ad79ff;
    text-shadow:0 0 8px rgba(174,120,255,.8);
}


/* Modal */

.match-chat-modal{
    position:fixed;
    inset:0;
    z-index:10050;
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.match-chat-modal.open{
    display:flex;
}

.match-chat-backdrop{
    position:absolute;
    inset:0;
    background:rgba(3,4,10,.80);
    backdrop-filter:blur(8px);
}

.match-chat-panel{
    position:relative;
    z-index:1;
    width:min(720px,100%);
    height:min(720px,calc(100vh - 48px));
    display:flex;
    flex-direction:column;
    overflow:hidden;

    border:1px solid rgba(161,107,255,.30);
    border-radius:14px;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(104,52,176,.18),
            transparent 35%
        ),
        linear-gradient(
            180deg,
            rgba(16,17,29,.99),
            rgba(8,9,17,.99)
        );

    box-shadow:
        0 30px 90px rgba(0,0,0,.68),
        0 0 40px rgba(106,53,181,.10);
}


/* Header */

.match-chat-header{
    padding:20px 22px 16px;
    border-bottom:1px solid rgba(255,255,255,.07);
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
}

.match-chat-kicker{
    color:#9b72d9;
    font-size:9px;
    font-weight:800;
    letter-spacing:.20em;
    margin-bottom:5px;
}

.match-chat-header h2{
    margin:0;
    font-size:20px;
    letter-spacing:.07em;
}

.match-chat-versus{
    margin-top:7px;
    display:flex;
    align-items:center;
    gap:8px;
    color:#b9b8c5;
    font-size:11px;
    font-weight:700;
}

.match-chat-versus small{
    color:#6d6b7b;
    font-size:8px;
}

.match-chat-close{
    width:34px;
    height:34px;
    flex:0 0 34px;
    border-radius:8px;
    border:1px solid rgba(255,255,255,.09);
    background:rgba(255,255,255,.035);
    color:#aaa8b6;
    font-size:23px;
    line-height:1;
    cursor:pointer;
}

.match-chat-close:hover{
    color:white;
    border-color:rgba(190,145,255,.45);
}


/* Security notice */

.match-chat-security{
    padding:9px 22px;
    border-bottom:1px solid rgba(255,255,255,.055);
    background:rgba(116,69,177,.055);
    color:#777585;
    font-size:10px;
    letter-spacing:.025em;
}


/* Messages */

.match-chat-messages{
    flex:1;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:20px 20px 12px;
    scrollbar-width:thin;
}

.match-chat-loading,
.match-chat-empty{
    height:100%;
    min-height:180px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    color:#666573;
}

.match-chat-empty strong{
    margin-top:10px;
    color:#898794;
    font-size:11px;
    letter-spacing:.12em;
}

.match-chat-empty span{
    margin-top:5px;
    font-size:11px;
}

.match-chat-empty-icon{
    color:#9160d6;
    font-size:28px;
    opacity:.65;
}

.match-chat-row{
    display:flex;
    margin-bottom:13px;
}

.match-chat-row.mine{
    justify-content:flex-end;
}

.match-chat-row.opponent,
.match-chat-row.staff{
    justify-content:flex-start;
}

.match-chat-bubble{
    width:auto;
    max-width:min(76%,520px);
    min-width:150px;
    padding:11px 13px 9px;
    border-radius:10px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.035);
}

.match-chat-row.mine .match-chat-bubble{
    background:rgba(119,72,185,.13);
    border-color:rgba(164,110,241,.28);
}

.match-chat-row.confederation:not(.mine) .match-chat-bubble{
    background:rgba(42,105,198,.10);
    border-color:rgba(69,137,239,.25);
}

.match-chat-row.resistance:not(.mine) .match-chat-bubble{
    background:rgba(191,49,65,.09);
    border-color:rgba(229,69,86,.24);
}

.match-chat-row.staff .match-chat-bubble{
    background:rgba(126,75,198,.13);
    border-color:rgba(175,116,255,.30);
    box-shadow:inset 3px 0 0 rgba(166,104,255,.50);
}

.match-chat-meta{
    display:flex;
    align-items:center;
    gap:7px;
    margin-bottom:6px;
}

.match-chat-meta strong{
    color:#d9d8df;
    font-size:11px;
}

.match-chat-meta span{
    color:#666471;
    font-size:7px;
    font-weight:800;
    letter-spacing:.10em;
}

.match-chat-row.confederation .match-chat-meta strong{
    color:#76aefc;
}

.match-chat-row.resistance .match-chat-meta strong{
    color:#ff7885;
}

.match-chat-row.staff .match-chat-meta strong{
    color:#c7a2ff;
}

.match-chat-text{
    color:#d0cfd6;
    font-size:13px;
    line-height:1.48;
    overflow-wrap:anywhere;
}

.match-chat-bubble time{
    display:block;
    margin-top:7px;
    color:#575663;
    font-size:8px;
    text-align:right;
}


/* Composer */

.match-chat-compose{
    padding:12px 14px 6px;
    display:flex;
    align-items:flex-end;
    gap:9px;
    border-top:1px solid rgba(255,255,255,.065);
    background:rgba(5,6,12,.68);
}

.match-chat-compose textarea{
    flex:1;
    resize:none;
    min-height:40px;
    max-height:140px;
    padding:11px 12px;

    border:1px solid rgba(255,255,255,.09);
    border-radius:8px;

    background:rgba(255,255,255,.035);
    color:#eeeef2;

    font:inherit;
    font-size:13px;
    line-height:1.35;

    outline:none;
}

.match-chat-compose textarea:focus{
    border-color:rgba(171,111,255,.50);
    box-shadow:0 0 0 2px rgba(136,75,221,.08);
}

.match-chat-compose textarea::placeholder{
    color:#5d5c68;
}

.match-chat-compose button{
    height:40px;
    padding:0 17px;
    border:1px solid rgba(174,113,255,.45);
    border-radius:8px;
    background:linear-gradient(
        180deg,
        rgba(129,72,208,.36),
        rgba(83,43,145,.30)
    );
    color:#dfccff;
    font-size:10px;
    font-weight:800;
    letter-spacing:.12em;
    cursor:pointer;
}

.match-chat-compose button:hover{
    border-color:rgba(195,151,255,.75);
}

.match-chat-compose button:disabled{
    opacity:.5;
    cursor:wait;
}

.match-chat-compose-foot{
    padding:0 15px 10px;
    display:flex;
    justify-content:space-between;
    gap:12px;
    background:rgba(5,6,12,.68);
    color:#4e4d59;
    font-size:7px;
    font-weight:700;
    letter-spacing:.08em;
}

body.match-chat-open{
    overflow:hidden;
}


/* Mobile */

@media (max-width:600px){

    .match-chat-modal{
        padding:0;
        align-items:flex-end;
    }

    .match-chat-panel{
        width:100%;
        height:min(82vh,720px);
        max-height:82vh;
        border-radius:16px 16px 0 0;
        border-left:0;
        border-right:0;
        border-bottom:0;
    }

    .match-chat-header{
        padding:16px 16px 13px;
    }

    .match-chat-header h2{
        font-size:17px;
    }

    .match-chat-security{
        padding:8px 16px;
        font-size:9px;
    }

    .match-chat-messages{
        padding:15px 12px 8px;
    }

    .match-chat-bubble{
        max-width:86%;
    }

    .match-chat-compose{
        padding:10px 10px 5px;
    }

    .match-chat-compose button{
        padding:0 13px;
    }

    .match-chat-compose-foot{
        padding:0 11px 9px;
    }

    .match-chat-compose-foot span:first-child{
        display:none;
    }

    .match-chat-compose-foot{
        justify-content:flex-end;
    }
}



/* ==========================================================
   V32 — TOURNAMENT CHAT
   ========================================================== */

.tournament-chat-page{
    max-width:1000px;
    margin:0 auto;
}

.tournament-chat-heading{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:20px;
    margin-bottom:20px;
}

.tournament-chat-heading h1{
    margin-bottom:5px;
}

.tournament-chat-live{
    display:flex;
    align-items:center;
    gap:7px;
    padding:7px 10px;
    border:1px solid rgba(112,220,158,.18);
    border-radius:7px;
    background:rgba(65,174,112,.055);
    color:#73d89c;
    font-size:9px;
    font-weight:800;
    letter-spacing:.14em;
}

.tournament-chat-live span{
    width:6px;
    height:6px;
    border-radius:50%;
    background:#6ed696;
    box-shadow:0 0 8px rgba(110,214,150,.7);
}


.tournament-chat-shell{
    height:min(690px,calc(100vh - 220px));
    min-height:500px;

    display:flex;
    flex-direction:column;

    overflow:hidden;

    border:1px solid rgba(155,104,229,.20);
    border-radius:13px;

    background:
        radial-gradient(
            circle at 50% 0,
            rgba(99,51,163,.10),
            transparent 35%
        ),
        rgba(10,11,19,.91);

    box-shadow:
        0 24px 70px rgba(0,0,0,.25);
}


.tournament-chat-notice{
    padding:10px 16px;

    border-bottom:
        1px solid rgba(255,255,255,.055);

    background:
        rgba(112,67,173,.045);

    color:#6f6d7b;

    font-size:9px;
    letter-spacing:.035em;
}

.tournament-chat-notice span{
    color:#9563dc;
    margin-right:6px;
}


.tournament-chat-messages{
    flex:1;
    min-height:0;

    overflow-y:auto;
    overscroll-behavior:contain;

    padding:22px 22px 14px;

    scrollbar-width:thin;
}


.tournament-chat-empty{
    height:100%;
    min-height:220px;

    display:flex;
    flex-direction:column;

    justify-content:center;
    align-items:center;

    text-align:center;

    color:#5c5b67;
}

.tournament-chat-empty div{
    color:#8e5bd5;
    font-size:30px;
    opacity:.65;
}

.tournament-chat-empty strong{
    margin-top:10px;

    color:#85838f;

    font-size:10px;
    letter-spacing:.15em;
}

.tournament-chat-empty span{
    margin-top:5px;
    font-size:11px;
}


.tournament-chat-row{
    display:flex;
    margin-bottom:14px;
}

.tournament-chat-row.mine{
    justify-content:flex-end;
}

.tournament-chat-row.other,
.tournament-chat-row.staff{
    justify-content:flex-start;
}


.tournament-chat-bubble{
    max-width:min(72%,560px);
    min-width:160px;

    padding:11px 13px 9px;

    border-radius:10px;

    border:
        1px solid rgba(255,255,255,.075);

    background:
        rgba(255,255,255,.032);
}


.tournament-chat-row.mine
.tournament-chat-bubble{
    border-color:
        rgba(160,105,239,.27);

    background:
        rgba(116,69,181,.12);
}


.tournament-chat-row.confederation:not(.mine)
.tournament-chat-bubble{
    border-color:
        rgba(66,137,238,.24);

    background:
        rgba(43,106,198,.09);
}


.tournament-chat-row.resistance:not(.mine)
.tournament-chat-bubble{
    border-color:
        rgba(228,68,86,.23);

    background:
        rgba(190,49,64,.08);
}


.tournament-chat-row.staff
.tournament-chat-bubble{
    border-color:
        rgba(177,116,255,.30);

    background:
        rgba(126,74,199,.12);

    box-shadow:
        inset 3px 0 0
        rgba(166,103,255,.48);
}


.tournament-chat-meta{
    display:flex;
    align-items:center;

    gap:7px;

    margin-bottom:6px;
}


.tournament-chat-meta strong{
    color:#dad9e0;
    font-size:11px;
}


.tournament-chat-meta span{
    color:#64626e;

    font-size:7px;
    font-weight:800;

    letter-spacing:.11em;
}


.tournament-chat-row.confederation
.tournament-chat-meta strong{
    color:#79b0ff;
}


.tournament-chat-row.resistance
.tournament-chat-meta strong{
    color:#ff7886;
}


.tournament-chat-row.staff
.tournament-chat-meta strong{
    color:#c8a4ff;
}


.tournament-chat-text{
    color:#d3d2d8;

    font-size:13px;
    line-height:1.5;

    overflow-wrap:anywhere;
}


.tournament-chat-bubble time{
    display:block;

    margin-top:7px;

    color:#55545f;

    font-size:8px;

    text-align:right;
}


.tournament-chat-compose{
    padding:12px 14px 6px;

    display:flex;
    align-items:flex-end;

    gap:9px;

    border-top:
        1px solid rgba(255,255,255,.06);

    background:
        rgba(5,6,12,.70);
}


.tournament-chat-compose textarea{
    flex:1;

    min-height:41px;
    max-height:150px;

    resize:none;

    padding:11px 12px;

    border:
        1px solid rgba(255,255,255,.09);

    border-radius:8px;

    outline:none;

    background:
        rgba(255,255,255,.035);

    color:#eeeeF2;

    font:inherit;
    font-size:13px;
    line-height:1.4;
}


.tournament-chat-compose textarea:focus{
    border-color:
        rgba(169,109,250,.48);

    box-shadow:
        0 0 0 2px
        rgba(133,73,216,.07);
}


.tournament-chat-compose textarea::placeholder{
    color:#5d5c68;
}


.tournament-chat-compose button{
    height:41px;

    padding:0 18px;

    border:
        1px solid rgba(174,113,255,.44);

    border-radius:8px;

    background:
        linear-gradient(
            180deg,
            rgba(129,72,208,.36),
            rgba(83,43,145,.30)
        );

    color:#dfccff;

    font-size:10px;
    font-weight:800;

    letter-spacing:.12em;

    cursor:pointer;
}


.tournament-chat-compose button:disabled{
    opacity:.5;
    cursor:wait;
}


.tournament-chat-compose-foot{
    padding:0 15px 10px;

    display:flex;
    justify-content:space-between;

    gap:12px;

    background:
        rgba(5,6,12,.70);

    color:#4e4d59;

    font-size:7px;
    font-weight:700;

    letter-spacing:.08em;
}


@media(max-width:600px){

    .tournament-chat-page{
        padding-left:0;
        padding-right:0;
    }

    .tournament-chat-heading{
        padding:0 4px;
        align-items:flex-start;
    }

    .tournament-chat-live{
        margin-top:5px;
    }

    .tournament-chat-shell{
        height:calc(100vh - 205px);
        min-height:430px;

        border-radius:10px;
    }

    .tournament-chat-messages{
        padding:15px 10px 9px;
    }

    .tournament-chat-bubble{
        max-width:87%;
    }

    .tournament-chat-compose{
        padding:10px 9px 5px;
    }

    .tournament-chat-compose button{
        padding:0 13px;
    }

    .tournament-chat-compose-foot{
        justify-content:flex-end;
        padding:0 10px 8px;
    }

    .tournament-chat-compose-foot
    span:first-child{
        display:none;
    }
}



/* ==========================================================
   V33 — CHAT UNREAD BADGE
   ========================================================== */

.tournament-chat-menu-link{
    display:flex !important;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.tournament-chat-menu-label{
    min-width:0;
}

.tournament-chat-menu-right{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    flex:0 0 auto;
}

.tournament-chat-unread-badge{
    min-width:20px;
    height:20px;
    padding:0 6px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    border:1px solid rgba(190,135,255,.55);
    border-radius:999px;

    background:
        linear-gradient(
            180deg,
            rgba(145,77,232,.92),
            rgba(102,49,177,.92)
        );

    color:#fff;

    font-size:9px;
    font-weight:900;
    line-height:1;

    letter-spacing:0;

    box-shadow:
        0 0 12px rgba(145,78,230,.30);
}

.tournament-chat-unread-badge[hidden]{
    display:none !important;
}



/* ==========================================================
   V34 — MATCH CHAT BUTTON
   ========================================================== */

.match-foot{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.match-foot-status{
    min-width:0;
    flex:1;
}

.match-foot-status > span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}


.match-chat-button{
    flex:0 0 auto;

    height:28px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    gap:5px;

    padding:0 9px;

    border:
        1px solid rgba(165,105,246,.28);

    border-radius:6px;

    background:
        linear-gradient(
            180deg,
            rgba(116,65,187,.14),
            rgba(75,38,129,.11)
        );

    color:#b991ef;

    font-size:8px;
    font-weight:900;

    letter-spacing:.10em;

    cursor:pointer;

    transition:
        border-color .15s ease,
        background .15s ease,
        color .15s ease,
        box-shadow .15s ease;
}


.match-chat-button span{
    color:#9560dd;

    font-size:7px;

    filter:
        drop-shadow(
            0 0 4px
            rgba(150,91,225,.45)
        );
}


.match-chat-button:hover{
    border-color:
        rgba(181,121,255,.50);

    background:
        rgba(122,68,197,.20);

    color:#dcc5ff;

    box-shadow:
        0 0 12px
        rgba(118,63,193,.12);
}


.match-chat-button:focus-visible{
    outline:
        2px solid
        rgba(177,117,255,.50);

    outline-offset:2px;
}


@media(max-width:600px){

    .match-foot{
        gap:6px;
    }

    .match-chat-button{
        height:27px;

        padding:0 8px;

        font-size:7px;
    }

}



/* ==========================================================
   V35 — MATCH CHAT UNREAD
   ========================================================== */

.match-foot-status{
    min-width:0;
    flex:1;
}

.match-chat-button-label{
    display:inline-block;
}

.match-chat-unread{
    min-width:17px;
    height:17px;
    padding:0 5px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    border-radius:999px;

    background:rgba(158,92,235,.92);
    border:1px solid rgba(213,177,255,.40);

    color:#fff;

    font-size:8px;
    font-weight:900;
    line-height:1;

    box-shadow:
        0 0 9px rgba(153,86,232,.35);
}

.match-chat-unread[hidden]{
    display:none !important;
}



/* ==========================================================
   V36 — RESULT CORRECTION
   ========================================================== */

.correct-result-trigger{
    width:100%;
    margin-top:8px;
    padding:9px 12px;

    border:1px solid rgba(255,178,73,.28);
    border-radius:8px;

    background:
        linear-gradient(
            180deg,
            rgba(255,178,73,.09),
            rgba(255,178,73,.035)
        );

    color:#f4bd72;

    font:inherit;
    font-size:9px;
    font-weight:900;
    letter-spacing:.13em;

    cursor:pointer;

    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.correct-result-trigger:hover{
    border-color:rgba(255,190,94,.58);
    background:rgba(255,178,73,.12);
    transform:translateY(-1px);
}


.result-correction-modal{
    position:fixed;
    inset:0;
    z-index:10050;

    display:none;
    align-items:center;
    justify-content:center;

    padding:20px;
}

.result-correction-modal.open{
    display:flex;
}

.result-correction-backdrop{
    position:absolute;
    inset:0;

    background:rgba(2,5,12,.84);
    backdrop-filter:blur(7px);
}

.result-correction-panel{
    position:relative;
    z-index:1;

    width:min(520px,100%);
    max-height:calc(100vh - 40px);
    overflow:auto;

    border:1px solid rgba(255,177,70,.25);
    border-radius:16px;

    background:
        radial-gradient(
            circle at top right,
            rgba(255,165,55,.08),
            transparent 35%
        ),
        #0c111c;

    box-shadow:
        0 28px 90px rgba(0,0,0,.65),
        0 0 40px rgba(255,165,55,.06);
}

.result-correction-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;

    padding:20px 20px 17px;

    border-bottom:
        1px solid rgba(255,255,255,.07);
}

.result-correction-kicker{
    display:block;
    margin-bottom:5px;

    color:#d79645;

    font-size:9px;
    font-weight:900;
    letter-spacing:.18em;
}

.result-correction-head h2{
    margin:0;

    color:#fff;

    font-size:18px;
    letter-spacing:.04em;
}

.result-correction-close{
    width:32px;
    height:32px;

    display:flex;
    align-items:center;
    justify-content:center;

    border:1px solid rgba(255,255,255,.09);
    border-radius:8px;

    background:rgba(255,255,255,.035);
    color:#aeb7c7;

    font-size:21px;
    line-height:1;

    cursor:pointer;
}

.result-correction-close:hover{
    color:#fff;
    border-color:rgba(255,255,255,.22);
}


.result-correction-warning{
    margin:16px 20px 0;
    padding:12px 13px;

    display:flex;
    flex-direction:column;
    gap:4px;

    border:1px solid rgba(255,177,70,.18);
    border-radius:9px;

    background:rgba(255,166,49,.055);
}

.result-correction-warning strong{
    color:#efb462;

    font-size:9px;
    letter-spacing:.13em;
}

.result-correction-warning span{
    color:#aeb7c7;

    font-size:11px;
    line-height:1.5;
}


.result-correction-current{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;

    padding:14px 20px 0;
}

.result-correction-current > div{
    padding:10px 11px;

    border:1px solid rgba(255,255,255,.065);
    border-radius:8px;

    background:rgba(255,255,255,.025);
}

.result-correction-current span{
    display:block;
    margin-bottom:4px;

    color:#69758a;

    font-size:8px;
    font-weight:900;
    letter-spacing:.12em;
}

.result-correction-current strong{
    display:block;

    overflow:hidden;
    text-overflow:ellipsis;

    color:#dce4f1;

    font-size:11px;
    white-space:nowrap;
}


.result-correction-form{
    display:grid;
    grid-template-columns:1fr 28px 1fr;
    align-items:end;
    gap:10px;

    padding:18px 20px 20px;
}

.result-correction-team label{
    display:block;
    min-height:30px;
    margin-bottom:7px;

    color:#b7c2d4;

    font-size:10px;
    font-weight:800;
    line-height:1.35;
}

.result-correction-team input{
    width:100%;
    height:46px;

    border:1px solid rgba(255,255,255,.10);
    border-radius:9px;

    background:#080d16;
    color:#fff;

    text-align:center;

    font:inherit;
    font-size:18px;
    font-weight:900;

    outline:none;
}

.result-correction-team input:focus{
    border-color:rgba(255,181,77,.50);

    box-shadow:
        0 0 0 3px rgba(255,174,63,.06);
}

.result-correction-versus{
    height:46px;

    display:flex;
    align-items:center;
    justify-content:center;

    color:#69758a;

    font-size:17px;
    font-weight:900;
}

.result-correction-notice{
    grid-column:1/-1;

    padding:10px 0 0;

    color:#737f92;

    font-size:10px;
    line-height:1.5;
}

.result-correction-actions{
    grid-column:1/-1;

    display:flex;
    justify-content:flex-end;
    gap:8px;

    margin-top:5px;
}

.result-correction-confirm{
    min-height:36px;
    padding:0 15px;

    border:1px solid rgba(255,172,60,.42);
    border-radius:8px;

    background:
        linear-gradient(
            180deg,
            rgba(210,126,30,.95),
            rgba(164,87,13,.95)
        );

    color:#fff;

    font:inherit;
    font-size:9px;
    font-weight:900;
    letter-spacing:.1em;

    cursor:pointer;
}

.result-correction-confirm:hover{
    filter:brightness(1.1);
}

body.result-correction-open{
    overflow:hidden;
}


@media(max-width:600px){

    .result-correction-modal{
        align-items:flex-end;
        padding:0;
    }

    .result-correction-panel{
        width:100%;
        max-height:88vh;

        border-radius:17px 17px 0 0;

        border-left:0;
        border-right:0;
        border-bottom:0;
    }

    .result-correction-head{
        padding:17px 16px 14px;
    }

    .result-correction-warning{
        margin:
            14px 16px 0;
    }

    .result-correction-current{
        padding:
            12px 16px 0;
    }

    .result-correction-form{
        padding:
            16px 16px 20px;
    }

}



/* ==========================================================
   V37 — NAVIGATION ORDER / CHAT TYPOGRAPHY
   ========================================================== */

/*
 * Only menu numbers should use the small navigation-counter
 * typography. Labels always use the full menu typography.
 */
.portal-menu-links a .portal-menu-label{
    min-width:0;
    color:inherit;
    font-size:inherit;
    font-weight:inherit;
    line-height:1.2;
    letter-spacing:normal;
}

.portal-menu-links a .portal-menu-number{
    flex:0 0 auto;
    color:#66758b;
    font-size:11px;
    font-weight:800;
    line-height:1;
    letter-spacing:.12em;
}

/* Tournament Chat keeps the unread badge + number together. */
.tournament-chat-menu-right{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    flex:0 0 auto;
}

/*
 * Override the legacy generic:
 * .portal-menu-links a span { font-size:11px; }
 */
.portal-menu-links a span.portal-menu-label{
    color:inherit;
    font-size:inherit;
    letter-spacing:normal;
}



/* ==========================================================
   V37 — NAVIGATION ORDER / CHAT TYPOGRAPHY
   ========================================================== */

/*
 * Only menu numbers should use the small navigation-counter
 * typography. Labels always use the full menu typography.
 */
.portal-menu-links a .portal-menu-label{
    min-width:0;
    color:inherit;
    font-size:inherit;
    font-weight:inherit;
    line-height:1.2;
    letter-spacing:normal;
}

.portal-menu-links a .portal-menu-number{
    flex:0 0 auto;
    color:#66758b;
    font-size:11px;
    font-weight:800;
    line-height:1;
    letter-spacing:.12em;
}

/* Tournament Chat keeps the unread badge + number together. */
.tournament-chat-menu-right{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    flex:0 0 auto;
}

/*
 * Override the legacy generic:
 * .portal-menu-links a span { font-size:11px; }
 */
.portal-menu-links a span.portal-menu-label{
    color:inherit;
    font-size:inherit;
    letter-spacing:normal;
}


/* ==========================================================
   V39 — TOURNAMENT CHAT VIEWPORT FIT
   Keep the composer visible without page scrolling
   ========================================================== */

.tournament-chat-heading{
    margin-bottom:12px;
}

.tournament-chat-shell{
    height:min(690px,calc(100vh - 190px));
    min-height:0;
}

@media(max-width:600px){
    .tournament-chat-heading{
        margin-bottom:10px;
    }

    .tournament-chat-shell{
        height:calc(100dvh - 175px);
        min-height:0;
    }
}



/* ==========================================================
   V41 — CHAT ADMIN CONTROLS
   ========================================================== */

.tournament-chat-notice{
    display:flex;
    align-items:center;
    gap:8px;
}

.tournament-chat-notice-text{
    flex:1;
}

.match-chat-header-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

.chat-clear-button{
    appearance:none;
    border:1px solid rgba(255,90,105,.28);
    border-radius:7px;
    background:rgba(190,45,62,.08);
    color:#ff7885;
    padding:7px 10px;
    font-size:8px;
    font-weight:800;
    letter-spacing:.10em;
    cursor:pointer;
    transition:.16s ease;
    white-space:nowrap;
}

.chat-clear-button:hover{
    background:rgba(190,45,62,.16);
    border-color:rgba(255,90,105,.45);
}

.chat-clear-button:disabled{
    opacity:.4;
    cursor:not-allowed;
}

.portal-confirm-overlay{
    position:fixed;
    inset:0;
    z-index:10000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:rgba(2,3,8,.78);
    backdrop-filter:blur(8px);
}

.portal-confirm-overlay[hidden]{
    display:none;
}

.portal-confirm-card{
    width:min(420px,100%);
    padding:22px;
    border:1px solid rgba(255,90,105,.22);
    border-radius:13px;
    background:
        radial-gradient(
            circle at 50% 0,
            rgba(173,50,75,.10),
            transparent 45%
        ),
        #0b0c14;
    box-shadow:0 30px 90px rgba(0,0,0,.55);
}

.portal-confirm-kicker{
    margin-bottom:7px;
    color:#ff7180;
    font-size:8px;
    font-weight:800;
    letter-spacing:.18em;
}

.portal-confirm-card h3{
    margin:0 0 9px;
}

.portal-confirm-card p{
    margin:0;
    color:#898794;
    font-size:12px;
    line-height:1.6;
}

.portal-confirm-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:20px;
}

.portal-confirm-actions button{
    border-radius:7px;
    padding:9px 13px;
    font-size:9px;
    font-weight:800;
    letter-spacing:.08em;
    cursor:pointer;
}

.portal-confirm-cancel{
    border:1px solid rgba(255,255,255,.10);
    background:rgba(255,255,255,.035);
    color:#aaa8b4;
}

.portal-confirm-delete{
    border:1px solid rgba(255,90,105,.35);
    background:rgba(190,45,62,.15);
    color:#ff7b87;
}

@media(max-width:600px){
    .chat-clear-button{
        padding:6px 8px;
        font-size:7px;
    }

    .portal-confirm-card{
        padding:19px;
    }
}


/* ==========================================================
   V42 — ADMIN PENDING EDIT INDICATORS
   ========================================================== */

.admin-edit-pending{
    display:inline-flex;
    align-items:center;
    margin-left:7px;
    padding:3px 7px;
    border:1px solid rgba(245,184,76,.34);
    border-radius:5px;
    background:rgba(245,184,76,.09);
    color:#f2bd62;
    font-size:9px;
    font-weight:800;
    letter-spacing:.07em;
    text-decoration:none;
    vertical-align:middle;
    box-shadow:0 0 12px rgba(245,184,76,.07);
}

.admin-edit-pending:hover{
    border-color:rgba(245,184,76,.65);
    background:rgba(245,184,76,.15);
    color:#ffd27d;
}

.admin-edit-count{
    border-color:rgba(245,184,76,.30);
    background:rgba(245,184,76,.08);
    color:#f2bd62;
}

.admin-edit-count.is-empty{
    opacity:.42;
}

@media(max-width:600px){
    .admin-edit-pending{
        margin-left:5px;
        margin-top:4px;
    }
}


/* =========================================================
   V44 — CHAT ATTACHMENTS
   ========================================================= */

.tournament-chat-attach{
    flex:0 0 auto;
    width:44px;
    min-width:44px;
    height:44px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:10px;
    background:rgba(255,255,255,.045);
    color:#ddd;
    cursor:pointer;
    font-size:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.tournament-chat-attach:hover{
    border-color:rgba(170,110,255,.6);
    background:rgba(150,80,255,.10);
}

.tournament-chat-attach:active{
    transform:scale(.96);
}

.tournament-chat-attach:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.tournament-chat-file-preview{
    margin:8px 0 0;
    padding:8px 10px;
    border:1px solid rgba(255,255,255,.09);
    border-radius:9px;
    background:rgba(255,255,255,.035);
    font-size:12px;
    align-items:center;
    gap:10px;
}

.tournament-chat-file-preview:not([hidden]){
    display:flex;
}

#tournament-chat-file-name{
    min-width:0;
    flex:1;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:rgba(255,255,255,.78);
}

#tournament-chat-file-remove{
    flex:0 0 auto;
    border:0;
    background:transparent;
    color:rgba(255,255,255,.55);
    cursor:pointer;
    font-size:20px;
    line-height:1;
    padding:0 3px;
}

#tournament-chat-file-remove:hover{
    color:#fff;
}

.tournament-chat-media-link{
    display:block;
    margin-top:9px;
    width:max-content;
    max-width:100%;
}

.tournament-chat-image{
    display:block;
    max-width:min(340px,100%);
    max-height:280px;
    width:auto;
    height:auto;
    object-fit:contain;
    border-radius:10px;
    border:1px solid rgba(255,255,255,.10);
    cursor:zoom-in;
}

.tournament-chat-video{
    display:block;
    width:min(420px,100%);
    max-height:320px;
    margin-top:9px;
    border-radius:10px;
    background:#050505;
    border:1px solid rgba(255,255,255,.10);
}

@media (max-width:760px){
    .tournament-chat-attach{
        width:42px;
        min-width:42px;
        height:42px;
    }

    .tournament-chat-image{
        max-width:100%;
        max-height:240px;
    }

    .tournament-chat-video{
        width:100%;
        max-height:280px;
    }
}


/* V44.1 — Tournament Chat textarea scrollbar */
#tournament-chat-input{
    scrollbar-width:none;
    -ms-overflow-style:none;
}

#tournament-chat-input::-webkit-scrollbar{
    display:none;
    width:0;
    height:0;
}

/* V44.2 — clean Tournament Chat textarea */
#tournament-chat-input{
    scrollbar-width:none !important;
    -ms-overflow-style:none;
}

#tournament-chat-input::-webkit-scrollbar{
    width:0 !important;
    height:0 !important;
    display:none !important;
}

/* =========================================================
   V45 TOURNAMENT CHAT MENTIONS
   ========================================================= */

.tournament-chat-shell{
    position:relative;
}

.tournament-chat-mentions{
    position:absolute;
    left:14px;
    right:14px;
    bottom:82px;
    z-index:80;

    max-height:280px;
    overflow-y:auto;

    padding:7px;

    background:rgba(9,10,18,.98);
    border:1px solid rgba(151,91,255,.42);
    border-radius:12px;

    box-shadow:
        0 18px 50px rgba(0,0,0,.55),
        0 0 24px rgba(128,70,255,.10);

    backdrop-filter:blur(16px);
}

.tournament-chat-mentions[hidden]{
    display:none !important;
}

.tournament-chat-mention-item{
    width:100%;
    min-height:52px;

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;

    padding:9px 12px;

    border:1px solid transparent;
    border-radius:8px;

    background:transparent;

    color:#ececf4;
    text-align:left;
    cursor:pointer;
}

.tournament-chat-mention-item:hover,
.tournament-chat-mention-item.active{
    background:rgba(135,79,255,.11);
    border-color:rgba(151,91,255,.28);
}

.tournament-chat-mention-name{
    font-weight:800;
    letter-spacing:.02em;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.tournament-chat-mention-description{
    flex:0 0 auto;

    font-size:11px;
    letter-spacing:.08em;
    text-transform:uppercase;

    color:rgba(220,220,235,.52);
}

.tournament-chat-mention-item.confederation
.tournament-chat-mention-name{
    color:#63b3ff;
}

.tournament-chat-mention-item.resistance
.tournament-chat-mention-name{
    color:#ff646f;
}

.tournament-chat-mention-item.special
.tournament-chat-mention-name{
    color:#bd91ff;
}

@media(max-width:760px){

    .tournament-chat-mentions{
        left:8px;
        right:8px;
        bottom:86px;
        max-height:230px;
    }

    .tournament-chat-mention-item{
        min-height:48px;
        gap:10px;
    }

    .tournament-chat-mention-description{
        font-size:9px;
    }
}


/* =========================================================
   V45 — Tournament Chat rendered mentions
   ========================================================= */

.tournament-chat-mentioned{
    display:inline;
    font-weight:800;
    letter-spacing:.01em;
    border-radius:5px;
    padding:1px 4px;
    white-space:normal;
}

.tournament-chat-mentioned.special{
    color:#bd91ff;
    background:rgba(189,145,255,.10);
    text-shadow:0 0 10px rgba(189,145,255,.25);
}

.tournament-chat-mentioned.confederation{
    color:#63b3ff;
    background:rgba(99,179,255,.10);
    text-shadow:0 0 10px rgba(99,179,255,.25);
}

.tournament-chat-mentioned.resistance{
    color:#ff646f;
    background:rgba(255,100,111,.10);
    text-shadow:0 0 10px rgba(255,100,111,.25);
}

/* =========================================================
   V46 - MATCH CHAT ATTACHMENTS
========================================================= */

.match-chat-attach-button{
    flex:0 0 auto;
    width:46px;
    min-width:46px;
    height:46px;
    border:1px solid rgba(255,255,255,.14);
    border-radius:10px;
    background:rgba(255,255,255,.045);
    color:#d8d8e8;
    font-size:20px;
    line-height:1;
    cursor:pointer;
    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.match-chat-attach-button:hover{
    border-color:rgba(166,103,255,.55);
    background:rgba(166,103,255,.10);
}

.match-chat-attach-button:active{
    transform:scale(.96);
}

.match-chat-attach-button:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.match-chat-attachment-preview{
    padding:0 18px 8px;
}

.match-chat-selected-attachment{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:9px 11px;
    border:1px solid rgba(166,103,255,.25);
    border-radius:10px;
    background:rgba(166,103,255,.07);
}

.match-chat-selected-attachment-info{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:2px;
}

.match-chat-selected-attachment-info strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:12px;
    font-weight:700;
    color:#f1eff8;
}

.match-chat-selected-attachment-info span{
    font-size:10px;
    color:rgba(255,255,255,.50);
}

.match-chat-attachment-remove{
    flex:0 0 auto;
    width:28px;
    height:28px;
    display:grid;
    place-items:center;
    padding:0;
    border:1px solid rgba(255,255,255,.12);
    border-radius:8px;
    background:rgba(255,255,255,.04);
    color:#d9d6e2;
    font-size:20px;
    line-height:1;
    cursor:pointer;
}

.match-chat-attachment-remove:hover{
    border-color:rgba(255,100,120,.55);
    background:rgba(255,80,100,.10);
}

.match-chat-attachment{
    margin-top:8px;
    max-width:360px;
}

.match-chat-attachment a{
    display:block;
}

.match-chat-attachment img{
    display:block;
    width:auto;
    max-width:100%;
    max-height:300px;
    object-fit:contain;
    border-radius:10px;
    border:1px solid rgba(255,255,255,.10);
    background:rgba(0,0,0,.25);
    cursor:zoom-in;
}

.match-chat-attachment video{
    display:block;
    width:100%;
    max-width:360px;
    max-height:300px;
    border-radius:10px;
    border:1px solid rgba(255,255,255,.10);
    background:#000;
}

@media(max-width:760px){
    .match-chat-attach-button{
        width:44px;
        min-width:44px;
        height:44px;
    }

    .match-chat-attachment-preview{
        padding-left:12px;
        padding-right:12px;
    }

    .match-chat-attachment{
        max-width:100%;
    }

    .match-chat-attachment img,
    .match-chat-attachment video{
        max-width:100%;
        max-height:260px;
    }
}

/* =========================================================
   V47 - MATCH CHAT MENTIONS
========================================================= */

.match-chat-mentions{
    position:absolute;
    left:18px;
    right:18px;
    bottom:82px;
    z-index:40;
    max-height:250px;
    overflow-y:auto;
    padding:6px;
    border:1px solid rgba(166,103,255,.30);
    border-radius:12px;
    background:rgba(12,12,19,.98);
    box-shadow:0 14px 40px rgba(0,0,0,.45);
    backdrop-filter:blur(12px);
}

.match-chat-mention-item{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 12px;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#eee;
    text-align:left;
    cursor:pointer;
}

.match-chat-mention-item:hover,
.match-chat-mention-item.active{
    background:rgba(166,103,255,.12);
}

.match-chat-mention-name{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:13px;
    font-weight:800;
}

.match-chat-mention-description{
    flex:0 0 auto;
    font-size:10px;
    letter-spacing:.05em;
    text-transform:uppercase;
    color:rgba(255,255,255,.42);
}

.match-chat-mention-item.confederation
.match-chat-mention-name{
    color:#67b7ff;
}

.match-chat-mention-item.resistance
.match-chat-mention-name{
    color:#ff6d79;
}

.match-chat-mention-item.special
.match-chat-mention-name{
    color:#bd8cff;
}

.match-chat-mentioned{
    display:inline;
    padding:1px 4px;
    border-radius:5px;
    font-weight:800;
}

.match-chat-mentioned.confederation{
    color:#70bdff;
    background:rgba(64,158,255,.12);
}

.match-chat-mentioned.resistance{
    color:#ff7580;
    background:rgba(255,75,90,.12);
}

.match-chat-mentioned.special{
    color:#c494ff;
    background:rgba(166,103,255,.13);
}

@media(max-width:760px){
    .match-chat-mentions{
        left:12px;
        right:12px;
        bottom:78px;
        max-height:220px;
    }

    .match-chat-mention-item{
        padding:11px 10px;
    }

    .match-chat-mention-description{
        font-size:9px;
    }
}

/* =========================================================
   V48 - TEAM EDIT CHANGE REVIEW
========================================================= */

.admin-team-heading{
    margin-bottom:18px;
}

.admin-team-heading h2{
    margin:5px 0 12px;
}

.admin-team-edit-alert{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 14px;
    border:1px solid rgba(180,120,255,.30);
    border-radius:10px;
    background:rgba(151,83,255,.08);
}

.admin-team-edit-alert-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    flex:0 0 34px;
    border-radius:8px;
    background:rgba(167,104,255,.15);
    color:#c79aff;
    font-size:18px;
}

.admin-team-edit-alert div{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.admin-team-edit-alert strong{
    color:#d5b5ff;
    font-size:12px;
    letter-spacing:.08em;
}

.admin-team-edit-alert span{
    color:rgba(255,255,255,.55);
    font-size:12px;
}

.admin-team-review-grid{
    align-items:start;
}

.admin-team-card-head,
.admin-edit-review-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}

.admin-team-card-head h3,
.admin-edit-review-head h3{
    margin:3px 0 0;
}

.admin-team-current-list{
    border-top:1px solid rgba(255,255,255,.07);
}

.admin-team-current-row{
    display:grid;
    grid-template-columns:140px minmax(0,1fr);
    gap:16px;
    padding:10px 0;
    border-bottom:1px solid rgba(255,255,255,.06);
}

.admin-team-current-row > span{
    color:rgba(255,255,255,.43);
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.admin-team-current-row strong{
    min-width:0;
    overflow-wrap:anywhere;
    color:rgba(255,255,255,.86);
}

.admin-team-registration-decision{
    margin-top:22px;
    padding-top:18px;
    border-top:1px solid rgba(255,255,255,.08);
}


/* CHANGE COUNTER */

.admin-edit-change-count{
    min-width:72px;
    padding:9px 12px;
    text-align:center;
    border:1px solid rgba(178,113,255,.28);
    border-radius:10px;
    background:rgba(155,83,255,.08);
}

.admin-edit-change-count strong{
    display:block;
    color:#c99cff;
    font-size:23px;
    line-height:1;
}

.admin-edit-change-count span{
    display:block;
    margin-top:4px;
    color:rgba(255,255,255,.48);
    font-size:9px;
    letter-spacing:.12em;
}


/* INDIVIDUAL CHANGE */

.admin-edit-change-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.admin-edit-change{
    overflow:hidden;
    border:1px solid rgba(255,255,255,.09);
    border-radius:10px;
    background:rgba(255,255,255,.018);
}

.admin-edit-field{
    padding:8px 12px;
    border-bottom:1px solid rgba(255,255,255,.07);
    color:rgba(255,255,255,.54);
    font-size:10px;
    font-weight:800;
    letter-spacing:.1em;
}

.admin-edit-values{
    display:grid;
    grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);
    align-items:stretch;
}

.admin-edit-old,
.admin-edit-new{
    min-width:0;
    padding:12px;
}

.admin-edit-old{
    background:rgba(255,75,90,.035);
}

.admin-edit-new{
    background:rgba(60,220,150,.045);
}

.admin-edit-old span,
.admin-edit-new span{
    display:block;
    margin-bottom:5px;
    font-size:9px;
    font-weight:800;
    letter-spacing:.1em;
}

.admin-edit-old span{
    color:rgba(255,110,120,.68);
}

.admin-edit-new span{
    color:rgba(80,225,160,.75);
}

.admin-edit-old strong,
.admin-edit-new strong{
    display:block;
    overflow-wrap:anywhere;
    font-size:13px;
}

.admin-edit-old strong{
    color:rgba(255,255,255,.55);
}

.admin-edit-new strong{
    color:#f2fff8;
}

.admin-edit-arrow{
    display:flex;
    align-items:center;
    justify-content:center;
    color:#b887f6;
    background:rgba(150,90,255,.05);
    font-size:16px;
}


/* DECISION */

.admin-edit-decision{
    margin-top:20px;
    padding-top:18px;
    border-top:1px solid rgba(255,255,255,.09);
}

.admin-edit-decision .actions{
    justify-content:flex-end;
}

.admin-edit-no-change{
    padding:18px;
    text-align:center;
    border:1px dashed rgba(255,255,255,.12);
    border-radius:10px;
    color:rgba(255,255,255,.48);
}

.admin-edit-empty{
    min-height:240px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
}

.admin-edit-empty-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:48px;
    height:48px;
    margin-bottom:14px;
    border-radius:50%;
    background:rgba(60,220,150,.08);
    border:1px solid rgba(60,220,150,.18);
    color:#72e5ad;
    font-size:20px;
}

.admin-edit-empty h3{
    margin:5px 0;
}


/* MOBILE */

@media(max-width:760px){

    .admin-team-card-head,
    .admin-edit-review-head{
        gap:10px;
    }

    .admin-team-current-row{
        grid-template-columns:110px minmax(0,1fr);
        gap:10px;
    }

    .admin-edit-values{
        grid-template-columns:1fr;
    }

    .admin-edit-arrow{
        min-height:25px;
        transform:rotate(90deg);
    }

    .admin-edit-old,
    .admin-edit-new{
        padding:11px 12px;
    }

    .admin-edit-decision .actions{
        display:grid;
        grid-template-columns:1fr;
    }

    .admin-edit-decision .btn{
        width:100%;
    }
}

/* ============================================================
   V47 — DYNAMIC COMPACT BRACKET TREE
   Admin + Public
   ============================================================ */

.tournament-bracket.dynamic-tree{
    position:relative;
    display:flex;
    align-items:flex-start;
    gap:62px;
}

.tournament-bracket.dynamic-tree .tournament-round{
    position:relative;
    width:300px;
    flex:0 0 300px;
}

.tournament-bracket.dynamic-tree .round-matches{
    position:relative;
    display:block;
    flex:none;
    min-height:0;
}

.tournament-bracket.dynamic-tree .tournament-match{
    position:absolute;
    left:0;
    width:300px;
    margin:0;
    z-index:2;
}

/* Disable the old straight connector. */
.tournament-bracket.dynamic-tree .tournament-match::after{
    display:none !important;
}

/* SVG containing the real tree connectors. */
.dynamic-bracket-connectors{
    position:absolute;
    left:0;
    top:0;
    width:100%;
    height:100%;
    overflow:visible;
    pointer-events:none;
    z-index:1;
}

.dynamic-bracket-connectors path{
    fill:none;
    stroke:rgba(108,145,204,.52);
    stroke-width:1.5;
    vector-effect:non-scaling-stroke;
}

.dynamic-bracket-connectors path.preliminary-feed{
    stroke:rgba(125,154,211,.62);
}

@media(max-width:700px){
    .tournament-bracket.dynamic-tree{
        gap:29px;
    }

    .tournament-bracket.dynamic-tree .tournament-round{
        width:280px;
        flex-basis:280px;
    }

    .tournament-bracket.dynamic-tree .tournament-match{
        width:280px;
    }
}


/* ==========================================================
   V48 — THIRD-PLACE MATCH
   ========================================================== */

.bracket-special-column{
    flex:0 0 310px;
    width:310px;
    min-width:310px;
    position:relative;
    display:flex;
    flex-direction:column;
    align-self:flex-start;
}

.third-place-column{
    margin-left:24px;
}

.third-place-heading{
    border-color:rgba(205,151,55,.38);
}

.third-place-heading > span{
    color:#e6c46b;
    text-shadow:0 0 18px rgba(205,151,55,.22);
}

.third-place-match-wrap{
    position:relative;
    margin-top:28px;
}

.third-place-match-wrap > .tournament-match{
    position:relative !important;
    top:auto !important;
    left:auto !important;
    right:auto !important;
    width:100%;
}

.third-place-column .tournament-match{
    border-color:rgba(205,151,55,.30);
    box-shadow:
        0 14px 34px rgba(0,0,0,.28),
        0 0 22px rgba(205,151,55,.055);
}

.third-place-column .tournament-match-head{
    border-bottom-color:rgba(205,151,55,.18);
}

.third-place-result{
    margin-top:14px;
    padding:14px 16px;
    border:1px solid rgba(205,151,55,.35);
    border-radius:12px;
    background:
        linear-gradient(
            135deg,
            rgba(205,151,55,.11),
            rgba(18,20,31,.82)
        );
    box-shadow:0 10px 30px rgba(0,0,0,.22);
    display:flex;
    flex-direction:column;
    gap:4px;
}

.third-place-result span{
    font-size:10px;
    font-weight:800;
    letter-spacing:.16em;
    color:#d9b85c;
}

.third-place-result strong{
    font-size:16px;
    color:#fff3c4;
}

.admin-third-place-column .match-editor.open{
    position:relative;
    z-index:20;
}

@media (max-width: 760px){
    .bracket-special-column{
        flex:0 0 calc(100vw - 44px);
        width:calc(100vw - 44px);
        min-width:calc(100vw - 44px);
        scroll-snap-align:start;
    }

    .third-place-column{
        margin-left:18px;
    }

    .third-place-match-wrap{
        margin-top:20px;
    }
}

/* ==========================================================
   V50 — SEPARATE MATCH MANAGEMENT WINDOW
   ========================================================== */

.match-management-page{
    width:min(680px,calc(100% - 28px));
    margin:36px auto 70px;
}

.match-management-shell{
    border:1px solid rgba(116,143,200,.22);
    border-radius:18px;
    padding:24px;
    background:
        linear-gradient(
            145deg,
            rgba(13,22,39,.98),
            rgba(7,12,23,.98)
        );
    box-shadow:0 24px 70px rgba(0,0,0,.38);
}

.match-management-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:22px;
}

.match-management-head h1{
    margin:5px 0 5px;
}

.match-window-close{
    border:1px solid rgba(129,151,195,.24);
    border-radius:9px;
    padding:9px 13px;
    background:rgba(7,12,23,.7);
    color:#9facbf;
    font-size:10px;
    font-weight:800;
    letter-spacing:.1em;
    cursor:pointer;
}

.management-section{
    margin-top:18px;
    padding:20px;
    border:1px solid rgba(115,143,200,.16);
    border-radius:14px;
    background:rgba(4,9,18,.42);
}

.management-section-title{
    margin-bottom:18px;
    color:#8799ba;
    font-size:10px;
    font-weight:900;
    letter-spacing:.16em;
}

.management-section label{
    display:block;
    margin:15px 0 7px;
    font-size:10px;
    font-weight:800;
    letter-spacing:.1em;
    color:#8c9bb5;
}

.management-section select,
.management-section input[type="datetime-local"]{
    width:100%;
}

.management-bo-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:8px;
}

.management-bo-option{
    margin:0 !important;
    cursor:pointer;
}

.management-bo-option input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.management-bo-option span{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    border:1px solid rgba(112,139,193,.20);
    border-radius:9px;
    background:rgba(8,14,27,.76);
    color:#8999b4;
}

.management-bo-option input:checked + span{
    border-color:rgba(149,92,238,.75);
    background:rgba(126,69,209,.18);
    color:#f1e8ff;
    box-shadow:0 0 18px rgba(126,69,209,.12);
}

.match-management-save,
.match-result-save,
.match-correction-save{
    width:100%;
    margin-top:20px;
}

.management-scoreboard{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:end;
    gap:14px;
}

.management-score-team{
    min-width:0;
}

.management-score-team > span{
    display:block;
    min-height:36px;
    margin-bottom:9px;
    color:#e7edf9;
    font-size:13px;
    font-weight:800;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.management-score-divider{
    padding-bottom:10px;
    color:#7585a3;
    font-size:24px;
    font-weight:900;
}

.score-counter{
    display:grid;
    grid-template-columns:42px 1fr 42px;
    gap:6px;
}

.score-counter button{
    border:1px solid rgba(116,143,200,.24);
    border-radius:8px;
    background:rgba(11,18,33,.9);
    color:#dce6f8;
    font-size:20px;
    cursor:pointer;
}

.score-counter input{
    width:100%;
    min-width:0;
    text-align:center;
    font-size:20px;
    font-weight:900;
}

.match-management-winner{
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:13px 16px;
    border:1px solid rgba(220,180,76,.30);
    border-radius:11px;
    background:rgba(177,128,31,.08);
}

.match-management-winner span{
    color:#bfa45e;
    font-size:9px;
    font-weight:900;
    letter-spacing:.15em;
}

.match-management-winner strong{
    color:#f2d77f;
}

@media(max-width:600px){
    .match-management-page{
        width:calc(100% - 18px);
        margin:12px auto 40px;
    }

    .match-management-shell{
        padding:16px;
    }

    .management-scoreboard{
        grid-template-columns:1fr;
    }

    .management-score-divider{
        display:none;
    }
}

/* ==========================================================
   FLEXIBLE BEST-OF MATCH FORMAT
   ========================================================== */

.flexible-bo-control{
    display:grid;
    grid-template-columns:52px 1fr 52px;
    gap:8px;
    align-items:stretch;
}

.bo-step{
    border:1px solid rgba(112,139,193,.25);
    border-radius:10px;
    background:rgba(8,14,27,.85);
    color:#dce6f8;
    font-size:22px;
    font-weight:800;
    cursor:pointer;
}

.bo-step:hover{
    border-color:rgba(149,92,238,.65);
    background:rgba(126,69,209,.14);
}

.bo-value-wrap{
    position:relative;
}

.bo-value-wrap input{
    width:100%;
    height:100%;
    min-height:48px;
    padding:8px 55px 8px 14px;
    text-align:center;
    font-size:18px;
    font-weight:900;
}

.bo-value-wrap small{
    position:absolute;
    right:14px;
    top:50%;
    transform:translateY(-50%);
    color:#9b8bc4;
    font-size:10px;
    font-weight:900;
    letter-spacing:.08em;
    pointer-events:none;
}

.bo-help{
    margin-top:7px;
    color:#687995;
    font-size:10px;
}

.bo-result-info{
    margin-top:12px;
    text-align:center;
    color:#71829e;
    font-size:11px;
}

.bo-result-info strong{
    color:#d8e2f4;
}


/* ==========================================================
   V51 — MATCH MANAGEMENT TRUE VIEWPORT MODAL
   The editor must never participate in bracket-card layout.
   ========================================================== */

.match-editor{
    position:fixed !important;
    inset:0 !important;

    z-index:10000 !important;

    display:none !important;

    width:100vw !important;
    height:100vh !important;
    max-width:none !important;
    max-height:none !important;

    margin:0 !important;
    padding:20px !important;

    box-sizing:border-box !important;

    align-items:center !important;
    justify-content:center !important;

    background:rgba(2,6,15,.78) !important;

    backdrop-filter:blur(7px);
    -webkit-backdrop-filter:blur(7px);

    overflow:auto !important;
}

.match-editor.open{
    display:flex !important;
}

/* The actual management window */
.match-editor .match-editor-modal{
    position:relative !important;
    z-index:1 !important;

    box-sizing:border-box !important;

    width:min(680px,100%) !important;
    max-width:680px !important;

    max-height:calc(100vh - 40px) !important;

    overflow-y:auto !important;
    overflow-x:hidden !important;

    margin:0 !important;

    padding:24px !important;

    border:1px solid rgba(116,143,200,.25) !important;
    border-radius:18px !important;

    background:
        linear-gradient(
            145deg,
            rgba(13,22,39,.99),
            rgba(7,12,23,.99)
        ) !important;

    box-shadow:
        0 30px 90px rgba(0,0,0,.65),
        0 0 35px rgba(80,110,180,.08) !important;
}

/* Header */
.match-editor .match-editor-modal-head{
    position:sticky !important;
    top:0 !important;
    z-index:5 !important;

    display:flex !important;
    align-items:flex-start !important;
    justify-content:space-between !important;

    gap:20px !important;

    margin:-24px -24px 22px !important;
    padding:20px 24px !important;

    border-bottom:1px solid rgba(116,143,200,.16) !important;

    background:
        linear-gradient(
            180deg,
            rgba(13,22,39,1),
            rgba(13,22,39,.96)
        ) !important;

    backdrop-filter:blur(12px);
}

/* Close button */
.match-editor .match-editor-modal-close{
    flex:0 0 auto !important;

    width:36px !important;
    height:36px !important;

    border:1px solid rgba(129,151,195,.24) !important;
    border-radius:9px !important;

    background:rgba(7,12,23,.75) !important;

    color:#9facbf !important;

    font-size:22px !important;
    line-height:1 !important;

    cursor:pointer !important;
}

.match-editor .match-editor-modal-close:hover{
    color:#fff !important;
    border-color:rgba(255,255,255,.25) !important;
}

/* Do not allow old V28 width rules to affect modal contents */
.match-editor .bracket-edit-form,
.match-editor .bracket-result-form{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    box-sizing:border-box !important;
}

/* Picker menus stay inside the management window */
.match-editor .bracket-team-picker-menu,
.match-editor .bracket-format-menu{
    z-index:20 !important;
}

/* Mobile */
@media (max-width:700px){

    .match-editor{
        padding:10px !important;
    }

    .match-editor .match-editor-modal{
        width:100% !important;
        max-width:none !important;
        max-height:calc(100vh - 20px) !important;

        padding:18px !important;

        border-radius:14px !important;
    }

    .match-editor .match-editor-modal-head{
        margin:-18px -18px 18px !important;
        padding:16px 18px !important;
    }
}

/* ==========================================================
   V52 — PORTALED MATCH EDITOR
   Editors are moved directly under <body> by JavaScript.
   ========================================================== */


body > .match-editor{
    position:fixed !important;
    inset:0 !important;
    z-index:999999 !important;
}

body > .match-editor .match-editor-modal{
    position:relative !important;
    z-index:1000000 !important;
}

/* ==========================================================
   V53 — WINNER: GOLD BORDER + ORIGINAL FACTION GLOW
   ========================================================== */

/* Confederation winner: gold border, keep blue glow */
.team-winner.faction-conf{
    border-color:#ffd35a !important;
}

/* Resistance winner: gold border, keep red glow */
.team-winner.faction-res{
    border-color:#ffd35a !important;
}

/* Winning advancement path */
.dynamic-bracket-connectors path.winner-feed{
    stroke:#ffd35a !important;
    stroke-width:2.5px !important;
    filter:
        drop-shadow(0 0 3px rgba(255,211,90,.95))
        drop-shadow(0 0 7px rgba(255,178,30,.60));
}

/* ==========================================================
   V54 — MATCH CHAT ATTACH BUTTON STABILITY
   ========================================================== */

.match-chat-compose .match-chat-attach-button{
    appearance:none !important;
    -webkit-appearance:none !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    flex:0 0 46px !important;
    width:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    height:40px !important;

    padding:0 !important;
    margin:0 !important;

    overflow:hidden !important;

    border:1px solid rgba(174,113,255,.30) !important;
    border-radius:8px !important;

    background:rgba(255,255,255,.045) !important;
    color:#d8d8e8 !important;

    font-family:Arial,sans-serif !important;
    font-size:18px !important;
    line-height:1 !important;
    text-align:center !important;

    cursor:pointer !important;
}

#match-chat-attachment[hidden]{
    display:none !important;
    position:absolute !important;
    width:0 !important;
    height:0 !important;
    opacity:0 !important;
    pointer-events:none !important;
}

/* ==========================================================
   V55 — CONFIRM DIALOG ABOVE MATCH CHAT
   ========================================================== */

.portal-confirm-overlay{
    position:fixed !important;
    inset:0 !important;
    z-index:2000000 !important;
}

.portal-confirm-card{
    position:relative !important;
    z-index:2000001 !important;
}


/* ==========================================================
   V56 — SELECTED PARTICIPANTS REDESIGN
   ========================================================== */

.participants-page{
    max-width:1180px;
    margin:0 auto;
}

.participants-intro{
    margin-top:8px;
}

.participants-factions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px;
    margin-top:24px;
}


/* ----------------------------------------------------------
   FACTION PANELS
   ---------------------------------------------------------- */

.participants-faction{
    position:relative;
    overflow:hidden;

    padding:22px;

    border-radius:18px;

    background:#101522;
}

.participants-faction::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
}


/* Confederation */

.participants-conf{
    border:1px solid rgba(48,147,255,.28);

    box-shadow:
        0 18px 55px rgba(0,0,0,.20),
        inset 0 0 40px rgba(30,119,255,.025);
}

.participants-conf::before{
    background:
        radial-gradient(
            circle at 0 0,
            rgba(35,135,255,.12),
            transparent 38%
        );
}


/* Resistance */

.participants-res{
    border:1px solid rgba(255,65,88,.27);

    box-shadow:
        0 18px 55px rgba(0,0,0,.20),
        inset 0 0 40px rgba(255,40,70,.025);
}

.participants-res::before{
    background:
        radial-gradient(
            circle at 0 0,
            rgba(255,42,70,.11),
            transparent 38%
        );
}


/* ----------------------------------------------------------
   PANEL HEADER
   ---------------------------------------------------------- */

.participants-faction-head{
    position:relative;
    z-index:1;

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:18px;

    padding-bottom:18px;
    margin-bottom:12px;

    border-bottom:1px solid rgba(255,255,255,.075);
}

.participants-faction-title{
    display:flex;
    align-items:center;
    gap:13px;
}

.participants-faction-logo{
    width:44px;
    height:44px;

    object-fit:contain;

    filter:
        drop-shadow(0 0 9px rgba(255,255,255,.10));
}

.participants-faction-label{
    margin-bottom:4px;

    font-size:9px;
    font-weight:900;
    letter-spacing:.18em;
}

.participants-conf .participants-faction-label{
    color:#65b4ff;
}

.participants-res .participants-faction-label{
    color:#ff687b;
}

.participants-faction-head h2{
    margin:0;

    color:#f3f3f7;

    font-size:20px;
    line-height:1.15;
}

.participants-faction-head h2 span{
    color:#81899a;
    font-size:11px;
    font-weight:600;
}

.participants-count{
    display:flex;
    align-items:center;
    justify-content:center;

    min-width:38px;
    height:38px;
    padding:0 10px;

    border-radius:10px;

    font-size:15px;
    font-weight:900;
}

.participants-conf .participants-count{
    border:1px solid rgba(70,159,255,.25);
    background:rgba(43,132,255,.09);
    color:#74bcff;
}

.participants-res .participants-count{
    border:1px solid rgba(255,77,100,.25);
    background:rgba(255,48,77,.08);
    color:#ff7485;
}


/* ----------------------------------------------------------
   TEAM CARDS
   ---------------------------------------------------------- */

.participants-team-list{
    position:relative;
    z-index:1;

    display:flex;
    flex-direction:column;

    gap:8px;
}

.participant-team-card{
    position:relative;

    width:100%;
    min-width:0;

    display:grid;
    grid-template-columns:minmax(0,1fr) auto 20px;
    align-items:center;

    gap:15px;

    padding:14px 14px;

    border-radius:11px;

    text-align:left;

    appearance:none;
    -webkit-appearance:none;

    cursor:pointer;

    transition:
        transform .16s ease,
        border-color .16s ease,
        background .16s ease,
        box-shadow .16s ease;
}

.participants-conf .participant-team-card{
    border:1px solid rgba(66,146,255,.12);

    background:
        linear-gradient(
            90deg,
            rgba(29,95,181,.10),
            rgba(255,255,255,.018)
        );

    color:#fff;
}

.participants-res .participant-team-card{
    border:1px solid rgba(255,72,96,.12);

    background:
        linear-gradient(
            90deg,
            rgba(166,31,51,.10),
            rgba(255,255,255,.018)
        );

    color:#fff;
}

.participant-team-card:hover{
    transform:translateY(-1px);
}

.participants-conf .participant-team-card:hover{
    border-color:rgba(65,158,255,.42);

    background:
        linear-gradient(
            90deg,
            rgba(29,108,214,.18),
            rgba(255,255,255,.025)
        );

    box-shadow:
        0 5px 22px rgba(22,107,230,.10);
}

.participants-res .participant-team-card:hover{
    border-color:rgba(255,68,93,.40);

    background:
        linear-gradient(
            90deg,
            rgba(187,30,53,.18),
            rgba(255,255,255,.025)
        );

    box-shadow:
        0 5px 22px rgba(230,28,58,.09);
}

.participant-team-main{
    min-width:0;
}

.participant-team-main strong{
    display:block;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    color:#f4f4f7;

    font-size:14px;
    font-weight:800;
}

.participant-team-main span{
    display:block;

    margin-top:4px;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    color:#8992a4;

    font-size:10px;
}

.participant-team-preview{
    color:#697286;

    font-size:9px;
    font-weight:700;

    white-space:nowrap;
}

.participant-team-preview span{
    margin:0 3px;
    opacity:.55;
}

.participant-team-arrow{
    font-size:22px;
    font-weight:300;

    transition:transform .16s ease;
}

.participants-conf .participant-team-arrow{
    color:#55aaff;
}

.participants-res .participant-team-arrow{
    color:#ff6175;
}

.participant-team-card:hover .participant-team-arrow{
    transform:translateX(3px);
}

.participants-empty{
    padding:20px;

    color:#70798a;

    font-size:11px;
    text-align:center;
}


/* ----------------------------------------------------------
   TEAM INFO MODAL
   ---------------------------------------------------------- */

.participants-team-modal{
    position:fixed;
    inset:0;

    z-index:1500000;

    display:none;

    align-items:center;
    justify-content:center;

    padding:22px;
}

.participants-team-modal.open{
    display:flex;
}

.participants-team-backdrop{
    position:absolute;
    inset:0;

    background:rgba(2,4,9,.82);

    backdrop-filter:blur(8px);
}

.participants-team-dialog{
    position:relative;
    z-index:1;

    width:min(470px,100%);
    max-height:min(720px,90vh);

    overflow-y:auto;

    padding:27px;

    border-radius:17px;

    background:
        radial-gradient(
            circle at 50% 0,
            rgba(255,255,255,.045),
            transparent 36%
        ),
        #0c1019;

    box-shadow:
        0 35px 100px rgba(0,0,0,.70);
}

.is-confederation .participants-team-dialog{
    border:1px solid rgba(55,153,255,.32);

    box-shadow:
        0 35px 100px rgba(0,0,0,.70),
        0 0 40px rgba(30,125,255,.08);
}

.is-resistance .participants-team-dialog{
    border:1px solid rgba(255,66,91,.32);

    box-shadow:
        0 35px 100px rgba(0,0,0,.70),
        0 0 40px rgba(255,34,66,.08);
}

.participants-team-close{
    position:absolute;

    top:15px;
    right:15px;

    width:32px;
    height:32px;

    display:grid;
    place-items:center;

    padding:0;

    border:1px solid rgba(255,255,255,.10);
    border-radius:8px;

    background:rgba(255,255,255,.035);
    color:#8d94a3;

    font-size:19px;
    line-height:1;

    cursor:pointer;
}

.participants-team-close:hover{
    color:#fff;
    border-color:rgba(255,255,255,.22);
}

.participants-modal-faction{
    display:flex;
    align-items:center;

    gap:9px;

    margin-bottom:11px;
}

.participants-modal-faction img{
    width:28px;
    height:28px;

    object-fit:contain;
}

.participants-modal-faction span{
    font-size:9px;
    font-weight:900;
    letter-spacing:.18em;
}

.is-confederation .participants-modal-faction span{
    color:#60afff;
}

.is-resistance .participants-modal-faction span{
    color:#ff6679;
}

.participants-team-dialog > h2{
    margin:0 45px 23px 0;

    color:#f5f5f7;

    font-size:25px;
    line-height:1.15;
}

.participants-modal-section{
    margin-top:13px;

    padding:15px;

    border:1px solid rgba(255,255,255,.075);
    border-radius:11px;

    background:rgba(255,255,255,.022);
}

.participants-modal-label{
    margin-bottom:10px;

    color:#737d90;

    font-size:8px;
    font-weight:900;
    letter-spacing:.16em;
}

.participants-modal-leader{
    color:#f1f2f6;

    font-size:14px;
    font-weight:800;
}

.participants-modal-roster{
    display:flex;
    flex-direction:column;

    gap:6px;
}

.participants-modal-player{
    display:flex;
    align-items:center;

    gap:10px;

    min-height:37px;

    padding:8px 10px;

    border-radius:8px;

    background:rgba(255,255,255,.03);
}

.participants-player-number{
    width:24px;

    color:#606b7c;

    font-size:9px;
    font-weight:800;
}

.participants-modal-player strong{
    color:#e7e9ee;

    font-size:12px;
    font-weight:700;
}

.is-confederation .participants-modal-player{
    border-left:2px solid rgba(61,157,255,.55);
}

.is-resistance .participants-modal-player{
    border-left:2px solid rgba(255,63,88,.55);
}

body.participants-modal-open{
    overflow:hidden;
}


/* ----------------------------------------------------------
   MOBILE
   ---------------------------------------------------------- */

@media(max-width:800px){

    .participants-factions{
        grid-template-columns:1fr;
    }

}


@media(max-width:520px){

    .participants-faction{
        padding:15px;
        border-radius:14px;
    }

    .participants-faction-logo{
        width:38px;
        height:38px;
    }

    .participants-faction-head h2{
        font-size:18px;
    }

    .participants-count{
        display:none;
    }

    .participant-team-card{
        grid-template-columns:minmax(0,1fr) 18px;
        padding:13px 12px;
    }

    .participant-team-preview{
        display:none;
    }

    .participants-team-modal{
        padding:12px;
    }

    .participants-team-dialog{
        padding:22px 17px;
        border-radius:14px;
    }

}

/* =========================================================
   V57 — CHAT FACTION / STAFF BUBBLE COLORS
   Staff        = Gold
   Confederation = Blue
   Resistance    = Red
   ========================================================= */

/* ---------- MATCH CHAT ---------- */

.match-chat-row.confederation .match-chat-bubble{
    background:rgba(42,105,198,.12) !important;
    border-color:rgba(69,137,239,.42) !important;
    box-shadow:inset 3px 0 0 rgba(69,137,239,.58);
}

.match-chat-row.resistance .match-chat-bubble{
    background:rgba(191,49,65,.11) !important;
    border-color:rgba(229,69,86,.40) !important;
    box-shadow:inset 3px 0 0 rgba(229,69,86,.56);
}

.match-chat-row.staff .match-chat-bubble{
    background:rgba(201,155,45,.11) !important;
    border-color:rgba(255,211,90,.44) !important;
    box-shadow:inset 3px 0 0 rgba(255,211,90,.68);
}

.match-chat-row.staff .match-chat-meta strong{
    color:#ffd35a;
}


/* ---------- TOURNAMENT CHAT ---------- */

.tournament-chat-row.confederation .tournament-chat-bubble{
    background:rgba(43,106,198,.11) !important;
    border-color:rgba(66,137,238,.40) !important;
    box-shadow:inset 3px 0 0 rgba(66,137,238,.56);
}

.tournament-chat-row.resistance .tournament-chat-bubble{
    background:rgba(190,49,64,.10) !important;
    border-color:rgba(228,68,86,.39) !important;
    box-shadow:inset 3px 0 0 rgba(228,68,86,.55);
}

.tournament-chat-row.staff .tournament-chat-bubble{
    background:rgba(201,155,45,.11) !important;
    border-color:rgba(255,211,90,.44) !important;
    box-shadow:inset 3px 0 0 rgba(255,211,90,.68);
}

.tournament-chat-row.staff .tournament-chat-meta strong{
    color:#ffd35a;
}


/* =========================================================
   V58 — CHAT MENTION COLORS
   @staff / @all = Gold
   @leaders      = Purple
   Confederation = Blue
   Resistance    = Red
   ========================================================= */

/* Tournament Chat — autocomplete */
.tournament-chat-mention-item.special[data-key="staff"] .tournament-chat-mention-name,
.tournament-chat-mention-item.special[data-key="all"] .tournament-chat-mention-name{
    color:#ffd35a;
}

.tournament-chat-mention-item.special[data-key="leaders"] .tournament-chat-mention-name{
    color:#bd91ff;
}

/* Tournament Chat — rendered mentions */
.tournament-chat-mentioned.gold{
    color:#ffd35a;
    background:rgba(255,211,90,.11);
    text-shadow:0 0 10px rgba(255,211,90,.28);
}

.tournament-chat-mentioned.leaders{
    color:#bd91ff;
    background:rgba(189,145,255,.11);
    text-shadow:0 0 10px rgba(189,145,255,.28);
}


/* Match Chat — autocomplete */
.match-chat-mention-item.special[data-key="staff"] .match-chat-mention-name,
.match-chat-mention-item.special[data-key="all"] .match-chat-mention-name{
    color:#ffd35a;
}

.match-chat-mention-item.special[data-key="leaders"] .match-chat-mention-name{
    color:#c494ff;
}

/* Match Chat — rendered mentions */
.match-chat-mentioned.gold{
    color:#ffd35a;
    background:rgba(255,211,90,.12);
    text-shadow:0 0 10px rgba(255,211,90,.28);
}

.match-chat-mentioned.leaders{
    color:#c494ff;
    background:rgba(166,103,255,.13);
    text-shadow:0 0 10px rgba(196,148,255,.28);
}


/* ==========================================================
   V59 CHAT MESSAGE EDIT / DELETE / HISTORY
   ========================================================== */

.chat-message-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:8px;
}

.chat-message-time{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
}

.chat-message-actions{
    display:flex;
    align-items:center;
    gap:6px;
}

.chat-message-action,
.chat-message-edited{
    appearance:none;
    border:0;
    background:transparent;
    font:inherit;
    cursor:pointer;
    padding:2px 4px;
    letter-spacing:.08em;
    font-size:10px;
    font-weight:800;
}

.chat-message-action{
    color:rgba(255,255,255,.58);
}

.chat-message-action:hover{
    color:#fff;
}

.chat-message-action.danger{
    color:#ff7c87;
}

.chat-message-action.danger:hover{
    color:#ffb0b7;
}

.chat-message-edited{
    color:rgba(255,211,90,.82);
    text-decoration:underline;
    text-decoration-style:dotted;
    text-underline-offset:3px;
}

.chat-message-edited:hover{
    color:#ffd35a;
}


/* Deleted message must override faction/staff V57 styling. */

.tournament-chat-row.deleted .tournament-chat-bubble,
.match-chat-row.deleted .match-chat-bubble,
.tournament-chat-bubble.chat-message-deleted,
.match-chat-bubble.chat-message-deleted{
    background:rgba(110,115,126,.12) !important;
    border-color:rgba(180,185,195,.20) !important;
    box-shadow:none !important;
}

.chat-message-deleted-text{
    color:rgba(220,223,230,.58);
    font-style:italic;
    font-size:13px;
    line-height:1.45;
}


/* Modal */

.chat-message-modal[hidden]{
    display:none !important;
}

.chat-message-modal{
    position:fixed;
    inset:0;
    z-index:100000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
}

.chat-message-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(3,5,12,.78);
    backdrop-filter:blur(7px);
}

.chat-message-modal-panel{
    position:relative;
    z-index:1;
    width:min(560px,100%);
    max-height:min(760px,88vh);
    overflow:auto;
    padding:24px;
    border:1px solid rgba(160,112,255,.35);
    border-radius:16px;
    background:
        linear-gradient(
            145deg,
            rgba(23,18,39,.98),
            rgba(10,11,20,.99)
        );
    box-shadow:
        0 28px 90px rgba(0,0,0,.62),
        0 0 34px rgba(124,76,255,.12);
}

.chat-message-modal-panel h2{
    margin:4px 40px 18px 0;
}

.chat-message-modal-x{
    position:absolute;
    top:14px;
    right:14px;
    width:34px;
    height:34px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:9px;
    background:rgba(255,255,255,.04);
    color:#fff;
    font-size:22px;
    cursor:pointer;
}

.chat-message-modal-x:hover{
    background:rgba(255,255,255,.09);
}

#tournament-chat-edit-input{
    display:block;
    width:100%;
    min-height:130px;
    resize:vertical;
    padding:13px 14px;
    border:1px solid rgba(160,112,255,.32);
    border-radius:11px;
    outline:none;
    background:rgba(4,5,12,.58);
    color:#fff;
    font:inherit;
    line-height:1.5;
}

#tournament-chat-edit-input:focus{
    border-color:rgba(177,135,255,.72);
    box-shadow:0 0 0 3px rgba(135,83,255,.10);
}

.chat-message-edit-note{
    margin-top:9px;
    color:rgba(255,255,255,.46);
    font-size:11px;
}

.chat-message-modal-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:18px;
}

.chat-message-modal-footer > div{
    display:flex;
    gap:8px;
}

.chat-message-modal-footer > span{
    color:rgba(255,255,255,.46);
    font-size:11px;
}

.chat-message-primary,
.chat-message-secondary{
    border-radius:9px;
    padding:9px 13px;
    font:inherit;
    font-size:11px;
    font-weight:800;
    letter-spacing:.06em;
    cursor:pointer;
}

.chat-message-primary{
    border:1px solid rgba(176,132,255,.65);
    background:rgba(125,76,255,.24);
    color:#fff;
}

.chat-message-primary:hover{
    background:rgba(125,76,255,.36);
}

.chat-message-secondary{
    border:1px solid rgba(255,255,255,.13);
    background:rgba(255,255,255,.04);
    color:rgba(255,255,255,.72);
}


/* History */

.chat-history-panel{
    width:min(680px,100%);
}

.chat-history-content{
    display:grid;
    gap:14px;
}

.chat-history-revision{
    padding:15px;
    border:1px solid rgba(255,255,255,.10);
    border-radius:12px;
    background:rgba(255,255,255,.025);
}

.chat-history-revision-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}

.chat-history-revision-head strong{
    color:#d7c4ff;
    font-size:11px;
    letter-spacing:.09em;
}

.chat-history-revision-head time{
    color:rgba(255,255,255,.42);
    font-size:10px;
}

.chat-history-label{
    margin:8px 0 5px;
    color:rgba(255,255,255,.42);
    font-size:9px;
    font-weight:800;
    letter-spacing:.12em;
}

.chat-history-message{
    padding:10px 11px;
    border-radius:8px;
    background:rgba(0,0,0,.20);
    color:rgba(255,255,255,.82);
    line-height:1.5;
    overflow-wrap:anywhere;
}

.chat-history-arrow{
    padding:5px 0 0;
    color:rgba(255,211,90,.58);
    text-align:center;
}

.chat-diff-change{
    padding:1px 2px;
    border-radius:3px;
    background:rgba(255,211,90,.23);
    color:#ffe69b;
}

.chat-history-loading,
.chat-history-empty,
.chat-history-error{
    padding:22px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:11px;
    color:rgba(255,255,255,.58);
    text-align:center;
}

.chat-history-error{
    color:#ff9da6;
}


@media (max-width:600px){

    .chat-message-modal{
        padding:12px;
        align-items:flex-end;
    }

    .chat-message-modal-panel{
        width:100%;
        max-height:88vh;
        padding:19px;
        border-radius:16px 16px 10px 10px;
    }

    .chat-message-footer{
        align-items:flex-end;
    }

    .chat-message-actions{
        flex-shrink:0;
    }

    .chat-message-action{
        font-size:9px;
    }

    .chat-message-modal-footer{
        align-items:flex-end;
    }
}


/* V59 Match Chat edit textarea */
#match-chat-edit-input{
    display:block;
    width:100%;
    min-height:130px;
    resize:vertical;
    padding:13px 14px;
    border:1px solid rgba(160,112,255,.32);
    border-radius:11px;
    outline:none;
    background:rgba(4,5,12,.58);
    color:#fff;
    font:inherit;
    line-height:1.5;
}

#match-chat-edit-input:focus{
    border-color:rgba(177,135,255,.72);
    box-shadow:0 0 0 3px rgba(135,83,255,.10);
}

/* V63 — Match Chat clickable team sender */
.match-chat-meta .match-chat-team-sender{
    appearance:none;
    -webkit-appearance:none;
    display:inline;
    width:auto;
    min-width:0;
    min-height:0;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    outline:0;
    background:transparent;
    box-shadow:none;
    color:inherit;
    font:inherit;
    font-weight:800;
    line-height:inherit;
    letter-spacing:inherit;
    text-align:left;
    cursor:pointer;
}

.match-chat-row.confederation
.match-chat-meta .match-chat-team-sender{
    color:#62aaff;
    text-shadow:0 0 8px rgba(67,145,255,.28);
}

.match-chat-row.resistance
.match-chat-meta .match-chat-team-sender{
    color:#ff6875;
    text-shadow:0 0 8px rgba(255,71,87,.25);
}

.match-chat-meta .match-chat-team-sender:hover{
    text-decoration:underline;
}

/* =========================================================
   V64 — GLOBAL CHAT TEAM CARD
   Tournament Chat + Match Chat
========================================================= */

.chat-team-card-modal{
    position:fixed;
    inset:0;
    z-index:10030;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
}

.chat-team-card-modal[hidden]{
    display:none !important;
}

.chat-team-card-backdrop{
    position:absolute;
    inset:0;
    background:rgba(3,3,8,.80);
    backdrop-filter:blur(5px);
}

.chat-team-card{
    position:relative;
    z-index:1;
    width:min(470px,100%);
    max-height:88vh;
    overflow:auto;
    padding:20px;
    border:1px solid rgba(142,88,217,.26);
    border-radius:12px;
    background:
        radial-gradient(
            circle at 90% 0%,
            rgba(112,60,175,.10),
            transparent 34%
        ),
        #0c0b12;
    box-shadow:0 25px 75px rgba(0,0,0,.7);
}

.chat-team-card.confederation{
    border-color:rgba(65,138,237,.35);
}

.chat-team-card.resistance{
    border-color:rgba(230,66,75,.35);
}

.chat-team-card-x{
    appearance:none;
    position:absolute;
    top:10px;
    right:10px;
    width:28px;
    height:28px;
    border:0;
    border-radius:6px;
    background:rgba(255,255,255,.035);
    color:#8a8692;
    font-size:18px;
    cursor:pointer;
}

.chat-team-card-x:hover{
    background:rgba(255,255,255,.07);
    color:#fff;
}

.chat-team-card-top{
    display:flex;
    align-items:center;
    gap:13px;
    padding-right:30px;
}

.chat-team-logo{
    flex:0 0 50px;
    width:50px !important;
    height:50px !important;
    max-width:50px !important;
    max-height:50px !important;
    object-fit:contain !important;
}

.chat-team-faction{
    color:#6e6978;
    font-size:7px;
    font-weight:900;
    letter-spacing:.14em;
}

.chat-team-card h2{
    margin:3px 0 !important;
    color:#ece9f0;
    font-size:19px !important;
    line-height:1.2;
}

.chat-team-leader{
    color:#74717d;
    font-size:9px;
}

.chat-team-leader strong{
    color:#bbb7c1;
}

.chat-team-muted-banner{
    margin-top:14px;
    padding:8px 9px;
    border:1px solid rgba(160,165,175,.15);
    border-radius:6px;
    background:rgba(120,125,135,.06);
    color:#898991;
    font-size:9px;
}

.chat-team-muted-banner strong{
    margin-right:5px;
    color:#bfc0c6;
}

.chat-team-roster-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:11px;
    margin-top:16px;
}

.chat-team-roster-title,
.chat-team-moderation-title{
    margin-bottom:5px;
    color:#6a6672;
    font-size:7px;
    font-weight:900;
    letter-spacing:.11em;
}

.chat-team-roster{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.chat-team-player{
    min-height:32px;
    display:flex;
    align-items:center;
    gap:7px;
    padding:5px 7px;
    border:1px solid rgba(255,255,255,.05);
    border-radius:6px;
    background:rgba(255,255,255,.015);
}

.chat-team-player span{
    width:18px;
    color:#585560;
    font-size:7px;
    font-weight:900;
}

.chat-team-player strong{
    color:#bdb9c2;
    font-size:9px;
}

.chat-team-moderation{
    margin-top:17px;
    padding-top:14px;
    border-top:1px solid rgba(255,255,255,.055);
}

.chat-team-current-mute{
    margin-bottom:8px;
    color:#99969f;
    font-size:9px;
    line-height:1.5;
}

/* Both Tournament Chat and Match Chat */
#chat-team-mute-reason,
#match-team-mute-reason{
    appearance:none;
    width:100%;
    min-height:62px;
    resize:vertical;
    padding:8px;
    border:1px solid rgba(255,255,255,.075);
    border-radius:6px;
    outline:none;
    background:#08070d;
    color:#dedbe3;
    font-family:inherit;
    font-size:10px;
}

#chat-team-mute-reason:focus,
#match-team-mute-reason:focus{
    border-color:rgba(151,91,230,.42);
}

.chat-team-reason-count{
    margin:4px 0 7px;
    color:#56535e;
    font-size:7px;
    text-align:right;
}

.chat-team-mute-button,
.chat-team-unmute-button{
    appearance:none;
    width:100%;
    padding:8px;
    border-radius:6px;
    font-family:inherit;
    font-size:8px;
    font-weight:900;
    letter-spacing:.08em;
    cursor:pointer;
}

.chat-team-mute-button{
    border:1px solid rgba(234,68,78,.28);
    background:rgba(190,42,52,.08);
    color:#e7747b;
}

.chat-team-unmute-button{
    border:1px solid rgba(70,190,120,.27);
    background:rgba(42,150,86,.07);
    color:#71ce97;
}

.chat-team-moderation-status{
    margin-top:7px;
    color:#72ca97;
    font-size:8px;
}

.chat-team-moderation-status.error{
    color:#e8747a;
}

@media(max-width:600px){
    .chat-team-roster-grid{
        grid-template-columns:1fr;
    }

    .chat-team-card{
        max-height:92vh;
        padding:17px;
    }
}


/* V65 — Team Card above Match Chat modal */
.chat-team-card-modal{
    z-index:999999 !important;
}


/* V66 — Match Chat muted team state */
.match-chat-row.muted .match-chat-bubble{
    border-color:rgba(135,140,150,.18) !important;
    background:rgba(65,67,73,.10) !important;
    box-shadow:none !important;
    filter:saturate(.12);
}

.match-chat-row.muted .match-chat-team-sender{
    color:#999aa0 !important;
    text-shadow:none !important;
}

.match-chat-row.muted .match-chat-text{
    color:#9a9aa1 !important;
}

.match-chat-row.muted .chat-muted-badge{
    margin-left:5px;
    padding:2px 4px;
    border:1px solid rgba(170,175,185,.15);
    border-radius:4px;
    background:rgba(125,130,140,.07);
    color:#85858d !important;
    font-size:6px !important;
    font-weight:900 !important;
}


/* V67 — Notification Center team-status filters */

.notification-status-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.notification-status-card{
    position:relative;
    display:flex;
    align-items:center;
    gap:12px;
    min-height:82px;
    padding:14px 16px;
    border:1px solid rgba(255,255,255,.10);
    border-radius:12px;
    background:rgba(7,12,22,.72);
    cursor:pointer;
    transition:
        border-color .16s ease,
        background .16s ease,
        box-shadow .16s ease;
}

.notification-status-card input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.notification-status-icon{
    flex:0 0 34px;
    width:34px;
    height:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:9px;
    background:rgba(255,255,255,.07);
    color:#858b98;
    font-size:17px;
    font-weight:900;
}

.notification-status-card span:last-child{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.notification-status-card b{
    color:#f0edf5;
    font-size:14px;
}

.notification-status-card small{
    color:#858b9c;
    font-size:11px;
}

.notification-status-card:has(input:checked){
    border-color:#d5ad38;
    background:
        linear-gradient(
            135deg,
            rgba(213,173,56,.10),
            rgba(8,14,24,.78)
        );
    box-shadow:
        0 0 0 1px rgba(213,173,56,.10),
        0 0 18px rgba(213,173,56,.08);
}

.notification-status-card:has(input:checked)
.notification-status-icon{
    background:rgba(213,173,56,.16);
    color:#f1c94d;
}

@media(max-width:700px){
    .notification-status-grid{
        grid-template-columns:1fr;
    }
}


/* V68 — Notification team list scrollbar */
.notify-team-scroll{
    scrollbar-width:thin;
    scrollbar-color:rgba(115,130,160,.65) transparent;
}

.notify-team-scroll::-webkit-scrollbar{
    width:6px;
}

.notify-team-scroll::-webkit-scrollbar-track{
    background:transparent;
}

.notify-team-scroll::-webkit-scrollbar-thumb{
    background:rgba(115,130,160,.55);
    border-radius:999px;
}

.notify-team-scroll::-webkit-scrollbar-thumb:hover{
    background:rgba(135,150,185,.75);
}


/* V69 — Notification status disabled in manual team mode */
.notification-status-disabled{
    opacity:.38;
}

.notification-status-disabled .notification-status-card{
    cursor:not-allowed;
    box-shadow:none !important;
}

.notification-status-disabled .notification-status-card:has(input:checked){
    border-color:rgba(255,255,255,.10);
    background:rgba(7,12,23,.55);
}


/* V70 — Notification teams: only the team list scrolls */
#notif-teams-wrap .notification-team-grid{
    max-height:none !important;
    overflow:visible !important;
}

#notif-teams-wrap .notify-team-scroll{
    max-height:355px !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    overscroll-behavior:contain;
}


/* =========================================================
   V71 — CHAT REPLIES
   ========================================================= */

/* Composer reply preview */
.chat-reply-preview{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 13px;
    margin:0 12px 8px;
    border:1px solid rgba(139,92,246,.32);
    border-left:3px solid #9b6cff;
    border-radius:10px;
    background:rgba(16,18,30,.94);
    box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.chat-reply-preview[hidden]{
    display:none !important;
}

.chat-reply-preview-content{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:2px;
}

.chat-reply-preview-label{
    font-size:9px;
    font-weight:800;
    letter-spacing:.14em;
    color:#a98aff;
}

.chat-reply-preview-content strong{
    font-size:12px;
    line-height:1.25;
    color:#f4f1ff;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.chat-reply-preview-content > span:last-child{
    max-width:620px;
    font-size:11px;
    line-height:1.35;
    color:rgba(232,232,244,.65);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.chat-reply-preview-close{
    flex:0 0 auto;
    width:28px;
    height:28px;
    border:0;
    border-radius:7px;
    background:rgba(255,255,255,.06);
    color:#c9c7d3;
    font-size:19px;
    line-height:1;
    cursor:pointer;
}

.chat-reply-preview-close:hover{
    background:rgba(255,255,255,.11);
    color:#fff;
}


/* Quote displayed inside a reply */
.chat-reply-quote{
    display:flex;
    width:100%;
    flex-direction:column;
    align-items:flex-start;
    gap:3px;
    margin:0 0 8px;
    padding:7px 9px;
    border:0;
    border-left:3px solid rgba(169,138,255,.85);
    border-radius:6px;
    background:rgba(0,0,0,.20);
    text-align:left;
    color:inherit;
    cursor:pointer;
}

.chat-reply-quote:hover{
    background:rgba(255,255,255,.055);
}

.chat-reply-quote-label{
    max-width:100%;
    font-size:9px;
    font-weight:800;
    letter-spacing:.08em;
    color:#b49aff;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.chat-reply-quote-text{
    display:block;
    width:100%;
    max-width:520px;
    font-size:11px;
    line-height:1.35;
    color:rgba(240,240,248,.68);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.chat-reply-quote.deleted{
    opacity:.6;
}


/* Personal unread reply counter */
.chat-unread-replies{
    position:absolute;
    right:22px;
    bottom:88px;
    z-index:30;
    min-width:86px;
    padding:8px 12px;
    border:1px solid rgba(168,126,255,.65);
    border-radius:999px;
    background:rgba(24,18,42,.96);
    color:#d6c4ff;
    font-size:10px;
    font-weight:900;
    letter-spacing:.08em;
    cursor:pointer;
    box-shadow:
        0 8px 28px rgba(0,0,0,.34),
        0 0 18px rgba(139,92,246,.16);
    backdrop-filter:blur(10px);
}

.chat-unread-replies[hidden]{
    display:none !important;
}

.chat-unread-replies:hover{
    border-color:#b898ff;
    color:#fff;
    transform:translateY(-1px);
}


/* Reply target/read highlight */
.tournament-chat-row.chat-reply-highlight
.tournament-chat-bubble{
    animation:chatReplyHighlight 1.8s ease;
}

@keyframes chatReplyHighlight{
    0%{
        box-shadow:
            0 0 0 1px rgba(185,153,255,.9),
            0 0 0 5px rgba(139,92,246,.18),
            0 0 28px rgba(139,92,246,.34);
    }

    45%{
        box-shadow:
            0 0 0 1px rgba(185,153,255,.65),
            0 0 0 3px rgba(139,92,246,.10),
            0 0 18px rgba(139,92,246,.22);
    }

    100%{
        box-shadow:none;
    }
}


@media (max-width:700px){

    .chat-reply-preview{
        margin:0 8px 7px;
        padding:9px 10px;
    }

    .chat-reply-preview-content > span:last-child{
        max-width:68vw;
    }

    .chat-reply-quote-text{
        max-width:64vw;
    }

    .chat-unread-replies{
        right:12px;
        bottom:84px;
        padding:7px 10px;
        min-width:76px;
        font-size:9px;
    }
}


/* =========================================================
   V72 — TOURNAMENT CHAT VIEWPORT + SCROLLBAR
   ========================================================= */

/*
   Height is set precisely by JS from the shell's actual
   viewport position. These rules keep all internal sections
   constrained correctly.
*/
.tournament-chat-page{
    min-height:0;
}

.tournament-chat-shell{
    min-height:0 !important;
    max-height:none !important;
}

.tournament-chat-body{
    flex:1 1 auto;
    min-height:0;
    overflow:hidden;
    position:relative;
}

.tournament-chat-messages{
    height:100%;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    overscroll-behavior:contain;

    /* Firefox */
    scrollbar-width:thin;
    scrollbar-color:rgba(151,100,225,.65) rgba(255,255,255,.035);
}

/* Chromium / Edge / Safari */
.tournament-chat-messages::-webkit-scrollbar{
    width:7px;
}

.tournament-chat-messages::-webkit-scrollbar-track{
    background:rgba(255,255,255,.025);
    border-radius:999px;
}

.tournament-chat-messages::-webkit-scrollbar-thumb{
    background:
        linear-gradient(
            180deg,
            rgba(173,119,244,.72),
            rgba(112,67,173,.62)
        );
    border-radius:999px;
    border:2px solid rgba(10,11,19,.9);
}

.tournament-chat-messages::-webkit-scrollbar-thumb:hover{
    background:
        linear-gradient(
            180deg,
            rgba(193,145,255,.88),
            rgba(137,82,207,.78)
        );
}

/* Composer/reply controls must never be squeezed away. */
.tournament-chat-compose,
.tournament-chat-compose-foot,
.chat-reply-preview{
    flex-shrink:0;
}

@media(max-width:600px){
    .tournament-chat-messages::-webkit-scrollbar{
        width:5px;
    }
}


/* =========================================================
   V73 — TOURNAMENT CHAT TRUE VIEWPORT LAYOUT
   ========================================================= */

.tournament-chat-page{
    display:flex;
    flex-direction:column;
    min-height:0;
}

.tournament-chat-heading{
    flex:0 0 auto;
}

.tournament-chat-shell{
    flex:1 1 auto;
    min-height:0 !important;
    overflow:hidden !important;
}

.tournament-chat-body{
    flex:1 1 0 !important;
    min-height:0 !important;
    overflow:hidden !important;
}

.tournament-chat-messages{
    height:100% !important;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
}

/* Prevent the browser page from receiving wheel movement
   once the internal chat reaches its ends. */
.tournament-chat-messages{
    overscroll-behavior-y:contain;
}


/* =========================================================
   V74 — TOURNAMENT CHAT STABLE VIEWPORT
   CSS ONLY — NO SCROLL-BASED HEIGHT CALCULATION
   ========================================================= */

/* Desktop */
.tournament-chat-page{
    display:flex;
    flex-direction:column;
    min-height:0;
    padding-top:18px;
    padding-bottom:12px;
}

.tournament-chat-heading{
    flex:0 0 auto;
    margin-bottom:12px;
}

.tournament-chat-shell{
    height:calc(100dvh - 190px) !important;
    min-height:420px !important;
    max-height:calc(100dvh - 190px) !important;

    display:flex;
    flex-direction:column;
    overflow:hidden !important;
}

.tournament-chat-body{
    flex:1 1 0 !important;
    min-height:0 !important;
    overflow:hidden !important;
}

.tournament-chat-messages{
    height:100% !important;
    min-height:0 !important;

    overflow-y:auto !important;
    overflow-x:hidden !important;

    overscroll-behavior-y:contain;

    scrollbar-width:thin;
    scrollbar-color:
        rgba(151,100,225,.68)
        rgba(255,255,255,.035);
}

.tournament-chat-messages::-webkit-scrollbar{
    width:7px;
}

.tournament-chat-messages::-webkit-scrollbar-track{
    background:rgba(255,255,255,.025);
}

.tournament-chat-messages::-webkit-scrollbar-thumb{
    background:linear-gradient(
        180deg,
        rgba(178,124,246,.78),
        rgba(112,67,173,.68)
    );
    border-radius:999px;
    border:2px solid rgba(10,11,19,.9);
}

.tournament-chat-compose,
.tournament-chat-compose-foot,
.tournament-chat-file-preview,
.chat-reply-preview{
    flex:0 0 auto;
}


/* Mobile */
@media(max-width:600px){

    .tournament-chat-page{
        padding-top:8px;
        padding-bottom:8px;
    }

    .tournament-chat-heading{
        margin-bottom:8px;
    }

    .tournament-chat-shell{
        /*
         * Fixed relative to dynamic viewport.
         * Scrolling the document CANNOT enlarge this.
         */
        height:calc(100dvh - 155px) !important;
        max-height:calc(100dvh - 155px) !important;
        min-height:300px !important;
    }

    .tournament-chat-messages::-webkit-scrollbar{
        width:5px;
    }
}

/* =========================================================
   V76 — TOURNAMENT CHAT RESPONSIVE LAYOUT
   ========================================================= */

/*
 * Do NOT lock body/wrap height.
 * Do NOT resize chat from scroll position.
 */

body.tournament-chat-view .tournament-chat-page{
    width:100%;
    max-width:1000px;
    min-width:0;
    margin:0 auto;
}

body.tournament-chat-view .tournament-chat-shell{
    width:100%;
    max-width:100%;
    min-width:0;

    height:calc(100dvh - 235px) !important;
    max-height:none !important;
    min-height:520px !important;

    display:flex;
    flex-direction:column;
    overflow:hidden !important;
}

body.tournament-chat-view .tournament-chat-body{
    flex:1 1 0;
    min-width:0;
    min-height:0;
    overflow:hidden;
}

body.tournament-chat-view .tournament-chat-messages{
    width:100%;
    max-width:100%;
    min-width:0;
    height:100%;

    overflow-y:auto !important;
    overflow-x:hidden !important;
    overscroll-behavior:contain;
}


/* ---------------- MOBILE ---------------- */

@media(max-width:600px){

    body.tournament-chat-view .tournament-chat-page{
        width:100%;
        max-width:100%;
        min-width:0;

        padding-left:0;
        padding-right:0;
    }

    body.tournament-chat-view .tournament-chat-shell{
        width:100%;
        max-width:100%;
        min-width:0;

        height:calc(100dvh - 175px) !important;
        min-height:400px !important;

        margin-left:0;
        margin-right:0;
    }

    body.tournament-chat-view .tournament-chat-body,
    body.tournament-chat-view .tournament-chat-messages,
    body.tournament-chat-view .tournament-chat-compose,
    body.tournament-chat-view .tournament-chat-compose-foot,
    body.tournament-chat-view .chat-reply-preview{
        width:100%;
        max-width:100%;
        min-width:0;
    }

    body.tournament-chat-view .tournament-chat-compose{
        grid-template-columns:minmax(0,1fr) auto auto;
    }
}


/* =========================================================
   V77 — TOURNAMENT CHAT: NO DOCUMENT SCROLL
   Keep navbar + heading + composer visible.
   Only message history scrolls.
   ========================================================= */

body.tournament-chat-view{
    height:100dvh;
    min-height:100dvh;
    overflow:hidden;
}

/*
 * The normal wrapper remains full width.
 * Do NOT give it a fixed height.
 */
body.tournament-chat-view > .wrap{
    width:min(1100px,92%);
    max-width:92%;
    overflow:visible;
}

/*
 * Calculate the chat shell from its fixed document position.
 * Unlike the removed JS, this value cannot change when scrolling.
 */
body.tournament-chat-view .tournament-chat-shell{
    height:calc(100dvh - 230px) !important;
    min-height:0 !important;
    max-height:calc(100dvh - 230px) !important;
}

body.tournament-chat-view .tournament-chat-body{
    flex:1 1 0 !important;
    min-height:0 !important;
    overflow:hidden !important;
}

body.tournament-chat-view .tournament-chat-messages{
    height:100% !important;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
}


/* MOBILE */
@media(max-width:600px){

    body.tournament-chat-view{
        width:100%;
        height:100dvh;
        min-height:100dvh;
        overflow:hidden;
    }

    body.tournament-chat-view > .wrap{
        width:94%;
        max-width:94%;
        margin-left:auto;
        margin-right:auto;
    }

    body.tournament-chat-view .tournament-chat-page{
        width:100%;
        max-width:100%;
        min-width:0;
        padding-top:8px;
        padding-bottom:0;
    }

    body.tournament-chat-view .tournament-chat-shell{
        width:100%;
        max-width:100%;

        height:calc(100dvh - 160px) !important;
        max-height:calc(100dvh - 160px) !important;
        min-height:0 !important;

        margin:0;
    }

    body.tournament-chat-view .tournament-chat-body{
        min-width:0;
        min-height:0;
    }

    body.tournament-chat-view .tournament-chat-messages{
        min-width:0;
        min-height:0;
    }
}


/* =========================================================
   V78 — TOURNAMENT CHAT COMPACT HEADER
   Move chat panel upward without changing scroll behavior
   ========================================================= */

body.tournament-chat-view .tournament-chat-page{
    padding-top:4px !important;
}

body.tournament-chat-view .tournament-chat-heading{
    margin-bottom:8px !important;
}

body.tournament-chat-view .tournament-chat-heading h1{
    margin-top:8px;
    margin-bottom:8px;
}

body.tournament-chat-view .tournament-chat-heading p{
    margin-top:0;
    margin-bottom:0;
}


/* MOBILE */
@media(max-width:600px){

    body.tournament-chat-view .tournament-chat-page{
        padding-top:0 !important;
    }

    body.tournament-chat-view .tournament-chat-heading{
        margin-bottom:8px !important;
    }

    body.tournament-chat-view .tournament-chat-heading h1{
        font-size:32px;
        line-height:1.05;
        margin:7px 0 8px;
    }

    body.tournament-chat-view .tournament-chat-heading p{
        font-size:14px;
        line-height:1.4;
        margin:0;
        max-width:85%;
    }

    body.tournament-chat-view .tournament-chat-heading .eyebrow{
        margin:0;
    }
}


/* =========================================================
   V79 — MOBILE TOURNAMENT CHAT HIGHER
   Desktop remains unchanged
   ========================================================= */

@media(max-width:600px){

    /* Less empty space below navigation */
    body.tournament-chat-view .tournament-chat-page{
        padding-top:0 !important;
    }

    body.tournament-chat-view .tournament-chat-heading{
        position:relative;
        margin-top:-12px !important;
        margin-bottom:6px !important;
    }

    /* Compact communication label */
    body.tournament-chat-view .tournament-chat-heading .eyebrow{
        font-size:11px;
        line-height:1;
        margin:0 0 7px !important;
    }

    /* Compact title */
    body.tournament-chat-view .tournament-chat-heading h1{
        font-size:28px !important;
        line-height:1.05 !important;
        margin:0 0 7px !important;
    }

    /* Description takes less vertical room */
    body.tournament-chat-view .tournament-chat-heading p{
        font-size:13px !important;
        line-height:1.3 !important;
        margin:0 !important;
        max-width:78% !important;
    }

    /* Keep LIVE beside the heading instead of consuming height */
    body.tournament-chat-view .tournament-chat-live{
        position:absolute;
        right:0;
        top:5px;
    }

    /*
     * We recovered header space, so give that space
     * directly back to the chat.
     */
    body.tournament-chat-view .tournament-chat-shell{
        height:calc(100dvh - 125px) !important;
        max-height:calc(100dvh - 125px) !important;
    }
}


/* =========================================================
   V80 — SHORT MOBILE TOURNAMENT CHAT
   Only phones / short mobile viewports
   ========================================================= */

@media(max-width:600px) and (max-height:700px){

    /* Compact top navigation */
    body.tournament-chat-view .portal-nav{
        padding-top:8px !important;
        padding-bottom:6px !important;
    }

    body.tournament-chat-view .brand{
        font-size:10px !important;
        line-height:1.15 !important;
    }

    body.tournament-chat-view .portal-menu-button,
    body.tournament-chat-view .portal-menu-toggle{
        min-height:34px !important;
        padding:7px 10px !important;
    }


    /* Pull Tournament Chat heading upward */
    body.tournament-chat-view .tournament-chat-heading{
        margin-top:-4px !important;
        margin-bottom:5px !important;
    }

    body.tournament-chat-view .tournament-chat-heading .eyebrow{
        font-size:9px !important;
        margin-bottom:4px !important;
    }

    body.tournament-chat-view .tournament-chat-heading h1{
        font-size:22px !important;
        line-height:1 !important;
        margin:0 0 5px !important;
    }

    body.tournament-chat-view .tournament-chat-heading p{
        font-size:10px !important;
        line-height:1.25 !important;
        max-width:72% !important;
    }

    body.tournament-chat-view .tournament-chat-live{
        top:3px !important;
        transform:scale(.85);
        transform-origin:right top;
    }


    /* Move chat box upward and give it the recovered space */
    body.tournament-chat-view .tournament-chat-shell{
        height:calc(100dvh - 105px) !important;
        max-height:calc(100dvh - 105px) !important;
    }

}

/* V81 — short mobile composer footer */
@media(max-width:600px) and (max-height:700px){
    body.tournament-chat-view .tournament-chat-compose-foot{
        display:none !important;
    }
}

/* =========================================================
   V82 — SHORT MOBILE: KEEP COMPOSER ABOVE VIEWPORT BOTTOM
   ========================================================= */

@media(max-width:600px) and (max-height:700px){

    body.tournament-chat-view .tournament-chat-shell{
        /*
         * Keep the current TOP position.
         * Reduce only the bottom of the shell so the composer
         * remains fully inside the visible viewport.
         */
        height:calc(100dvh - 145px) !important;
        max-height:calc(100dvh - 145px) !important;
        min-height:0 !important;
    }

    body.tournament-chat-view .tournament-chat-compose{
        flex:0 0 auto !important;
        position:relative;
        z-index:5;
    }

    body.tournament-chat-view .tournament-chat-compose-foot{
        display:none !important;
    }

    body.tournament-chat-view .tournament-chat-body{
        flex:1 1 0 !important;
        min-height:0 !important;
    }

    body.tournament-chat-view .tournament-chat-messages{
        min-height:0 !important;
        overflow-y:auto !important;
    }
}

/* =========================================================
   V83 — REAL PHONE COMPOSER POSITION
   Apply corrected bottom spacing to all phone widths
   ========================================================= */

@media(max-width:600px){

    body.tournament-chat-view .tournament-chat-shell{
        height:calc(100dvh - 145px) !important;
        max-height:calc(100dvh - 145px) !important;
        min-height:0 !important;
    }

    body.tournament-chat-view .tournament-chat-body{
        flex:1 1 0 !important;
        min-height:0 !important;
        overflow:hidden !important;
    }

    body.tournament-chat-view .tournament-chat-messages{
        flex:1 1 auto !important;
        min-height:0 !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
    }

    body.tournament-chat-view .tournament-chat-compose{
        flex:0 0 auto !important;
        position:relative;
        z-index:5;
    }

    body.tournament-chat-view .tournament-chat-compose-foot{
        display:none !important;
    }
}

/* V84 — PHONE BOTTOM CLEARANCE */
@media(max-width:600px){
    body.tournament-chat-view .tournament-chat-shell{
        height:calc(100dvh - 170px) !important;
        max-height:calc(100dvh - 170px) !important;
        min-height:0 !important;
    }
}


/* =========================================================
   V87 — CHAT COMPOSER + EMOJI PICKER
   ========================================================= */

/* ---------- COMPOSER ---------- */

.tournament-chat-compose{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 42px 42px auto !important;
    gap:8px !important;
    align-items:end !important;
}

.chat-emoji-wrap{
    position:relative !important;
    width:42px;
    height:42px;
    flex:none;
    align-self:end;
}


/* Attachment + Emoji = matching utility buttons */

.tournament-chat-attach,
.chat-emoji-button{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    padding:0 !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    border:1px solid rgba(147,102,216,.48) !important;
    border-radius:9px !important;

    background:
        linear-gradient(
            180deg,
            rgba(48,31,72,.96),
            rgba(30,21,48,.96)
        ) !important;

    color:#eee5ff !important;

    cursor:pointer;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.04);

    transition:
        border-color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.tournament-chat-attach{
    font-size:0 !important;
}

.tournament-chat-attach::before{
    content:"📎";
    font-size:19px;
    line-height:1;
}

.chat-emoji-button{
    font-size:0 !important;
}

.chat-emoji-button::before{
    content:"😀";
    font-size:19px;
    line-height:1;
}

.tournament-chat-attach:hover,
.chat-emoji-button:hover{
    border-color:#a873ee !important;
    background:
        linear-gradient(
            180deg,
            rgba(69,43,102,.98),
            rgba(42,27,65,.98)
        ) !important;
    transform:translateY(-1px);
}


/* ---------- PICKER ---------- */

.chat-emoji-picker{
    position:absolute !important;

    right:-52px !important;
    left:auto !important;
    bottom:50px !important;

    width:350px !important;
    height:auto !important;
    max-width:none !important;
    max-height:none !important;

    display:block !important;

    padding:10px !important;

    overflow:visible !important;

    background:
        linear-gradient(
            180deg,
            rgba(25,20,38,.995),
            rgba(12,10,20,.995)
        ) !important;

    border:1px solid rgba(156,105,225,.52) !important;
    border-radius:12px !important;

    box-shadow:
        0 20px 60px rgba(0,0,0,.72),
        0 0 30px rgba(127,73,190,.12) !important;

    z-index:999999 !important;
}

.chat-emoji-picker[hidden]{
    display:none !important;
}


/* Search */

.chat-emoji-search-wrap{
    width:100% !important;
    height:35px !important;

    display:flex !important;
    align-items:center !important;

    gap:7px;

    padding:0 10px !important;
    margin:0 0 8px !important;

    box-sizing:border-box;

    border:1px solid rgba(147,116,190,.25) !important;
    border-radius:7px !important;

    background:rgba(7,6,12,.68) !important;

    color:#8e829e;
}

.chat-emoji-search{
    width:100% !important;
    min-width:0 !important;
    height:auto !important;

    padding:0 !important;
    margin:0 !important;

    border:0 !important;
    outline:0 !important;
    box-shadow:none !important;

    background:transparent !important;
    color:#f0ebf7 !important;

    font-size:12px !important;
}

.chat-emoji-search::placeholder{
    color:#746b80 !important;
}


/* Category bar */

.chat-emoji-categories{
    width:100% !important;

    display:grid !important;
    grid-template-columns:repeat(9,minmax(0,1fr)) !important;

    gap:2px !important;

    margin:0 0 7px !important;
    padding:0 0 7px !important;

    border-bottom:
        1px solid rgba(255,255,255,.065);
}

.chat-emoji-category{
    width:auto !important;
    min-width:0 !important;
    height:29px !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    padding:0 !important;
    margin:0 !important;

    border:0 !important;
    border-radius:6px !important;

    background:transparent !important;

    font-size:16px !important;
    line-height:1 !important;

    opacity:.58;
    cursor:pointer;
}

.chat-emoji-category:hover{
    opacity:1;
    background:rgba(147,93,218,.13) !important;
}

.chat-emoji-category.active{
    opacity:1;

    background:rgba(147,93,218,.18) !important;

    box-shadow:
        inset 0 -2px 0 #aa72ef !important;
}


/* Category title */

.chat-emoji-section-title{
    height:17px !important;

    margin:0 2px 4px !important;

    color:#8d819d !important;

    font-size:9px !important;
    font-weight:800 !important;

    letter-spacing:.11em;
}


/* Actual emoji area */

.chat-emoji-grid{
    width:100% !important;
    height:210px !important;

    display:grid !important;
    grid-template-columns:repeat(9,minmax(0,1fr)) !important;
    grid-auto-rows:35px !important;

    gap:1px !important;

    padding:0 3px 0 0 !important;
    margin:0 !important;

    overflow-y:auto !important;
    overflow-x:hidden !important;

    box-sizing:border-box;

    scrollbar-width:thin;
    scrollbar-color:#73509f rgba(255,255,255,.025);
}

.chat-emoji-grid::-webkit-scrollbar{
    width:5px;
}

.chat-emoji-grid::-webkit-scrollbar-track{
    background:rgba(255,255,255,.025);
}

.chat-emoji-grid::-webkit-scrollbar-thumb{
    background:#73509f;
    border-radius:10px;
}


/* Individual emoji — NO purple box */

.chat-emoji-item{
    width:35px !important;
    height:35px !important;
    min-width:0 !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    padding:0 !important;
    margin:0 auto !important;

    border:0 !important;
    border-radius:6px !important;

    background:transparent !important;
    box-shadow:none !important;

    font-family:
        "Segoe UI Emoji",
        "Apple Color Emoji",
        "Noto Color Emoji",
        sans-serif !important;

    font-size:20px !important;
    line-height:1 !important;

    cursor:pointer;

    transition:
        background .1s ease,
        transform .1s ease;
}

.chat-emoji-item:hover{
    background:rgba(150,96,220,.17) !important;
    transform:scale(1.13);
}

.chat-emoji-empty{
    grid-column:1/-1;

    display:flex;
    align-items:center;
    justify-content:center;

    height:100px;

    color:#786e84;
    font-size:11px;
}


/* ---------- PHONE ---------- */

@media(max-width:600px){

    body.tournament-chat-view .tournament-chat-compose{
        display:grid !important;

        grid-template-columns:
            minmax(0,1fr) 36px 36px auto !important;

        gap:5px !important;
    }

    .chat-emoji-wrap{
        width:36px;
        height:36px;
    }

    .tournament-chat-attach,
    .chat-emoji-button{
        width:36px !important;
        min-width:36px !important;
        height:36px !important;
    }

    .tournament-chat-attach::before,
    .chat-emoji-button::before{
        font-size:17px;
    }

    .chat-emoji-picker{
        position:fixed !important;

        left:50% !important;
        right:auto !important;

        bottom:68px !important;

        width:min(350px,calc(100vw - 16px)) !important;

        transform:translateX(-50%) !important;

        padding:9px !important;
    }

    .chat-emoji-grid{
        height:190px !important;
    }

    .chat-emoji-item{
        width:33px !important;
        height:33px !important;
        font-size:19px !important;
    }
}

/* V88 — MATCH CHAT EMOJI COMPOSER */

.match-chat-compose{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 42px 42px auto !important;
    gap:8px !important;
    align-items:end !important;
}

.match-chat-attach-button{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    padding:0 !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    border:1px solid rgba(147,102,216,.48) !important;
    border-radius:9px !important;

    background:
        linear-gradient(
            180deg,
            rgba(48,31,72,.96),
            rgba(30,21,48,.96)
        ) !important;

    color:#eee5ff !important;
    font-size:19px !important;

    cursor:pointer;
}

.match-chat-attach-button:hover{
    border-color:#a873ee !important;
    background:
        linear-gradient(
            180deg,
            rgba(69,43,102,.98),
            rgba(42,27,65,.98)
        ) !important;
}

@media(max-width:600px){

    .match-chat-compose{
        grid-template-columns:
            minmax(0,1fr) 36px 36px auto !important;

        gap:5px !important;
    }

    .match-chat-attach-button{
        width:36px !important;
        min-width:36px !important;
        height:36px !important;
        font-size:17px !important;
    }
}


/* V89 — remove native Match Chat textarea scrollbar */
#match-chat-input{
    overflow-y:hidden !important;
    scrollbar-width:none !important;
}

#match-chat-input::-webkit-scrollbar{
    display:none !important;
    width:0 !important;
    height:0 !important;
}


/* =========================================================
   V90 — MOBILE MATCH CHAT COMPOSER FIX
   ========================================================= */

@media(max-width:600px){

    .match-chat-compose{
        display:grid !important;
        grid-template-columns:minmax(0,1fr) 38px 38px auto !important;
        gap:6px !important;
        align-items:end !important;
    }

    .match-chat-compose > textarea{
        grid-column:1 !important;
        min-width:0 !important;
    }

    .match-chat-attach-button{
        grid-column:2 !important;
        position:static !important;

        width:38px !important;
        min-width:38px !important;
        height:38px !important;

        margin:0 !important;
        transform:none !important;
    }

    .match-chat-compose > .chat-emoji-wrap{
        grid-column:3 !important;

        position:relative !important;

        width:38px !important;
        min-width:38px !important;
        height:38px !important;

        margin:0 !important;
        transform:none !important;
    }

    .match-chat-compose > .chat-emoji-wrap > .chat-emoji-button{
        position:static !important;

        width:38px !important;
        min-width:38px !important;
        height:38px !important;

        margin:0 !important;
        transform:none !important;
    }

    #match-chat-send{
        grid-column:4 !important;
        position:static !important;
        margin:0 !important;
        transform:none !important;
    }
}

/* =========================================================
   V91 — MATCH CHAT MOBILE COMPOSER FINAL OVERRIDE
   ========================================================= */

@media(max-width:600px){

    .match-chat-compose{
        display:flex !important;
        flex-direction:row !important;
        align-items:flex-end !important;
        gap:6px !important;
        width:100% !important;
    }

    #match-chat-input{
        flex:1 1 auto !important;
        width:auto !important;
        min-width:0 !important;
        position:static !important;
        margin:0 !important;
    }

    #match-chat-attach-button{
        flex:0 0 38px !important;
        width:38px !important;
        min-width:38px !important;
        height:38px !important;

        position:static !important;
        inset:auto !important;

        margin:0 !important;
        padding:0 !important;

        transform:none !important;
    }

    .match-chat-compose > .chat-emoji-wrap{
        flex:0 0 38px !important;

        width:38px !important;
        min-width:38px !important;
        height:38px !important;

        position:relative !important;
        inset:auto !important;

        margin:0 !important;
        padding:0 !important;

        transform:none !important;
    }

    #match-chat-emoji{
        display:flex !important;

        width:38px !important;
        min-width:38px !important;
        height:38px !important;

        position:static !important;
        inset:auto !important;

        margin:0 !important;
        padding:0 !important;

        transform:none !important;
    }

    #match-chat-send{
        flex:0 0 auto !important;

        position:static !important;
        inset:auto !important;

        margin:0 !important;
        transform:none !important;
    }
}

/* =========================================================
   V92 — MATCH CHAT MOBILE PAGE LOCK
   ========================================================= */

@media(max-width:700px){

    html:has(body.match-chat-open){
        overflow:hidden !important;
        overscroll-behavior:none !important;
    }

    body.match-chat-open{
        overflow:hidden !important;
        overscroll-behavior:none !important;

        width:100% !important;
        height:100dvh !important;
        max-height:100dvh !important;
    }

    /*
     * Match Chat remains fixed to the phone viewport.
     * The bracket behind it cannot scroll.
     */
    body.match-chat-open .match-chat-modal{
        position:fixed !important;
        inset:0 !important;

        width:100vw !important;
        height:100dvh !important;
        max-height:100dvh !important;

        overflow:hidden !important;
        overscroll-behavior:none !important;
    }

    /*
     * Only message history is a vertical scroll surface.
     */
    body.match-chat-open .match-chat-messages{
        overflow-x:hidden !important;
        overflow-y:auto !important;

        overscroll-behavior:contain !important;
        -webkit-overflow-scrolling:touch;

        touch-action:pan-y !important;
    }
}

/* =========================================================
   V93 — MATCH CHAT PAGE LOCK — ALL DEVICES
   ========================================================= */

/* Lock the bracket/page behind Match Chat on PC + mobile */
html:has(body.match-chat-open),
body.match-chat-open{
    overflow:hidden !important;
    overscroll-behavior:none !important;
}

/* Match Chat itself stays inside the viewport */
body.match-chat-open .match-chat-modal{
    position:fixed !important;
    inset:0 !important;

    width:100vw !important;
    height:100dvh !important;
    max-height:100dvh !important;

    overflow:hidden !important;
    overscroll-behavior:none !important;
}

/* Only the actual message history may scroll */
body.match-chat-open .match-chat-messages{
    overflow-x:hidden !important;
    overflow-y:auto !important;

    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-y !important;
}

/* =========================================================
   V94 — MATCH CHAT SCROLLBAR
   Match Tournament Chat scrollbar style
   ========================================================= */

.match-chat-messages{
    scrollbar-width:thin !important;
    scrollbar-color:#7d45c7 rgba(255,255,255,.035) !important;
}

/* Chrome / Edge / Safari */
.match-chat-messages::-webkit-scrollbar{
    width:7px !important;
}

.match-chat-messages::-webkit-scrollbar-track{
    background:rgba(255,255,255,.035) !important;
    border-radius:999px !important;
}

.match-chat-messages::-webkit-scrollbar-thumb{
    background:linear-gradient(
        180deg,
        #9a5ce0,
        #6630a8
    ) !important;

    border-radius:999px !important;

    border:1px solid rgba(15,10,28,.65) !important;

    box-shadow:
        0 0 6px rgba(150,80,220,.28) !important;
}

.match-chat-messages::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(
        180deg,
        #ae72eb,
        #7942bd
    ) !important;
}

/* =========================================================
   V95 — TOURNAMENT BRACKET HORIZONTAL SCROLLBAR
   ========================================================= */

.bracket-scroll.tournament-bracket-scroll{
    scrollbar-width:thin !important;
    scrollbar-color:#7d45c7 rgba(255,255,255,.035) !important;
}

/* Chrome / Edge / Safari */
.bracket-scroll.tournament-bracket-scroll::-webkit-scrollbar{
    height:7px !important;
}

.bracket-scroll.tournament-bracket-scroll::-webkit-scrollbar-track{
    background:rgba(255,255,255,.035) !important;
    border-radius:999px !important;
}

.bracket-scroll.tournament-bracket-scroll::-webkit-scrollbar-thumb{
    background:linear-gradient(
        90deg,
        #6630a8,
        #9a5ce0,
        #6630a8
    ) !important;

    border-radius:999px !important;
    border:1px solid rgba(15,10,28,.65) !important;

    box-shadow:
        0 0 6px rgba(150,80,220,.28) !important;
}

.bracket-scroll.tournament-bracket-scroll::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(
        90deg,
        #7942bd,
        #ae72eb,
        #7942bd
    ) !important;
}

/* =========================================================
   V96 — NOTIFICATION TEAM LIST SCROLLBAR
   Match global purple scrollbar design
   ========================================================= */

.notify-team-scroll{
    scrollbar-width:thin !important;
    scrollbar-color:#7d45c7 rgba(255,255,255,.035) !important;
}

.notify-team-scroll::-webkit-scrollbar{
    width:7px !important;
}

.notify-team-scroll::-webkit-scrollbar-track{
    background:rgba(255,255,255,.035) !important;
    border-radius:999px !important;
}

.notify-team-scroll::-webkit-scrollbar-thumb{
    background:linear-gradient(
        180deg,
        #9a5ce0,
        #6630a8
    ) !important;

    border-radius:999px !important;
    border:1px solid rgba(15,10,28,.65) !important;

    box-shadow:
        0 0 6px rgba(150,80,220,.28) !important;
}

.notify-team-scroll::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(
        180deg,
        #ae72eb,
        #7942bd
    ) !important;
}

/* =========================================================
   V97 — GLOBAL WEBSITE SCROLLBAR
   Default scrollbar for all pages
   ========================================================= */

/* Firefox */
html{
    scrollbar-width:thin;
    scrollbar-color:#7d45c7 #0b0d15;
}

/* Chrome / Edge / Safari */
html::-webkit-scrollbar,
body::-webkit-scrollbar{
    width:8px;
    height:8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track{
    background:#0b0d15;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb{
    background:linear-gradient(
        180deg,
        #9a5ce0,
        #6630a8
    );

    border-radius:999px;
    border:1px solid #0b0d15;

    box-shadow:
        0 0 6px rgba(150,80,220,.30);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(
        180deg,
        #b271ed,
        #7942bd
    );
}

/* Horizontal page scrollbar uses the same theme */
html::-webkit-scrollbar-thumb:horizontal,
body::-webkit-scrollbar-thumb:horizontal{
    background:linear-gradient(
        90deg,
        #6630a8,
        #9a5ce0,
        #6630a8
    );
}

/* =========================================================
   V98 — TOURNAMENT INFO / RULES MODAL SCROLL LOCK
   Lock background page, keep modal content scrollable
   PC + Mobile
   ========================================================= */

/* Main website must not scroll while either modal is open */
html:has(body.modal-open),
body.modal-open{
    overflow:hidden !important;
    overscroll-behavior:none !important;
}

/* Modal occupies the viewport and does not become a page scroll */
body.modal-open .content-modal.open{
    position:fixed !important;
    inset:0 !important;

    width:100vw !important;
    height:100dvh !important;
    max-height:100dvh !important;

    overflow:hidden !important;
    overscroll-behavior:none !important;
}

/* Only the Information / Rules panel may scroll */
body.modal-open .content-modal.open .modal-panel{
    max-height:calc(100dvh - 40px) !important;

    overflow-x:hidden !important;
    overflow-y:auto !important;

    overscroll-behavior:contain !important;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-y !important;

    /* Same purple scrollbar design */
    scrollbar-width:thin !important;
    scrollbar-color:#7d45c7 rgba(255,255,255,.035) !important;
}

body.modal-open .content-modal.open .modal-panel::-webkit-scrollbar{
    width:7px !important;
}

body.modal-open .content-modal.open .modal-panel::-webkit-scrollbar-track{
    background:rgba(255,255,255,.035) !important;
    border-radius:999px !important;
}

body.modal-open .content-modal.open .modal-panel::-webkit-scrollbar-thumb{
    background:linear-gradient(
        180deg,
        #9a5ce0,
        #6630a8
    ) !important;

    border-radius:999px !important;
    border:1px solid rgba(15,10,28,.65) !important;

    box-shadow:
        0 0 6px rgba(150,80,220,.28) !important;
}

body.modal-open .content-modal.open .modal-panel::-webkit-scrollbar-thumb:hover{
    background:linear-gradient(
        180deg,
        #ae72eb,
        #7942bd
    ) !important;
}

/* =========================================================
   V112 — STABLE RESPONSIVE MOBILE/TABLET BATTLEFIELD
   Desktop remains completely unchanged.
   ========================================================= */

.mobile-battlefield{
    display:none;
}

@media (max-width:760px){

    /*
     * The browser document itself does not scroll.
     * This prevents Chrome's changing toolbar viewport from
     * moving/repainting the battlefield.
     */
    html,
    body{
        width:100%;
        height:100%;
        overflow:hidden;
        background:#070b12 !important;
    }

    body{
        position:relative;
    }

    /*
     * Stable wallpaper.
     *
     * Same behavior as a responsive banner:
     * phone  -> center crop
     * tablet -> more image visible
     *
     * The image keeps its aspect ratio.
     */
    .mobile-battlefield{
        display:block;
        position:absolute;
        inset:0;

        width:100%;
        height:100%;

        pointer-events:none;
        z-index:0;

        background:
            #070b12
            url('/static/tournament-background.jpg')
            center center / cover
            no-repeat;
    }

    /*
     * Existing cinematic overlay remains above the battlefield.
     */
    .page-backdrop{
        position:absolute !important;
        inset:0;
        z-index:1 !important;
        pointer-events:none;
    }

    /*
     * The website scrolls OVER the stationary battlefield.
     *
     * Horizontal scrolling still belongs to components such
     * as the tournament bracket, not to the page itself.
     */
    body:not(.tournament-chat-view) > .wrap{
        position:absolute;
        z-index:2;

        top:0;
        left:0;
        right:0;
        bottom:0;

        width:min(1100px,92%);
        max-width:92%;
        margin:0 auto;

        overflow-y:auto;
        overflow-x:hidden;

        -webkit-overflow-scrolling:touch;
    }

    /*
     * Tournament Chat already has its own carefully tuned
     * viewport/scroll system. Do not replace it.
     */
    body.tournament-chat-view > .wrap{
        position:relative;
        z-index:2;
    }
}

/* =========================================================
   V113 — MOBILE PAGE SCROLLBAR AT VIEWPORT EDGE
   Keep V112 battlefield and content alignment unchanged.
   ========================================================= */

@media (max-width:760px){

    body:not(.tournament-chat-view) > .wrap{
        /*
         * V112 originally uses 92% width = 4% margin each side.
         * Expand only the scroll box to the full viewport.
         */
        width:100% !important;
        max-width:100% !important;
        margin:0 !important;

        /*
         * Restore the original 4% visual content margins.
         */
        padding-left:4%;
        padding-right:4%;

        /*
         * Scrollbar now belongs to the viewport edge.
         */
        overflow-y:auto;
        overflow-x:hidden;

        scrollbar-width:thin;
        scrollbar-color:#8b4bd1 rgba(10,7,18,.45);
    }

    body:not(.tournament-chat-view) > .wrap::-webkit-scrollbar{
        width:6px;
    }

    body:not(.tournament-chat-view) > .wrap::-webkit-scrollbar-track{
        background:rgba(10,7,18,.45);
    }

    body:not(.tournament-chat-view) > .wrap::-webkit-scrollbar-thumb{
        background:linear-gradient(
            180deg,
            #a967e8,
            #7540b8
        );
        border-radius:999px;
    }
}

/* V114 — Mobile pull-to-refresh */
.mobile-pull-refresh{
    display:none;
}

@media(max-width:760px){

    .mobile-pull-refresh{
        position:fixed;
        z-index:99999;

        top:8px;
        left:50%;

        display:flex;
        align-items:center;
        gap:8px;

        padding:8px 13px;

        border:1px solid rgba(158,93,226,.45);
        border-radius:999px;

        background:rgba(10,14,24,.92);
        backdrop-filter:blur(12px);

        color:#bfa0ed;

        font-size:10px;
        font-weight:850;
        letter-spacing:.12em;

        opacity:0;
        pointer-events:none;

        transform:
            translate(-50%, calc(-60px + var(--pull-distance, 0px)));

        transition:
            opacity .15s ease,
            border-color .15s ease,
            box-shadow .15s ease;
    }

    .mobile-pull-refresh.visible{
        opacity:1;
    }

    .mobile-pull-refresh.ready{
        color:#d9c1ff;
        border-color:#a65ee8;
        box-shadow:0 0 18px rgba(147,72,214,.32);
    }

    .mobile-pull-refresh-icon{
        font-size:17px;
        line-height:1;
    }

    .mobile-pull-refresh.ready .mobile-pull-refresh-icon{
        transform:rotate(180deg);
    }

    .mobile-pull-refresh.refreshing .mobile-pull-refresh-icon{
        animation:mobile-refresh-spin .7s linear infinite;
    }

    @keyframes mobile-refresh-spin{
        to{
            transform:rotate(360deg);
        }
    }
}

/* =========================================================
   V117 — Direct Staff Edit faction selector
   ========================================================= */

.admin-faction-portal-select .portal-select-trigger{
    min-height:48px;
}

.admin-faction-portal-select .portal-select-value{
    display:flex;
    align-items:center;
    gap:10px;
}

.admin-faction-trigger-logo{
    width:27px;
    height:27px;
    object-fit:contain;
    flex:0 0 auto;
}

.admin-faction-portal-select .portal-select-option{
    display:grid;
    grid-template-columns:38px 1fr 24px;
    align-items:center;
    gap:10px;
}

.admin-faction-select-logo{
    width:34px;
    height:34px;
    object-fit:contain;
}

.admin-faction-check{
    opacity:0;
    font-weight:900;
    font-size:17px;
}

.admin-faction-portal-select
.portal-select-option.selected
.admin-faction-check{
    opacity:1;
}

.admin-faction-portal-select
.portal-select-option.faction-confederation.selected{
    border-color:rgba(72,157,255,.75);
    background:rgba(30,100,190,.16);
}

.admin-faction-portal-select
.portal-select-option.faction-resistance.selected{
    border-color:rgba(255,72,82,.75);
    background:rgba(190,35,50,.16);
}

.admin-faction-portal-select[data-faction="confederation"]
.portal-select-trigger{
    border-color:rgba(72,157,255,.55);
}

.admin-faction-portal-select[data-faction="resistance"]
.portal-select-trigger{
    border-color:rgba(255,72,82,.55);
}

/* =========================================================
   V118 — Direct Staff Edit dropdown stacking fix
   ========================================================= */

.admin-faction-portal-select{
    position:relative;
    z-index:20;
}

.admin-faction-portal-select.open{
    z-index:1000;
}

.admin-faction-portal-select .portal-select-menu{
    z-index:1001;
}

/* Keep the Direct Staff Edit card above the following card
   while its faction selector is open. */
.card:has(.admin-faction-portal-select.open){
    position:relative;
    z-index:999;
    overflow:visible;
}


/* =========================================================
   V119 — Notification Center faction selector
   Match Direct Staff Edit faction UI
   ========================================================= */

.notification-faction-portal-select .portal-select-option{
    grid-template-columns:38px 1fr 24px;
}

.notification-faction-portal-select .portal-select-trigger{
    min-height:48px;
}


/* V122 — Emergency replacement team selectors */
.emergency-replacement-card{
    overflow:visible;
}

.emergency-team-select{
    position:relative;
    z-index:20;
}

.emergency-team-select.open{
    z-index:1000;
}

.emergency-team-select .portal-select-trigger{
    min-height:58px;
}

.emergency-team-select .portal-select-value{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.emergency-team-trigger-copy{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    min-width:0;
    line-height:1.15;
}

.emergency-team-trigger-copy strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    max-width:100%;
}

.emergency-team-trigger-copy small{
    margin-top:4px;
    opacity:.7;
}

.emergency-team-select .portal-select-menu{
    z-index:1001;
    max-height:300px;
    overflow-y:auto;
}

.emergency-team-select .portal-select-option{
    grid-template-columns:38px 1fr 24px;
    align-items:center;
}

.emergency-team-select .portal-select-option[data-faction="confederation"].selected{
    border-color:rgba(72,157,255,.75);
    background:rgba(30,100,190,.16);
}

.emergency-team-select .portal-select-option[data-faction="resistance"].selected{
    border-color:rgba(255,72,82,.75);
    background:rgba(190,35,50,.16);
}

.emergency-team-select[data-faction="confederation"] .portal-select-trigger{
    border-color:rgba(72,157,255,.55);
}

.emergency-team-select[data-faction="resistance"] .portal-select-trigger{
    border-color:rgba(255,72,82,.55);
}

.emergency-team-select .portal-select-option.selected .admin-faction-check{
    opacity:1;
}

.emergency-team-placeholder{
    grid-template-columns:1fr !important;
}

.emergency-replacement-card:has(.emergency-team-select.open){
    position:relative;
    z-index:999;
}

/* V123 — Fix emergency team selector text layout */
.emergency-team-select .portal-select-option .portal-select-copy{
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:center !important;
    gap:3px !important;
    min-width:0;
    line-height:1.15;
}

.emergency-team-select .portal-select-option .portal-select-copy strong{
    display:block !important;
    width:100%;
    font-weight:800;
    line-height:1.2;
}

.emergency-team-select .portal-select-option .portal-select-copy small{
    display:block !important;
    width:100%;
    margin:0 !important;
    line-height:1.2;
    opacity:.7;
}

.emergency-team-select .emergency-team-trigger-copy{
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:center !important;
    gap:3px !important;
    min-width:0;
}

.emergency-team-select .emergency-team-trigger-copy strong,
.emergency-team-select .emergency-team-trigger-copy small{
    display:block !important;
}

.emergency-team-select .admin-faction-trigger-logo{
    width:30px !important;
    height:30px !important;
    object-fit:contain;
    flex:0 0 30px;
}

.emergency-team-select .admin-faction-select-logo{
    width:34px !important;
    height:34px !important;
    object-fit:contain;
}

/* =========================================================
   V124 — Emergency replacement
   Use the same Portal Select appearance as Notification Center
   ========================================================= */

.emergency-replacement-card{
    overflow:visible;
}

.emergency-portal-select{
    position:relative;
}

.emergency-portal-select.open{
    z-index:1000;
}

.emergency-portal-select .portal-select-trigger{
    min-height:48px;
}

.emergency-portal-select .portal-select-menu{
    z-index:1001;
    max-height:300px;
    overflow-y:auto;
}

.emergency-portal-select .portal-select-option{
    grid-template-columns:22px 1fr !important;
}

.emergency-portal-select .portal-select-copy{
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:2px !important;
}

.emergency-portal-select .portal-select-copy strong{
    display:block !important;
}

.emergency-portal-select .portal-select-copy small{
    display:block !important;
    margin:0 !important;
}

.emergency-replacement-card:has(.emergency-portal-select.open){
    position:relative;
    z-index:999;
    overflow:visible;
}

/* V125 — Emergency selectors match Notification Center faction UI */

.emergency-portal-select.admin-faction-portal-select
.portal-select-option{
    grid-template-columns:38px 1fr 24px !important;
}

.emergency-portal-select
.portal-select-option.faction-confederation.selected{
    border-color:rgba(72,157,255,.75) !important;
    background:rgba(30,100,190,.16) !important;
}

.emergency-portal-select
.portal-select-option.faction-resistance.selected{
    border-color:rgba(255,72,82,.75) !important;
    background:rgba(190,35,50,.16) !important;
}

.emergency-portal-select[data-faction="confederation"]
.portal-select-trigger{
    border-color:rgba(72,157,255,.55);
}

.emergency-portal-select[data-faction="resistance"]
.portal-select-trigger{
    border-color:rgba(255,72,82,.55);
}

.emergency-portal-select
.portal-select-option.selected
.admin-faction-check{
    opacity:1;
}

.emergency-portal-select .admin-faction-select-logo{
    width:34px;
    height:34px;
    object-fit:contain;
}

.emergency-portal-select .admin-faction-trigger-logo{
    width:27px;
    height:27px;
    object-fit:contain;
    flex:0 0 auto;
}

.emergency-portal-select .portal-select-value{
    display:flex;
    align-items:center;
    gap:10px;
}

/* =========================================================
   V126 — Entry Draw Draft refresh
   ========================================================= */

.draw-review-page{
    position:relative;
}

.draw-review-grid{
    margin-top:14px;
}

.draw-faction-card{
    overflow:visible;
}

.draft-team-row{
    display:grid;
    grid-template-columns:minmax(150px,1fr) minmax(210px,1.25fr) auto;
    gap:10px;
    align-items:center;
    padding:14px 0;
    border-bottom:1px solid rgba(120,145,180,.22);
}

.draft-team-row:last-child{
    border-bottom:0;
}

.draft-team-name{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.draft-team-name img{
    width:30px;
    height:30px;
    object-fit:contain;
    flex:0 0 auto;
}

.draft-team-name strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.draft-team-select{
    min-width:0;
}

.draft-team-select .portal-select-trigger{
    min-height:48px;
}

.draft-team-select .portal-select-menu{
    z-index:1100;
    max-height:280px;
    overflow-y:auto;
}

.draft-team-select .portal-select-option{
    grid-template-columns:38px 1fr 24px;
}

.draft-team-select
.portal-select-option.faction-confederation.selected{
    border-color:rgba(72,157,255,.75);
    background:rgba(30,100,190,.16);
}

.draft-team-select
.portal-select-option.faction-resistance.selected{
    border-color:rgba(255,72,82,.75);
    background:rgba(190,35,50,.16);
}

.draft-team-select
.portal-select-option.selected
.admin-faction-check{
    opacity:1;
}

.draft-team-row:has(.draft-team-select.open){
    position:relative;
    z-index:1000;
}

.draw-faction-card:has(.draft-team-select.open){
    position:relative;
    z-index:999;
}

.draw-review-actions{
    margin-top:18px;
}

@media(max-width:760px){

    .draft-team-row{
        grid-template-columns:1fr;
    }

    .draft-team-name{
        margin-bottom:2px;
    }

    .draft-team-row > .btn{
        width:100%;
    }

    .draw-review-actions{
        flex-direction:column;
    }

    .draw-review-actions form,
    .draw-review-actions .btn{
        width:100%;
    }
}

/* V127 — Force Draft team faction icons to compact size */
.draw-review-page .draw-faction-card .draft-team-row .draft-team-name > img{
    display:block !important;
    width:30px !important;
    height:30px !important;
    min-width:30px !important;
    max-width:30px !important;
    min-height:30px !important;
    max-height:30px !important;
    object-fit:contain !important;
    flex:0 0 30px !important;
}

/* V129 — Published Entry Draw state */
.published-draw-state{
    margin-top:16px;
}

.published-draw-badge{
    display:flex;
    align-items:center;
    gap:10px;
    width:max-content;
    max-width:100%;
    padding:10px 14px;
    margin-bottom:14px;
    border:1px solid rgba(47,211,153,.45);
    border-radius:12px;
    background:rgba(25,145,105,.12);
    color:#72e7ba;
}

.published-draw-badge > span{
    display:grid;
    place-items:center;
    width:24px;
    height:24px;
    border-radius:50%;
    background:rgba(47,211,153,.18);
    font-weight:900;
}

.published-draw-badge strong{
    font-size:13px;
    letter-spacing:.04em;
}

.published-draw-state .btn.bad{
    margin-top:6px;
}

/* V130 — Published draw reset state */
.published-draw-reset{
    margin-top:16px;
}

.published-draw-badge{
    display:flex;
    align-items:center;
    gap:9px;
    width:max-content;
    max-width:100%;
    padding:9px 13px;
    margin-bottom:14px;
    border:1px solid rgba(47,211,153,.48);
    border-radius:11px;
    background:rgba(25,145,105,.12);
    color:#72e7ba;
}

.published-draw-badge > span{
    display:grid;
    place-items:center;
    width:23px;
    height:23px;
    border-radius:50%;
    background:rgba(47,211,153,.18);
    font-weight:900;
}

.published-draw-badge strong{
    font-size:13px;
    letter-spacing:.035em;
}

/* =========================================================
   V135 — FINAL TOP 4
   ========================================================= */

.final-standings-column{
    min-width:240px;
}

.final-position-card{
    margin-top:12px;
    min-height:64px;
    padding:10px 13px;
    display:flex;
    align-items:center;
    gap:11px;
    border-radius:11px;
    background:rgba(8,14,25,.92);
    border:1px solid rgba(255,255,255,.12);
}

.final-position-card img{
    width:32px;
    height:32px;
    object-fit:contain;
    flex:0 0 32px;
}

.final-position-rank{
    width:30px;
    height:30px;
    flex:0 0 30px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    font-size:14px;
    font-weight:900;
}

.final-position-card span{
    display:block;
    margin-bottom:3px;
    font-size:10px;
    font-weight:900;
    letter-spacing:1.1px;
}

.final-position-card strong{
    display:block;
    font-size:14px;
}

.second-place-card{
    border-color:rgba(205,218,235,.38);
}

.second-place-card .final-position-rank{
    color:#e3e9f1;
    border:1px solid rgba(220,230,245,.5);
    background:rgba(210,220,235,.1);
}

.second-place-card span{
    color:#d5dce7;
}

.third-place-card{
    border-color:rgba(205,145,75,.42);
}

.third-place-card .final-position-rank{
    color:#e0a968;
    border:1px solid rgba(205,145,75,.5);
    background:rgba(205,145,75,.1);
}

.third-place-card span{
    color:#d9a15f;
}

.fourth-place-card{
    border-color:rgba(125,137,155,.30);
}

.fourth-place-card .final-position-rank{
    color:#9ca8ba;
    border:1px solid rgba(145,155,175,.4);
    background:rgba(145,155,175,.08);
}

.fourth-place-card span{
    color:#929daf;
}


/* V138 — Pending registration auto-edit history */
.admin-team-edit-history{
  overflow:hidden;
}

.admin-team-history-list{
  display:grid;
  gap:10px;
  margin-top:18px;
}

.admin-team-history-item{
  border:1px solid rgba(139,92,246,.22);
  border-radius:12px;
  background:rgba(10,13,24,.58);
  overflow:hidden;
}

.admin-team-history-item summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  cursor:pointer;
  list-style:none;
}

.admin-team-history-item summary::-webkit-details-marker{
  display:none;
}

.admin-team-history-item summary > div{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.admin-team-history-item[open] summary{
  border-bottom:1px solid rgba(139,92,246,.18);
}

.admin-team-history-data{
  padding:8px 16px 14px;
}

.admin-team-history-item .tag.approved{
  white-space:nowrap;
  border-color:rgba(74,222,128,.3);
  color:#86efac;
}

@media(max-width:760px){
  .admin-team-history-item summary{
    align-items:flex-start;
    flex-direction:column;
  }
}
