/* AYSO 10U referee quick reference. Built to be read on a phone at the
 * field, often in direct sun: high contrast, big numbers, no tiny text. */

:root {
    --bg: #f3f4f1;
    --surface: #ffffff;
    --border: #dcdfd8;
    --ink: #121816;
    --ink-soft: #545e5a;
    --brand: #1f5f5b;
    --on-brand: #ffffff;

    --dfk: #b42318;  --dfk-bg: #fdecea;
    --pk: #7a2e98;   --pk-bg: #f4e9f8;
    --ifk: #1d4ed8;  --ifk-bg: #e7edfc;
    --re: #3f4a46;   --re-bg: #e8ebe7;

    --po: #8a4b00;   --po-bg: #fff3dc;  --po-line: #e9a93a;
    --warn: #9b1c12; --warn-bg: #fde8e5; --warn-line: #e3725f;

    --radius: 12px;
    --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1413;
        --surface: #172120;
        --border: #2a3735;
        --ink: #eef2f0;
        --ink-soft: #9eaba7;
        --brand: #17423f;
        --on-brand: #eef2f0;

        --dfk: #ff9a8f;  --dfk-bg: #3b1e1b;
        --pk: #dcaaf0;   --pk-bg: #301f39;
        --ifk: #9db8ff;  --ifk-bg: #1b2643;
        --re: #c4ceca;   --re-bg: #26302e;

        --po: #f3bd63;   --po-bg: #2a2010;  --po-line: #8a6420;
        --warn: #ffb3a8; --warn-bg: #3a1a16; --warn-line: #a3473a;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

b { font-weight: 650; }

/* ---------------------------------------------------------------- header */

.top {
    background: var(--brand);
    color: var(--on-brand);
    padding: calc(env(safe-area-inset-top) + 1rem) var(--gutter) 0.9rem;
}
.top-in { max-width: 44rem; margin: 0 auto; }
.top h1 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.top .sub { margin: 0.1rem 0 0; font-size: 0.9rem; opacity: 0.85; }

main {
    max-width: 44rem;
    margin: 0 auto;
    padding: 1rem var(--gutter) 1rem;
}

/* ------------------------------------------------------ collapsible sections */

/* Native <details>: no JavaScript, and Chrome's find-in-page opens a closed
 * section when the match is inside it. */
.sec { margin: 0 0 0.6rem; }

.sec > summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:focus-visible { outline: 3px solid var(--ifk); outline-offset: 2px; }

/* Chevron: points down when closed, up when open. */
.sec > summary::after {
    content: "";
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    margin-right: 0.2rem;
    border-right: 2.5px solid var(--ink-soft);
    border-bottom: 2.5px solid var(--ink-soft);
    transform: translateY(-25%) rotate(45deg);
    transition: transform 150ms ease;
}
.sec[open] > summary::after { transform: translateY(25%) rotate(-135deg); }

.sum-text { flex: 1; min-width: 0; }
.sum-text h2 { margin: 0; font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.sum-text .hint { display: block; margin-top: 0.1rem; color: var(--ink-soft); font-size: 0.85rem; line-height: 1.3; }

.sec-body { padding-top: 0.6rem; }

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

.card {
    margin: 0 0 0.75rem;
    padding: 0.9rem 1rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.card h3 { margin: 0 0 0.45rem; font-size: 1.05rem; font-weight: 700; }
.card h3 .call { margin-right: 0.3rem; }
.card h4 {
    margin: 0.85rem 0 0.25rem;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.card p { margin: 0.35rem 0 0; }
.card > :first-child { margin-top: 0; }
.lead { color: var(--ink); }

.list { margin: 0; padding-left: 1.15rem; }
.list li { margin: 0.22rem 0; }
.list .list { margin-top: 0.15rem; }
.list.cols { columns: 2; column-gap: 1.75rem; }
.list.cols li { break-inside: avoid; }

/* Checklist bullets for the things you actually walk through. */
.list.check { padding-left: 0; list-style: none; }
.list.check li { position: relative; padding-left: 1.5rem; }
.list.check li::before {
    content: "✓";
    position: absolute;
    left: 0.15rem;
    color: var(--brand);
    font-weight: 700;
}

.aside { color: var(--ink-soft); font-size: 0.92em; }

/* ------------------------------------------------------- numbers at a glance */

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
}
.stat {
    padding: 0.6rem 0.8rem 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.stat dt {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.stat dd { margin: 0.1rem 0 0; font-size: 1.3rem; font-weight: 750; line-height: 1.2; }
.stat dd small {
    display: block;
    margin-top: 0.15rem;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
}
@media (min-width: 36rem) {
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------ restart calls */

.call {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.5;
    vertical-align: 0.06em;
    white-space: nowrap;
}
.call.dfk { background: var(--dfk-bg); color: var(--dfk); }
.call.pk  { background: var(--pk-bg);  color: var(--pk); }
.call.ifk { background: var(--ifk-bg); color: var(--ifk); }
.call.re  { background: var(--re-bg);  color: var(--re); }

.c-dfk { border-left: 4px solid var(--dfk); }
.c-pk  { border-left: 4px solid var(--pk); }
.c-ifk { border-left: 4px solid var(--ifk); }

.kinds { display: grid; gap: 0.4rem; margin: 0.15rem 0 0.9rem; }
.kind {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    margin: 0;
    font-size: 0.95rem;
}
.kind .call { flex: 0 0 2.6rem; text-align: center; }

/* The "what do I give?" line at the bottom of a rule card. */
.outcome {
    margin-top: 0.75rem !important;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
    font-weight: 600;
}
.outcome .aside { font-weight: 400; }
.outcome + .outcome { margin-top: 0.45rem !important; padding-top: 0; border-top: 0; }
.arrow { color: var(--ink-soft); }

.note {
    margin-top: 0.75rem !important;
    padding: 0.55rem 0.7rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.95rem;
}

.warn {
    margin: 0 0 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    border-left-width: 4px;
    border-radius: var(--radius);
    color: var(--warn);
}

/* ---------------------------------------------------------------- playoffs */

/* Deliberately looks different from everything above, open or closed, so a
 * playoff-only rule is never mistaken for a regular-season one. */
.sec.po {
    margin-top: 1.1rem;
    background: var(--po-bg);
    border: 2px solid var(--po-line);
    border-radius: calc(var(--radius) + 4px);
}
.sec.po > summary { background: transparent; border: 0; }
.sec.po > summary::after { border-color: var(--po); }
.sec.po .sum-text h2 { color: var(--po); }
.sec.po > .sec-body { padding: 0 0.75rem 0.1rem; }

.po-tag {
    display: inline-block;
    margin-bottom: 0.3rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: var(--po-line);
    color: #2a1800;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.po-intro { margin: 0 0.25rem 0.75rem; font-size: 0.95rem; }

/* Home-team rankings: two lists side by side on a phone, four across wider. */
.ranks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.1rem 1rem;
    margin-top: 0.35rem;
}
.rank h4 { margin-top: 0.75rem; }
.rank ol { margin: 0; padding-left: 1.7rem; }
.rank li { margin: 0.1rem 0; overflow-wrap: anywhere; }
.rank li::marker { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (min-width: 36rem) {
    .ranks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.po .card { border-color: var(--po-line); }
.po .note { background: var(--po-bg); }

.flow { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.flow li {
    position: relative;
    margin: 0;
    padding: 0 0 0.7rem 2.1rem;
    counter-increment: step;
}
.flow li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.05rem;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: var(--po-line);
    color: #2a1800;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.45rem;
    text-align: center;
}
/* Connector between steps. */
.flow li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 0.7rem;
    top: 1.6rem;
    bottom: 0.1rem;
    border-left: 2px solid var(--po-line);
}
.flow li:last-child { padding-bottom: 0; }

.contacts { margin: 0; padding: 0; list-style: none; }
.contacts li { margin: 0.45rem 0; }
.contacts .role {
    display: block;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 600;
}
.contacts a {
    display: block;
    color: var(--ifk);
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- footer */

.foot {
    max-width: 44rem;
    margin: 0 auto;
    padding: 0.5rem var(--gutter) calc(env(safe-area-inset-bottom) + 2.5rem);
    color: var(--ink-soft);
    font-size: 0.85rem;
}
.foot p { margin: 0.4rem 0; }

@media (prefers-reduced-motion: reduce) {
    .sec > summary::after { transition: none; }
}
