/* DinkPool — "Night Court" design system (see DESIGN.md) */
:root {
  --navy: #0D1B2A;
  --navy-raised: #15283E;
  --navy-line: #2E4560;
  --paper: #F3F4EE;
  --white: #FFFFFF;
  --accent: #7FB2FF;
  --coral: #FF6B4A;
  --muted-on-dark: #C9D2DE;
  --subtle-on-dark: #9FB0C4;
  --muted: #3D5573;
  --rule: #D7DBCF;
  --coral-text: #C2410C; /* coral dark enough for small text on white (4.5:1) */
  --ink: #0D1B2A;        /* text on page and card surfaces (navy in light theme) */
  --surface: #FFFFFF;    /* cards, inputs, menus (white in light theme) */

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --radius-pill: 999px;
  --radius-card: 28px;
  --radius-panel: 36px;
  --radius-icon: 30px;
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Dark theme: page and card surfaces go dark, text flips to paper. Accent/coral fills keep navy text. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #08111B;
  --surface: #15283E;
  --rule: #2E4560;
  --muted: #A9B8CA;
  --ink: #F3F4EE;
  --coral-text: #FF8A70;
}
:root[data-theme="dark"] .btn-navy { background: var(--accent); color: var(--navy); }
:root[data-theme="dark"] .date-tile, :root[data-theme="dark"] .podium .place, :root[data-theme="dark"] .person .avatar { background: var(--navy); }
:root[data-theme="dark"] .match.ready { border-color: var(--accent); }
:root[data-theme="dark"] .menu { box-shadow: 0 18px 50px rgba(0, 0, 0, .55); border: 1px solid var(--rule); }
:root[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .7); }
:root[data-theme="dark"] .footer .logo-mark { color: var(--navy); }

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.55; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.eyebrow { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.on-dark .eyebrow, .eyebrow.on-dark { color: var(--subtle-on-dark); }
.h2 { font-size: clamp(2.25rem, 4.5vw, 3.75rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.h3 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.lead { font-size: 1.25rem; line-height: 1.55; }
.muted { color: var(--muted); }
.on-dark .muted { color: var(--muted-on-dark); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 18px 30px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 18px; line-height: 1; text-decoration: none; border: 2px solid transparent; cursor: pointer; background: none; transition: transform .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-secondary { border-color: var(--navy-line); color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-outline { border-color: var(--rule); color: var(--ink); background: var(--surface); }
.btn-coral { background: var(--coral); color: var(--navy); }
.btn-sm { padding: 10px 18px; font-size: 15px; gap: 8px; }
.btn-sm svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; padding: 1.25rem 0; }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); }
.logo-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--navy); display: grid; place-items: center; flex: none; }
.logo-mark svg { width: 28px; height: 28px; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn), .nav-links button.navlink { color: var(--muted-on-dark); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; background: none; border: 0; cursor: pointer; padding: 0; }
.nav-links a:not(.btn):hover, .nav-links button.navlink:hover { color: var(--white); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-line); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: 15px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- hero ---------- */
.dark { background: var(--navy); color: var(--white); }
.hero { padding: 4rem 0 6rem; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3rem 4rem; }
.hero-copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.hero h1 { font-size: clamp(3rem, 7vw, 5.75rem); font-weight: 800; line-height: 0.95; letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--accent); display: block; }
.hero .lead { color: var(--muted-on-dark); max-width: 36ch; }
.pill-eyebrow { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--navy-line); border-radius: var(--radius-pill); padding: 8px 16px; font-size: 15px; font-weight: 500; color: var(--muted-on-dark); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-card { flex: 1 1 340px; max-width: 460px; width: 100%; }

/* ---------- live score card ---------- */
.score-card { background: var(--navy-raised); border: 1px solid var(--navy-line); border-radius: var(--radius-card); padding: 28px; display: flex; flex-direction: column; gap: 18px; color: var(--white); }
.score-card header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.score-card .court-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--coral); color: var(--navy); font-weight: 700; font-size: 13px; letter-spacing: .08em; border-radius: var(--radius-pill); padding: 5px 12px; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--navy); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-badge::before { animation: none; } }
.score-panel { background: var(--navy); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.score-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.score-line .team { font-weight: 500; color: var(--muted-on-dark); min-width: 0; overflow-wrap: anywhere; }
.score-line .pts { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; color: var(--white); }
.score-line.lead-team .team { color: var(--white); font-weight: 700; }
.score-line.lead-team .pts { color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--navy); border-radius: 18px; padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--subtle-on-dark); font-weight: 500; }
.stat .v { font-family: var(--font-display); font-weight: 700; font-size: 22px; }

/* ---------- sections ---------- */
.section { padding: 7rem 0; }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 3rem; max-width: 760px; }
.section-head.row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; max-width: none; }
.grid-300 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.grid-260 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 40px; }

.feature-card { background: var(--surface); border-radius: var(--radius-card); padding: 36px; display: flex; flex-direction: column; gap: 18px; }
.feature-card p { color: var(--muted); }
.icon-tile { width: 112px; height: 112px; border-radius: var(--radius-icon); display: flex; align-items: center; justify-content: center; flex: none; }
.icon-tile svg { width: 64px; height: 64px; }
.icon-tile--accent { background: var(--accent); color: var(--navy); }
.icon-tile--navy { background: var(--navy); color: var(--accent); }
.icon-tile--coral { background: var(--coral); color: var(--navy); }

.panel { border-radius: var(--radius-panel); padding: clamp(2rem, 5vw, 4.5rem); }
.panel.dark .muted { color: var(--muted-on-dark); }
.step { display: flex; flex-direction: column; gap: 16px; }
.step .num { font-family: var(--font-display); font-weight: 800; font-size: 96px; line-height: .9; color: var(--accent); }
.step h3 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.panel-accent { background: var(--accent); color: var(--navy); display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }

/* ---------- event card ---------- */
.event-card { background: var(--surface); border-radius: var(--radius-card); padding: 28px; display: flex; flex-direction: column; gap: 20px; text-decoration: none; color: var(--ink); }
.event-top { display: flex; gap: 18px; align-items: center; }
.date-tile { width: 84px; height: 84px; border-radius: 22px; background: var(--navy); color: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.date-tile .mon { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.date-tile .day { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; }
.event-card h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.venue { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; margin-top: 4px; }
.venue svg { width: 18px; height: 18px; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--paper); border-radius: var(--radius-pill); padding: 6px 14px; font-size: 14px; font-weight: 500; color: var(--muted); }
.tag.accent { background: var(--accent); color: var(--navy); font-weight: 700; }
.tag.coral { background: var(--coral); color: var(--navy); font-weight: 700; }
.tag.navy { background: var(--navy); color: var(--white); }
.on-dark .tag:not(.accent):not(.coral) { background: var(--navy-raised); color: var(--muted-on-dark); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--rule); padding: 2.5rem 0; margin-top: 4rem; }
.footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer .logo { color: var(--ink); }
.footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.footer nav a { color: var(--muted); text-decoration: none; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- app pages ---------- */
.app-head { padding-bottom: 3rem; }
.app-head h1 { font-size: clamp(2.25rem, 4.5vw, 3.75rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.app-head .meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted-on-dark); margin-top: 16px; }
.app-head .meta span { display: inline-flex; align-items: center; gap: 8px; }
.app-head .meta svg { width: 18px; height: 18px; }
.page { padding-top: 3rem; padding-bottom: 2rem; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.card { background: var(--surface); border-radius: var(--radius-card); padding: 28px; }
.card-tight { background: var(--surface); border-radius: 20px; padding: 18px 20px; }
.card h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.tab { background: none; border: 0; padding: 12px 18px; min-height: 44px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; border: 2px solid var(--rule); border-radius: 14px; padding: 10px 14px; background: var(--surface); }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 18px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.toggle-card { border: 2px solid var(--rule); border-radius: 20px; padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; background: var(--surface); }
.toggle-card:has(input:checked) { border-color: var(--ink); }
.toggle-card input { width: 22px; height: 22px; accent-color: var(--ink); margin: 3px 0 0; flex: none; }
.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.format-opt { border: 2px solid var(--rule); border-radius: 18px; padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.format-opt input { position: absolute; opacity: 0; pointer-events: none; }
.format-opt:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.format-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.format-opt b { font-family: var(--font-display); font-size: 18px; }
.format-opt span { font-size: 14px; color: var(--muted); line-height: 1.4; }

.notice { border-radius: 18px; padding: 14px 18px; background: var(--paper); border: 2px solid var(--rule); display: flex; gap: 12px; align-items: flex-start; }
.notice.warn { border-color: var(--coral); }
.notice.info { border-color: var(--accent); }
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }

/* division cards */
.div-card { background: var(--surface); border-radius: var(--radius-card); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.div-card h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.count { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; border-collapse: collapse; font-size: 16px; }
table.list th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.list td { padding: 12px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { font-family: var(--font-display); font-weight: 800; color: var(--muted); width: 2.5rem; }

/* match cards */
.match { background: var(--surface); border-radius: 18px; border: 2px solid transparent; display: flex; flex-direction: column; min-width: 0; }
.match.playing { border-color: var(--coral); }
.match.ready { border-color: var(--accent); }
.match-head { display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.match-side { display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 44px; }
.match-side + .match-side { border-top: 1px solid var(--rule); }
.match-side .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; font-size: 15px; }
.match-side .sc { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; display: flex; gap: 8px; font-size: 18px; }
.match-side.win .nm { font-weight: 700; }
.match-side.win .sc { color: var(--ink); }
.match-side.lose { color: var(--muted); }
.match-side .tbd { color: var(--muted); font-style: italic; }
.match-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 10px 10px; }
.match-foot .btn { flex: 1; }
.seed { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 1.4em; }

.bracket { display: flex; gap: 28px; overflow-x: auto; padding: 8px 2px 18px; -webkit-overflow-scrolling: touch; }
.bracket-col { display: flex; flex-direction: column; justify-content: space-around; gap: 16px; min-width: 240px; flex: 0 0 240px; }
.bracket-col h4 { font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.round-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }

/* courts board */
.courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.court-tile { background: var(--navy-raised); border: 1px solid var(--navy-line); border-radius: var(--radius-card); padding: 22px; color: var(--white); display: flex; flex-direction: column; gap: 12px; }
.court-tile h3 { font-size: 22px; }
.court-tile.free { opacity: .6; }

/* modal */
dialog { border: 0; border-radius: var(--radius-card); padding: 0; max-width: min(560px, calc(100vw - 32px)); width: 100%; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(13, 27, 42, .6); }
.modal-body { padding: 28px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 64px); overflow: auto; }
.games { display: grid; gap: 10px; }
.game-row { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 10px; align-items: center; }
.game-row .input { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: var(--white); padding: 14px 22px; border-radius: var(--radius-pill); font-weight: 500; z-index: 100; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(13, 27, 42, .25); }
.toast.err { background: var(--coral); color: var(--navy); }

.dupr-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--navy); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: var(--radius-pill); letter-spacing: .04em; }
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.podium .place { background: var(--navy); color: var(--white); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.podium .place .n { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }
.podium .place:nth-child(2) .n { color: var(--muted-on-dark); }
.podium .place:nth-child(n+3) .n { color: var(--coral); }
.loading { padding: 5rem 0; text-align: center; color: var(--muted); }
.dupr-frame { width: 100%; height: 640px; max-height: calc(100vh - 220px); border: 0; border-radius: 18px; background: var(--paper); }
.copybox { display: flex; gap: 8px; }
.copybox .input { font-size: 15px; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-art { padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 2px solid var(--navy-line); pointer-events: none; }
.auth-art::before { content: ""; position: absolute; right: -60px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; border: 2px solid var(--navy-line); pointer-events: none; }
.auth-copy { display: flex; flex-direction: column; gap: 2.5rem; max-width: 560px; position: relative; z-index: 1; }
.auth-copy h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); font-weight: 800; line-height: .98; letter-spacing: -0.035em; }
.auth-copy h1 em { font-style: normal; color: var(--accent); display: block; }
.auth-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.auth-perks li { display: flex; gap: 16px; align-items: flex-start; }
.auth-perks li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.auth-perks b { font-size: 18px; }
.auth-perks li span span { color: var(--muted-on-dark); }
.auth-perk-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--navy-raised); border: 1px solid var(--navy-line); color: var(--accent); display: grid; place-items: center; flex: none; }
.auth-foot { color: var(--subtle-on-dark); font-size: 15px; position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(2rem, 5vw, 4rem) 1.5rem; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-panel); padding: clamp(28px, 4vw, 44px); display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 56px; padding: 0 24px; border-radius: var(--radius-pill); border: 2px solid var(--rule); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 17px; text-decoration: none; transition: border-color .12s ease, transform .12s ease; margin-top: 6px; }
.btn-google:hover { border-color: var(--ink); }
.btn-google:active { transform: translateY(1px); }
.auth-legal { font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 6px; }
.auth-legal a { color: var(--ink); font-weight: 500; }
.auth-back { color: var(--muted); font-weight: 500; text-decoration: none; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; align-self: flex-start; }
.auth-back:hover { color: var(--ink); }
.auth-dev { border: 2px dashed var(--rule); border-radius: 18px; padding: 14px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-art { gap: 2rem; }
  .auth-perks, .auth-foot { display: none; }
  .auth-copy h1 { font-size: clamp(2.25rem, 9vw, 3rem); }
  .auth-panel { padding-top: 0; margin-top: -1px; background: linear-gradient(var(--navy) 0 64px, var(--paper) 64px); }
}

/* account dropdown */
.usermenu { position: relative; }
.usermenu-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px 4px 4px; border-radius: var(--radius-pill); color: var(--muted-on-dark); cursor: pointer; min-height: 44px; }
.usermenu-btn:hover, .usermenu-btn[aria-expanded="true"] { background: var(--navy-raised); color: var(--white); }
.usermenu-btn .avatar { width: 36px; height: 36px; background: var(--accent); color: var(--navy); }
.usermenu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 260px; max-width: calc(100vw - 32px); background: var(--surface); color: var(--ink); border-radius: 22px; padding: 8px; box-shadow: 0 18px 50px rgba(13, 27, 42, .28); z-index: 50; display: flex; flex-direction: column; }
.menu-head { display: flex; flex-direction: column; padding: 12px 14px 14px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; min-width: 0; }
.menu-head span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-links .menu [role^=menuitem] { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; font-size: 16px; }
.nav-links .menu [role^=menuitem]:hover, .nav-links .menu [role^=menuitem]:focus-visible { background: var(--paper); color: var(--ink); outline: none; }
.menu [role^=menuitem] svg { color: var(--muted); flex: none; }
.menu .theme-row { border-top: 1px solid var(--rule); border-radius: 0; margin-top: 6px; }
@media (max-width: 520px) { .usermenu { position: static; } .nav-links { position: relative; } .menu { left: 0; right: auto; } }

/* partner flow */
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.person:last-child { border-bottom: 0; }
.person .avatar { width: 40px; height: 40px; background: var(--navy); color: var(--white); }
.grow { flex: 1 1 160px; min-width: 0; }
.notice.req { align-items: center; flex-wrap: wrap; }
.partner-alt { border-top: 1px solid var(--rule); padding-top: 18px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--coral); color: var(--navy); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.usermenu-btn .badge { position: absolute; transform: translate(26px, -14px); }
.usermenu-btn { position: relative; }

/* theme switch in the account menu */
.nav-links .menu .theme-row { justify-content: space-between; }
.switch { width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--rule); position: relative; flex: none; transition: background .15s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(13, 27, 42, .3); transition: transform .15s ease; }
[aria-checked="true"] .switch { background: var(--accent); }
[aria-checked="true"] .switch::after { transform: translateX(18px); background: var(--navy); }

/* tournament branding */
.cover-head { background-size: cover; background-position: center; }
.t-title { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.t-logo { width: 72px; height: 72px; border-radius: 20px; object-fit: contain; background: var(--white); padding: 6px; flex: none; }
.card-logo { width: 48px; height: 48px; border-radius: 14px; object-fit: contain; background: var(--paper); padding: 4px; flex: none; align-self: flex-start; }
.brand-preview { background: var(--navy); color: var(--white); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 16px; background-size: cover; background-position: center; }
.brand-preview .t-logo { width: 52px; height: 52px; border-radius: 14px; }
.brand-preview b { font-family: var(--font-display); font-size: 26px; letter-spacing: -0.02em; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid transparent; box-shadow: inset 0 0 0 1px rgba(13, 27, 42, .15); position: relative; }
.swatch:has(input:checked) { border-color: var(--ink); }
.swatch input[type=radio] { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatch.custom { background: conic-gradient(#FF9EC7, #FFD166, #9BE15D, #5EEAD4, #7FB2FF, #C4B5FD, #FF9EC7); overflow: hidden; }
.swatch.custom input { position: absolute; inset: -8px; width: 60px; height: 60px; opacity: 0; cursor: pointer; }
