:root {
  --bg: #070809;
  --panel: rgba(17, 19, 22, .92);
  --panel-2: rgba(24, 25, 29, .94);
  --line: rgba(237, 0, 18, .24);
  --line-strong: rgba(237, 0, 18, .64);
  --green: #ed0012;
  --green-2: #ff1425;
  --green-dark: #87000d;
  --text: #f7f7f8;
  --muted: #9ba0aa;
  --danger: #ff5e68;
  --warning: #ffce45;
  --info: #5dc7ff;
  --radius: 18px;
  --shadow: 0 28px 90px rgba(0,0,0,.55);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background:
  radial-gradient(circle at 78% -8%, rgba(237,0,18,.16), transparent 32rem),
  radial-gradient(circle at -10% 72%, rgba(135,0,13,.14), transparent 34rem),
  var(--bg); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 85%); }
a { color: inherit; text-decoration: none; }
button,input,select,textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1380px, calc(100% - 32px)); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(22px); background: rgba(7,8,9,.9); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 13px; min-width: max-content; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; color: #ffffff; font-weight: 950; font-size: 19px; letter-spacing: -1px; background: linear-gradient(145deg, #ff3544, var(--green-2)); clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%); box-shadow: 0 0 38px rgba(237,0,18,.34); }
.brand-name { font-weight: 900; font-size: 17px; letter-spacing: .02em; line-height: 1.05; }
.brand-caption { color: var(--muted); font-size: 11px; margin-top: 5px; text-transform: uppercase; letter-spacing: .15em; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); padding: 10px 13px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.nav a:hover,.nav a.active { color: var(--text); background: rgba(237,0,18,.11); }
.btn { border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.035); min-height: 42px; padding: 0 17px; border-radius: 11px; font-weight: 800; transition: .18s ease; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.btn:hover { transform: translateY(-1px); border-color: var(--line-strong); background: rgba(237,0,18,.11); }
.btn-primary { color: #ffffff; border-color: transparent; background: linear-gradient(135deg, #ff2637, var(--green)); box-shadow: 0 12px 38px rgba(237,0,18,.2); }
.btn-primary:hover { background: linear-gradient(135deg, #ff4a58, #ed0012); }
.btn-danger { border-color: rgba(255,94,104,.35); color: #ffb5ba; }
.hero { position: relative; overflow: hidden; min-height: 600px; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(5,6,7,.98) 0%, rgba(5,6,7,.86) 44%, rgba(5,6,7,.2) 100%), url('./assets/neon-lines-wide.jpg') center/cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 58%, rgba(237,0,18,.16) 58.2%, transparent 59%); pointer-events: none; }
.hero-content { position: relative; z-index: 2; max-width: 760px; padding: 92px 0 100px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #ffbec3; text-transform: uppercase; letter-spacing: .19em; font-size: 12px; font-weight: 900; }
.eyebrow::before { content: ""; width: 40px; height: 2px; background: var(--green); box-shadow: 0 0 18px var(--green); }
h1 { font-size: clamp(45px, 7vw, 92px); line-height: .92; letter-spacing: -.065em; margin: 23px 0 26px; max-width: 830px; }
h1 span { color: var(--green); text-shadow: 0 0 40px rgba(237,0,18,.22); }
.lead { color: #c9cbd0; font-size: clamp(17px, 2vw, 21px); line-height: 1.65; max-width: 690px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta { display: flex; gap: 34px; margin-top: 46px; flex-wrap: wrap; }
.hero-metric strong { display: block; font-size: 27px; color: var(--green); }
.hero-metric span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; text-transform: uppercase; letter-spacing: .11em; }
.section { padding: 74px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 26px; margin-bottom: 28px; }
.section-title { margin: 0; font-size: clamp(27px, 4vw, 44px); letter-spacing: -.04em; }
.section-copy { color: var(--muted); max-width: 650px; line-height: 1.6; margin: 10px 0 0; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { position: relative; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(20,22,25,.94), rgba(10,11,13,.96)); border-radius: var(--radius); box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; top: 0; left: 0; width: 92px; height: 2px; background: var(--green); box-shadow: 0 0 20px var(--green); }
.card-body { padding: 24px; }
.metric { padding: 25px; min-height: 142px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.metric-value { font-size: 39px; font-weight: 950; margin-top: 16px; }
.metric-note { margin-top: 8px; color: #b9bbc1; font-size: 13px; }
.feature { min-height: 250px; padding: 26px; }
.feature-number { color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .14em; }
.feature h3 { font-size: 22px; margin: 43px 0 12px; }
.feature p { color: var(--muted); line-height: 1.6; margin: 0; }
.stage-strip { background: linear-gradient(110deg, rgba(62,5,11,.86), rgba(9,10,12,.95)), url('./assets/neon-panels.jpg') center/cover; border-block: 1px solid var(--line); }
.stage-inner { padding: 55px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.stage-inner h2 { margin: 0; font-size: clamp(28px, 5vw, 50px); }
.stage-inner p { color: #c3c5ca; max-width: 780px; line-height: 1.6; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th,td { padding: 15px 17px; text-align: left; border-bottom: 1px solid rgba(237,0,18,.12); }
th { color: #b9bdc5; font-size: 11px; text-transform: uppercase; letter-spacing: .11em; background: rgba(237,0,18,.045); }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 10px; background: rgba(237,0,18,.1); color: #ffc1c6; font-size: 12px; font-weight: 800; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 13px var(--green); }
.status-warn { background: rgba(255,206,69,.1); color: #ffe69c; }
.status-warn::before { background: var(--warning); box-shadow: 0 0 12px var(--warning); }
.empty { padding: 38px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.footer { border-top: 1px solid var(--line); color: var(--muted); padding: 30px 0 44px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* Admin */
.admin-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 260px minmax(0,1fr); }
.sidebar { position: sticky; top: 76px; align-self: start; height: calc(100vh - 76px); padding: 26px 17px; border-right: 1px solid var(--line); background: rgba(8,9,11,.78); overflow-y: auto; }
.sidebar-caption { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; padding: 0 12px 11px; }
.side-link { width: 100%; border: 0; color: var(--muted); background: transparent; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 11px; text-align: left; font-weight: 750; margin-bottom: 4px; }
.side-link:hover,.side-link.active { color: var(--text); background: rgba(237,0,18,.12); }
.side-link b { width: 25px; color: var(--green); font-size: 12px; }
.admin-main { padding: 34px; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.admin-head h1 { font-size: clamp(32px, 5vw, 55px); margin: 0; letter-spacing: -.05em; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.form-card { padding: 25px; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.form-grid.cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
[hidden] { display: none !important; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
label { color: #c2c5cb; font-size: 12px; font-weight: 800; }
input,select,textarea { width: 100%; color: var(--text); background: #0e1013; border: 1px solid rgba(146,150,159,.28); border-radius: 10px; padding: 12px 13px; outline: 0; }
input:focus,select:focus,textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(237,0,18,.11); }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 18px; }
.help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.logo-drop { position: relative; border: 1px dashed var(--line-strong); border-radius: 13px; min-height: 145px; display: grid; place-items: center; text-align: center; padding: 18px; background: rgba(77,255,71,.025); }
.logo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-preview { max-height: 95px; max-width: 130px; object-fit: contain; display: none; }
.notice { display: none; padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line); margin-bottom: 18px; line-height: 1.5; }
.notice.show { display: block; }
.notice.success { background: rgba(237,0,18,.1); color: #caffc7; }
.notice.error { border-color: rgba(255,94,104,.4); background: rgba(255,94,104,.08); color: #ffc3c6; }
.notice.info { border-color: rgba(93,199,255,.35); background: rgba(93,199,255,.07); color: #c9efff; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(90deg, rgba(3,7,4,.95), rgba(3,7,4,.72)), url('./assets/neon-x.jpg') center/cover; }
.login-card { width: min(470px,100%); padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: rgba(5,10,6,.9); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.login-card h1 { margin: 28px 0 8px; font-size: 42px; }
.login-card .field { margin-top: 15px; }
.login-card .btn { width: 100%; margin-top: 21px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: #b8efbb; }
.mobile-menu { display: none; }
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 7px; overflow-x: auto; padding: 13px 16px; }
  .sidebar-caption { display: none; }
  .side-link { min-width: max-content; margin: 0; }
  .admin-main { padding: 24px 16px 50px; }
  .form-grid,.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .field.span-3 { grid-column: span 2; }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 22px, 1380px); }
  .topbar-inner { min-height: 68px; }
  .brand-caption { display: none; }
  .brand-mark { width: 42px; height: 42px; }
  .topbar .btn { padding: 0 12px; font-size: 12px; }
  .hero { min-height: 590px; background-position: 62% center; }
  .hero-content { padding: 72px 0; }
  .hero-meta { gap: 22px; }
  .section { padding: 54px 0; }
  .grid-4 { grid-template-columns: 1fr; }
  .stage-inner { grid-template-columns: 1fr; }
  .form-grid,.form-grid.cols-2 { grid-template-columns: 1fr; }
  .field.span-2,.field.span-3 { grid-column: span 1; }
  .admin-head { align-items: flex-start; flex-direction: column; }
}

/* Stage 1 v0.4.0 — player position and field-side registration */
.form-grid.cols-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.form-card-head { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; }
.form-section-title { margin:24px 0 12px; padding-bottom:9px; border-bottom:1px solid rgba(77,255,71,.12); color:#d7ead9; font-size:12px; font-weight:900; text-transform:uppercase; letter-spacing:.13em; }
.required-mark { color:var(--green); }
input:disabled,select:disabled { opacity:.58; cursor:not-allowed; }
button:disabled { opacity:.56; cursor:wait; transform:none !important; }
@media (max-width: 1180px) {
  .form-grid.cols-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .form-grid.cols-4 { grid-template-columns: 1fr; }
}

/* Mobile overflow hardening verified by browser E2E. */
html, body { max-width: 100%; overflow-x: clip; }
.table-wrap { max-width: 100%; }
@media (max-width: 680px) {
  .topbar-inner { gap: 8px; }
  .brand { min-width: 0; flex: 1 1 auto; gap: 8px; }
  .brand-name { font-size: 13px; line-height: 1.15; white-space: normal; }
  .topbar .btn { flex: 0 0 auto; }
  .sidebar { width: 100%; max-width: 100vw; min-width: 0; }
}

/* Stage 1 v0.4.0 — player photos and combined playing role */
.photo-upload { display:flex; align-items:center; gap:16px; min-height:126px; padding:14px; border:1px dashed var(--line-strong); border-radius:14px; background:rgba(77,255,71,.025); }
.photo-frame { width:104px; height:104px; flex:0 0 104px; position:relative; display:grid; place-items:center; overflow:hidden; border-radius:18px; border:1px solid rgba(237,0,18,.22); background:linear-gradient(145deg,#111a14,#080d09); }
.photo-placeholder { color:var(--muted); font-size:12px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.player-photo-preview { width:100%; height:100%; display:none; object-fit:cover; }
.photo-controls { min-width:0; flex:1; display:flex; flex-direction:column; align-items:flex-start; gap:9px; }
.photo-controls input[type="file"] { padding:9px; font-size:12px; }
.btn-small { min-height:34px; padding:0 12px; font-size:11px; }
.player-avatar-wrap { display:flex; flex-direction:column; align-items:center; gap:5px; min-width:76px; }
.player-avatar { width:64px; height:64px; object-fit:cover; border-radius:16px; border:1px solid rgba(77,255,71,.32); background:#0e1013; box-shadow:0 10px 24px rgba(0,0,0,.28); }
.avatar-source { max-width:84px; color:var(--muted); font-size:9px; font-weight:850; line-height:1.2; text-align:center; text-transform:uppercase; letter-spacing:.06em; }
.player-actions { display:flex; flex-direction:column; gap:7px; align-items:flex-start; }
.team-logo-thumb { width:42px; height:42px; object-fit:contain; border-radius:10px; padding:3px; border:1px solid rgba(77,255,71,.2); background:#09100b; vertical-align:middle; margin-right:8px; }
@media (max-width:680px) {
  .photo-upload { align-items:flex-start; flex-direction:column; }
  .photo-frame { width:118px; height:118px; flex-basis:118px; }
}

/* Stage 1 v0.5.0 — complete team registry */
.field.span-4 { grid-column: span 4; }
.form-details { margin-top:20px; border:1px solid rgba(117,158,124,.18); border-radius:14px; background:rgba(8,14,9,.48); overflow:hidden; }
.form-details summary { padding:15px 17px; color:#c9ddcc; font-size:12px; font-weight:900; cursor:pointer; text-transform:uppercase; letter-spacing:.08em; list-style-position:inside; }
.form-details[open] summary { border-bottom:1px solid rgba(117,158,124,.14); background:rgba(237,0,18,.045); }
.details-body { padding:17px; }
.team-logo-cell { display:flex; align-items:center; gap:8px; min-width:118px; }
.team-logo-cell .team-logo-thumb { margin-right:0; }
.badge-warning { display:inline-flex; margin-top:5px; padding:3px 7px; border-radius:999px; background:rgba(255,206,69,.1); color:#ffe69c; font-size:10px; font-weight:850; }
#team-short-3,#team-short-4 { text-transform:uppercase; letter-spacing:.14em; font-weight:900; }
@media (max-width:1180px) {
  .field.span-4 { grid-column:span 2; }
}
@media (max-width:680px) {
  .field.span-4 { grid-column:span 1; }
  .details-body { padding:14px; }
}

.public-team-cell{display:flex;align-items:center;gap:10px;min-width:210px}.public-team-logo{width:42px;height:42px;object-fit:contain;background:#050806;border:1px solid var(--line);flex:0 0 auto}.code-chip{display:inline-flex;min-width:48px;justify-content:center;border:1px solid #38513e;padding:5px 7px;color:var(--green2);font:800 12px ui-monospace,monospace}


/* Stage 1 v0.6.0 — identity, governance and exact RLF league branding */
.brand-logo { width:54px; height:54px; flex:0 0 54px; object-fit:contain; padding:3px; border-radius:12px; background:#fff; border:1px solid rgba(255,255,255,.22); box-shadow:0 0 32px rgba(77,255,71,.18), 0 10px 26px rgba(0,0,0,.28); }
.brand-logo-login { width:78px; height:78px; flex-basis:78px; border-radius:18px; }
.login-brand { align-items:center; }
.form-brand-preview { width:116px; min-width:116px; padding:9px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.96); box-shadow:0 18px 48px rgba(0,0,0,.28); }
.form-brand-preview img { display:block; width:100%; height:auto; }
.field-action { justify-content:flex-end; }
.field-action .btn { width:100%; }
.inline-help { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.link-button { border:0; padding:0; background:none; color:var(--green); font-size:12px; font-weight:850; text-decoration:underline; text-underline-offset:3px; }
.link-button:hover { color:#b8ffb4; }
.color-field { position:relative; }
.color-field input[type="color"] { min-height:50px; padding:5px; cursor:pointer; }
.color-field output { font:800 12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#d8ebdb; }
.kit-swatch { min-height:96px; display:grid; grid-template-columns:repeat(3,1fr); align-self:end; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:#070b08; }
.kit-swatch span { min-height:92px; }
.contact-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.contact-card { padding:16px; border:1px solid rgba(117,158,124,.2); border-radius:14px; background:rgba(7,13,9,.62); }
.contact-card h3 { margin:0 0 13px; font-size:16px; }
.contact-card .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.check-line { display:flex; align-items:flex-start; gap:10px; color:#c4d5c7; font-size:12px; font-weight:700; line-height:1.5; }
.check-line input { width:auto; margin-top:2px; accent-color:var(--green); }
.color-chips { display:flex; align-items:center; gap:6px; }
.color-chip { width:23px; height:23px; border-radius:7px; border:1px solid rgba(255,255,255,.3); box-shadow:0 4px 12px rgba(0,0,0,.28); }
.table-actions { display:flex; flex-wrap:wrap; gap:6px; min-width:170px; }
.history-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; }
.history-grid h3 { margin:0 0 14px; }
.history-list { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.history-list li { display:grid; gap:4px; padding:13px; border:1px solid rgba(117,158,124,.18); border-radius:12px; background:rgba(7,13,9,.5); }
.history-list span,.history-list small { color:var(--muted); line-height:1.45; }
.status-success { color:#ffbec3; background:rgba(237,0,18,.12); }
.status-info { color:#c9efff; background:rgba(93,199,255,.09); }
.status-warn { color:#ffe69c; background:rgba(255,206,69,.1); }
.hero-brand-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,330px); gap:54px; align-items:center; }
.hero-league-logo { width:min(100%,330px); justify-self:end; padding:18px; border-radius:30px; background:rgba(255,255,255,.96); border:1px solid rgba(255,255,255,.35); box-shadow:0 32px 100px rgba(0,0,0,.55),0 0 48px rgba(77,255,71,.14); }
.public-team-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.public-team-card { display:grid; grid-template-columns:92px minmax(0,1fr); gap:19px; padding:22px; }
.public-team-card .public-team-logo { width:92px; height:92px; border-radius:18px; padding:7px; background:#fff; }
.public-team-card h3 { margin:0 0 6px; font-size:22px; }
.public-team-official { color:var(--muted); font-size:12px; line-height:1.45; }
.public-team-meta { grid-column:1/-1; display:grid; gap:9px; margin-top:3px; }
.public-team-row { display:flex; justify-content:space-between; gap:16px; color:#c4d5c7; font-size:12px; }
.public-team-row span:first-child { color:var(--muted); }
.public-team-colors { display:flex; gap:6px; }
.public-contact { padding-top:10px; border-top:1px solid rgba(117,158,124,.15); }
@media (max-width:1100px) {
  .public-team-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .hero-brand-grid { grid-template-columns:1fr minmax(180px,250px); }
  .contact-grid { grid-template-columns:1fr; }
}
@media (max-width:680px) {
  .brand-logo { width:44px; height:44px; flex-basis:44px; border-radius:10px; }
  .brand-logo-login { width:70px; height:70px; flex-basis:70px; }
  .form-card-head { flex-direction:column; }
  .form-brand-preview { width:92px; min-width:92px; }
  .contact-card .form-grid { grid-template-columns:1fr; }
  .history-grid,.public-team-grid,.hero-brand-grid { grid-template-columns:1fr; }
  .hero-league-logo { width:190px; justify-self:start; }
  .public-team-card { grid-template-columns:70px minmax(0,1fr); }
  .public-team-card .public-team-logo { width:70px; height:70px; }
  .inline-help { align-items:flex-start; flex-direction:column; }
}

/* v0.6.0 public team registry */
.hero-league-logo img { display:block; width:100%; height:auto; }
.hero-league-logo span { display:block; margin-top:12px; color:#203124; text-align:center; font-size:11px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.public-team-card { display:block; padding:22px; }
.public-team-card-head { display:grid; grid-template-columns:88px minmax(0,1fr); gap:17px; align-items:center; }
.public-team-card-logo { width:88px; height:88px; object-fit:contain; padding:6px; border-radius:18px; border:1px solid rgba(77,255,71,.24); background:#fff; }
.public-team-card h3 { margin:5px 0 4px; font-size:22px; }
.public-team-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.45; }
.public-team-tags { display:flex; flex-wrap:wrap; gap:6px; margin:18px 0; }
.public-team-tags span { padding:5px 8px; border:1px solid rgba(77,255,71,.18); border-radius:999px; color:#cde5d0; background:rgba(77,255,71,.045); font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.06em; }
.team-facts { margin:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; }
.team-facts div { min-width:0; padding:10px; border-radius:10px; background:rgba(255,255,255,.025); }
.team-facts dt { color:var(--muted); font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; }
.team-facts dd { margin:4px 0 0; color:#e1f0e3; font-size:12px; line-height:1.35; }
.public-team-colors { display:flex; align-items:center; gap:7px; margin-top:16px; color:var(--muted); font-size:11px; }
.public-team-colors i { width:24px; height:24px; border:1px solid rgba(255,255,255,.3); border-radius:7px; background:var(--chip,#111); box-shadow:0 4px 12px rgba(0,0,0,.28); }
.public-team-contact { display:grid; gap:3px; margin-top:15px; padding-top:14px; border-top:1px solid rgba(117,158,124,.15); color:#dbeade; font-size:12px; }
.public-team-contact span { color:var(--muted); }
@media (max-width:680px) {
  .public-team-card-head { grid-template-columns:68px minmax(0,1fr); }
  .public-team-card-logo { width:68px; height:68px; border-radius:14px; }
  .team-facts { grid-template-columns:1fr; }
}

/* Stage 1 v0.7.0 — tournament creation */
.tournament-form-card { overflow:visible; }
.checkbox-field { justify-content:flex-end; padding-bottom:12px; }
.checkbox-field label { display:flex; align-items:center; gap:9px; min-height:46px; color:#dceade; font-size:12px; font-weight:850; }
.checkbox-field input { width:auto; accent-color:var(--green); }
.tiebreaker-fieldset { margin:18px 0 0; padding:17px; border:1px solid rgba(117,158,124,.2); border-radius:14px; background:rgba(7,13,9,.55); }
.tiebreaker-fieldset legend { padding:0 8px; color:#cfe3d2; font-size:11px; font-weight:900; letter-spacing:.06em; text-transform:uppercase; }
.tiebreaker-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.tiebreaker-grid label { display:flex; align-items:flex-start; gap:8px; padding:10px; border:1px solid rgba(117,158,124,.13); border-radius:10px; color:#c7d9ca; background:rgba(255,255,255,.018); font-size:11px; line-height:1.35; }
.tiebreaker-grid input { width:auto; margin-top:1px; accent-color:var(--green); }
.participant-filter { min-height:28px; margin:12px 0; color:var(--muted); font-size:12px; }
.participant-picker { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; max-height:430px; padding:12px; overflow:auto; border:1px solid rgba(117,158,124,.2); border-radius:14px; background:rgba(5,10,7,.66); }
.participant-option { position:relative; display:grid; grid-template-columns:42px minmax(0,1fr); gap:11px; align-items:center; min-height:70px; padding:11px; border:1px solid rgba(117,158,124,.14); border-radius:12px; background:rgba(255,255,255,.018); cursor:pointer; transition:border-color .15s,background .15s,transform .15s; }
.participant-option:hover { transform:translateY(-1px); border-color:rgba(237,0,18,.34); }
.participant-option.is-ineligible { opacity:.46; cursor:not-allowed; }
.participant-option:has(input:checked) { border-color:rgba(77,255,71,.58); background:rgba(77,255,71,.075); box-shadow:inset 0 0 0 1px rgba(237,0,18,.12); }
.participant-option input { position:absolute; top:8px; right:8px; width:auto; accent-color:var(--green); }
.participant-option img { width:42px; height:42px; object-fit:contain; padding:3px; border-radius:9px; background:#fff; }
.participant-option strong { display:block; padding-right:18px; font-size:12px; }
.participant-option span { display:block; margin-top:4px; color:var(--muted); font-size:9px; line-height:1.35; text-transform:uppercase; letter-spacing:.05em; }
.tournament-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:18px; }
.tournament-summary .summary-cell { padding:13px; border:1px solid rgba(117,158,124,.17); border-radius:12px; background:rgba(77,255,71,.03); }
.tournament-summary strong { display:block; color:#f0fff2; font-size:14px; }
.tournament-summary span { display:block; margin-top:4px; color:var(--muted); font-size:10px; line-height:1.35; text-transform:uppercase; letter-spacing:.06em; }
.tournament-stage-list { display:grid; gap:4px; min-width:140px; }
.tournament-stage-list span { color:#d6e7d9; font-size:11px; }
.public-tournament-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.public-tournament-card { position:relative; overflow:hidden; padding:23px; border:1px solid rgba(77,255,71,.17); border-radius:18px; background:linear-gradient(145deg,rgba(13,22,15,.94),rgba(5,9,6,.96)); }
.public-tournament-card::after { content:""; position:absolute; width:180px; height:180px; right:-85px; top:-95px; border-radius:50%; background:radial-gradient(circle,rgba(77,255,71,.14),transparent 67%); pointer-events:none; }
.public-tournament-head { display:flex; align-items:flex-start; gap:14px; }
.public-tournament-logo { width:64px; height:64px; flex:0 0 64px; padding:5px; border-radius:14px; background:#fff; }
.public-tournament-card h3 { margin:4px 0 5px; font-size:21px; }
.public-tournament-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.public-tournament-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:18px; }
.public-tournament-meta div { padding:10px; border-radius:10px; background:rgba(255,255,255,.025); }
.public-tournament-meta span { display:block; color:var(--muted); font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.07em; }
.public-tournament-meta strong { display:block; margin-top:4px; color:#e4f2e6; font-size:12px; }
.public-tournament-stages { display:flex; flex-wrap:wrap; gap:6px; margin-top:14px; }
.public-tournament-stages span { padding:5px 8px; border-radius:999px; border:1px solid rgba(77,255,71,.17); color:#cde6d0; background:rgba(77,255,71,.04); font-size:9px; font-weight:850; text-transform:uppercase; }
@media (max-width:1100px) {
  .participant-picker,.public-tournament-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tiebreaker-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tournament-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:680px) {
  .participant-picker,.public-tournament-grid,.tiebreaker-grid,.tournament-summary { grid-template-columns:1fr; }
  .participant-picker { max-height:none; }
  .public-tournament-meta { grid-template-columns:1fr; }
}

/* Stage 1 v0.9.1 — optional venue names and fully manual rounds */
.manual-rounds-title { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.manual-rounds { display:grid; gap:12px; margin-top:14px; }
.manual-round-card { padding:15px; border:1px solid rgba(117,158,124,.2); border-radius:15px; background:linear-gradient(145deg,rgba(11,19,13,.92),rgba(5,10,7,.9)); }
.manual-round-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:13px; }
.manual-round-head > div:first-child { display:flex; align-items:center; min-width:0; gap:9px; }
.manual-round-head strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.round-number { display:grid; place-items:center; width:29px; height:29px; flex:0 0 29px; border:1px solid rgba(77,255,71,.32); border-radius:9px; color:var(--green2); background:rgba(77,255,71,.06); font:900 12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.round-visibility { display:inline-flex; padding:4px 7px; border-radius:999px; color:#ffe69c; background:rgba(255,206,69,.08); font-size:9px; font-weight:900; letter-spacing:.06em; text-transform:uppercase; white-space:nowrap; }
.round-visibility.is-public { color:#ffbec3; background:rgba(237,0,18,.12); }
.round-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.btn-danger-soft { border-color:rgba(255,105,105,.25); color:#ffc5c5; background:rgba(255,70,70,.04); }
.btn-danger-soft:hover { border-color:rgba(255,105,105,.5); background:rgba(255,70,70,.09); }
.manual-round-grid { align-items:end; }
.round-publish { padding-bottom:0; }
@media (max-width:680px) {
  .manual-rounds-title,.manual-round-head { align-items:flex-start; flex-direction:column; }
  .manual-round-head > div:first-child { width:100%; flex-wrap:wrap; }
  .round-actions { width:100%; justify-content:flex-start; }
}

/* Stage 1 v0.9.1 — tournament and championship league logos */
.tournament-logo-field{align-self:stretch}.competition-logo-preview{display:flex;align-items:center;gap:10px;margin-top:10px}.competition-logo-preview img{width:76px;height:76px;object-fit:contain;padding:5px;border-radius:14px;background:#fff;border:1px solid rgba(237,0,18,.22)}
.championship-leagues-launch{display:flex;align-items:center;justify-content:space-between;gap:22px;margin:20px 0;padding:18px;border:1px solid rgba(237,0,18,.22);border-radius:16px;background:linear-gradient(135deg,rgba(77,255,71,.055),rgba(255,255,255,.018))}.championship-leagues-launch[hidden]{display:none}.championship-leagues-launch h3{margin:5px 0 5px}.championship-leagues-launch p{margin:0;color:var(--muted);font-size:11px;line-height:1.5}.championship-leagues-actions{display:flex;align-items:center;gap:12px}.league-summary{min-width:150px;color:var(--green2);font-size:11px;font-weight:800;text-align:right}
.league-dialog{width:min(1100px,calc(100% - 24px));max-height:92vh;padding:0;border:1px solid rgba(77,255,71,.28);border-radius:20px;background:#08100a;color:var(--text);box-shadow:0 30px 100px rgba(0,0,0,.72)}.league-dialog::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(6px)}.league-dialog-shell{padding:24px}.league-dialog-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding-bottom:16px;border-bottom:1px solid rgba(77,255,71,.15)}.league-dialog-head h2{margin:5px 0 6px}.league-dialog-head p{margin:0;color:var(--muted);font-size:11px}.dialog-close{width:38px;height:38px;border:1px solid rgba(255,255,255,.15);border-radius:10px;background:#101812;color:#fff;font-size:25px}.championship-leagues-list{display:grid;gap:14px;max-height:62vh;overflow:auto;padding:18px 3px}.league-card-editor{padding:16px;border:1px solid rgba(77,255,71,.18);border-radius:15px;background:rgba(255,255,255,.018)}.league-card-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:13px}.league-card-head strong{font-size:15px}.league-card-actions{display:flex;gap:6px}.league-editor-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.league-editor-grid .span-2{grid-column:span 2}.league-logo-box{display:flex;align-items:center;gap:10px}.league-logo-box img{width:74px;height:74px;object-fit:contain;padding:5px;border-radius:12px;background:#fff}.league-dialog-footer{display:flex;justify-content:space-between;gap:10px;padding-top:16px;border-top:1px solid rgba(77,255,71,.15)}.league-pill-list{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.league-pill-list span{padding:4px 7px;border:1px solid rgba(77,255,71,.18);border-radius:999px;color:#d7efda;font-size:9px}
.public-league-list{display:grid;gap:7px;margin-top:14px}.public-league-item{display:flex;align-items:center;gap:9px;padding:9px;border:1px solid rgba(77,255,71,.13);border-radius:10px;background:rgba(255,255,255,.018)}.public-league-item img{width:36px;height:36px;object-fit:contain;padding:2px;border-radius:8px;background:#fff}.public-league-item strong{display:block;font-size:11px}.public-league-item span{display:block;color:var(--muted);font-size:9px;margin-top:2px}
@media(max-width:850px){.championship-leagues-launch{align-items:flex-start;flex-direction:column}.championship-leagues-actions{width:100%;justify-content:space-between}.league-summary{text-align:left}.league-editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){.league-dialog-shell{padding:16px}.league-editor-grid{grid-template-columns:1fr}.league-editor-grid .span-2{grid-column:auto}.league-card-head{align-items:flex-start}.league-card-actions{flex-wrap:wrap;justify-content:flex-end}.championship-leagues-actions{align-items:flex-start;flex-direction:column}.league-dialog-footer{flex-direction:column}.league-dialog-footer .btn{width:100%}}

/* Stage 1 v0.11.0 — referee registry and tournament statistics */
.stats-summary {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:9px;
  margin-top:16px;
}
.stats-summary > span {
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-height:34px;
  padding:7px 10px;
  border:1px solid rgba(77,255,71,.18);
  border-radius:10px;
  color:#cfe3d2;
  background:rgba(237,0,18,.045);
  font-size:11px;
}
.stats-summary strong { color:#f3fff4; }
.statistics-entry-grid,.statistics-raw-grid { align-items:start; margin-top:18px; }
.statistics-preview-card { margin-top:18px; }
.statistics-preview-card .table-wrap,.public-statistics-result .table-wrap { margin-top:8px; }
.statistics-preview-card table,.public-statistics-result table { min-width:720px; }
.statistics-preview-card tbody tr:first-child,.public-statistics-result tbody tr:first-child { background:rgba(77,255,71,.045); }
.statistics-preview-card tbody tr:first-child td:first-child,.public-statistics-result tbody tr:first-child td:first-child { color:var(--green2); }
.public-statistics-control { padding:22px; }
.public-statistics-result { margin-top:16px; padding:22px; }
.public-statistics-result h3 { margin:4px 0 0; font-size:24px; }
.statistics-public-section { background:linear-gradient(180deg,rgba(77,255,71,.018),transparent 72%); }
#referees-body a { color:var(--green2); text-decoration:none; }
#referees-body a:hover { text-decoration:underline; text-underline-offset:3px; }
@media (max-width:680px) {
  .stats-summary { align-items:stretch; flex-direction:column; }
  .stats-summary > span { width:100%; }
  .public-statistics-control,.public-statistics-result { padding:16px; }
}
.stats-summary .stats-warning { width:100%; border-color:rgba(255,206,69,.25); color:#ffe8a6; background:rgba(255,206,69,.06); line-height:1.45; }

/* RLF 2.0 */
.legacy-hidden{display:none!important}.side-link[href]{text-decoration:none;display:flex;align-items:center}

/* Uploaded team kits retain the whole image, including transparent PNG backgrounds. */
.team-kit-uploads{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:18px 0}
.team-kit-upload{min-width:0;padding:16px;border:1px solid var(--line,#343434);border-radius:16px}
.team-kit-upload input[type=file]{width:100%;min-width:0;font-size:14px}
.team-kit-image{height:240px;display:grid;place-items:center;background:#111416;border-radius:12px;margin:8px 0;color:#aaa}
.team-kit-image img{width:100%;height:100%;max-height:240px;object-fit:contain}
.team-kit-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:760px){.team-kit-uploads{grid-template-columns:1fr}.team-kit-image{height:280px}.team-kit-image img{max-height:280px}}

.team-kit-thumbs{display:flex;gap:8px;margin-bottom:8px}.team-kit-thumbs img{width:44px;height:60px;object-fit:contain}.public-team-kits{display:flex;gap:14px;flex-wrap:wrap}.public-team-kits figure{margin:0;flex:1 1 90px;min-width:0}.public-team-kits img{width:100%;height:170px;object-fit:contain}.public-team-kits figcaption{font-size:12px;color:#999}

.wizard-nav{display:flex;gap:8px;overflow:auto;padding:12px 0}.wizard-nav button{white-space:nowrap}.wizard-nav [aria-current=step]{background:var(--accent,#a8ff2a);color:var(--bg,#111)}[data-wizard-step][hidden]{display:none!important}.tiebreaker-grid label{display:flex;align-items:center;gap:8px}.calendar-match-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;padding:12px;border-bottom:1px solid var(--line,#aaa)}
.calendar-wizard-nav{margin:4px 0 18px}.calendar-wizard-nav [aria-current=step]{background:var(--accent,#a8ff2a);color:var(--bg,#111)}[data-calendar-panel][hidden]{display:none!important}#calendar-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;align-items:end}.calendar-step-actions{position:sticky;bottom:8px;z-index:2;padding:10px;background:var(--card,#17191d);border:1px solid var(--line,#444);border-radius:12px}.calendar-step-actions #calendar-draft-save{margin-inline:auto}.calendar-step-actions #calendar-step-next{margin-left:auto}#calendar-team-preview .participant-row{display:grid;grid-template-columns:36px minmax(0,1fr) minmax(90px,auto);align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line,#444)}#calendar-team-preview .participant-row>span:first-child{color:var(--muted,#999)}#calendar-team-preview .participant-row strong{overflow-wrap:anywhere}@media(max-width:640px){.calendar-wizard-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.calendar-wizard-nav button{white-space:normal;min-height:44px}.calendar-step-actions{position:static;display:grid;grid-template-columns:1fr 1fr;gap:8px}.calendar-step-actions #calendar-draft-save{grid-column:1/-1;grid-row:1;margin:0}.calendar-step-actions #calendar-step-back{grid-column:1;grid-row:2}.calendar-step-actions #calendar-step-next{grid-column:2;grid-row:2;margin:0}#calendar-team-preview .participant-row{grid-template-columns:28px minmax(0,1fr)}#calendar-team-preview .participant-row>span:last-child{grid-column:2}}
