/* 100×30: mobile-first. Base styles target phones; wider screens add columns. */

@font-face {
    font-family: "Barlow";
    src: url("/assets/barlow-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("/assets/barlow-500.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("/assets/barlow-600.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("/assets/barlow-700.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("/assets/barlow-condensed-600.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("/assets/barlow-condensed-800.woff2") format("woff2");
    font-weight: 800;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("/assets/barlow-condensed-800i.woff2") format("woff2");
    font-weight: 800;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("/assets/barlow-condensed-900i.woff2") format("woff2");
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --bg: #0b0b0e;
    --surface: #131317;
    --surface-2: #1c1c22;
    --surface-3: #26262e;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #f4f2ee;
    --muted: #9b99a4;
    --faint: #5f5d68;
    --danger: #ff4d5e;
    --robin: #ff6b35;
    --robin-ink: #200a00;
    --patrick: #38d6f5;
    --patrick-ink: #001a21;
    --accent: var(--robin);
    --accent-ink: var(--robin-ink);
    --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
    --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --pad: 16px;
    --radius: 24px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-tone="patrick"] {
    --accent: var(--patrick);
    --accent-ink: var(--patrick-ink);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font: 500 16px/1.4 var(--body);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

[hidden] {
    display: none !important;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

button:disabled {
    cursor: default;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

svg {
    display: block;
}

h1,
h2,
h3,
p {
    margin: 0;
}

/* Glows in both players' colors, plus a fine grain so the black isn't flat. */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(70% 45% at 0% 0%, rgba(255, 107, 53, 0.17), transparent 70%),
        radial-gradient(70% 45% at 100% 0%, rgba(56, 214, 245, 0.13), transparent 70%),
        radial-gradient(90% 50% at 50% 110%, rgba(255, 255, 255, 0.04), transparent 70%),
        var(--bg);
}

.backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-tone="robin"] .backdrop {
    background:
        radial-gradient(80% 50% at 15% 0%, rgba(255, 107, 53, 0.22), transparent 70%),
        radial-gradient(60% 40% at 100% 10%, rgba(56, 214, 245, 0.08), transparent 70%),
        var(--bg);
}

[data-tone="patrick"] .backdrop {
    background:
        radial-gradient(80% 50% at 85% 0%, rgba(56, 214, 245, 0.18), transparent 70%),
        radial-gradient(60% 40% at 0% 10%, rgba(255, 107, 53, 0.09), transparent 70%),
        var(--bg);
}

/* ------------------------------------------------------------------------ */
/* Shared bits */

.eyebrow,
.label {
    font: 700 13px/1 var(--display);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.avatar {
    --c: var(--accent);
    --ink: var(--accent-ink);
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 50%;
    background: var(--c);
    color: var(--ink);
    font: italic 900 28px/1 var(--display);
    padding-right: 2px;
    box-shadow: 0 6px 24px -6px var(--c);
}

.avatar.small {
    width: 30px;
    height: 30px;
    font-size: 17px;
    box-shadow: none;
}

[data-player="robin"] .avatar,
.avatar.robin {
    --c: var(--robin);
    --ink: var(--robin-ink);
}

[data-player="patrick"] .avatar,
.avatar.patrick {
    --c: var(--patrick);
    --ink: var(--patrick-ink);
}

.robin {
    --c: var(--robin);
}

.patrick {
    --c: var(--patrick);
}

.chip {
    display: inline-grid;
    place-items: center;
    height: 54px;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font: italic 800 23px/1 var(--display);
    letter-spacing: 0.01em;
    transition:
        transform 0.12s var(--ease),
        background-color 0.2s;
}

.chip:active {
    transform: scale(0.94);
    background: var(--surface-3);
}

.cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 60px;
    border-radius: 18px;
    background: var(--accent);
    color: var(--accent-ink);
    font: italic 900 23px/1 var(--display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 12px 32px -14px var(--accent);
    transition:
        transform 0.12s var(--ease),
        filter 0.2s,
        background-color 0.25s,
        color 0.25s;
}

.cta svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cta:active {
    transform: scale(0.97);
    filter: brightness(1.1);
}

.cta.is-done {
    background: color-mix(in oklab, var(--accent) 12%, transparent);
    color: var(--accent);
    box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--accent) 45%, transparent);
}

.ghost {
    height: 60px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font: italic 800 21px/1 var(--display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Sections sit straight on the background; hairlines separate them. */
.card {
    position: relative;
}

.card + .card {
    margin-top: 34px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-title {
    font: italic 900 24px/1 var(--display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    font: 800 13px/1 var(--display);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c, var(--muted));
    background: color-mix(in oklab, var(--c, var(--muted)) 14%, transparent);
    border: 1px solid color-mix(in oklab, var(--c, var(--muted)) 30%, transparent);
    white-space: nowrap;
}

.badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ------------------------------------------------------------------------ */
/* Lock screen */

.lock {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    min-height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    padding: calc(var(--safe-top) + 36px) 20px calc(var(--safe-bottom) + 24px);
}

.lock-intro {
    animation: rise 0.7s var(--ease) both;
}

.mega {
    margin: 14px 0 0;
    font-weight: normal;
}

/* The stripe is as wide as the number above it. */
.mega-mark {
    display: inline-grid;
    gap: clamp(12px, 3.5vw, 18px);
}

.mega-num {
    display: block;
    margin-left: -0.04em;
    font: italic 900 clamp(150px, 50vw, 230px)/0.8 var(--display);
    letter-spacing: -0.02em;
    color: var(--text);
}

.stripe {
    display: flex;
    gap: 6px;
    height: clamp(6px, 1.8vw, 9px);
    transform: skewX(-14deg);
}

.stripe i {
    flex: 1;
    border-radius: 999px;
    background: var(--c);
}

.mega-sub {
    display: block;
    margin-top: 18px;
    font: italic 800 clamp(24px, 7.4vw, 34px)/1 var(--display);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mega-sub b {
    color: var(--muted);
    font-weight: 800;
    padding: 0 0.08em;
}

.lock-dates {
    margin-top: 12px;
    color: var(--muted);
    font-size: 15px;
}

.lock-rules {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    animation: rise 0.7s 0.05s var(--ease) both;
}

.lock-rules li {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: baseline;
    font-size: 15px;
    color: var(--muted);
}

.lock-rules b {
    display: block;
    font: italic 800 19px/1.1 var(--display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
}

.lock-rules span {
    font: italic 900 22px/1 var(--display);
    color: var(--faint);
}

.lock.is-pin .lock-rules,
.lock.is-pin .lock-dates {
    display: none;
}

.lock.is-pin .mega-num {
    font-size: clamp(96px, 30vw, 150px);
}

.lock.is-pin .mega-sub {
    font-size: clamp(20px, 6vw, 26px);
}

.lock-pick {
    animation: rise 0.7s 0.1s var(--ease) both;
}

.lock-pick .label {
    margin-bottom: 14px;
}

.players {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.vs {
    font: italic 900 18px/1 var(--display);
    color: var(--faint);
    text-transform: uppercase;
}

.player-card {
    --c: var(--robin);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 168px;
    padding: 16px;
    border-radius: var(--radius);
    text-align: left;
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in oklab, var(--c) 26%, transparent), transparent 60%),
        var(--surface);
    border: 1px solid color-mix(in oklab, var(--c) 30%, transparent);
    transition: transform 0.15s var(--ease);
}

.player-card[data-player="patrick"] {
    --c: var(--patrick);
}

.player-card:active {
    transform: scale(0.96);
}

.player-card .avatar {
    margin-bottom: auto;
}

.player-name {
    margin-top: 18px;
    font: italic 900 32px/0.9 var(--display);
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.player-hint {
    font-size: 13px;
    color: var(--muted);
}

.lock-pin {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: rise 0.45s var(--ease) both;
}

.pin-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 40px;
    padding: 0 14px 0 8px;
    margin-right: auto;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}

.back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pin-head .avatar {
    order: 2;
}

.pin-head > div {
    order: 1;
    text-align: right;
}

.pin-title {
    font: italic 900 30px/0.95 var(--display);
    text-transform: uppercase;
    color: var(--accent);
}

.pin-hint {
    font-size: 14px;
    color: var(--muted);
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 10px 0 0;
}

.pin-dots i {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    transition:
        background-color 0.15s,
        border-color 0.15s,
        transform 0.2s var(--ease);
}

.pin-dots i.on {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.12);
    box-shadow: 0 0 16px -2px var(--accent);
}

.pin-dots.error i {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: none;
}

.pin-dots.shake {
    animation: shake 0.42s;
}

.pin-dots.success i {
    background: var(--accent);
    border-color: var(--accent);
    animation: pop 0.4s var(--ease);
}

.pin-error {
    min-height: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--danger);
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.keypad button {
    display: grid;
    place-items: center;
    height: clamp(58px, 8.5dvh, 72px);
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    font: 600 32px/1 var(--display);
    transition:
        transform 0.1s var(--ease),
        background-color 0.15s;
}

.keypad button:active {
    transform: scale(0.94);
    background: var(--surface-3);
}

.keypad button:disabled {
    opacity: 0.4;
}

.keypad button[data-key="back"] {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}

.keypad svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ------------------------------------------------------------------------ */
/* App shell */

.app {
    min-height: 100dvh;
    padding-bottom: calc(var(--safe-bottom) + 28px);
    animation: fade 0.4s var(--ease) both;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(var(--safe-top) + 10px) var(--pad) 10px;
    background: linear-gradient(to bottom, rgba(11, 11, 14, 0.92), rgba(11, 11, 14, 0.7));
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 3px;
    margin-right: auto;
    font: italic 900 25px/1 var(--display);
}

.brand-num {
    padding-bottom: 5px;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, var(--robin) 0 46%, transparent 46% 54%, var(--patrick) 54%) left bottom / 100% 3px
        no-repeat;
}

.brand-x {
    font-size: 18px;
    color: var(--muted);
}

.day-pill {
    padding: 8px 12px;
    border-radius: 999px;
    font: italic 800 15px/1 var(--display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--accent);
    background: color-mix(in oklab, var(--accent) 13%, transparent);
    border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}

.day-pill b {
    color: var(--text);
    font-weight: 900;
}

.me-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
}

.me-chip svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.layout {
    display: grid;
    max-width: 560px;
    margin: 0 auto;
    padding: 22px var(--pad) 0;
}

/* ------------------------------------------------------------------------ */
/* Today */

.hero {
    text-align: center;
}

.hero-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
}

.streak {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: italic 900 18px/1 var(--display);
    color: var(--accent);
}

.streak svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ring {
    position: relative;
    display: block;
    width: min(70vw, 270px);
    aspect-ratio: 1;
    margin: 6px auto 0;
    border-radius: 50%;
}

.ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.ring circle {
    fill: none;
    stroke-width: 20;
}

.ring-track {
    stroke: var(--surface-3);
}

/* Ten notches on the empty track, one per ten push-ups. */
.ring-ticks {
    stroke: rgba(0, 0, 0, 0.6);
    stroke-dasharray: 2 63.345;
    stroke-dashoffset: 1;
}

/* Every set is its own arc, so you can see how the 100 was built. */
.seg {
    stroke: var(--accent);
    stroke-dasharray: 0 653.45;
    transition:
        stroke-dasharray 0.6s var(--ease),
        stroke-dashoffset 0.6s var(--ease);
}

.seg.alt {
    stroke: color-mix(in oklab, var(--accent) 72%, #fff);
}

.ring.is-done #ring-sets {
    filter: drop-shadow(0 0 10px color-mix(in oklab, var(--accent) 65%, transparent));
}

.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-count {
    font: italic 900 clamp(88px, 27vw, 116px)/0.82 var(--display);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    padding-right: 0.06em;
}

.ring-goal {
    margin-top: 6px;
    font: 700 15px/1 var(--display);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.ring-bonus {
    margin-top: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    font: italic 800 14px/1 var(--display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-ink);
    background: var(--accent);
}

.ring.bump .ring-count {
    animation: bump 0.35s var(--ease);
}

.hero-status {
    margin-top: 14px;
    font: italic 900 27px/1 var(--display);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-wrap: balance;
}

.rival {
    margin-top: 8px;
    font-size: 15px;
    color: var(--muted);
}

.rival:empty {
    display: none;
}

.rival::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    vertical-align: 1px;
    border-radius: 50%;
    background: var(--c, var(--muted));
}

.rival b {
    color: var(--text);
    font-weight: 600;
}

.sets {
    margin-top: 20px;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
}

.sets-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sets-meta {
    font-size: 13px;
    color: var(--faint);
}

.set-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.set {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding-left: 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    animation: set-in 0.35s var(--ease);
}

.set-reps {
    font: italic 900 21px/1 var(--display);
    color: var(--accent);
}

.set:nth-child(even) .set-reps {
    color: color-mix(in oklab, var(--accent) 72%, #fff);
}

.set-time {
    margin-left: 6px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--faint);
}

.set-remove {
    display: grid;
    place-items: center;
    width: 34px;
    height: 38px;
    margin-left: 2px;
    border-radius: 0 999px 999px 0;
    color: var(--faint);
}

.set-remove svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
}

.set-remove:active {
    color: var(--danger);
}

.set-list.is-locked .set {
    padding-right: 14px;
}

.set-list.is-locked .set-remove {
    display: none;
}

.sets-empty {
    font-size: 14px;
    line-height: 1.45;
    color: var(--faint);
    text-align: left;
    text-wrap: pretty;
}

.quick-wrap {
    margin: 18px 0 10px;
    text-align: left;
}

.quick-wrap .label {
    margin-bottom: 10px;
}

.quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 0.8fr;
    gap: 7px;
}

.chip-custom {
    color: var(--muted);
}

.chip-custom svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ------------------------------------------------------------------------ */
/* Head to head */

.vs-names,
.vs-totals {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
}

.vs-names {
    grid-template-columns: 1fr 1fr;
}

.vs-name {
    font: 800 14px/1 var(--display);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c);
}

.vs-name.patrick,
.vs-total.patrick {
    text-align: right;
}

.vs-total {
    font: italic 900 46px/1 var(--display);
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
}

.vs-total small {
    font-size: 22px;
    color: var(--faint);
}

.vs-total-label {
    padding-bottom: 8px;
    font-size: 13px;
    color: var(--faint);
}

.split {
    display: flex;
    gap: 4px;
    height: 10px;
    margin: 10px 0 6px;
}

.split i {
    flex: 1 1 0;
    min-width: 10px;
    border-radius: 999px;
    transition: flex-grow 0.7s var(--ease);
}

.split-robin {
    background: linear-gradient(90deg, #ff9a5c, var(--robin));
}

.split-patrick {
    background: linear-gradient(90deg, var(--patrick), #7be6ff);
}

.split.empty i {
    background: var(--surface-3);
}

.vs-stats {
    margin-top: 10px;
}

.vs-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.vs-label {
    font: 700 12px/1 var(--display);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: center;
}

.vs-val {
    font: italic 800 21px/1 var(--display);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.vs-val:last-child {
    text-align: right;
}

.vs-val.win {
    color: var(--c);
}

.vs-val small {
    font: 600 13px/1 var(--body);
    font-style: normal;
    color: var(--faint);
}

.activity {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--faint);
    text-align: center;
}

.activity:empty {
    display: none;
}

/* ------------------------------------------------------------------------ */
/* 30-day board */

.legend {
    display: flex;
    gap: 12px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.legend-item::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--c);
}

.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.cell {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 4 / 5;
    padding: 6px;
    border-radius: 13px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    text-align: left;
    transition: transform 0.12s var(--ease);
}

.cell:active:not(:disabled) {
    transform: scale(0.93);
}

.cell-day {
    font: italic 800 16px/1 var(--display);
    color: var(--muted);
}

.cell-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 52%;
}

.cell-bars i {
    position: relative;
    flex: 1;
    height: 100%;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.cell-bars i::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--c);
    transform-origin: bottom;
    transform: scaleY(var(--p, 0));
    transition: transform 0.6s var(--ease);
}

.cell-check {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: var(--text);
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cell.is-both {
    background:
        linear-gradient(155deg, rgba(255, 107, 53, 0.2), transparent 55%),
        linear-gradient(335deg, rgba(56, 214, 245, 0.2), transparent 55%),
        var(--surface-2);
    border-color: var(--line-strong);
}

.cell.is-mine .cell-day {
    color: var(--accent);
}

.cell.is-today {
    border-color: var(--accent);
    box-shadow:
        0 0 0 1px var(--accent),
        0 0 18px -4px var(--accent);
}

.cell.is-today .cell-day {
    color: var(--text);
}

.cell.is-future {
    background: transparent;
    border-style: dashed;
    border-color: var(--line);
}

.cell.is-future .cell-day {
    color: var(--faint);
}

.cell.is-future .cell-bars {
    opacity: 0.4;
}

.cell.is-tiebreak {
    border-color: color-mix(in oklab, var(--accent) 35%, transparent);
}

.cell.is-tiebreak .cell-day {
    color: var(--accent);
}

.board-hint {
    margin-top: 14px;
    font-size: 13px;
    color: var(--faint);
    text-align: center;
}

/* ------------------------------------------------------------------------ */
/* Day sheet */

.sheet {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    margin: auto 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: visible;
}

.sheet[open] {
    animation: sheet-up 0.38s var(--ease);
}

.sheet::backdrop {
    background: rgba(5, 5, 7, 0.66);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.sheet-body {
    display: grid;
    gap: 16px;
    max-width: 520px;
    max-height: calc(100dvh - var(--safe-top) - 12px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0 auto;
    padding: 10px 20px calc(var(--safe-bottom) + 20px);
    background: #17171c;
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.8);
}

.grabber {
    justify-self: center;
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: var(--line-strong);
    margin-bottom: 4px;
}

.sheet-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.sheet-title {
    margin-top: 8px;
    font: italic 900 30px/1 var(--display);
    text-transform: uppercase;
}

.sheet-total {
    font: italic 900 44px/0.85 var(--display);
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.sheet-total span {
    font-size: 20px;
    color: var(--faint);
}

.sheet-add {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.sheet-add .stepper {
    margin-top: -2px;
}

.stepper {
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    align-items: center;
    gap: 10px;
}

.step {
    height: 64px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font: 600 34px/1 var(--display);
    transition: transform 0.1s var(--ease);
}

.step:active {
    transform: scale(0.93);
}

.stepper input {
    width: 100%;
    min-width: 0;
    height: 72px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--accent);
    text-align: center;
    font: italic 900 68px/1 var(--display);
    font-variant-numeric: tabular-nums;
}

.stepper input:focus {
    outline: none;
    background: var(--surface-2);
}

.presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.presets .chip {
    height: 46px;
    font-size: 20px;
}

.presets .chip.on {
    color: var(--accent);
    border-color: color-mix(in oklab, var(--accent) 45%, transparent);
    background: color-mix(in oklab, var(--accent) 10%, var(--surface-2));
}

.sheet-rival {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    font-size: 15px;
    color: var(--muted);
}

.sheet-rival b {
    font: italic 900 24px/1 var(--display);
    color: var(--c);
}

.sheet-rival::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--c);
}

.sheet-rival span {
    margin-right: auto;
}

.sheet-body > .ghost {
    height: 54px;
}

/* ------------------------------------------------------------------------ */
/* Toast & confetti */

.toast {
    position: fixed;
    inset: auto auto calc(var(--safe-bottom) + 20px) 50%;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 13px 20px;
    border: 0;
    border-radius: 999px;
    overflow: visible;
    background: var(--text);
    color: #121214;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translate(-50%, 16px);
    transition:
        opacity 0.25s,
        transform 0.3s var(--ease);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.toast.has-action {
    padding: 6px 6px 6px 20px;
}

.toast-action {
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: #121214;
    color: var(--text);
    font: italic 800 17px/1 var(--display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Inside the day sheet the bottom is busy, so the toast drops in from the top. */
.sheet .toast {
    bottom: auto;
    top: calc(var(--safe-top) + 16px);
    transform: translate(-50%, -16px);
}

.sheet .toast.show {
    transform: translate(-50%, 0);
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

.confetti {
    position: fixed;
    inset: 0;
    z-index: 60;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ------------------------------------------------------------------------ */
/* Motion */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

@keyframes shake {
    15%,
    55% {
        transform: translateX(-10px);
    }
    35%,
    75% {
        transform: translateX(10px);
    }
    90% {
        transform: translateX(-4px);
    }
}

@keyframes pop {
    50% {
        transform: scale(1.35);
    }
}

@keyframes set-in {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
}

@keyframes bump {
    40% {
        transform: scale(1.08);
    }
}

@keyframes sheet-up {
    from {
        transform: translateY(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ------------------------------------------------------------------------ */
/* Wider screens */

@media (max-width: 359px) {
    .quick {
        gap: 6px;
    }
    .chip {
        font-size: 20px;
    }
    .player-name {
        font-size: 26px;
    }
}

/* Short phone screens (or Safari with its toolbars): keep the player picker in view. */
@media (max-height: 740px) and (max-width: 959px) {
    .lock-rules {
        display: none;
    }
    .mega-num {
        font-size: clamp(120px, 40vw, 180px);
    }
}

@media (min-width: 560px) {
    .grid {
        grid-template-columns: repeat(10, 1fr);
    }
    .sheet {
        margin: auto;
    }
    .sheet-body {
        border-radius: 28px;
        border-bottom: 1px solid var(--line-strong);
        padding-bottom: 20px;
    }
    .sheet[open] {
        animation: rise 0.3s var(--ease);
    }
    .grabber {
        display: none;
    }
}

@media (min-width: 960px) {
    :root {
        --pad: 28px;
    }
    .lock {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
        gap: 64px;
        max-width: 1040px;
        padding-top: 40px;
    }
    .mega-num,
    .lock.is-pin .mega-num {
        font-size: 240px;
    }
    .lock.is-pin .lock-rules {
        display: grid;
    }
    .lock-intro {
        grid-area: 1 / 1;
        align-self: end;
    }
    .lock-rules {
        grid-area: 2 / 1;
        align-self: start;
    }
    .lock-pick,
    .lock-pin {
        grid-area: 1 / 2 / span 2;
    }
    .layout {
        grid-template-columns: minmax(360px, 400px) 1fr;
        grid-template-areas:
            "hero versus"
            "hero board";
        align-items: start;
        column-gap: 72px;
        max-width: 1120px;
        padding-top: 36px;
    }
    .hero {
        grid-area: hero;
        position: sticky;
        top: 88px;
    }
    .card.versus {
        grid-area: versus;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }
    .board {
        grid-area: board;
    }
}
