/* RDF Breaking League — single stylesheet, no build step. */

:root {
    --bg: #0e0d13;
    --bg-raised: #17151f;
    --bg-input: #1e1b28;
    --line: #2a2735;
    --line-soft: #221f2d;
    --text: #ece9f5;
    --muted: #9b95ae;
    --dim: #6d6784;
    --accent: #ff4d6d;
    --accent-soft: rgba(255, 77, 109, 0.14);
    --gold: #ffc857;
    --ok: #3ddc97;
    --warn: #ffb03a;
    --bad: #ff5c7a;
    --live: #5ac8fa;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8rem; }
small { color: var(--muted); }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }

/* ------------------------------------------------------------- structure */

.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1.2rem;
    padding: .7rem 1.4rem;
    background: rgba(14, 13, 19, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex; align-items: center; gap: .55rem;
    font-weight: 800; letter-spacing: -.02em; color: var(--text);
    font-size: 1.02rem;
}
.brand:hover { text-decoration: none; }
.brand .mark {
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #b4297a);
    color: #fff; font-size: .8rem; font-weight: 800;
}

.topnav { display: flex; gap: .2rem; flex-wrap: wrap; }
.topnav a {
    padding: .4rem .7rem; border-radius: 8px;
    color: var(--muted); font-weight: 550; font-size: .9rem;
}
.topnav a:hover { background: var(--bg-raised); color: var(--text); text-decoration: none; }
.topnav a.is-active { background: var(--accent-soft); color: var(--accent); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }

.shell { max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.4rem 4rem; }
.shell--wide { max-width: 1500px; }

.page-head {
    display: flex; align-items: flex-start; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 1.3rem;
}
.page-head .spacer { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: .15rem 0 0; }

.crumbs { font-size: .85rem; color: var(--dim); margin-bottom: .5rem; }
.crumbs a { color: var(--muted); }

/* ----------------------------------------------------------------- cards */

.card {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    margin-bottom: 1.1rem;
}
.card--flush { padding: 0; overflow: hidden; }
.card h2, .card h3 { margin-bottom: .7rem; }
.card__head {
    display: flex; align-items: center; gap: .8rem;
    padding: .9rem 1.15rem; border-bottom: 1px solid var(--line-soft);
}
.card__head h2, .card__head h3 { margin: 0; }
.card__head .spacer { margin-left: auto; display: flex; gap: .45rem; }
.card__body { padding: 1.15rem; }

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.stat .label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.stat--accent .value { color: var(--accent); }
.stat--ok .value { color: var(--ok); }
.stat--warn .value { color: var(--warn); }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
    text-align: left; padding: .6rem .8rem;
    color: var(--dim); font-weight: 600; font-size: .76rem;
    text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
td { padding: .65rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .022); }
td.right, th.right { text-align: right; }
td.tight { white-space: nowrap; width: 1%; }

.empty {
    padding: 2.2rem 1rem; text-align: center; color: var(--muted);
    border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty strong { display: block; color: var(--text); margin-bottom: .3rem; }

/* --------------------------------------------------------------- badges */

.badge {
    display: inline-block; padding: .16rem .5rem; border-radius: 999px;
    font-size: .72rem; font-weight: 650; letter-spacing: .02em;
    text-transform: uppercase; white-space: nowrap;
}
.badge--ok { background: rgba(61, 220, 151, .15); color: var(--ok); }
.badge--warn { background: rgba(255, 176, 58, .15); color: var(--warn); }
.badge--bad { background: rgba(255, 92, 122, .15); color: var(--bad); }
.badge--live { background: rgba(90, 200, 250, .15); color: var(--live); }
.badge--neutral { background: rgba(255, 255, 255, .07); color: var(--muted); }
.badge--gold { background: rgba(255, 200, 87, .16); color: var(--gold); }

.tag {
    display: inline-block; padding: .12rem .45rem; border-radius: 5px;
    background: var(--bg-input); color: var(--muted);
    font-size: .74rem; border: 1px solid var(--line);
}

/* -------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem; border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--bg-input); color: var(--text);
    font: inherit; font-size: .88rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #3a3648; text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #ff3d60; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--bad); border-color: rgba(255, 92, 122, .35); background: transparent; }
.btn--danger:hover { background: rgba(255, 92, 122, .1); }
.btn--ok { color: var(--ok); border-color: rgba(61, 220, 151, .35); background: transparent; }
.btn--ok:hover { background: rgba(61, 220, 151, .1); }
.btn--sm { padding: .3rem .6rem; font-size: .8rem; }
.btn--block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- forms */

.field { margin-bottom: .95rem; }
.field label { display: block; margin-bottom: .3rem; font-size: .86rem; font-weight: 600; color: var(--text); }
.field .hint { display: block; margin-top: .28rem; font-size: .8rem; color: var(--dim); }
.field .err { display: block; margin-top: .28rem; font-size: .8rem; color: var(--bad); }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], input[type=tel], input[type=url],
input[type=search], select, textarea {
    width: 100%; padding: .55rem .7rem;
    background: var(--bg-input); color: var(--text);
    border: 1px solid var(--line); border-radius: 9px;
    font: inherit; font-size: .92rem;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input.is-invalid, select.is-invalid { border-color: var(--bad); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }

.check { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .6rem; }
.check input { margin-top: .25rem; }
.check label { margin: 0; font-weight: 500; }

.form-row { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.auth-shell { max-width: 430px; margin: 3.5rem auto; padding: 0 1.2rem; }
.auth-shell .card { padding: 1.6rem; }

/* --------------------------------------------------------------- alerts */

.alert {
    padding: .7rem .95rem; border-radius: var(--radius);
    margin-bottom: .9rem; font-size: .9rem;
    border: 1px solid transparent;
}
.alert--success { background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .3); color: #8df0c4; }
.alert--error { background: rgba(255, 92, 122, .1); border-color: rgba(255, 92, 122, .3); color: #ffa8b9; }
.alert--info { background: rgba(90, 200, 250, .1); border-color: rgba(90, 200, 250, .3); color: #a9e0fb; }
.alert--warn { background: rgba(255, 176, 58, .1); border-color: rgba(255, 176, 58, .3); color: #ffd699; }

.notice {
    border-left: 3px solid var(--accent);
    padding: .6rem .9rem; background: var(--accent-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: .88rem; margin-bottom: 1rem;
}

/* -------------------------------------------------------------- bracket */

.bracket {
    display: flex; gap: 2.2rem; overflow-x: auto;
    padding: .5rem .2rem 1.2rem;
    align-items: stretch;
}
.bracket__round { display: flex; flex-direction: column; justify-content: space-around; gap: 1rem; min-width: 230px; }
.bracket__round-title {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--dim); font-weight: 700; text-align: center; margin-bottom: .2rem;
}
.match {
    background: var(--bg-raised); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; position: relative;
}
.match.is-live { border-color: var(--live); box-shadow: 0 0 0 3px rgba(90, 200, 250, .12); }
.match.is-ready { border-color: #3a3648; }
.match__side {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .65rem; font-size: .88rem;
}
.match__side + .match__side { border-top: 1px solid var(--line-soft); }
.match__side.is-winner { background: rgba(61, 220, 151, .09); font-weight: 650; }
.match__side.is-loser { color: var(--dim); }
.match__seed {
    min-width: 20px; text-align: center; font-size: .7rem;
    color: var(--dim); font-weight: 700;
}
.match__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match__votes { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.match__foot {
    padding: .3rem .65rem; border-top: 1px solid var(--line-soft);
    font-size: .74rem; color: var(--dim);
    display: flex; align-items: center; gap: .4rem;
}
.match__foot .spacer { margin-left: auto; }

/* --------------------------------------------------------- judge console */

.vs-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch; }
.vs-grid .vs { display: grid; place-items: center; color: var(--dim); font-weight: 800; font-size: 1.1rem; }
.side-card {
    border: 2px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.1rem; text-align: center; background: var(--bg-raised);
}
.side-card h3 { font-size: 1.2rem; margin-bottom: .2rem; }
.side-card.is-picked { border-color: var(--ok); background: rgba(61, 220, 151, .07); }

.score-row { display: flex; align-items: center; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); }
.score-row:last-child { border-bottom: 0; }
.score-row .name { flex: 1; text-align: left; }
.score-row .name small { display: block; color: var(--dim); font-size: .76rem; }
.score-row input[type=number] { width: 80px; }

/* --------------------------------------------------------------- pieces */

.person { display: flex; align-items: center; gap: .6rem; }
.avatar {
    width: 32px; height: 32px; border-radius: 9px; flex: none;
    display: grid; place-items: center;
    background: var(--bg-input); border: 1px solid var(--line);
    font-size: .78rem; font-weight: 700; color: var(--muted);
}
.person .who { line-height: 1.25; min-width: 0; }
.person .who strong { display: block; font-weight: 650; }
.person .who small { color: var(--dim); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.list-plain li:last-child { border-bottom: 0; }

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: .35rem .9rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.sep { height: 1px; background: var(--line-soft); margin: 1rem 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mt1 { margin-top: .8rem; }
.mb1 { margin-bottom: .8rem; }
.stack > * + * { margin-top: .8rem; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin-bottom: 0; min-width: 150px; }

.hero {
    border-radius: var(--radius-lg); padding: 2.4rem 1.8rem;
    background:
        radial-gradient(900px 300px at 15% -20%, rgba(255, 77, 109, .28), transparent 60%),
        radial-gradient(700px 300px at 90% 0%, rgba(90, 200, 250, .16), transparent 60%),
        var(--bg-raised);
    border: 1px solid var(--line); margin-bottom: 1.4rem;
}
.hero h1 { font-size: 2.1rem; }
.hero p { color: var(--muted); max-width: 60ch; font-size: 1.02rem; }

.pill-nav { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.pill-nav a {
    padding: .35rem .75rem; border-radius: 999px;
    background: var(--bg-raised); border: 1px solid var(--line);
    color: var(--muted); font-size: .86rem; font-weight: 550;
}
.pill-nav a.is-active { background: var(--accent-soft); border-color: rgba(255, 77, 109, .4); color: var(--accent); }
.pill-nav a:hover { text-decoration: none; color: var(--text); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }
.dot--bad { background: var(--bad); }

.count-chip {
    display: inline-grid; place-items: center; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
    font-size: .7rem; font-weight: 700;
}

.footer { border-top: 1px solid var(--line); padding: 1.4rem; text-align: center; color: var(--dim); font-size: .84rem; }

@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; gap: .6rem; }
    .topnav { order: 3; width: 100%; }
    .vs-grid { grid-template-columns: 1fr; }
    .vs-grid .vs { padding: .4rem 0; }
    .hero { padding: 1.6rem 1.2rem; }
    .hero h1 { font-size: 1.6rem; }
}

/* ============================================================ role lens ==
   One account can hold every role at once. The lens narrows what is shown to
   one at a time, and colours the chrome so you always know which hat you have
   on. It is presentation only — permissions are unaffected. */

:root {
    --tone-family: #ff4d6d;
    --tone-studio: #38bdf8;
    --tone-judge: #a78bfa;
    --tone-admin: #3ddc97;
}

.topbar { border-top: 3px solid transparent; }
.topbar--family   { border-top-color: var(--tone-family); }
.topbar--studio   { border-top-color: var(--tone-studio); }
.topbar--judge    { border-top-color: var(--tone-judge); }
.topbar--admin    { border-top-color: var(--tone-admin); }

.lens-tag {
    padding: .2rem .55rem; border-radius: 999px;
    font-size: .74rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; white-space: nowrap;
    border: 1px solid currentColor;
}
.lens-tag--family   { color: var(--tone-family); }
.lens-tag--studio   { color: var(--tone-studio); }
.lens-tag--judge    { color: var(--tone-judge); }
.lens-tag--admin    { color: var(--tone-admin); }

.dot--family   { background: var(--tone-family); }
.dot--studio   { background: var(--tone-studio); }
.dot--judge    { background: var(--tone-judge); }
.dot--admin    { background: var(--tone-admin); }

/* --------------------------------------------------- identity + switcher */

.whoami { position: relative; }
.whoami > summary {
    display: flex; align-items: center; gap: .5rem;
    padding: .3rem .5rem; border-radius: 10px; cursor: pointer;
    list-style: none; border: 1px solid var(--line); background: var(--bg-raised);
}
.whoami > summary::-webkit-details-marker { display: none; }
.whoami > summary:hover { border-color: #3a3648; }
.whoami__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.whoami__text strong { font-size: .86rem; font-weight: 650; }
.whoami__chev { color: var(--dim); font-size: .7rem; }

.whoami__menu {
    position: absolute; right: 0; top: calc(100% + .45rem); z-index: 100;
    min-width: 290px; padding: .4rem;
    background: var(--bg-raised); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.whoami__head { padding: .6rem .65rem .7rem; border-bottom: 1px solid var(--line-soft); }
.whoami__head small { display: block; color: var(--dim); margin-top: .1rem; }
.whoami__roles { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }

.whoami__section {
    padding: .6rem .65rem .3rem; font-size: .7rem; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase; color: var(--dim);
}

.whoami__lens, .whoami__item {
    display: flex; align-items: center; gap: .55rem; width: 100%;
    padding: .5rem .65rem; border: 0; border-radius: 9px;
    background: transparent; color: var(--text); font: inherit; font-size: .88rem;
    text-align: left; cursor: pointer;
}
.whoami__lens:hover, .whoami__item:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.whoami__lens.is-current { background: rgba(255,255,255,.06); }
.whoami__lens small { display: block; color: var(--dim); font-size: .76rem; font-weight: 400; }
.whoami__lens strong { font-weight: 600; }
.whoami__check { margin-left: auto; color: var(--ok); }
.whoami__item--danger { color: var(--bad); }

@media (max-width: 720px) {
    .whoami__text { display: none; }
    .whoami__menu { right: -.5rem; min-width: 260px; }
    .lens-tag { display: none; }
}

/* ======================================================= matrix backdrop ==
   Sits behind everything, very low contrast, and stops entirely for anyone who
   has asked for reduced motion. */

#rain {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none; opacity: .5;
}

/* Lift real content above the canvas. The topbar is deliberately excluded —
   it already sits at z-index 50, and resetting it here would drop it below the
   page content, which puts the identity dropdown behind the page. */
.shell, .footer, .auth-shell { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
    #rain { display: none; }
}

/* Lens tones for the roles added after the first pass. */
:root { --tone-coordinator: #ffc857; --tone-mc: #fb923c; --tone-breaker: #f472b6; }
.topbar--coordinator { border-top-color: var(--tone-coordinator); }
.topbar--mc          { border-top-color: var(--tone-mc); }
.lens-tag--coordinator { color: var(--tone-coordinator); }
.lens-tag--mc          { color: var(--tone-mc); }
.dot--coordinator { background: var(--tone-coordinator); }
.dot--mc          { background: var(--tone-mc); }

/* ======================================================= at-event shell ==
   judges. / coordinator. / mc. — a phone, held one-handed, in a dark loud
   room. Fixed thin header so you always know which tool you are in, and a
   thumb-reachable tab bar instead of a menu you have to open. */

.ev-bar {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem .9rem;
    padding-top: calc(.55rem + env(safe-area-inset-top));
    background: rgba(14, 13, 19, .96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    border-top: 3px solid var(--accent);
}
.ev-bar--judge       { border-top-color: var(--tone-judge); }
.ev-bar--coordinator { border-top-color: var(--tone-coordinator); }
.ev-bar--mc          { border-top-color: var(--tone-mc); }
.ev-bar--breaker     { border-top-color: var(--tone-breaker); }
.ev-bar--parent      { border-top-color: var(--tone-family); }
.ev-bar--studio      { border-top-color: var(--tone-studio); }
.ev-bar--coach       { border-top-color: var(--tone-admin); }

.ev-brand {
    display: flex; align-items: center; gap: .5rem;
    color: var(--text); font-weight: 800; letter-spacing: -.01em;
}
.ev-brand:hover { text-decoration: none; }

.ev-menu { margin-left: auto; position: relative; }
.ev-menu > summary { list-style: none; cursor: pointer; }
.ev-menu > summary::-webkit-details-marker { display: none; }
.ev-menu__panel {
    position: absolute; right: 0; top: calc(100% + .4rem); z-index: 70;
    min-width: 230px; padding: .35rem;
    background: var(--bg-raised); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.ev-menu__who { padding: .6rem .65rem; border-bottom: 1px solid var(--line-soft); }
.ev-menu__who small { display: block; color: var(--dim); }

.ev-main {
    max-width: 780px; margin: 0 auto;
    padding: 1rem .9rem calc(5.5rem + env(safe-area-inset-bottom));
}

.ev-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; gap: .3rem; padding: .45rem .6rem;
    padding-bottom: calc(.45rem + env(safe-area-inset-bottom));
    background: rgba(14, 13, 19, .97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
}
.ev-tabs a {
    flex: 1; text-align: center; padding: .7rem .5rem;
    border-radius: 10px; font-size: .9rem; font-weight: 650;
    color: var(--muted);
}
.ev-tabs a.is-active { background: var(--accent-soft); color: var(--accent); }
.ev-tabs a:hover { text-decoration: none; }

/* On an event host everything is one column and the touch targets grow.
   Stat tiles are the exception: four of them stacked is a screen and a half
   of scrolling before you reach the thing you actually came to do. */
.ev-main .grid--2 { grid-template-columns: 1fr; }
.ev-main .grid--3, .ev-main .grid--4 { grid-template-columns: 1fr 1fr; gap: .55rem; }
.ev-main .stat { padding: .6rem .7rem; }
.ev-main .stat .value { font-size: 1.3rem; }
.ev-main .stat .label { font-size: .68rem; }
.ev-main .page-head h1 { font-size: 1.35rem; }
.ev-main .btn { padding: .65rem 1rem; font-size: .95rem; }
.ev-main .btn--sm { padding: .45rem .8rem; font-size: .86rem; }
.ev-main .side-card { padding: 1.4rem 1rem; }
.ev-main .side-card h3 { font-size: 1.35rem; }
.ev-main input[type=number], .ev-main input[type=text], .ev-main select {
    font-size: 16px; /* stops iOS zooming the page on focus */
    padding: .7rem;
}
.ev-main .vs-grid { grid-template-columns: 1fr; gap: .6rem; }
.ev-main .vs-grid .vs { padding: .2rem 0; font-size: .95rem; }
.ev-main table { font-size: .88rem; }
.ev-main .crumbs { display: none; }

/* ------------------------------------------------------- the breaker card
   One dancer, top to bottom, in the order they ask: who am I, when do I need
   to be there, who am I facing. Big type on the times because that is the bit
   read across a gym at arm's length. */

.bk-switch {
    display: flex; gap: .35rem; overflow-x: auto;
    margin: -.25rem 0 .9rem; padding-bottom: .25rem;
    scrollbar-width: none;
}
.bk-switch::-webkit-scrollbar { display: none; }
.bk-switch a {
    flex: 0 0 auto; padding: .45rem .8rem;
    border: 1px solid var(--line); border-radius: 999px;
    font-size: .88rem; font-weight: 650; color: var(--muted); white-space: nowrap;
}
.bk-switch a.is-active {
    background: var(--accent-soft); color: var(--accent); border-color: transparent;
}
.bk-switch a:hover { text-decoration: none; }

.bk-who h1 { font-size: 1.6rem; margin: 0 0 .15rem; letter-spacing: -.02em; }
.bk-h {
    margin: 1.6rem 0 .6rem; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em; color: var(--dim);
}

.bk-card {
    background: var(--bg-raised); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: .95rem; margin-bottom: .7rem;
}
.bk-card--battle { border-left: 3px solid var(--tone-breaker); }
.bk-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.bk-card__top h3 { margin: 0; font-size: 1.05rem; }

.bk-when { margin: .6rem 0 .5rem; font-size: 1.05rem; line-height: 1.35; }
.bk-vs { margin: .6rem 0 .4rem; font-size: 1.15rem; line-height: 1.35; }

/* The call sheet. Doors, stretch and prelims are three different times and
   only one of them is when you need to already be warm. */
.bk-times { list-style: none; margin: 0; padding: .55rem 0 0; border-top: 1px solid var(--line-soft); }
.bk-times li {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: .3rem 0; font-size: .95rem;
}
.bk-times li span { color: var(--muted); }
.bk-times li strong { font-variant-numeric: tabular-nums; font-size: 1.05rem; }

.bk-facts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }

.bk-list { list-style: none; margin: 0; padding: 0; }
.bk-list li {
    display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
    padding: .6rem .2rem; border-bottom: 1px solid var(--line-soft);
}
.bk-list li small { width: 100%; }

.bk-meter {
    height: 8px; margin-top: .7rem; border-radius: 999px;
    background: var(--line); overflow: hidden;
}
.bk-meter span { display: block; height: 100%; background: var(--tone-breaker); }

/* ------------------------------------------------------- the coach roster
   A coach assesses in the moment, in a studio, holding a phone. Big tap
   targets, and the progress bar carries the information so the list can be
   read at a glance rather than opened one dancer at a time. */

.ch-roster { list-style: none; margin: 0; padding: 0; }
.ch-roster li {
    background: var(--bg-raised); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: .8rem .9rem; margin-bottom: .55rem;
}
.ch-roster li > a {
    display: flex; justify-content: space-between; align-items: center;
    gap: .7rem; color: var(--text);
}
.ch-roster li > a:hover { text-decoration: none; }
.ch-roster__who strong { display: block; font-size: 1.05rem; }
.ch-roster__who small { display: block; }
.ch-roster__level { text-align: right; white-space: nowrap; }
.ch-roster__level strong { display: block; margin-top: .2rem; font-size: 1.1rem; }
.ch-roster .bk-meter { margin-top: .6rem; }

/* --------------------------------------------------- general mobile pass */

@media (max-width: 640px) {
    .shell { padding: 1rem .8rem 3rem; }
    h1 { font-size: 1.4rem; }
    .page-head { gap: .6rem; }
    .page-head .spacer { margin-left: 0; width: 100%; }
    .page-head .spacer .btn { flex: 1; justify-content: center; }
    .btn { padding: .6rem .9rem; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .card { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    /* 16px stops iOS zooming when a field takes focus. */
    input, select, textarea { font-size: 16px; }
    .filters .field { min-width: 100%; }
    .pill-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .3rem; }
    .pill-nav a { white-space: nowrap; }
}
