:root {
  --bg: #0b0f1a;
  --bg-elev: #12182a;
  --bg-card: #161e33;
  --border: rgba(148, 163, 255, 0.18);
  --text: #eef2ff;
  --muted: #9aa6c5;
  --accent: #1a9fff;
  --accent-2: #0b6fd4;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --court: #2dd4bf;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124,156,255,.22), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(167,139,250,.18), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, .btn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: .7rem 1.15rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f1a;
  font-weight: 650;
  transition: transform .15s ease, filter .15s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.soft {
  background: rgba(124,156,255,.15);
  color: #c7d2fe;
}

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11,15,26,.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .9rem 0;
}
.brand {
  display: flex; align-items: center; gap: .65rem; font-weight: 750; letter-spacing: .02em;
}
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #7c9cff, #a78bfa 55%, #34d399);
  box-shadow: 0 0 24px rgba(124,156,255,.45);
}
.nav-links { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.nav-links a {
  padding: .45rem .8rem; border-radius: 999px; color: var(--muted); font-size: .95rem;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.05); }

/* Hero */
.hero { padding: 3.5rem 0 2rem; }
.hero-grid {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow {
  display: inline-flex; gap: .4rem; align-items: center;
  color: #c4b5fd; font-size: .85rem; font-weight: 600;
  background: rgba(167,139,250,.12); border: 1px solid rgba(167,139,250,.28);
  padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; margin: 0 0 1rem;
}
.hero p.lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 1.5rem; max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent), var(--bg-card);
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  padding: 1.2rem; box-shadow: var(--shadow);
}
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: 1rem; }
.stat {
  background: rgba(0,0,0,.25); border-radius: 12px; padding: .85rem; text-align: center;
}
.stat b { display: block; font-size: 1.25rem; }
.stat span { color: var(--muted); font-size: .8rem; }

/* Sections */
section { padding: 1.5rem 0 2.5rem; }
.section-title {
  display: flex; justify-content: space-between; align-items: end; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.section-title h2 { margin: 0; font-size: 1.45rem; }
.section-title p { margin: 0; color: var(--muted); }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem;
}
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: rgba(124,156,255,.45); transform: translateY(-2px); }
.card-media {
  height: 140px;
  background:
    linear-gradient(135deg, rgba(45,212,191,.35), rgba(124,156,255,.25)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='rgba(255,255,255,.12)' stroke-width='2' d='M10 40h60M40 10v60'/%3E%3Ccircle cx='40' cy='40' r='18' fill='none' stroke='rgba(255,255,255,.15)' stroke-width='2'/%3E%3C/svg%3E");
  background-size: cover, 60px;
}
.card-body { padding: 1rem 1.1rem 1.2rem; }
.pill {
  display: inline-block; font-size: .75rem; font-weight: 650; padding: .2rem .55rem;
  border-radius: 999px; background: rgba(52,211,153,.15); color: var(--green);
}
.pill.soon { background: rgba(251,191,36,.14); color: var(--amber); }
.pill.live { background: rgba(251,113,133,.16); color: var(--rose); }
.pill.published { background: rgba(26,159,255,.16); color: #60b8ff; }
html[data-theme="light"] .pill.published { color: var(--accent-2); }
.card h3 { margin: .55rem 0 .35rem; font-size: 1.1rem; }
.meta { color: var(--muted); font-size: .9rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: .55rem .9rem; margin-top: .7rem; color: var(--muted); font-size: .85rem; }

/* Tournament page */
.tour-hero {
  padding: 2rem 0 1rem;
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 1.25rem;
}
@media (max-width: 900px) { .tour-hero { grid-template-columns: 1fr; } }
.tour-info {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.35rem; box-shadow: var(--shadow);
}
.tour-info h1 { margin: .4rem 0 .6rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.info-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem 1rem; margin-top: 1rem;
}
@media (max-width: 560px) { .info-grid { grid-template-columns: 1fr; } }
.info-item label { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.info-item div { font-weight: 600; }
.fee-box {
  margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .55rem;
}
.fee {
  background: rgba(0,0,0,.28); border: 1px solid var(--border); border-radius: 12px;
  padding: .65rem .85rem; min-width: 120px;
}
.fee strong { display: block; font-size: 1.15rem; }
.fee span { color: var(--muted); font-size: .8rem; }

/* Tabs */
.tabs {
  display: flex; gap: .4rem; flex-wrap: wrap; margin: 1.25rem 0 .9rem;
  border-bottom: 1px solid var(--border); padding-bottom: .55rem;
}
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: .55rem .95rem;
}
.tab.active {
  color: var(--text); background: rgba(124,156,255,.12); border-color: var(--border);
}
.panel { display: none; }
.panel.active { display: block; }

.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rose);
  box-shadow: 0 0 10px var(--rose); display: inline-block; margin-right: .35rem;
}

/* Pools & standings */
.pools {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem;
}
@media (max-width: 800px) { .pools { grid-template-columns: 1fr; } }
.pool {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.pool-head {
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,.02);
}
.pool-head h3 { margin: 0; font-size: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,.05); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
.rank { color: var(--muted); width: 2rem; }
.qualify { color: var(--green); font-weight: 650; }

.note {
  color: var(--muted); font-size: .9rem; margin: .75rem 0 0;
}

/* Director / forms */
.form-grid { display: grid; gap: 1rem; }
.form-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem;
}
.form-card h3 { margin: 0 0 .85rem; }
.fields { display: grid; gap: .75rem; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; background: #0a0e19; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: .7rem .8rem; font: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.player-table { margin-top: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(124,156,255,.12); color: #c7d2fe; border-radius: 999px;
  padding: .15rem .55rem; font-size: .78rem; font-weight: 600;
}

footer {
  border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.5rem 0 2rem; color: var(--muted); font-size: .9rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.banner {
  background: rgba(124,156,255,.1); border: 1px solid var(--border); border-radius: 12px;
  padding: .8rem 1rem; color: #c7d2fe; font-size: .92rem; margin-bottom: 1rem;
}

.paid { color: var(--green); font-weight: 650; }
.unpaid { color: var(--rose); font-weight: 650; }

/* Site logo (transparent PNG): no tile, larger, "floating". Dark theme: a soft light rim + blue glow keeps the dark
   gear visible; light theme: a faint shadow. */
.brand img.logo-img {
  width: 52px; height: 52px; object-fit: contain; flex: none; display: block;
  background: none; padding: 0; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 0 1px rgba(255,255,255,.55)) drop-shadow(0 0 7px rgba(110,185,255,.35));
}
html[data-theme="light"] .brand img.logo-img { filter: drop-shadow(0 1px 2px rgba(15,23,42,.22)); }
.nav-inner { padding: .6rem 0; }
@media (max-width: 640px) { .brand img.logo-img { width: 38px; height: 38px; } .brand { gap: .5rem; } }
.brand .logo { display: none; }

/* Account menu (organizer only) */
.account-menu { position: relative; }
.account-menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu[open] > summary .chip { background: rgba(26,159,255,.25); }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + .45rem);
  min-width: 240px; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: .45rem;
}
.account-dropdown a,
.account-dropdown button.menu-item {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  gap: .75rem; text-align: left; background: transparent; color: var(--text);
  border: none; border-radius: 10px; padding: .65rem .75rem; font: inherit; cursor: pointer;
}
.account-dropdown a:hover,
.account-dropdown button.menu-item:hover { background: rgba(255,255,255,.06); }
.account-dropdown .menu-sep {
  height: 1px; background: var(--border); margin: .35rem .4rem;
}
.account-dropdown .menu-label {
  color: var(--muted); font-size: .75rem; text-transform: uppercase;
  letter-spacing: .04em; padding: .35rem .75rem .15rem;
}
.lang-pills { display: flex; gap: .35rem; }
.lang-pills button {
  padding: .25rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 650;
  background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid transparent;
}
.lang-pills button.active {
  color: var(--text); border-color: var(--border); background: rgba(26,159,255,.18);
}

/* Light mode (organizer preference) */
html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --border: rgba(15, 40, 80, 0.12);
  --text: #0f172a;
  --muted: #5b6b86;
  --shadow: 0 18px 50px rgba(15, 40, 80, .12);
}
html[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(26,159,255,.12), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(11,111,212,.08), transparent 55%),
    var(--bg);
}
html[data-theme="light"] .nav {
  background: rgba(244,247,251,.85);
}
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea {
  background: #f8fafc; color: var(--text);
}

.account-dropdown .submenu {
  display: none; margin: .15rem 0 .25rem .5rem;
  border-left: 1px solid var(--border); padding-left: .35rem;
}
.account-dropdown .submenu.open { display: block; }
.account-dropdown .submenu button {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--text); border: none;
  border-radius: 8px; padding: .5rem .75rem; font: inherit; cursor: pointer;
}
.account-dropdown .submenu button:hover { background: rgba(255,255,255,.06); }
.account-dropdown .submenu button.active { color: var(--accent); font-weight: 650; }
html[data-theme="light"] .account-dropdown .submenu button:hover { background: rgba(15,40,80,.06); }

/* Yes/No choice row */
.choice-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .35rem; }
.choice {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .85rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,.04);
  cursor: pointer; font-weight: 600; font-size: .9rem;
}
.choice:has(input:checked) {
  border-color: rgba(26,159,255,.55); background: rgba(26,159,255,.15); color: var(--text);
}
.choice input { accent-color: var(--accent); }

/* Paid / DUPR tags after each name */
.name-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; }
.tag {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: .12rem .45rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .01em;
}
.tag.paid { background: rgba(52,211,153,.15); color: var(--green); }
.tag.unpaid { background: rgba(251,113,133,.15); color: var(--rose); }
.tag.dupr { background: rgba(26,159,255,.15); color: #93c5fd; }
.tag.muted { background: rgba(148,163,184,.12); color: var(--muted); }

/* Danger zone + modal */
.danger-zone {
  border-color: rgba(251,113,133,.35);
  background: linear-gradient(180deg, rgba(251,113,133,.06), transparent 60%);
}
.btn.danger {
  background: #e11d48; color: #fff; border: none;
}
.btn.danger:hover { filter: brightness(1.08); }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(2,6,23,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(440px, 100%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}
.modal h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.modal p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
html[data-theme="light"] .choice { background: #f8fafc; }
html[data-theme="light"] .modal-backdrop { background: rgba(15,23,42,.4); }

/* Event format */
.choice.block.format-choice,
.choice.format-choice {
  display: inline-flex;
  width: auto;
  flex: 1 1 0;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  border-radius: 12px;
  padding: .45rem .7rem;
  font-size: .88rem;
  white-space: nowrap;
}
.choice.format-choice input {
  margin: 0;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
}
.choice-stack {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  gap: .4rem;
  margin-top: .35rem;
  align-items: stretch;
}
@media (max-width: 800px) {
  .choice-stack { flex-wrap: wrap; }
  .choice.format-choice { flex: 1 1 100%; white-space: normal; }
}
.format-panel {
  margin-top: .35rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(26,159,255,.06);
}
.format-panel[hidden] { display: none !important; }
.subhead {
  margin: 0 0 .65rem;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .row3 { grid-template-columns: 1fr; } }
.money {
  display: flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 .65rem;
}
.money span { color: var(--muted); font-weight: 700; }
.money input {
  border: none !important; background: transparent !important;
  padding: .65rem 0 !important; width: 100%;
  box-shadow: none !important;
}
html[data-theme="light"] .format-panel { background: rgba(26,159,255,.08); }
html[data-theme="light"] .money { background: #f8fafc; }

.score-group { margin-top: .9rem; padding-top: .75rem; border-top: 1px solid rgba(148,163,184,.25); }
.score-group[hidden] { display: none !important; }
.score-group-title { margin: 0 0 .5rem; font-size: .95rem; font-weight: 600; }
.format-panel .hint { display: block; margin-top: .25rem; font-size: .78rem; opacity: .7; }

.pools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.pool-card { border: 1px solid rgba(148,163,184,.3); border-radius: 12px; padding: .75rem .9rem; background: rgba(26,159,255,.06); }
.pool-card h4 { margin: 0 0 .5rem; font-size: 1rem; }
.pool-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.pool-card li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .9rem; }
.seed-num { font-weight: 700; font-size: .78rem; opacity: .75; min-width: 3.4rem; }

.court-assign { display: grid; gap: .6rem; }
.court-row { display: grid; grid-template-columns: 170px 1fr; gap: .75rem; align-items: center; padding: .6rem .75rem; border: 1px solid rgba(148,163,184,.25); border-radius: 12px; }
.court-row-label { display: grid; gap: .15rem; }
.court-summary { font-size: .8rem; opacity: .7; }
.court-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.court-chip { min-width: 2.3rem; height: 2.3rem; border-radius: 999px; border: 1px solid rgba(148,163,184,.4); background: transparent; color: inherit; font-weight: 600; cursor: pointer; }
.court-chip:hover { border-color: var(--accent); }
.court-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.court-chip.taken { opacity: .35; }
@media (max-width: 640px) { .court-row { grid-template-columns: 1fr; } }

/* Court buttons drawn as mini pickleball courts (top-down, landscape). */
.court-chip {
  position: relative; width: 64px; min-width: 64px; height: 36px; border-radius: 3px; padding: 0;
  border: 2px solid rgba(255,255,255,.75);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.95) calc(50% - 1px), rgba(255,255,255,.95) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent 31%, rgba(255,255,255,.6) 31%, rgba(255,255,255,.6) calc(31% + 1px), transparent calc(31% + 1px), transparent calc(69% - 1px), rgba(255,255,255,.6) calc(69% - 1px), rgba(255,255,255,.6) 69%, transparent 69%),
    linear-gradient(180deg, transparent calc(50% - .5px), rgba(255,255,255,.6) calc(50% - .5px), rgba(255,255,255,.6) calc(50% + .5px), transparent calc(50% + .5px)),
    #2f6f4f;
  color: #fff; font-size: .85rem; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.8);
  transition: transform .12s ease, box-shadow .12s ease;
}
.court-chip::after { content: ""; position: absolute; inset: 31% auto 31% 50%; }
.court-chip:hover { transform: translateY(-1px); border-color: #fff; }
.court-chip.on {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent 31%, rgba(255,255,255,.75) 31%, rgba(255,255,255,.75) calc(31% + 1px), transparent calc(31% + 1px), transparent calc(69% - 1px), rgba(255,255,255,.75) calc(69% - 1px), rgba(255,255,255,.75) 69%, transparent 69%),
    linear-gradient(180deg, transparent calc(50% - .5px), rgba(255,255,255,.75) calc(50% - .5px), rgba(255,255,255,.75) calc(50% + .5px), transparent calc(50% + .5px)),
    #1a9fff;
  border-color: #fff; box-shadow: 0 0 0 2px rgba(26,159,255,.45), 0 4px 10px rgba(26,159,255,.35);
}
.court-chip.taken { opacity: .28; filter: grayscale(.6); }
.court-chips { gap: .5rem; }

.court-chip { width: 76px; min-width: 76px; height: 42px; }
.court-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem; border-radius: 999px; background: rgba(10,20,30,.85); color: #fff; font-size: .78rem; font-weight: 800; text-shadow: none; position: relative; z-index: 1; }
.court-chip.on .court-num { background: #fff; color: #0b5ea8; }
.court-chip.taken { opacity: .4; }

/* Center line only runs through the service boxes, not the kitchen. */
.court-chip, .court-chip.on {
  background-image:
    linear-gradient(90deg, transparent calc(50% - 1px), var(--net, rgba(255,255,255,.95)) calc(50% - 1px), var(--net, rgba(255,255,255,.95)) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent 31%, var(--ln, rgba(255,255,255,.6)) 31%, var(--ln, rgba(255,255,255,.6)) calc(31% + 1px), transparent calc(31% + 1px), transparent calc(69% - 1px), var(--ln, rgba(255,255,255,.6)) calc(69% - 1px), var(--ln, rgba(255,255,255,.6)) 69%, transparent 69%),
    linear-gradient(180deg, transparent calc(50% - .5px), var(--ln, rgba(255,255,255,.6)) calc(50% - .5px), var(--ln, rgba(255,255,255,.6)) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(180deg, transparent calc(50% - .5px), var(--ln, rgba(255,255,255,.6)) calc(50% - .5px), var(--ln, rgba(255,255,255,.6)) calc(50% + .5px), transparent calc(50% + .5px));
  background-size: 100% 100%, 100% 100%, 31% 100%, 31% 100%;
  background-position: 0 0, 0 0, left top, right top;
  background-repeat: no-repeat;
  background-color: #2f6f4f;
}
.court-chip.on { --ln: rgba(255,255,255,.75); --net: #fff; background-color: #1a9fff; }


.published-banner { border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.12); font-weight: 600; }
.pub-teams { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.gen-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.gen-round { margin-top: .9rem; }
.gen-round-head { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .35rem; }
.gen-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.gen-match { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 10px; }
.gen-court { font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: rgba(59,130,246,.18); color: #93c5fd; }
.gen-wait { font-size: .75rem; width: 100%; }
.gen-bye { padding: .2rem .6rem; }

/* ---------- Scores page + results (scores.js) ---------- */
.pools.sc-single { grid-template-columns: 1fr; }
.sc-small { padding: .45rem .85rem; font-size: .85rem; }
button[disabled], .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.4); }
.sc-savebar {
  position: sticky; top: 66px; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: .55rem .8rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.sc-save { display: inline-flex; align-items: center; gap: .75rem; }
#sc-status.on { color: var(--green); font-weight: 650; }
.sc-stage { padding: .25rem 0 1.75rem; }
.sc-body { padding: .35rem 1rem 1rem; }
.sc-list { display: grid; gap: .5rem; }
.sc-match { border: 1px solid var(--border); border-radius: 12px; padding: .55rem .7rem; background: rgba(255,255,255,.02); }
.sc-match.done { border-color: rgba(52,211,153,.45); }
.sc-match.sc-wait-teams { opacity: .8; }
.sc-head { display: flex; align-items: flex-end; gap: .45rem; margin-bottom: .35rem; }
.sc-head-l { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .45rem; }
.sc-label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.sc-wait { font-size: .75rem; }
.sc-final { font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: .12rem .5rem; border-radius: 999px; background: rgba(52,211,153,.16); color: var(--green); }
.sc-final[hidden] { display: none; }
.sc-rows { display: grid; gap: .25rem; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .15rem .3rem; border-radius: 8px; }
.sc-row.win { background: rgba(52,211,153,.1); color: var(--green); font-weight: 700; }
.sc-row.win .sc-team::after { content: " ✓"; }
.sc-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-seed { display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.3rem; margin-right: .35rem; border-radius: 6px; background: rgba(124,156,255,.15); color: #c7d2fe; font-size: .72rem; font-weight: 800; }
.sc-pending { color: var(--muted); font-weight: 400; }
.sc-games { display: inline-flex; gap: .3rem; flex-shrink: 0; }
.sc-ghs { margin-left: auto; padding-right: .3rem; align-self: flex-end; }
.sc-gh { width: 2.9rem; text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted); line-height: 1.05; display: flex; flex-direction: column; justify-content: flex-end; }
.sc-gh small { font-size: .58rem; font-weight: 600; opacity: .85; }
.sc-in {
  width: 2.9rem; height: 2.1rem; text-align: center; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums;
  background: #0a0e19; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0;
}
.sc-in:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.sc-in:disabled { opacity: .35; }
.sc-in.bad { border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose); }
.sc-out { width: 2.9rem; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.sc-out.hi { color: var(--text); font-weight: 800; }
.sc-row.win .sc-out.hi { color: var(--green); }
.sc-ro .sc-gh, .sc-ro .sc-out { width: 2.5rem; }
.sc-err { margin-top: .4rem; color: var(--rose); font-size: .8rem; font-weight: 600; }
.sc-err[hidden] { display: none; }
.sc-bye .sc-row { font-weight: 600; }
.sc-bye .sc-row.win .sc-team::after { content: ""; }
.sc-table td, .sc-table th { padding: .55rem .6rem; }
.sc-gen { max-width: 640px; }
.sc-gen .btn { margin-top: .75rem; }
.sc-ptag { display: inline-flex; align-items: center; height: 1.3rem; padding: 0 .3rem; margin-right: .35rem; border-radius: 6px; background: rgba(52,211,153,.14); color: #a7f3d0; font-size: .68rem; font-weight: 700; letter-spacing: .02em; }
.sc-seeds { margin: .6rem 0 0; padding-left: 1.3rem; display: grid; gap: .2rem; }
.sc-gate { max-width: 560px; margin: 2rem auto; }
/* Bracket columns */
.sc-bracket-scroll { overflow-x: auto; padding-bottom: .5rem; }
.sc-bracket { display: flex; gap: 1rem; align-items: stretch; min-width: min-content; }
.sc-bcol { flex: 0 0 310px; display: flex; flex-direction: column; }
.sc-bcol h4 { margin: 0 0 .6rem; text-align: center; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sc-bcol h4 small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .85; }
.sc-bcol-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 1rem; }
.sc-bcol .sc-match { background: var(--bg-card); }
.sc-third h5 .meta { text-transform: none; letter-spacing: 0; font-weight: 500; }
.sc-third h5 { margin: 0 0 .4rem; font-size: .8rem; color: var(--amber); text-transform: uppercase; letter-spacing: .04em; }
.sc-third .sc-match { border-color: rgba(251,191,36,.4); }
.sc-champ { flex-basis: 220px; }
.sc-podium { text-align: center; border: 1px solid rgba(251,191,36,.4); border-radius: 14px; padding: 1rem; background: rgba(251,191,36,.06); }
.sc-trophy { font-size: 2rem; }
.sc-champ-name { font-weight: 800; font-size: 1.05rem; margin: .2rem 0 .35rem; }
html[data-theme="light"] .sc-in { background: #f8fafc; }
html[data-theme="light"] .sc-savebar { background: #fff; }
/* Pool play pickers (scores.html) */
.sc-viewbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin: 0 0 1rem; }
.sc-pick { display: grid; gap: .25rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.sc-pick[hidden] { display: none; }
.sc-pick select { min-width: 190px; background: #0a0e19; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .55rem .7rem; font: inherit; font-size: .92rem; font-weight: 500; }
.sc-step { display: inline-flex; gap: .5rem; margin-left: auto; }
html[data-theme="light"] .sc-pick select { background: #f8fafc; }
.sc-single .sc-list { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); align-items: start; }
.sc-single .sc-list .gen-bye { grid-column: 1 / -1; }
.save-warn { margin-top: .6rem; color: #fca5a5; font-size: .88rem; }

/* Organizer dashboard: empty state when no tournament is saved yet */
.desk-empty { text-align: center; padding: 2rem 1rem; }
.desk-empty p { margin: 0 0 1rem; color: var(--muted); font-size: 1.05rem; }
.desk-empty[hidden], #desk-table[hidden] { display: none !important; }

/* Public page: all organizer buttons together in the top bar */
.org-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; align-items: center; }
.org-match-actions { display: contents; }
@media (max-width: 640px) {
  .org-actions { width: 100%; justify-content: flex-start; }
  .org-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* Manage page: team editor (roster.js) */
.roster table td { vertical-align: middle; }
.roster-player { display: block; border-radius: 10px; transition: background-color .4s, box-shadow .4s; }
.roster-player .rp-main { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.roster-player .rp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .3rem; }
.roster-player .rp-duprid { width: 11rem; max-width: 100%; padding: .28rem .55rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; }
.roster-player .rp-duprid::placeholder { text-transform: none; letter-spacing: 0; }
.rp-link { font-size: .8rem; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.rp-link:hover { text-decoration: underline; }
.rp-link[hidden] { display: none; }
.roster-player.rp-flash { background: rgba(52,211,153,.14); box-shadow: 0 0 0 4px rgba(52,211,153,.14); }
.roster-player input {
  background: #0a0e19; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: .45rem .6rem; font: inherit; font-size: .92rem;
}
.roster-player .rp-name { flex: 1 1 9rem; min-width: 7rem; }
.roster-player .rp-dupr { width: 5.2rem; flex: 0 0 auto; }
.roster-player input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.roster-player input.bad { border-color: var(--rose); }
/* Rating box of a player just added from Find Player (directory has no rating): make it obvious to fill in */
.roster-player input.rp-need { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,159,255,.25); animation: rpNeed 1.6s ease-in-out 3; }
.roster-player input.rp-need::placeholder { color: var(--accent); opacity: 1; }
@keyframes rpNeed { 50% { box-shadow: 0 0 0 5px rgba(26,159,255,.45); } }
.rp-paid { min-width: 5.4rem; text-align: center; justify-content: center; border: none; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; padding: .25rem .6rem; }
.rp-paid:hover { transform: none; filter: brightness(1.15); }
.rp-actions { white-space: nowrap; text-align: right; }
.rp-ask { font-size: .85rem; color: var(--muted); }
.roster-empty { padding: 1rem; text-align: center; }
.roster-empty[hidden], .roster-msg[hidden] { display: none; }
.roster-msg { margin-top: .6rem; color: #fca5a5; }
.roster-count { margin-top: .35rem; }
.roster-save-note { margin-top: .5rem; font-size: .82rem; }
html[data-theme="light"] .roster-player input { background: #fff; color: #0f172a; }
@media (max-width: 720px) {
  .roster table, .roster tbody, .roster tr, .roster td { display: block; width: 100%; }
  .roster thead { display: none; }
  .roster tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .roster td.rank { font-weight: 700; }
  .rp-actions { text-align: left; }
}
.roster-count .paid { color: var(--green); font-weight: 600; }
.roster-count .unpaid { color: var(--rose); font-weight: 600; }

/* Find Player modal (saved players directory) */
.modal.fp-modal { width: min(700px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; }
.fp-search {
  width: 100%; margin-top: .85rem; background: #0a0e19; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: .6rem .75rem; font: inherit;
}
.fp-search:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.modal .fp-count { margin-top: .5rem; font-size: .82rem; }
.fp-list { margin-top: .4rem; overflow-y: auto; min-height: 4rem; max-height: 50vh; border: 1px solid var(--border); border-radius: 12px; }
.fp-row { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem .35rem 0; border-bottom: 1px solid var(--border); }
.fp-row:last-child { border-bottom: none; }
.fp-row.fp-head { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .5rem .5rem .5rem .75rem; }
.fp-head span:first-child, .fp-name { flex: 1 1 auto; min-width: 0; }
.fp-head span:nth-child(2), .fp-id { width: 6.2rem; flex: 0 0 auto; }
.fp-head span:nth-child(3), .fp-link { width: 7.4rem; flex: 0 0 auto; }
.fp-head span:nth-child(4) { width: 13rem; flex: 0 0 auto; }
.fp-pick {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .5rem; text-align: left;
  background: none; border: none; color: var(--text); font: inherit; padding: .45rem .75rem; border-radius: 8px; cursor: pointer;
}
.fp-pick:hover, .fp-pick:focus-visible { background: rgba(26,159,255,.1); }
.fp-row.in .fp-pick { color: var(--muted); cursor: default; }
.fp-row.in .fp-pick:hover { background: none; }
.fp-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-id { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; color: var(--muted); }
.fp-act { width: 13rem; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: .35rem; flex-wrap: nowrap; }
.fp-act.asking { flex-wrap: wrap; }
.fp-in { background: rgba(148,163,255,.14); color: var(--muted); white-space: nowrap; padding: .25rem .6rem; }
.fp-del { background: none; border: 1px solid transparent; color: var(--muted); font-size: 1.1rem; line-height: 1; width: 1.8rem; height: 1.8rem; border-radius: 8px; cursor: pointer; }
.fp-del:hover { border-color: var(--border); color: var(--rose); }
.fp-act .rp-ask { flex-basis: 100%; text-align: right; font-size: .78rem; }
.fp-empty { padding: 1.25rem 1rem; text-align: center; }
.modal .fp-msg { min-height: 1.3em; margin-top: .6rem; font-size: .88rem; }
.modal .fp-msg[data-kind="ok"] { color: var(--green); }
.modal .fp-msg[data-kind="warn"] { color: #fca5a5; }
.fp-foot { margin-top: .75rem; justify-content: flex-end; }
html[data-theme="light"] .fp-search { background: #fff; color: #0f172a; }
@media (max-width: 560px) {
  .fp-head { display: none !important; }
  .fp-row { flex-wrap: wrap; padding-left: 0; }
  .fp-act { width: 100%; justify-content: flex-start; padding-left: .75rem; }
  .fp-link { width: auto; padding-left: .75rem; }
  .fp-link:empty { display: none; }
}

/* Scores page: all pools at once, one Round picker (scores.js renderPoolList) */
.sc-pools { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
@media (min-width: 960px) { .sc-pools:not(.sc-single) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sc-pool .pool-head h3 { font-size: 1.08rem; }
.sc-pool .gen-round:first-child { margin-top: .6rem; }
.sc-pool .gen-bye { font-size: .85rem; border-left: 2px solid var(--border); margin-top: .1rem; }
.sc-pool-none { padding: .9rem 0 .2rem; }
.sc-pick-note { font-weight: 500; color: var(--muted); opacity: .85; }
@media (max-width: 560px) {
  .sc-viewbar { align-items: stretch; }
  .sc-viewbar .sc-pick, .sc-viewbar .sc-pick select { width: 100%; min-width: 0; }
  .sc-step { margin-left: 0; width: 100%; }
  .sc-step .btn { flex: 1; }
  .sc-body { padding: .35rem .6rem .8rem; }
  .sc-pool .pool-head { flex-wrap: wrap; gap: .35rem; }
}

/* Account settings: organization photo (org.js) */
.org-photo-box {
  margin-top: .35rem; min-height: 150px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 14px; padding: 1rem;
  background: linear-gradient(145deg, rgba(124,156,255,.12), rgba(45,212,191,.08));
}
.org-photo-box.has-photo { border-style: solid; background: rgba(255,255,255,.03); }
.org-photo-box img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; }
.org-photo-box img[hidden], .org-photo-empty[hidden] { display: none; }
.org-photo-empty { color: var(--muted); font-size: .9rem; text-align: center; max-width: 32rem; line-height: 1.45; }
.org-photo-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.org-photo-actions [hidden] { display: none; }
.org-ask { color: var(--muted); font-size: .9rem; }
.org-photo-msg { min-height: 1.2em; margin: .1rem 0 0; }
.org-photo-msg[data-kind="ok"] { color: var(--green); }
.org-photo-msg[data-kind="warn"] { color: var(--rose); }
html[data-theme="light"] .org-photo-box.has-photo { background: #f8fafc; }

/* Public tournament page: "Hosted by" (org.js) */
.hosted-by { display: flex; align-items: center; gap: .7rem; margin: -.1rem 0 .75rem; min-width: 0; }
.hosted-logo { height: 56px; width: auto; max-width: 140px; object-fit: contain; border-radius: 12px; flex: 0 0 auto; }
.hosted-logo[hidden] { display: none; }
.hosted-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.hosted-by:not(.has-logo) .hosted-text { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .35rem; }
.hosted-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hosted-name { font-size: 1rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 560px) { .hosted-logo { height: 48px; max-width: 110px; } .hosted-name { font-size: .95rem; } }

/* Account settings: Home facility "Saved" note (org.js) */
.hf-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.hf-saved { font-size: .85rem; font-weight: 650; color: var(--green); opacity: 0; transition: opacity .25s; }
.hf-saved.on { opacity: 1; }
.hf-saved[data-kind="warn"] { color: var(--rose); }

/* Supabase (db.js / login.js): save status, warnings, login messages */
.db-status {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60; max-width: min(420px, calc(100vw - 2rem));
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  padding: .55rem .8rem; font-size: .85rem; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.db-status.on { opacity: 1; transform: none; pointer-events: auto; }
.db-status[data-state="saved"] { color: var(--green); }
.db-status[data-state="offline"], .db-status[data-state="error"] { border-color: rgba(251,191,36,.55); color: #fcd34d; }
.db-retry { margin-left: .4rem; background: none; border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: .1rem .5rem; font: inherit; font-size: .8rem; cursor: pointer; }
.banner.db-warn { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.1); }
.auth-msg { margin: .25rem 0 0; font-size: .9rem; }
.auth-msg[data-kind="ok"] { color: var(--green); }
.auth-msg[data-kind="warn"] { color: #fca5a5; }
main > .auth-msg { margin: 0 0 1rem; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 12px; }
.auth-signed { max-width: 560px; margin-bottom: 1rem; }
.btn.is-busy { opacity: .65; cursor: progress; }
.fp-del.fp-del-off { opacity: .35; cursor: not-allowed; }
.fp-del.fp-del-off:hover { border-color: transparent; color: var(--muted); }
html[data-theme="light"] .db-status { background: #fff; color: #0f172a; }
html[data-theme="light"] .db-status[data-state="offline"], html[data-theme="light"] .db-status[data-state="error"] { color: #92400e; }
html[data-theme="light"] .auth-msg[data-kind="warn"] { color: #b91c1c; }

/* Home page: real published tournaments (home.js) */
.home-card { display: block; color: inherit; text-decoration: none; }
.home-card .card-media { height: 96px; }
.card-media.home-media-live { background-image: linear-gradient(135deg, rgba(251,113,133,.38), rgba(26,159,255,.28)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='rgba(255,255,255,.12)' stroke-width='2' d='M10 40h60M40 10v60'/%3E%3Ccircle cx='40' cy='40' r='18' fill='none' stroke='rgba(255,255,255,.15)' stroke-width='2'/%3E%3C/svg%3E"); }
.card-media.home-media-upcoming { background-image: linear-gradient(135deg, rgba(167,139,250,.4), rgba(251,191,36,.25)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='rgba(255,255,255,.12)' stroke-width='2' d='M10 40h60M40 10v60'/%3E%3Ccircle cx='40' cy='40' r='18' fill='none' stroke='rgba(255,255,255,.15)' stroke-width='2'/%3E%3C/svg%3E"); }
.card-media.home-media-complete { background-image: linear-gradient(135deg, rgba(52,211,153,.35), rgba(26,159,255,.3)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='rgba(255,255,255,.12)' stroke-width='2' d='M10 40h60M40 10v60'/%3E%3Ccircle cx='40' cy='40' r='18' fill='none' stroke='rgba(255,255,255,.15)' stroke-width='2'/%3E%3C/svg%3E"); }
.home-card h3, .home-hero-title { overflow-wrap: anywhere; }
.home-card .meta + .meta { margin-top: .15rem; }
.home-champ { margin-top: .55rem; color: var(--text); }
.home-host { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; min-width: 0; }
.home-host span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-host-img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; flex: none; background: rgba(255,255,255,.08); border: 1px solid var(--border); }
.home-hero-title { margin: .6rem 0 .35rem; font-size: 1.17rem; }
.hero-card > .home-hero-title:first-child { margin-top: 0; }
.home-tight { margin: .1rem 0; }
.home-small { margin-top: .6rem; font-size: .85rem; }
.home-small a, .home-message a { color: var(--accent); }
.home-hero-btn { margin-top: 1rem; }
.home-hero-btn .btn { width: 100%; text-align: center; display: inline-block; box-sizing: border-box; }
.home-message { max-width: 640px; }
.home-message h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.home-message p { margin: 0; }
.home-msg-btn { margin-top: .9rem; }
.home-more { margin-top: 1rem; text-align: center; }
.home-loading { display: flex; align-items: center; gap: .6rem; color: var(--muted); padding: .4rem 0; }
.home-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: homeSpin .8s linear infinite; flex: none; }
@keyframes homeSpin { to { transform: rotate(360deg); } }
.home-skeleton .card-media { height: 96px; opacity: .45; }
.home-skeleton .card-body span { display: block; height: .8rem; border-radius: 6px; background: rgba(148,163,184,.18); margin: .55rem 0; animation: homePulse 1.2s ease-in-out infinite; }
.home-skeleton .card-body span:nth-child(1) { width: 30%; } .home-skeleton .card-body span:nth-child(2) { width: 75%; height: 1.05rem; } .home-skeleton .card-body span:nth-child(3) { width: 55%; }
.home-skeleton:hover { transform: none; border-color: var(--border); }
@keyframes homePulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .home-spinner, .home-skeleton .card-body span { animation: none; } }
html[data-theme="light"] .stat { background: rgba(15,40,80,.06); }
html[data-theme="light"] .home-host-img { background: #f1f5f9; }
#past[hidden], #home-featured-link[hidden] { display: none !important; }
html[data-theme="light"] .btn.soft { color: var(--accent-2); background: rgba(26,159,255,.12); }
html[data-theme="light"] .eyebrow { color: #6d28d9; }

/* Find Player: edit a shared player inline */
.fp-edit { background: none; border: 1px solid transparent; color: var(--muted); font-size: 1rem; line-height: 1; width: 1.8rem; height: 1.8rem; border-radius: 8px; cursor: pointer; padding: 0; }
.fp-edit:hover, .fp-edit:focus-visible { border-color: var(--border); color: var(--accent); }
@media (min-width: 561px) { .fp-head span:nth-child(4), .fp-act { width: 15rem; } }
.fp-row.fp-editing { display: block; padding: .6rem .75rem .7rem; background: rgba(26,159,255,.06); }
.fp-eform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .6rem; }
.fp-ef { display: grid; gap: .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fp-ef-name { flex: 1 1 14rem; min-width: 0; }
.fp-ef-id { flex: 0 1 9rem; }
.fp-ef input { font: inherit; font-size: .92rem; font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--text); background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 9px; padding: .45rem .6rem; width: 100%; box-sizing: border-box; }
.fp-ef-id input { font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.fp-ef input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.fp-ef input.bad { border-color: var(--rose); }
.fp-ebtns { display: flex; gap: .4rem; }
.fp-eerr { margin: .45rem 0 0; color: #fca5a5; font-size: .85rem; }
.fp-eerr[hidden] { display: none; }
.modal .fp-enote { margin: .4rem 0 0; font-size: .8rem; }
html[data-theme="light"] .fp-ef input { background: #fff; }
html[data-theme="light"] .fp-eerr, html[data-theme="light"] .modal .fp-msg[data-kind="warn"] { color: #b91c1c; }
html[data-theme="light"] .fp-row.fp-editing { background: rgba(26,159,255,.07); }
@media (max-width: 640px) { .fp-ef-name, .fp-ef-id { flex: 1 1 100%; } .fp-ebtns { width: 100%; } .fp-ebtns .btn { flex: 1; } }
.fp-edit, .fp-del { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }

/* ===== Organizer profiles (orgprofile-1): home search, host links, host.html ===== */
/* Home cards: the title link stretches over the whole card; "Hosted by" is its own link on top (no nested links). */
.home-card { position: relative; }
.home-card-link { color: inherit; text-decoration: none; }
.home-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.home-card-link:focus-visible { outline: none; }
.home-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26,159,255,.35); }
a.home-host { position: relative; z-index: 2; text-decoration: none; border-radius: 8px; transition: color .15s ease; }
a.home-host:hover span, a.home-host:focus-visible span { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a.home-host:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-card a.home-host { display: flex; }

/* Home search */
.home-search { position: relative; margin: 0 0 .9rem; max-width: 640px; }
.home-search-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.15rem; pointer-events: none; }
.home-q { width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: .7rem 2.8rem .7rem 2.4rem; -webkit-appearance: none; appearance: none; }
.home-q::placeholder { color: var(--muted); opacity: .9; }
.home-q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,159,255,.25); }
.home-q::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
button.home-q-clear { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; padding: 0; border-radius: 50%; background: rgba(148,163,184,.16); color: var(--text); font-size: 1.15rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
button.home-q-clear:hover { transform: translateY(-50%); background: rgba(148,163,184,.28); filter: none; }
button.home-q-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.home-q-clear[hidden] { display: none; }
.home-q-count { margin: -.35rem 0 .8rem; font-size: .88rem; }
.home-q-count[hidden] { display: none; }
.home-orgs { margin: 0 0 1.1rem; }
.home-orgs-title { margin: 0 0 .5rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.home-org-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.home-org { display: inline-flex; align-items: center; gap: .55rem; max-width: 100%; padding: .4rem .85rem .4rem .45rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); color: var(--text); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.home-org:hover, .home-org:focus-visible { border-color: var(--accent); transform: translateY(-1px); outline: none; }
.home-org img, .home-org-ph { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--border); background: rgba(255,255,255,.08); }
.home-org-ph { display: inline-flex; align-items: center; justify-content: center; font-weight: 750; color: var(--accent); background: rgba(26,159,255,.14); }
.home-org-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.home-org-txt b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-org-txt small { font-size: .75rem; color: var(--muted); }
.home-message a.btn { color: #0b0f1a; }
.home-message a.btn.ghost { color: var(--text); }

/* Tournament page: "Hosted by" links to the organizer profile */
a.hosted-by { color: inherit; text-decoration: none; width: fit-content; max-width: 100%; border-radius: 12px; }
a.hosted-by[href] { cursor: pointer; }
a.hosted-by[href] .hosted-name::after { content: " ›"; color: var(--muted); font-weight: 600; }
a.hosted-by[href]:hover .hosted-name, a.hosted-by[href]:focus-visible .hosted-name { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a.hosted-by:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a.hosted-by[hidden] { display: none; }

/* Dashboard header buttons */
.desk-head-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
@media (max-width: 560px) { .desk-head-actions { width: 100%; } .desk-head-actions .btn { flex: 1 1 auto; text-align: center; } }

/* host.html: public organizer profile */
.host-main { padding-top: 1.8rem; padding-bottom: 2.5rem; }
.host-loading { padding: 2rem 0; }
.host-head { display: flex; align-items: center; gap: 1.4rem; padding: 1.4rem 1.5rem; margin-bottom: 1.2rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.host-photo { width: 112px; height: 112px; border-radius: 22px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: none; }
.host-photo-ph { display: flex; align-items: center; justify-content: center; font-size: 2.8rem; font-weight: 800; color: var(--accent); background: rgba(26,159,255,.14); }
.host-id { min-width: 0; }
.host-id .eyebrow { margin-bottom: .55rem; }
.host-name { margin: 0 0 .3rem; font-size: clamp(1.5rem, 3.2vw, 2.2rem); line-height: 1.12; overflow-wrap: anywhere; }
.host-id .meta { margin: .1rem 0; }
.host-count { font-weight: 600; }
.host-own { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }
.host-own a { color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.host-group { margin: 1.6rem 0 0; }
.host-group .section-title { margin-bottom: .75rem; }
.host-group h2 { font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
.host-n { font-size: .8rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: rgba(26,159,255,.16); color: var(--accent); }
.host-empty { max-width: none; }
.host-empty .card-body { padding: .9rem 1.1rem; }
.host-empty:hover { transform: none; border-color: var(--border); }
.host-notfound { padding: 2.5rem 0; display: flex; justify-content: center; }
.host-notfound .home-message { width: 100%; }
html[data-theme="light"] .banner.host-own { color: #1e3a8a; }
html[data-theme="light"] .home-org-ph, html[data-theme="light"] .host-photo-ph { color: var(--accent-2); }
html[data-theme="light"] .host-n { color: var(--accent-2); }
@media (max-width: 560px) {
  .host-head { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.1rem; }
  .host-photo { width: 88px; height: 88px; border-radius: 18px; }
  .home-search { max-width: none; }
  .home-q { font-size: 16px; } /* no iOS zoom on focus */
}
section.host-group { padding: 0; }
.host-group .card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* host.html: total cash paid out (payouts-1) */
.host-stat { margin-left: auto; flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: .1rem; padding: .85rem 1.1rem; border-radius: 14px; background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.3); min-width: 12rem; }
.host-stat-amt { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.05; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.host-stat-lbl { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text); }
.host-stat-sub { font-size: .82rem; color: var(--muted); }
html[data-theme="light"] .host-stat { background: rgba(5,150,105,.08); border-color: rgba(5,150,105,.3); }
html[data-theme="light"] .host-stat-amt { color: #047857; }
@media (max-width: 720px) {
  .host-head { flex-wrap: wrap; }
  .host-stat { margin-left: 0; width: 100%; align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .15rem .55rem; }
  .host-stat-sub { flex-basis: 100%; }
}

/* Manage page: roster name typeahead (typeahead-1) */
.rp-ta { position: absolute; z-index: 60; max-height: min(22rem, 60vh); overflow-y: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: .3rem; font-size: .92rem; -webkit-overflow-scrolling: touch; }
.rp-ta[hidden] { display: none; }
.rp-ta-opt { display: flex; align-items: center; gap: .55rem; padding: .55rem .65rem; border-radius: 9px; cursor: pointer; min-height: 2.5rem; color: var(--text); }
.rp-ta-opt:hover, .rp-ta-opt.active { background: rgba(26,159,255,.16); }
.rp-ta-opt.active { box-shadow: inset 0 0 0 1px rgba(26,159,255,.55); }
.rp-ta-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-ta-name b { color: var(--accent); font-weight: 700; }
.rp-ta-id { flex: none; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: var(--muted); }
.rp-ta-id.none { font-family: var(--font); font-style: italic; opacity: .8; }
.rp-ta-opt.taken { cursor: not-allowed; opacity: .55; }
.rp-ta-opt.taken:hover { background: none; }
.rp-ta-opt.taken .rp-ta-name b { color: inherit; }
.rp-ta-in { flex: none; background: rgba(148,163,255,.14); color: var(--muted); font-size: .7rem; padding: .15rem .5rem; white-space: nowrap; }
.rp-ta-note { padding: .6rem .65rem; color: var(--muted); }
.rp-ta-hint { padding: .45rem .65rem .3rem; margin-top: .2rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .75rem; }
html[data-theme="light"] .rp-ta { background: #fff; }
html[data-theme="light"] .rp-ta-opt:hover, html[data-theme="light"] .rp-ta-opt.active { background: rgba(26,159,255,.1); }
html[data-theme="light"] .rp-ta-name b { color: var(--accent-2); }
@media (max-width: 560px) {
  .rp-ta { font-size: .95rem; }
  .rp-ta-opt { min-height: 2.9rem; flex-wrap: wrap; row-gap: .15rem; }
  .rp-ta-name { flex-basis: 60%; }
  .rp-ta-in { order: 3; }
}
.rp-ta-opt { flex-wrap: wrap; row-gap: .2rem; }
.rp-ta-name { flex: 1 1 9rem; }
.rp-ta-opt.taken .rp-ta-in { order: 3; }
.rp-ta-opt.taken .rp-ta-id { order: 2; }

/* ---------- Public tournament page: hero photo, payouts, stream previews, live tabs (publicview-1) ---------- */
.tour-hero { align-items: start; }
.tour-info { position: relative; overflow: hidden; }
.tour-info-inner { position: relative; z-index: 1; }
/* Organizer's background photo + dark overlay. Same dark look in both themes so the text always reads. */
.tour-info.has-cover {
  --text: #f8fafc; --muted: #d0d8ea; --border: rgba(255,255,255,.2);
  color: var(--text); border-color: rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(6,10,22,.6) 0%, rgba(6,10,22,.78) 50%, rgba(6,10,22,.9) 100%),
    var(--cover) center / cover no-repeat,
    #0b0f1a;
}
.tour-info.has-cover h1 { text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.tour-info.has-cover .meta, .tour-info.has-cover .info-item div { text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.tour-info.has-cover .fee, .tour-info.has-cover .payout { background-color: rgba(0,0,0,.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tour-info.has-cover .pill { background: rgba(26,159,255,.3); color: #e0f2ff; }
.fee-box[hidden], .payout-row[hidden] { display: none; }

/* Payouts row: trophy + amount per place */
.payout-row { margin-top: 1.1rem; }
.payout-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.payout-list { display: flex; flex-wrap: wrap; gap: .6rem; }
.payout {
  display: flex; align-items: center; gap: .7rem; min-width: 150px;
  padding: .55rem 1rem .55rem .6rem; border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.22);
}
.payout.p1 { border-color: rgba(251,191,36,.6); background-image: linear-gradient(135deg, rgba(251,191,36,.2), transparent 70%); }
.payout.p2 { border-color: rgba(203,213,225,.55); background-image: linear-gradient(135deg, rgba(203,213,225,.16), transparent 70%); }
.payout.p3 { border-color: rgba(205,127,50,.6); background-image: linear-gradient(135deg, rgba(205,127,50,.2), transparent 70%); }
.payout-txt strong { display: block; font-size: 1.28rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.payout-txt small { color: var(--muted); font-size: .78rem; font-weight: 600; }
html[data-theme="light"] .tour-info:not(.has-cover) .payout { background-color: #fff; }
html[data-theme="light"] .tour-info:not(.has-cover) .fee { background: #f8fafc; }

/* Stream previews (right of the info card) */
.stream-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; align-content: start; }
.stream-previews.sp-n1 > *, .stream-previews.sp-n2 > *, .stream-previews.sp-n3 > :first-child, .stream-previews.sp-n0 > * { grid-column: 1 / -1; }
.sp-tile { background: #05070f; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; box-shadow: var(--shadow); }
.sp-screen { position: relative; aspect-ratio: 16 / 9; background: #0a0f1d; }
.sp-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sp-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  color: #fff; text-decoration: none; background: #111827 center / cover no-repeat;
}
.sp-card.sp-youtube { background-color: #2a0b10; }
.sp-card.sp-twitch { background-image: linear-gradient(135deg, #3b1d7a, #12082b); }
.sp-card.sp-facebook { background-image: linear-gradient(135deg, #0f3d91, #071a40); }
.sp-card.sp-link { background-image: linear-gradient(135deg, #1e293b, #0b1220); }
.sp-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.55)); }
.sp-card > * { position: relative; }
.sp-play { width: 3.1rem; height: 3.1rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: #0b0f1a; box-shadow: 0 6px 24px rgba(0,0,0,.45); transition: transform .15s ease; }
.sp-youtube .sp-play { background: #ff0033; color: #fff; }
.sp-twitch .sp-play { background: #9146ff; color: #fff; }
.sp-facebook .sp-play { background: #1877f2; color: #fff; }
.sp-card:hover .sp-play, .sp-card:focus-visible .sp-play { transform: scale(1.08); }
.sp-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sp-watch { font-size: .8rem; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.sp-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem .7rem; font-size: .85rem; color: #e5e9f5; }
.sp-court { font-weight: 700; display: inline-flex; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-open { color: #93c5fd; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.sp-open:hover { text-decoration: underline; }
.stream-previews.sp-n3 .sp-tile:not(:first-child) .sp-play { width: 2.4rem; height: 2.4rem; }
.stream-previews.sp-n3 .sp-tile:not(:first-child) .sp-watch { font-size: .72rem; }
.sp-empty {
  border: 1px dashed var(--border); border-radius: 14px; padding: 1.6rem 1.2rem; background: var(--bg-card);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; color: var(--muted);
}
.sp-empty strong { color: var(--text); font-size: 1rem; }
.sp-empty .meta { max-width: 300px; font-size: .85rem; }
.sp-empty-icon { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; background: rgba(26,159,255,.12); color: var(--accent); margin-bottom: .2rem; }
@media (max-width: 600px) {
  .stream-previews { grid-template-columns: 1fr; }
  .stream-previews > * { grid-column: 1 / -1 !important; }
  .stream-previews.sp-n3 .sp-tile:not(:first-child) .sp-play { width: 3.1rem; height: 3.1rem; }
  .sp-empty { padding: 1.1rem 1rem; }
}

/* Tab "Pools and Playoff Bracket" */
.pp-live { display: inline-flex; align-items: center; margin-left: .4rem; font-size: .78rem; font-weight: 700; color: var(--rose); white-space: nowrap; }
.pp-live .dot { width: 7px; height: 7px; animation: pp-pulse 1.6s ease-in-out infinite; }
@keyframes pp-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pp-live .dot { animation: none; } }
.pp-state { text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.25rem; margin: .25rem 0 1.25rem; }
.pp-state h2 { margin: .35rem 0 .3rem; font-size: clamp(1.3rem, 2.6vw, 1.75rem); }
.pp-state-icon { font-size: 2.3rem; line-height: 1; }
.pp-wait { background: linear-gradient(135deg, rgba(26,159,255,.14), rgba(167,139,250,.1)), var(--bg-card); }
.pp-body { padding: .75rem 1rem 1rem; }
.pp-champ {
  display: flex; align-items: center; gap: .85rem; width: fit-content; max-width: 100%; margin: 0 0 1rem;
  padding: .85rem 1.2rem; border-radius: 14px; border: 1px solid rgba(251,191,36,.6);
  background: linear-gradient(135deg, rgba(251,191,36,.22), rgba(251,191,36,.04)); box-shadow: 0 0 28px rgba(251,191,36,.15);
}
.pp-champ-cup { font-size: 2.1rem; line-height: 1; }
.pp-champ small { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 800; color: var(--amber); }
.pp-champ strong { font-size: 1.3rem; overflow-wrap: anywhere; }
.pp-bracket.is-done .sc-podium { border-color: rgba(251,191,36,.85); background: linear-gradient(180deg, rgba(251,191,36,.24), rgba(251,191,36,.05)); box-shadow: 0 0 30px rgba(251,191,36,.25); }
.pp-bracket.is-done .sc-champ-name { color: var(--amber); font-size: 1.2rem; }
.pp-adv { max-width: 520px; margin: 1.1rem auto 0; text-align: left; }
.pp-adv h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .45rem; }
.pp-adv-list { margin: 0; padding-left: 1.4rem; display: grid; gap: .3rem; }
.pp-table th.num, .pp-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-champ-row td { color: var(--amber); font-weight: 750; }
html[data-theme="light"] .pp-champ small, html[data-theme="light"] .pp-champ-row td, html[data-theme="light"] .pp-bracket.is-done .sc-champ-name { color: #b45309; }
html[data-theme="light"] .sc-seed { color: #3446a8; background: rgba(52,70,168,.1); }
html[data-theme="light"] .sc-ptag { color: #047857; background: rgba(4,120,87,.1); }
html[data-theme="light"] .gen-court { color: #0b5cad; background: rgba(26,159,255,.12); }

/* Players tab */
.pl-person { white-space: nowrap; }
.pl-dupr { display: inline-block; margin-left: .15rem; padding: .05rem .4rem; border-radius: 6px; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(26,159,255,.14); color: #7cc4ff; }
.pl-sep { color: var(--muted); }
.pl-pool { font-weight: 700; }
.pl-avgcell { text-align: right; white-space: nowrap; }
.pl-avg { font-weight: 800; font-variant-numeric: tabular-nums; }
html[data-theme="light"] .pl-dupr { color: var(--accent-2); }
@media (max-width: 560px) { .pl-person { white-space: normal; } .pl-table td, .pl-table th { padding: .55rem .5rem; } }

/* Manage page: stream court + background photo */
.stream-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: .75rem; align-items: end; }
@media (max-width: 640px) { .stream-row { grid-template-columns: 1fr; gap: .5rem; } }
.cover-field .meta { margin: 0 0 .55rem; font-size: .85rem; }
.cover-box { display: grid; gap: .6rem; }
.cover-preview {
  position: relative; overflow: hidden; max-width: 640px; aspect-ratio: 16 / 6; border-radius: 12px;
  border: 1px dashed var(--border); background: rgba(255,255,255,.02) center / cover no-repeat; display: grid; place-items: center; color: var(--muted);
}
.cover-preview.has-cover { border-style: solid; }
.cover-preview.has-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,10,22,.3), rgba(6,10,22,.6)); }
.cover-empty[hidden] { display: none; }
.cover-actions { margin: 0; }
.cover-actions [hidden] { display: none; }
.cover-msg { margin: 0; font-size: .88rem; }
.cover-msg.ok { color: var(--green); font-weight: 600; }
.cover-msg.warn { color: var(--rose); font-weight: 600; }

/* ---------- Sponsors round (sponsors-1): payout trophies, YouTube subscribe, promo box, Event Sponsors, card photos/prizes ---------- */
.apb-trophy { display: block; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.payout .trophy { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; }
html[data-theme="light"] .tour-info:not(.has-cover) .apb-trophy { filter: drop-shadow(0 2px 3px rgba(15,40,80,.22)); }

/* Right column of the hero: stream previews + promo box filling the remaining height */
.tour-side { display: flex; flex-direction: column; gap: .65rem; min-width: 0; align-self: stretch; }
.tour-side > .stream-previews { flex: none; }
.promo-box[hidden] { display: none; }
.promo-box {
  position: relative; overflow: hidden; flex: 1 1 auto; min-height: 104px;
  display: flex; flex-direction: column; justify-content: center; gap: .55rem; padding: 1.1rem 1.25rem;
  border-radius: 14px; border: 1px solid rgba(26,159,255,.45); color: #f8fafc;
  background: radial-gradient(120% 140% at 0% 0%, rgba(26,159,255,.55), transparent 60%), radial-gradient(120% 140% at 100% 100%, rgba(167,139,250,.5), transparent 60%), linear-gradient(135deg, #0d2350, #1b1446);
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.promo-box:hover { transform: translateY(-2px); border-color: rgba(125,200,255,.8); box-shadow: 0 18px 50px rgba(26,159,255,.25); }
.promo-box:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.promo-glow { position: absolute; width: 180px; height: 180px; right: -50px; top: -70px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); pointer-events: none; }
.promo-txt { position: relative; font-size: clamp(1.15rem, 2.1vw, 1.45rem); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.promo-go { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.promo-host { font-size: .82rem; font-weight: 600; color: #cfe3ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.promo-arrow { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #0d2350; box-shadow: 0 6px 18px rgba(0,0,0,.3); transition: transform .15s ease; }
.promo-box:hover .promo-arrow { transform: translate(2px, -2px); }
html[data-theme="light"] .promo-box {
  color: #0b1b3a; border-color: rgba(11,111,212,.35);
  background: radial-gradient(120% 140% at 0% 0%, rgba(26,159,255,.28), transparent 60%), radial-gradient(120% 140% at 100% 100%, rgba(167,139,250,.28), transparent 60%), linear-gradient(135deg, #eef6ff, #f3efff);
}
html[data-theme="light"] .promo-txt { text-shadow: none; }
html[data-theme="light"] .promo-host { color: #0b5cad; }
html[data-theme="light"] .promo-arrow { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
@media (max-width: 900px) { .promo-box { min-height: 92px; } }

/* YouTube Subscribe on stream previews */
.sp-meta { flex-wrap: wrap; row-gap: .3rem; }
.sp-actions { display: inline-flex; align-items: center; gap: .55rem; margin-left: auto; }
.sp-sub {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem .2rem .45rem; border-radius: 999px;
  background: #ff0033; color: #fff; font-size: .76rem; font-weight: 800; line-height: 1.3; white-space: nowrap; transition: filter .15s ease, transform .15s ease;
}
.sp-sub:hover { filter: brightness(1.1); transform: translateY(-1px); }
.sp-sub:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sp-sub-slot:empty { display: none; }

/* Event Sponsors (bottom of the public page) */
.sponsors-sec[hidden] { display: none; }
.sponsors-sec { margin: 2.2rem 0 1rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.sponsors-sec .section-title { justify-content: center; text-align: center; }
.sponsor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 220px)); justify-content: center; gap: 1rem; }
.sponsor-grid.sg-n1 { grid-template-columns: minmax(0, 260px); }
.sponsor-grid.sg-n2 { grid-template-columns: repeat(2, minmax(0, 240px)); }
.sponsor-grid.sg-n3 { grid-template-columns: repeat(3, minmax(0, 230px)); }
.sponsor-tile { display: flex; flex-direction: column; align-items: center; gap: .5rem; min-width: 0; color: var(--text); text-align: center; }
.sponsor-logo {
  width: 100%; aspect-ratio: 3 / 2; display: grid; place-items: center; padding: .9rem; border-radius: 14px;
  background: #f8fafc; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.sponsor-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
a.sponsor-tile:hover .sponsor-logo { transform: translateY(-3px); border-color: rgba(26,159,255,.6); box-shadow: 0 12px 30px rgba(26,159,255,.22); }
a.sponsor-tile:focus-visible { outline: none; }
a.sponsor-tile:focus-visible .sponsor-logo { outline: 3px solid var(--accent); outline-offset: 2px; }
.sponsor-name { font-size: .88rem; font-weight: 650; color: var(--muted); overflow-wrap: anywhere; }
a.sponsor-tile:hover .sponsor-name { color: var(--text); }
html[data-theme="light"] .sponsor-logo { background: #fff; box-shadow: 0 8px 22px rgba(15,40,80,.08); }
@media (max-width: 700px) { .sponsor-grid, .sponsor-grid.sg-n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sponsor-grid.sg-n1 { grid-template-columns: minmax(0, 240px); } }

/* Home / host cards: tournament photo + prize trophies */
.card-media.has-photo { background: #0b0f1a; position: relative; overflow: hidden; }
.card-media.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.25)); pointer-events: none; }
.card-prizes { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .7rem; }
.card-prize { display: inline-flex; align-items: center; gap: .2rem; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-prize b { font-weight: 800; }
.card-prize small { color: var(--muted); font-weight: 600; font-size: .78rem; margin-left: .1rem; }
.card-prize .apb-trophy { filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
html[data-theme="light"] .card-prize .apb-trophy { filter: drop-shadow(0 1px 1.5px rgba(15,40,80,.25)); }
.home-champ { display: flex; align-items: center; gap: .4rem; overflow-wrap: anywhere; }
.home-champ-ic { flex: none; display: inline-flex; }

/* Manage page: promo link fields + Event Sponsors */
.promo-fields { margin-top: .4rem; padding-top: .9rem; border-top: 1px dashed var(--border); display: grid; gap: .55rem; }
.promo-fields h4 { margin: 0; font-size: 1rem; }
.promo-fields > .meta { margin: 0; font-size: .85rem; }
.count-wrap { position: relative; }
.count-wrap input { padding-right: 3.6rem; }
.char-count { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-size: .78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.char-count.full { color: var(--amber); }
html[data-theme="light"] .char-count.full { color: #b45309; }
.field input.invalid { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(251,113,133,.18); }
.field-msg { margin: 0; font-size: .86rem; }
.field-msg[hidden] { display: none; }
.field-msg.warn { color: var(--rose); font-weight: 600; }
html[data-theme="light"] .field-msg.warn, html[data-theme="light"] .cover-msg.warn { color: #be123c; }
.sponsor-list { display: grid; gap: .65rem; margin: .3rem 0 .8rem; }
.sponsor-none { margin: 0; }
.sponsor-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: .85rem; align-items: center;
  padding: .7rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.02);
}
.sponsor-thumb { width: 120px; aspect-ratio: 3 / 2; border-radius: 10px; background: #f8fafc; border: 1px solid var(--border); display: grid; place-items: center; padding: .4rem; }
.sponsor-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sponsor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; min-width: 0; }
.sponsor-btns { display: flex; gap: .35rem; }
.btn.sm { padding: .42rem .7rem; font-size: .85rem; }
.btn.sm:disabled { opacity: .4; cursor: default; transform: none; }
.sponsor-actions { margin: 0; align-items: center; }
.sponsor-actions [hidden] { display: none; }
@media (max-width: 760px) {
  .sponsor-row { grid-template-columns: 96px minmax(0, 1fr); }
  .sponsor-thumb { width: 96px; }
  .sponsor-fields { grid-template-columns: 1fr; }
  .sponsor-btns { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- home2 round: readable hero text, promo link previews, home page refresh ---------- */
/* Tournament hero: description lines + Where/When/Ball… values bolder, brighter, with a subtle shadow */
.tour-info .tour-summary { font-weight: 600; line-height: 1.55; color: var(--text); opacity: .92; }
.tour-info .info-item div { font-weight: 700; font-size: 1.02rem; }
.tour-info .info-item label { font-weight: 700; }
.tour-info .info-item div .meta { font-weight: 600; }
.tour-info.has-cover {
  background:
    linear-gradient(180deg, rgba(6,10,22,.66) 0%, rgba(6,10,22,.82) 45%, rgba(6,10,22,.92) 100%),
    var(--cover) center / cover no-repeat,
    #0b0f1a;
}
.tour-info.has-cover .tour-summary { color: #f1f5ff; opacity: 1; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.85), 0 2px 12px rgba(0,0,0,.6); }
.tour-info.has-cover .info-item div { color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,.85), 0 2px 12px rgba(0,0,0,.55); }
.tour-info.has-cover .info-item div .meta { color: #dfe7f7; }
.tour-info.has-cover .info-item label { color: #c7d6f2; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.tour-info.has-cover .info-grid { padding: .85rem .95rem; border-radius: 14px; background: rgba(4,8,18,.38); border: 1px solid rgba(255,255,255,.08); }
html[data-theme="light"] .tour-info:not(.has-cover) .tour-summary { color: #1e293b; }
html[data-theme="light"] .tour-info:not(.has-cover) .info-item div { color: #0b1324; }
html[data-theme="light"] .tour-info:not(.has-cover) .info-item label { color: #475569; }

/* Promo box with the linked page's preview image (og:image) behind a dark overlay; the organizer's text stays on top */
.promo-box.has-shot { color: #fff; border-color: rgba(255,255,255,.22); background: #0b0f1a; justify-content: flex-end; min-height: 150px; }
.promo-shot { position: absolute; inset: 0; pointer-events: none; }
.promo-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.promo-box.has-shot:hover .promo-shot img { transform: scale(1.04); }
.promo-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,10,22,.35) 0%, rgba(6,10,22,.62) 45%, rgba(6,10,22,.9) 100%), linear-gradient(90deg, rgba(6,10,22,.55), transparent 75%); }
.promo-title { position: relative; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: #dbe7ff; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.promo-box.has-shot .promo-txt { font-weight: 900; text-shadow: 0 2px 4px rgba(0,0,0,.85), 0 4px 22px rgba(0,0,0,.7); }
.promo-box.has-shot .promo-host { color: #e2ecff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
html[data-theme="light"] .promo-box.has-shot { color: #fff; border-color: rgba(11,27,58,.25); background: #0b0f1a; }
html[data-theme="light"] .promo-box.has-shot .promo-txt { text-shadow: 0 2px 4px rgba(0,0,0,.85), 0 4px 22px rgba(0,0,0,.7); }
html[data-theme="light"] .promo-box.has-shot .promo-host { color: #e2ecff; }
@media (max-width: 900px) { .promo-box.has-shot { min-height: 140px; } }
/* Manage: preview of the promo box */
.promo-preview-wrap[hidden] { display: none; }
.promo-preview-wrap { display: grid; gap: .45rem; margin-top: .2rem; }
.promo-preview-head { max-width: 420px; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.promo-preview-head .label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.promo-preview-head .btn { padding: .35rem .75rem; font-size: .8rem; }
.promo-preview { max-width: 420px; min-height: 120px; }
.promo-preview.has-shot { min-height: 150px; }
.promo-preview-wrap > .meta { margin: 0; font-size: .82rem; }

/* Home hero: search bar where the two buttons were, bigger and more prominent */
.home-search-hero { max-width: 560px; margin: 0 0 1.1rem; }
.home-search-hero .home-q { font-size: 1.05rem; padding: .95rem 3rem .95rem 2.85rem; border-width: 1.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.home-search-hero .home-search-icon { left: 1.05rem; display: inline-flex; transform: translateY(-50%); }
.home-search-hero button.home-q-clear { right: .55rem; }
html[data-theme="light"] .home-search-hero .home-q { box-shadow: 0 8px 24px rgba(15,40,80,.1); background: #fff; }
.hero .home-search-hero + p.lead { margin-bottom: 0; font-size: 1.02rem; }

/* Home featured box: live carousel / next up (card style like the organizer profile cards) */
.hero-card.home-feat.has-slides { padding: 1rem; display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.home-feat-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 2.1rem; }
.home-feat-h { margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: .01em; display: inline-flex; align-items: center; gap: .5rem; }
.home-feat-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 0 rgba(251,113,133,.6); animation: featPulse 1.8s ease-out infinite; }
@keyframes featPulse { 70% { box-shadow: 0 0 0 .5rem rgba(251,113,133,0); } 100% { box-shadow: 0 0 0 0 rgba(251,113,133,0); } }
.home-feat-nav { display: inline-flex; align-items: center; gap: .35rem; }
button.home-feat-arrow { width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(148,163,184,.14); color: var(--text); border: 1px solid var(--border); }
button.home-feat-arrow:hover { background: rgba(26,159,255,.2); transform: none; }
button.home-feat-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-feat-count { min-width: 3.2rem; text-align: center; font-size: .85rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-feat-viewport { overflow: hidden; border-radius: var(--radius); }
.home-feat-track { display: flex; transition: transform .35s ease; }
.home-feat-slide { flex: 0 0 100%; min-width: 0; display: block; color: inherit; text-decoration: none; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--bg-card); transition: border-color .15s ease; }
.home-feat-slide:hover { border-color: rgba(124,156,255,.55); }
.home-feat-slide:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.home-feat-slide .card-media { height: 170px; }
.home-feat-body { display: block; padding: .85rem 1rem 1rem; }
.home-feat-name { display: block; margin: .5rem 0 .3rem; font-size: 1.22rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.home-feat-line { display: block; margin: .08rem 0; }
.home-feat-body .card-prizes { display: flex; }
.home-feat-body .card-prize { font-size: .98rem; }
.home-feat-dots { display: flex; justify-content: center; gap: .4rem; }
button.home-feat-pip { width: .55rem; height: .55rem; padding: 0; border-radius: 999px; background: rgba(148,163,184,.4); transition: width .2s ease, background .2s ease; }
button.home-feat-pip.on { width: 1.4rem; background: var(--accent); }
button.home-feat-pip:hover { transform: none; }
/* Upcoming list: one row of 5 on desktop */
.home-up-grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
@media (max-width: 860px) {
  .home-search-hero { max-width: none; }
  .home-feat-slide .card-media { height: 150px; }
  body.home-searching .hero-card.home-feat { display: none; } /* phone: search results come right after the search bar */
  .home-up-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 560px) { .home-search-hero .home-q { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .home-feat-track { transition: none; } .home-feat-dot { animation: none; } }
html[data-theme="light"] button.home-feat-arrow { background: #fff; }
html[data-theme="light"] .home-feat-slide { background: #fff; }

/* ---------------- Organizer paywall (billing.js / admin.js) ---------------- */
.auth-price { margin: .55rem 0 0; font-size: .9rem; font-weight: 650; color: var(--accent); }
html[data-theme="light"] .auth-price { color: var(--accent-2); }
.billing-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
  padding: .85rem 1.1rem; margin-bottom: 1rem; transition: box-shadow .3s ease;
}
.billing-card.locked { border-color: rgba(26,159,255,.45); background: linear-gradient(135deg, rgba(26,159,255,.12), rgba(11,111,212,.05)), var(--bg-card); padding: 1.05rem 1.2rem; }
.billing-card.pulse { box-shadow: 0 0 0 3px rgba(26,159,255,.45); }
.billing-card h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.billing-card .meta { margin: 0; }
.billing-ic { font-size: 1.4rem; line-height: 1; }
.billing-main { flex: 1 1 260px; min-width: 0; }
.billing-act { display: flex; gap: .5rem; flex-wrap: wrap; }
.billing-line { margin: 0; display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.billing-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(52,211,153,.18); flex: none; }
.billing-card.warn .billing-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.2); }
.billing-msg { margin: .45rem 0 0; font-size: .88rem; color: var(--muted); }
.billing-msg.ok { color: var(--green); }
.billing-msg.warn { color: #fca5a5; }
html[data-theme="light"] .billing-msg.warn { color: #b91c1c; }
html[data-theme="light"] .billing-msg.ok { color: #047857; }
.btn.is-locked { opacity: .55; filter: grayscale(.35); }
.btn.is-locked::before { content: "🔒 "; }
.billing-gate { max-width: 560px; margin: 1rem auto; text-align: center; padding: 2rem 1.5rem; }
.billing-gate h2 { margin: .5rem 0 .4rem; }
.billing-gate .billing-ic { font-size: 2rem; }
.billing-gate .hero-actions { justify-content: center; margin-top: 1.1rem; }
@media (max-width: 640px) {
  .billing-card { align-items: flex-start; }
  .billing-act, .billing-act .btn { width: 100%; }
  .billing-act .btn { text-align: center; }
}

/* Admin: organizer access */
.admin-tools { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: .8rem; }
.admin-search {
  flex: 1 1 260px; max-width: 380px; font: inherit; color: var(--text); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 999px; padding: .6rem 1rem;
}
.admin-table td { vertical-align: top; }
.admin-name { font-weight: 650; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.admin-name a:hover { color: var(--accent); }
.admin-email { word-break: break-all; }
.access-flag { display: inline-block; margin-top: .3rem; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.access-flag.on { color: var(--green); }
.access-flag.off { color: var(--rose); }
html[data-theme="light"] .access-flag.on { color: #047857; }
html[data-theme="light"] .access-flag.off { color: #be123c; }
.sub-pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; background: rgba(148,163,184,.14); color: var(--muted); margin-right: .3rem; }
.sub-pill.st-active, .sub-pill.st-trialing { background: rgba(52,211,153,.15); color: var(--green); }
.sub-pill.st-past_due, .sub-pill.st-unpaid { background: rgba(251,191,36,.16); color: var(--amber); }
.sub-pill.st-canceled, .sub-pill.st-incomplete_expired { background: rgba(251,113,133,.14); color: var(--rose); }
html[data-theme="light"] .sub-pill.st-active, html[data-theme="light"] .sub-pill.st-trialing { color: #047857; }
html[data-theme="light"] .sub-pill.st-past_due, html[data-theme="light"] .sub-pill.st-unpaid { color: #92400e; }
html[data-theme="light"] .sub-pill.st-canceled, html[data-theme="light"] .sub-pill.st-incomplete_expired { color: #be123c; }
.admin-note { display: flex; gap: .4rem; align-items: center; }
.admin-note input {
  flex: 1; min-width: 120px; font: inherit; font-size: .88rem; color: var(--text); background: transparent;
  border: 1px solid var(--border); border-radius: 10px; padding: .4rem .6rem;
}
.admin-saved { display: block; margin-top: .25rem; color: var(--green); font-size: .8rem; }
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-ui { width: 100%; height: 100%; border-radius: 999px; background: rgba(148,163,184,.35); transition: background .15s ease; position: relative; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s ease; }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: .5; }
@media (max-width: 760px) {
  .admin-table table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table thead { display: none; }
  .admin-table tr { border-bottom: 1px solid var(--border); padding: .7rem 0; }
  .admin-table td { border: none; padding: .3rem 0; }
  .admin-table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .15rem; }
}

/* ---------------- Top nav + footer bars: inverted from the page theme (navinv-1) ----------------
   Dark pages get a solid white bar with dark text; light pages get a solid dark-navy bar with light text. The theme
   variables are re-scoped on the bars, so everything inside (links, chips, the organizer menu) flips with them. */
.nav, body > footer {
  --text: #0f172a; --muted: #46546f; --border: rgba(15,23,42,.12);
  --bg-card: #ffffff; --bg-elev: #ffffff; --accent: #0b6fd4;
  --shadow: 0 18px 50px rgba(15,40,80,.22);
  --bar-bg: #ffffff; --bar-hover: rgba(15,23,42,.06); --bar-active: rgba(11,111,212,.11); --bar-active-text: #0a4f9a;
  --bar-chip-bg: rgba(11,111,212,.1); --bar-chip-text: #0a4f9a;
  color: var(--text);
}
html[data-theme="light"] .nav, html[data-theme="light"] body > footer {
  --text: #eef2ff; --muted: #aab5d1; --border: rgba(255,255,255,.12);
  --bg-card: #161e33; --bg-elev: #12182a; --accent: #4db5ff;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --bar-bg: #0b0f1a; --bar-hover: rgba(255,255,255,.08); --bar-active: rgba(77,181,255,.16); --bar-active-text: #ffffff;
  --bar-chip-bg: rgba(124,156,255,.18); --bar-chip-text: #dbe3ff;
}
.nav, html[data-theme="light"] .nav {
  background: var(--bar-bg); -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 12px rgba(0,0,0,.18);
}
html[data-theme="light"] .nav { box-shadow: 0 1px 12px rgba(15,23,42,.18); }
.nav .brand { color: var(--text); }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); background: var(--bar-hover); }
.nav-links a.active { color: var(--bar-active-text); background: var(--bar-active); font-weight: 600; }
.nav .btn.soft, html[data-theme="light"] .nav .btn.soft { background: var(--bar-chip-bg); color: var(--bar-chip-text); border: 1px solid transparent; }
.nav-links a.btn.soft.active, .nav .btn.soft:hover { background: var(--bar-active); color: var(--bar-active-text); }
.nav .chip { background: var(--bar-chip-bg); color: var(--bar-chip-text); }
.nav .account-menu > summary:hover .chip, .nav .account-menu[open] > summary .chip { background: var(--bar-active); color: var(--bar-active-text); }
.nav .account-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }
.nav .account-dropdown { background: var(--bg-card); border-color: var(--border); }
.nav .account-dropdown a:hover, .nav .account-dropdown button.menu-item:hover,
.nav .account-dropdown .submenu button:hover, html[data-theme="light"] .nav .account-dropdown .submenu button:hover { background: var(--bar-hover); }
.nav .account-dropdown .submenu button.active { color: var(--accent); }
.nav .lang-pills button { background: var(--bar-hover); color: var(--muted); }
.nav .lang-pills button.active { background: var(--bar-active); color: var(--bar-active-text); border-color: var(--border); }
/* Logo: no blue glow on the white bar (a soft shadow instead); a subtle rim + glow on the dark bar. */
.nav .brand img.logo-img { filter: drop-shadow(0 1px 1.5px rgba(15,23,42,.28)); }
html[data-theme="light"] .nav .brand img.logo-img { filter: drop-shadow(0 0 1px rgba(255,255,255,.45)) drop-shadow(0 0 5px rgba(110,185,255,.22)); }
/* Footer bar: solid band pinned to the bottom of short pages. */
body { display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > footer, html[data-theme="light"] body > footer { background: var(--bar-bg); color: var(--muted); border-top: 1px solid var(--border); padding: 1.25rem 0 1.5rem; }
body > footer a { color: var(--text); font-weight: 550; border-radius: 6px; }
body > footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Forgot password / reset page */
.auth-link { justify-self: start; background: none; border: 0; padding: .1rem 0; font: inherit; font-size: .9rem; color: var(--accent, #7c9cff); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-link:hover, .auth-link:focus-visible { text-decoration-thickness: 2px; }
.auth-link:disabled { opacity: .5; cursor: default; }
.reset-wrap { max-width: 560px; }
.reset-wrap .form-card + .form-card { margin-top: 1rem; }
.reset-hint { font-size: .85rem; color: var(--muted); margin: -.35rem 0 0; }
.fields[hidden], .auth-link[hidden] { display: none; }
