:root {
    --asphalt: #121513;
    --asphalt-2: #1a1f1b;
    --asphalt-3: #252b26;
    --paper: #f2ecde;
    --paper-2: #e6dece;
    --paper-3: #d8cfbd;
    --ink: #171a17;
    --ink-soft: #4f544c;
    --muted: #8d9389;
    --muted-dark: #6d7269;
    --orange: #ef5a2a;
    --orange-soft: #ff7b4e;
    --yellow: #f4c542;
    --green: #3d7a5c;
    --green-soft: #d7e7dd;
    --red: #cf4033;
    --blue: #7aa9b8;
    --line: rgba(242, 236, 222, 0.13);
    --line-dark: rgba(23, 26, 23, 0.14);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.2);
    --font-display: "Barlow Condensed", "Arial Narrow", "Arial", sans-serif;
    --font-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    background: var(--asphalt);
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--asphalt);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% -5%, rgba(239, 90, 42, 0.11), transparent 38%),
        radial-gradient(circle at 92% 12%, rgba(244, 197, 66, 0.07), transparent 32%),
        repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, 0.012) 22px 23px);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

button,
[role="button"] {
    cursor: pointer;
}

img,
video {
    max-width: 100%;
}

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

[hidden] {
    display: none !important;
}

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

::selection {
    background: var(--yellow);
    color: var(--ink);
}

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 22px;
    height: 22px;
    display: inline-block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
    vertical-align: middle;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 28px;
    height: 28px;
}

.kicker {
    display: block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-dark);
}

/* Boot */

.boot {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 50% 30%, rgba(239, 90, 42, 0.14), transparent 45%),
        var(--asphalt);
}

.boot-inner {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.boot-logo {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.boot-logo b {
    padding: 2px 8px 3px;
    border-radius: 5px;
    background: var(--yellow);
    color: var(--ink);
    font-size: 30px;
    font-weight: 800;
    transform: skewX(-5deg);
}

.boot-loader {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin: 30px 0 16px;
}

.boot-loader i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    animation: boot-bounce 0.9s ease-in-out infinite;
}

.boot-loader i:nth-child(2) {
    animation-delay: 0.12s;
    background: var(--yellow);
}

.boot-loader i:nth-child(3) {
    animation-delay: 0.24s;
    background: var(--paper);
}

.boot p {
    color: var(--muted);
    font-size: 14px;
}

.boot-error {
    margin-top: 24px;
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 20px;
    background: rgba(242, 236, 222, 0.04);
}

.boot-error-icon {
    color: var(--orange);
    margin-bottom: 10px;
}

.boot-error-icon .icon {
    width: 34px;
    height: 34px;
}

.boot-error h2 {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.boot-error p {
    margin-bottom: 18px;
    color: var(--muted);
}

@keyframes boot-bounce {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.55;
    }
    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Desktop gate */

.desktop-gate {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 30% 0%, rgba(239, 90, 42, 0.14), transparent 40%),
        #0b0d0b;
}

.desktop-gate-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.desktop-gate-phone {
    width: 82px;
    height: 82px;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
    border-radius: 26px;
    background: var(--yellow);
    color: var(--ink);
    transform: rotate(-4deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.desktop-gate-phone .icon {
    width: 42px;
    height: 42px;
}

.desktop-gate-card .kicker {
    color: var(--orange-soft);
    margin-bottom: 10px;
}

.desktop-gate-card h1 {
    font-family: var(--font-display);
    font-size: clamp(38px, 7vw, 54px);
    font-weight: 800;
    line-height: 0.92;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin-bottom: 16px;
}

.desktop-gate-card p {
    color: var(--muted);
    margin-bottom: 24px;
}

.desktop-gate-card .btn {
    width: 100%;
    margin-bottom: 10px;
}

/* App shell */

.app {
    width: 100%;
    max-width: 560px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: var(--asphalt);
    position: relative;
}

body.is-onboarding .app {
    grid-template-rows: minmax(0, 1fr);
}

body.is-onboarding .topbar,
body.is-onboarding .tabbar {
    display: none;
}

body.is-preview {
    min-height: 100vh;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(239, 90, 42, 0.08), transparent 45%),
        #080a08;
}

body.is-preview .app {
    width: 100%;
    max-width: 430px;
    height: calc(100vh - 36px);
    height: calc(100dvh - 36px);
    min-height: 620px;
    border: 1px solid rgba(242, 236, 222, 0.16);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

body.is-preview .desktop-gate {
    display: none;
}

body.is-preview .sheet-root,
body.is-preview .modal-root {
    width: 430px;
    height: calc(100vh - 36px);
    height: calc(100dvh - 36px);
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    border-radius: 30px;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(var(--safe-top) + 15px) 18px 10px;
    background: linear-gradient(to bottom, var(--asphalt) 72%, rgba(18, 21, 19, 0.88));
    position: relative;
    z-index: 20;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--paper);
}

.wordmark-main {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.wordmark-time {
    padding: 2px 6px 3px;
    border-radius: 4px;
    background: var(--yellow);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    transform: skewX(-5deg);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(61, 122, 92, 0.18);
    color: #9bd3b3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.live-pill i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #68c18f;
    box-shadow: 0 0 0 3px rgba(104, 193, 143, 0.14);
    animation: live-pulse 2.4s ease-out infinite;
}

.live-pill.is-offline {
    background: rgba(207, 64, 51, 0.16);
    color: #ef9a91;
}

.live-pill.is-offline i {
    background: var(--red);
    box-shadow: 0 0 0 3px rgba(207, 64, 51, 0.14);
    animation: none;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(104, 193, 143, 0.3);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(104, 193, 143, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(104, 193, 143, 0);
    }
}

.team-code-chip {
    min-width: 54px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(242, 236, 222, 0.04);
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1;
}

.main {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 6px 16px 26px;
    scrollbar-width: none;
}

.main::-webkit-scrollbar {
    display: none;
}

body.is-onboarding .main {
    padding: 0;
}

.view {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100%;
}

.tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 7px 9px calc(var(--safe-bottom) + 8px);
    border-top: 1px solid var(--line);
    background: rgba(18, 21, 19, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: relative;
    z-index: 20;
}

.tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 3px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.18s ease, background 0.18s ease;
}

.tab .icon {
    width: 21px;
    height: 21px;
}

.tab.is-active {
    color: var(--paper);
    background: rgba(242, 236, 222, 0.07);
}

.tab.is-active .icon {
    color: var(--orange-soft);
}

.tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 17px);
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--ink);
    font-size: 9px;
    line-height: 15px;
    font-weight: 800;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.btn:active {
    transform: scale(0.985);
}

.btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--orange);
    color: var(--ink);
}

.btn-yellow {
    background: var(--yellow);
    color: var(--ink);
}

.btn-dark {
    background: var(--ink);
    color: var(--paper);
}

.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--paper);
}

.btn-soft {
    background: rgba(242, 236, 222, 0.08);
    border-color: var(--line);
    color: var(--paper);
}

.btn-sm {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 9px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn.is-loading {
    color: transparent;
    position: relative;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    color: var(--ink);
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Shared cards */

.paper {
    background: var(--paper);
    color: var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.panel {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--asphalt-2);
}

.section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 2px 2px;
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.section-head p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.section-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--orange-soft);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Home hero */

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 17px 17px 15px;
    border-radius: 24px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -54px;
    top: -64px;
    width: 170px;
    height: 170px;
    border: 20px solid rgba(239, 90, 42, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.hero-head .kicker {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 1px;
}

.live-pill-dark {
    background: rgba(61, 122, 92, 0.12);
    color: var(--green);
}

.hero-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 2px;
    position: relative;
    z-index: 1;
}

.gauge-wrap {
    position: relative;
    width: 172px;
    max-width: 58%;
    flex: 0 0 auto;
}

.gauge {
    display: block;
    width: 100%;
    height: auto;
}

.gauge-track {
    fill: none;
    stroke: #d9d1c1;
    stroke-width: 13;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke: var(--orange);
    stroke-width: 13;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gauge-center {
    position: absolute;
    left: 50%;
    bottom: 3px;
    transform: translateX(-50%);
    text-align: center;
    line-height: 0.9;
}

.gauge-center b {
    display: block;
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gauge-center span {
    display: block;
    margin-top: 4px;
    color: var(--muted-dark);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-numbers {
    flex: 1;
    min-width: 0;
    padding-left: 4px;
}

.hero-points {
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--line-dark);
}

.hero-points b {
    display: block;
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -0.02em;
    color: var(--orange);
}

.hero-points span {
    display: block;
    margin-top: 5px;
    color: var(--muted-dark);
    font-size: 11px;
    font-weight: 600;
}

.hero-rank {
    margin-top: 9px;
    color: var(--muted-dark);
    font-size: 11px;
    font-weight: 600;
}

.hero-rank b {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--ink);
    margin-left: 3px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 11px;
    border-top: 1px dashed var(--line-dark);
    position: relative;
    z-index: 1;
}

.hero-stats > div {
    min-width: 0;
}

.hero-stats b {
    display: block;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-stats span {
    display: block;
    margin-top: 2px;
    color: var(--muted-dark);
    font-size: 10px;
    line-height: 1.15;
}

/* Destination card */

.dest-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border-radius: 20px;
    border: 1px dashed rgba(242, 236, 222, 0.26);
    background:
        linear-gradient(135deg, rgba(244, 197, 66, 0.06), transparent 55%),
        var(--asphalt-2);
    overflow: hidden;
}

.dest-card.is-open {
    border-style: solid;
    border-color: rgba(239, 90, 42, 0.36);
    background:
        linear-gradient(135deg, rgba(239, 90, 42, 0.11), transparent 58%),
        var(--asphalt-2);
}

.dest-card.is-done {
    border-color: rgba(61, 122, 92, 0.5);
    background:
        linear-gradient(135deg, rgba(61, 122, 92, 0.2), transparent 62%),
        var(--asphalt-2);
}

.dest-card.is-closed {
    opacity: 0.72;
}

.dest-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--yellow);
    color: var(--ink);
    transform: rotate(-3deg);
}

.dest-card.is-open .dest-icon {
    background: var(--orange);
}

.dest-card.is-done .dest-icon {
    background: #9bd3b3;
}

.dest-icon .icon {
    width: 23px;
    height: 23px;
}

.dest-copy {
    flex: 1;
    min-width: 0;
}

.dest-copy .kicker {
    color: var(--orange-soft);
    margin-bottom: 2px;
}

.dest-copy h2 {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 800;
    line-height: 0.98;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dest-copy p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.dest-countdown {
    flex: 0 0 auto;
    text-align: right;
    padding-left: 8px;
}

.dest-countdown b {
    display: block;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.dest-countdown span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.15;
    max-width: 74px;
}

.dest-address {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.05;
    color: var(--paper);
    margin-top: 2px;
}

.dest-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--orange-soft);
    font-size: 11px;
    font-weight: 700;
}

/* Quiz banner */

.quiz-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 18px;
    background: var(--yellow);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.quiz-banner .quiz-banner-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--ink);
    color: var(--yellow);
}

.quiz-banner .quiz-banner-icon .icon {
    width: 21px;
    height: 21px;
}

.quiz-banner-copy {
    flex: 1;
    min-width: 0;
}

.quiz-banner-copy b {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.quiz-banner-copy span {
    display: block;
    margin-top: 2px;
    color: rgba(23, 26, 23, 0.66);
    font-size: 11px;
}

.quiz-banner .btn {
    min-height: 36px;
    padding: 8px 12px;
    background: var(--ink);
    color: var(--paper);
    font-size: 12px;
}

.quiz-banner.is-passed {
    background: var(--green-soft);
}

.quiz-banner.is-failed {
    background: rgba(242, 236, 222, 0.08);
    color: var(--paper);
    box-shadow: none;
    border: 1px solid var(--line);
}

.quiz-banner.is-failed .quiz-banner-icon {
    background: rgba(242, 236, 222, 0.08);
    color: var(--muted);
}

.quiz-banner.is-failed .quiz-banner-copy span {
    color: var(--muted);
}

/* Roadbook task list */

.group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-head {
    margin: 8px 2px 0;
}

.group-head h2 {
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.group-head p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
}

.road-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-left: 34px;
}

.road-list::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(242, 236, 222, 0.28) 0 7px,
        transparent 7px 15px
    );
}

.road-list.is-mini {
    gap: 8px;
}

.task-row {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px 12px 14px;
    border: 0;
    border-radius: 15px;
    background: var(--paper);
    color: var(--ink);
    text-align: left;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
    transition: transform 0.16s ease, background 0.16s ease;
}

.task-row:active {
    transform: scale(0.988);
}

.task-row.is-done {
    background: var(--paper-2);
}

.task-row.is-locked {
    background: rgba(242, 236, 222, 0.08);
    color: var(--paper);
    box-shadow: none;
    border: 1px dashed var(--line);
}

.task-dot {
    position: absolute;
    left: -34px;
    top: 50%;
    width: 30px;
    height: 30px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid rgba(242, 236, 222, 0.32);
    background: var(--asphalt);
    color: var(--paper);
}

.task-dot .icon {
    width: 15px;
    height: 15px;
}

.task-row.is-done .task-dot {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.task-row.is-locked .task-dot {
    background: var(--asphalt-2);
    border-color: var(--line);
    color: var(--muted);
}

.task-body {
    flex: 1;
    min-width: 0;
    display: block;
}

.task-top {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.task-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-row.is-locked .task-title {
    color: var(--paper);
}

.task-desc {
    display: block;
    margin-top: 2px;
    color: var(--muted-dark);
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-row.is-locked .task-desc {
    color: var(--muted);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.task-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(23, 26, 23, 0.07);
    color: var(--muted-dark);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.3;
    white-space: nowrap;
}

.task-chip.is-bonus {
    background: rgba(244, 197, 66, 0.3);
    color: #7b5a00;
}

.task-chip.is-joker {
    background: rgba(244, 197, 66, 0.3);
    color: #6f5100;
}

.task-chip.is-open {
    background: rgba(61, 122, 92, 0.13);
    color: var(--green);
}

.task-chip.is-locked {
    background: rgba(242, 236, 222, 0.1);
    color: var(--muted);
}

.task-chevron {
    flex: 0 0 auto;
    color: var(--muted-dark);
    display: grid;
    place-items: center;
}

.task-chevron .icon {
    width: 17px;
    height: 17px;
}

.task-row.is-locked .task-chevron {
    color: var(--muted);
}

.task-stamp {
    position: absolute;
    top: 7px;
    right: 9px;
    padding: 2px 5px;
    border: 1.5px solid var(--green);
    border-radius: 3px;
    color: var(--green);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    transform: rotate(-7deg);
    background: rgba(242, 236, 222, 0.84);
}

.task-stamp.is-joker {
    border-color: #9a7410;
    color: #7b5a00;
}

.task-row.has-stamp .task-chevron {
    opacity: 0.3;
}

/* Bingo */

.bingo-progress-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    border-radius: 18px;
    background: var(--asphalt-2);
    border: 1px solid var(--line);
}

.bingo-mini-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    flex: 1;
    max-width: 190px;
}

.bingo-mini-dot {
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(242, 236, 222, 0.1);
    border: 1px solid rgba(242, 236, 222, 0.1);
}

.bingo-mini-dot.is-done {
    background: var(--green);
    border-color: var(--green);
}

.bingo-mini-dot.is-joker {
    background: var(--yellow);
    border-color: var(--yellow);
}

.bingo-progress-copy {
    flex: 1;
    min-width: 0;
}

.bingo-progress-copy b {
    display: block;
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 800;
    line-height: 1;
}

.bingo-progress-copy span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.bingo-board {
    position: relative;
    padding: 13px 13px 14px;
    border-radius: 22px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.bingo-board::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed rgba(23, 26, 23, 0.14);
    border-radius: 17px;
    pointer-events: none;
}

.bingo-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 3px 9px;
    border-bottom: 2px solid var(--ink);
    position: relative;
    z-index: 1;
}

.bingo-head h2 {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bingo-head span {
    color: var(--muted-dark);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.bingo-section {
    position: relative;
    z-index: 1;
    padding-top: 9px;
}

.bingo-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 2px 7px;
    color: var(--muted-dark);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.bingo-section-label::after {
    content: "";
    height: 1px;
    flex: 1;
    background: repeating-linear-gradient(
        to right,
        rgba(23, 26, 23, 0.22) 0 4px,
        transparent 4px 8px
    );
}

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

.bingo-grid.is-bingo2 {
    grid-template-columns: repeat(3, 1fr);
}

.bingo-cell {
    position: relative;
    aspect-ratio: 1 / 0.88;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 5px;
    border: 1px dashed rgba(23, 26, 23, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    color: var(--ink);
    text-align: center;
    overflow: hidden;
    transition: background 0.16s ease, transform 0.16s ease;
}

.bingo-cell:active {
    transform: scale(0.97);
}

.bingo-cell .icon {
    width: 20px;
    height: 20px;
    color: var(--muted-dark);
}

.bingo-cell.is-done {
    background: rgba(61, 122, 92, 0.14);
    border-color: var(--green);
}

.bingo-cell.is-done .icon {
    color: var(--green);
}

.bingo-cell.is-joker {
    background: rgba(244, 197, 66, 0.38);
    border-color: #b78b13;
}

.bingo-cell.is-joker .icon {
    color: #7b5a00;
}

.bingo-label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0.01em;
}

.bingo-mark {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
}

.bingo-cell.is-joker .bingo-mark {
    background: var(--yellow);
    color: var(--ink);
}

.bingo-mark .icon {
    width: 11px;
    height: 11px;
    color: inherit;
}

.bingo-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed var(--line-dark);
    color: var(--muted-dark);
    font-size: 10px;
}

.legend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.legend .is-done {
    background: var(--green);
}

.legend .is-joker {
    background: var(--yellow);
}

/* Live leaderboard */

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

.live-head h1 {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.live-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11.5px;
}

.live-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 2px 0 2px;
}

.live-summary > div {
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--asphalt-2);
}

.live-summary b {
    display: block;
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

.live-summary span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.15;
}

.km-bonus-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 13px;
    background: rgba(244, 197, 66, 0.1);
    border: 1px solid rgba(244, 197, 66, 0.26);
    color: var(--paper);
    font-size: 11px;
    line-height: 1.35;
}

.km-bonus-note .icon {
    width: 15px;
    height: 15px;
    color: var(--yellow);
    margin-top: 1px;
}

.km-bonus-note b {
    color: var(--yellow);
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 15px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.lb-row.is-self {
    outline: 2px solid var(--orange);
    outline-offset: -2px;
}

.lb-rank {
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
}

.lb-list .lb-row:nth-child(1) .lb-rank {
    background: var(--yellow);
    color: var(--ink);
}

.lb-list .lb-row:nth-child(2) .lb-rank {
    background: var(--paper-3);
    color: var(--ink);
}

.lb-list .lb-row:nth-child(3) .lb-rank {
    background: var(--orange);
    color: var(--ink);
}

.lb-body {
    flex: 1;
    min-width: 0;
}

.lb-top {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.lb-name {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.you-badge {
    flex: 0 0 auto;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--orange);
    color: var(--ink);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bonus-chip {
    flex: 0 0 auto;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--yellow);
    color: var(--ink);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.lb-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    color: var(--muted-dark);
    font-size: 10px;
}

.lb-bar {
    height: 4px;
    margin-top: 6px;
    border-radius: 999px;
    background: #dcd4c4;
    overflow: hidden;
}

.lb-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--orange);
    transition: width 0.55s ease;
}

.lb-row.is-self .lb-bar i {
    background: var(--green);
}

.lb-points {
    flex: 0 0 auto;
    min-width: 38px;
    text-align: right;
    font-family: var(--font-display);
    line-height: 0.85;
}

.lb-points b {
    font-size: 27px;
    font-weight: 800;
}

.lb-points span {
    display: block;
    margin-top: 3px;
    color: var(--muted-dark);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.empty-state {
    padding: 26px 20px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
}

.empty-state .icon {
    width: 30px;
    height: 30px;
    margin-bottom: 8px;
    color: var(--orange-soft);
}

.empty-state h2 {
    font-family: var(--font-display);
    font-size: 23px;
    line-height: 1;
    text-transform: uppercase;
    color: var(--paper);
    margin-bottom: 5px;
}

/* Team */

.team-card {
    padding: 18px;
    border-radius: 22px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.team-card::after {
    content: "";
    position: absolute;
    right: -44px;
    bottom: -52px;
    width: 140px;
    height: 140px;
    border: 18px solid rgba(239, 90, 42, 0.08);
    border-radius: 50%;
}

.team-card h1 {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.01em;
    margin: 2px 0 14px;
    max-width: 90%;
    overflow-wrap: anywhere;
}

.team-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.team-code {
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--yellow);
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0.2em;
    line-height: 1;
}

.team-code-row .btn {
    flex: 1;
}

.team-card p {
    margin-top: 12px;
    color: var(--muted-dark);
    font-size: 11.5px;
    position: relative;
    z-index: 1;
}

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

.stat-card {
    padding: 13px;
    border-radius: 15px;
    background: var(--asphalt-2);
    border: 1px solid var(--line);
}

.stat-card b {
    display: block;
    font-family: var(--font-display);
    font-size: 29px;
    font-weight: 800;
    line-height: 1;
}

.stat-card span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.quiz-status-card {
    padding: 15px;
    border-radius: 18px;
    background: var(--asphalt-2);
    border: 1px solid var(--line);
}

.quiz-status-card.is-active {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow);
}

.quiz-status-card.is-passed {
    background: var(--green-soft);
    color: var(--ink);
    border-color: var(--green-soft);
}

.quiz-status-card.is-failed {
    background: var(--asphalt-2);
}

.quiz-status-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
}

.quiz-status-head .icon {
    width: 19px;
    height: 19px;
    color: var(--orange-soft);
}

.quiz-status-card.is-active .quiz-status-head .icon {
    color: var(--ink);
}

.quiz-status-card.is-passed .quiz-status-head .icon {
    color: var(--green);
}

.quiz-status-head b {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1;
}

.quiz-status-card p {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.quiz-status-card.is-active p,
.quiz-status-card.is-passed p {
    color: rgba(23, 26, 23, 0.68);
}

.quiz-status-card .btn {
    margin-top: 10px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.info-item .icon {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    color: var(--orange-soft);
}

.info-item b {
    color: var(--paper);
}

.install-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: rgba(242, 236, 222, 0.03);
}

.install-card .install-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--yellow);
    color: var(--ink);
}

.install-card .install-icon .icon {
    width: 21px;
    height: 21px;
}

.install-copy {
    flex: 1;
    min-width: 0;
}

.install-copy b {
    display: block;
    font-size: 13px;
}

.install-copy span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.35;
}

.danger-zone {
    padding-top: 4px;
    text-align: center;
}

.danger-zone button {
    padding: 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-note {
    padding: 2px 8px 10px;
    text-align: center;
    color: rgba(141, 147, 137, 0.72);
    font-size: 9.5px;
    line-height: 1.4;
}

/* Onboarding */

.onboarding {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: calc(var(--safe-top) + 20px) 22px calc(var(--safe-bottom) + 22px);
    position: relative;
    overflow: hidden;
}

.onboarding::before {
    content: "";
    position: absolute;
    right: -130px;
    top: 80px;
    width: 300px;
    height: 300px;
    border: 34px solid rgba(239, 90, 42, 0.07);
    border-radius: 50%;
    pointer-events: none;
}

.onboarding-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.onboarding .wordmark-main {
    font-size: 21px;
}

.onboarding .wordmark-time {
    font-size: 15px;
}

.onboarding-tag {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.onboarding-hero {
    position: relative;
    z-index: 1;
    padding-top: clamp(34px, 9vh, 82px);
}

.onboarding-kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 13px;
    color: var(--orange-soft);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.onboarding-kicker::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--orange);
}

.onboarding h1 {
    font-family: var(--font-display);
    font-size: clamp(46px, 13vw, 72px);
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.onboarding h1 em {
    color: var(--orange-soft);
    font-style: normal;
}

.onboarding-lede {
    max-width: 340px;
    margin-top: 17px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.onboarding-lede b {
    color: var(--paper);
    font-weight: 600;
}

.route-art {
    width: min(100%, 390px);
    height: auto;
    margin: 14px auto 8px;
    display: block;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.route-road {
    fill: none;
    stroke: rgba(242, 236, 222, 0.16);
    stroke-width: 26;
    stroke-linecap: round;
}

.route-dash {
    fill: none;
    stroke: var(--yellow);
    stroke-width: 2.5;
    stroke-dasharray: 8 12;
    stroke-linecap: round;
    animation: route-dash 18s linear infinite;
}

.route-pin {
    fill: var(--orange);
    stroke: var(--asphalt);
    stroke-width: 3;
}

.route-target {
    color: var(--paper);
}

.route-target circle {
    fill: var(--yellow);
    stroke: var(--asphalt);
    stroke-width: 3;
}

.route-target path {
    fill: none;
    stroke: var(--asphalt);
    stroke-width: 2;
}

@keyframes route-dash {
    to {
        stroke-dashoffset: -200;
    }
}

.onboarding-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.onboarding-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
}

.onboarding-stat b {
    color: var(--paper);
    font-weight: 600;
}

.onboarding-form-wrap {
    margin-top: auto;
    padding-top: 22px;
    position: relative;
    z-index: 1;
}

.onboard-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 13px;
    background: rgba(242, 236, 222, 0.06);
    border: 1px solid var(--line);
    margin-bottom: 12px;
}

.onboard-switch button {
    padding: 9px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.onboard-switch button.is-active {
    background: var(--paper);
    color: var(--ink);
}

.onboard-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(242, 236, 222, 0.05);
    color: var(--paper);
    font-size: 15px;
    outline: 0;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--orange);
    background: rgba(242, 236, 222, 0.08);
}

.field input::placeholder,
.field textarea::placeholder {
    color: rgba(141, 147, 137, 0.7);
}

.field input.code-input {
    text-align: center;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.onboard-hint {
    padding: 1px 4px 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
}

.onboarding-footer {
    margin-top: 18px;
    text-align: center;
    color: rgba(141, 147, 137, 0.7);
    font-size: 9.5px;
    line-height: 1.45;
}

/* Sheet */

.sheet-root {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 4, 0.66);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    max-height: 94vh;
    max-height: 94dvh;
    display: flex;
    flex-direction: column;
    border-radius: 24px 24px 0 0;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.4);
    animation: sheet-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}

@keyframes sheet-in {
    from {
        transform: translateY(26px);
        opacity: 0.7;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sheet-handle {
    width: 42px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 999px;
    background: rgba(23, 26, 23, 0.2);
    flex: 0 0 auto;
}

.sheet-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 18px 12px;
    border-bottom: 1px dashed var(--line-dark);
    flex: 0 0 auto;
}

.sheet-title-wrap {
    flex: 1;
    min-width: 0;
}

.sheet-title-wrap .kicker {
    color: var(--muted-dark);
    margin-bottom: 2px;
}

.sheet-title {
    font-family: var(--font-display);
    font-size: 29px;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin: 0;
}

.sheet-close {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-dark);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
}

.sheet-close .icon {
    width: 18px;
    height: 18px;
}

.sheet-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 18px 22px;
    scrollbar-width: thin;
}

.sheet-footer {
    flex: 0 0 auto;
    padding: 11px 18px calc(var(--safe-bottom) + 13px);
    border-top: 1px dashed var(--line-dark);
    background: var(--paper);
}

.sheet-footer .btn {
    width: 100%;
}

.sheet-footer-note {
    margin-top: 6px;
    text-align: center;
    color: var(--muted-dark);
    font-size: 9.5px;
}

.sheet-intro {
    padding-bottom: 14px;
}

.sheet-intro p {
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.5;
}

.sheet-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.sheet-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(23, 26, 23, 0.06);
    color: var(--muted-dark);
    font-size: 9.5px;
    font-weight: 700;
}

.sheet-badge.is-orange {
    background: rgba(239, 90, 42, 0.13);
    color: #a73b18;
}

.sheet-badge.is-green {
    background: rgba(61, 122, 92, 0.14);
    color: var(--green);
}

.sheet-badge.is-yellow {
    background: rgba(244, 197, 66, 0.32);
    color: #745500;
}

.block {
    margin-top: 16px;
}

.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.block-head h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.block-head span {
    color: var(--muted-dark);
    font-size: 9.5px;
}

.upload-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 132px;
    padding: 16px;
    border: 1.5px dashed rgba(23, 26, 23, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    text-align: center;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.upload-slot:active {
    background: rgba(239, 90, 42, 0.07);
}

.upload-slot .icon {
    width: 27px;
    height: 27px;
    color: var(--orange);
}

.upload-slot b {
    font-size: 13px;
}

.upload-slot span {
    color: var(--muted-dark);
    font-size: 10px;
    line-height: 1.35;
}

.upload-slot.has-media {
    display: block;
    min-height: 0;
    padding: 0;
    border-style: solid;
    border-color: rgba(23, 26, 23, 0.16);
    background: #101310;
    overflow: hidden;
}

.upload-slot.has-media img,
.upload-slot.has-media video {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    background: #000;
}

.media-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    font-size: 10px;
}

.media-overlay button {
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

.upload-progress {
    height: 5px;
    width: 100%;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--paper-3);
    overflow: hidden;
}

.upload-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--orange);
    transition: width 0.2s linear;
}

.slot-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border: 1px dashed rgba(23, 26, 23, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
}

.slot-card.has-media {
    border-style: solid;
    border-color: rgba(61, 122, 92, 0.4);
    background: rgba(61, 122, 92, 0.06);
}

.slot-thumb {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--paper-3);
    color: var(--muted-dark);
    overflow: hidden;
    position: relative;
}

.slot-thumb img,
.slot-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slot-thumb .icon {
    width: 22px;
    height: 22px;
}

.slot-main {
    flex: 1;
    min-width: 0;
}

.slot-main b {
    display: block;
    font-size: 12px;
    line-height: 1.15;
}

.slot-main span {
    display: block;
    margin-top: 2px;
    color: var(--muted-dark);
    font-size: 9.5px;
}

.slot-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.slot-action {
    padding: 4px 7px;
    border: 0;
    border-radius: 5px;
    background: var(--ink);
    color: var(--paper);
    font-size: 9px;
    font-weight: 700;
}

.slot-action.is-ghost {
    background: transparent;
    color: var(--muted-dark);
    border: 1px solid var(--line-dark);
}

.slot-card .field {
    margin-top: 5px;
}

.slot-card .field select {
    padding: 7px 8px;
    border-color: var(--line-dark);
    background: rgba(255, 255, 255, 0.4);
    color: var(--ink);
    font-size: 11px;
}

.slot-card .field label {
    color: var(--muted-dark);
    font-size: 9px;
}

.note-field textarea {
    min-height: 92px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.35);
    border-color: var(--line-dark);
    color: var(--ink);
}

.note-field textarea::placeholder {
    color: var(--muted-dark);
}

.note-field label {
    color: var(--muted-dark);
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}

.media-gallery .media-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #101310;
    aspect-ratio: 1;
}

.media-gallery img,
.media-gallery video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-gallery .media-tag {
    position: absolute;
    left: 5px;
    bottom: 5px;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.joker-done-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(244, 197, 66, 0.28);
    border: 1px solid rgba(183, 139, 19, 0.35);
}

.joker-done-card .icon {
    width: 22px;
    height: 22px;
    color: #7b5a00;
    margin-top: 1px;
}

.joker-done-card b {
    display: block;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    color: #5f4600;
}

.joker-done-card p {
    margin-top: 4px;
    color: #6a5108;
    font-size: 11px;
}

.task-tip {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(239, 90, 42, 0.08);
    border: 1px solid rgba(239, 90, 42, 0.16);
    color: #8f3a1d;
    font-size: 11px;
    line-height: 1.4;
}

.task-tip .icon {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    color: var(--orange);
}

/* KM */

.km-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.km-form .field input {
    background: rgba(255, 255, 255, 0.4);
    border-color: var(--line-dark);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.km-form .field label {
    color: var(--muted-dark);
}

.km-result {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 13px;
    border-radius: 12px;
    background: rgba(61, 122, 92, 0.09);
    border: 1px solid rgba(61, 122, 92, 0.18);
}

.km-result span {
    color: var(--muted-dark);
    font-size: 10px;
    font-weight: 600;
}

.km-result b {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    color: var(--green);
}

.km-result b small {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted-dark);
}

.km-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.km-actions .btn {
    flex: 1;
}

/* GPS */

.gps-panel {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line-dark);
    background: rgba(255, 255, 255, 0.25);
}

.gps-panel.is-ok {
    border-color: rgba(61, 122, 92, 0.35);
    background: rgba(61, 122, 92, 0.08);
}

.gps-panel.is-error {
    border-color: rgba(207, 64, 51, 0.3);
    background: rgba(207, 64, 51, 0.06);
}

.gps-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.gps-status .icon {
    width: 20px;
    height: 20px;
    color: var(--orange);
    margin-top: 1px;
}

.gps-status.is-ok .icon {
    color: var(--green);
}

.gps-status.is-error .icon {
    color: var(--red);
}

.gps-status b {
    display: block;
    font-size: 13px;
    line-height: 1.2;
}

.gps-status span {
    display: block;
    margin-top: 2px;
    color: var(--muted-dark);
    font-size: 10.5px;
    line-height: 1.4;
}

.gps-distance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px dashed var(--line-dark);
}

.gps-distance span {
    color: var(--muted-dark);
    font-size: 10px;
}

.gps-distance b {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
}

.gps-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    color: var(--muted-dark);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.gps-link .icon {
    width: 14px;
    height: 14px;
}

/* Modal */

.modal-root {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(4, 6, 4, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
}

.modal-card {
    width: 100%;
    max-width: 380px;
    padding: 22px;
    border-radius: 22px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
    animation: modal-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

@keyframes modal-in {
    from {
        transform: translateY(12px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-dark);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
}

.modal-close .icon {
    width: 16px;
    height: 16px;
}

.modal-stamp {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border: 2px solid var(--green);
    border-radius: 50%;
    color: var(--green);
    transform: rotate(-8deg);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    line-height: 0.95;
}

.modal-stamp.is-yellow {
    border-color: #a77c0c;
    color: #7b5a00;
}

.modal-stamp .icon {
    width: 28px;
    height: 28px;
}

.modal-card .kicker {
    margin-bottom: 4px;
}

.modal-card h2 {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.modal-card p {
    margin-top: 9px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.45;
}

.modal-task {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 13px;
    padding: 10px 11px;
    border-radius: 10px;
    background: rgba(244, 197, 66, 0.26);
    font-size: 11px;
    font-weight: 600;
    color: #6d5100;
}

.modal-task .icon {
    width: 16px;
    height: 16px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

.modal-code {
    margin: 12px 0;
    padding: 13px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--yellow);
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-align: center;
    line-height: 1;
}

/* Quiz */

.quiz-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 50% 0%, rgba(244, 197, 66, 0.1), transparent 40%),
        var(--asphalt);
    animation: quiz-in 0.22s ease;
    overflow: hidden;
}

@keyframes quiz-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.quiz-shell {
    width: 100%;
    max-width: 560px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: calc(var(--safe-top) + 15px) 18px calc(var(--safe-bottom) + 16px);
}

.quiz-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.quiz-kicker {
    flex: 1;
    color: var(--orange-soft);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.quiz-timer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--yellow);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.quiz-timer.is-low {
    background: var(--red);
    color: #fff;
    animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
    50% {
        opacity: 0.62;
    }
}

.quiz-close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--paper);
}

.quiz-close .icon {
    width: 17px;
    height: 17px;
}

.quiz-progress {
    display: flex;
    gap: 5px;
    margin: 14px 0;
    flex: 0 0 auto;
}

.quiz-progress i {
    height: 4px;
    flex: 1;
    border-radius: 999px;
    background: rgba(242, 236, 222, 0.14);
}

.quiz-progress i.is-answered {
    background: var(--yellow);
}

.quiz-progress i.is-current {
    background: var(--orange);
}

.quiz-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 0;
}

.quiz-card {
    padding: 19px;
    border-radius: 22px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.quiz-qnum {
    display: block;
    color: var(--muted-dark);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.quiz-question {
    margin: 7px 0 16px;
    font-family: var(--font-display);
    font-size: 29px;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0.005em;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line-dark);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.28);
    color: var(--ink);
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.quiz-option.is-selected {
    border-color: var(--orange);
    background: rgba(239, 90, 42, 0.13);
}

.quiz-option-letter {
    width: 25px;
    height: 25px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(23, 26, 23, 0.08);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
}

.quiz-option.is-selected .quiz-option-letter {
    background: var(--orange);
    color: var(--ink);
}

.quiz-nav {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex: 0 0 auto;
}

.quiz-nav .btn {
    flex: 1;
}

.quiz-hint {
    margin-top: 9px;
    text-align: center;
    color: var(--muted);
    font-size: 10px;
}

.quiz-result {
    margin: auto;
    width: 100%;
    padding: 24px;
    border-radius: 24px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
    text-align: center;
}

.quiz-result .modal-stamp {
    margin: 0 auto 16px;
}

.quiz-result h2 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 800;
    line-height: 0.9;
    text-transform: uppercase;
}

.quiz-result p {
    margin-top: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.45;
}

.quiz-result .joker-result {
    margin: 15px 0;
    padding: 11px;
    border-radius: 11px;
    background: rgba(244, 197, 66, 0.3);
    color: #6d5100;
    font-size: 11.5px;
    font-weight: 600;
}

.quiz-result .btn {
    margin-top: 6px;
    width: 100%;
}

/* Toasts */

.toast-root {
    position: fixed;
    left: 50%;
    bottom: calc(var(--safe-bottom) + 82px);
    z-index: 120;
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 430px);
    display: flex;
    flex-direction: column;
    gap: 7px;
    pointer-events: none;
}

body.is-onboarding .toast-root {
    bottom: calc(var(--safe-bottom) + 22px);
}

body.is-preview .toast-root {
    bottom: calc(50% - min(50dvh, 430px) + 82px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    font-size: 12px;
    line-height: 1.35;
    animation: toast-in 0.2s ease;
}

.toast .icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: var(--green);
    margin-top: 1px;
}

.toast.is-error .icon {
    color: var(--red);
}

.toast.is-info .icon {
    color: var(--orange);
}

@keyframes toast-in {
    from {
        transform: translateY(8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Offline banner */

.sync-banner {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 11px;
    background: rgba(207, 64, 51, 0.12);
    border: 1px solid rgba(207, 64, 51, 0.28);
    color: #f2b2ab;
    font-size: 10.5px;
    line-height: 1.3;
}

.sync-banner .icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.sync-banner button {
    margin-left: auto;
    padding: 3px 6px;
    border: 0;
    border-radius: 4px;
    background: rgba(242, 236, 222, 0.1);
    color: var(--paper);
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

/* Small screens */

@media (max-width: 360px) {
    .main {
        padding-left: 13px;
        padding-right: 13px;
    }

    .topbar {
        padding-left: 14px;
        padding-right: 14px;
    }

    .gauge-wrap {
        width: 150px;
    }

    .hero-points b {
        font-size: 43px;
    }

    .hero-stats b {
        font-size: 19px;
    }

    .dest-countdown b {
        font-size: 21px;
    }

    .bingo-label {
        font-size: 11.5px;
    }

    .lb-points b {
        font-size: 23px;
    }

    .quiz-question {
        font-size: 25px;
    }
}

@media (max-height: 700px) {
    .onboarding-hero {
        padding-top: 28px;
    }

    .route-art {
        margin-top: 8px;
        margin-bottom: 2px;
    }

    .onboarding-form-wrap {
        padding-top: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
