:root {
    --bg: #e8f0e9;
    --paper: rgba(255, 255, 255, 0.84);
    --paper-solid: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.09);
    --green: #047857;
    --green-dark: #065f46;
    --violet: #6d28d9;
    --blue: #2563eb;
    --red: #be123c;
    --amber: #b45309;
    --shadow: 0 22px 70px rgba(15, 23, 42, 0.13);
    --geo-panel-frame: url("/geoguess/assets/panel-frame.svg");
    --geo-panel-frame-dark: url("/geoguess/assets/dark-panel-frame.svg");
    --geo-button-frame: url("/geoguess/assets/button-frame.svg");
    --geo-button-frame-dark: url("/geoguess/assets/button-frame-dark.svg");
    --geo-route-lines: url("/geoguess/assets/route-lines.svg");
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 8% 0%, rgba(16, 185, 129, 0.18), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.12), transparent 30%),
        linear-gradient(180deg, #f7fbf7, var(--bg));
}

.home-page {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 12%, rgba(16, 185, 129, 0.2), transparent 28rem),
        radial-gradient(circle at 88% 0%, rgba(37, 99, 235, 0.13), transparent 24rem),
        linear-gradient(135deg, #f8fbf5 0%, #edf7ed 46%, #e8f0e9 100%);
}

a { color: inherit; }

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.75rem 0.9rem;
    color: var(--ink);
    background: #fff;
}

label {
    display: grid;
    gap: 0.45rem;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 700;
}

.shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 3rem) 0;
}

.home-page .shell {
    width: min(1120px, calc(100% - 2rem));
    padding-top: clamp(1.25rem, 5vw, 4rem);
}

.card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--paper);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.card::after,
.results-map-card::after,
.display-overlay::after,
.map-box::after,
.streetview-preview::after,
.full-streetview::after,
.qr-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    pointer-events: none;
    background: var(--geo-panel-frame) center / 100% 100% no-repeat;
    opacity: 0.5;
}

.dark-card::after,
.results-map-card::after,
.display-overlay::after,
.full-streetview::after {
    background-image: var(--geo-panel-frame-dark);
    opacity: 0.56;
}

.glass {
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.72));
}

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(1.4rem, 4vw, 3rem);
}

.home-page .hero::before {
    content: "";
    position: absolute;
    right: -1.5rem;
    top: 0.9rem;
    width: min(54%, 35rem);
    height: 15rem;
    background: var(--geo-route-lines) center / 100% 100% no-repeat;
    opacity: 0.72;
}

.home-page .hero > * {
    position: relative;
    z-index: 1;
}

.home-page .hero .hero-compass {
    position: absolute;
    top: clamp(0.75rem, 3vw, 1.75rem);
    right: clamp(0.85rem, 3vw, 2rem);
    z-index: 0;
    width: clamp(5.4rem, 13vw, 9.4rem);
    height: auto;
    opacity: 0.22;
    filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.14));
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: rgba(4, 120, 87, 0.76);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0.7rem;
    font-size: 5rem;
    line-height: 0.95;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0.75rem;
}

.lead {
    max-width: 680px;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.65;
}

.muted { color: var(--muted); }
.muted-light { color: #cbd5e1; }

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    gap: 0.9rem;
    margin-top: clamp(1.5rem, 4vw, 2.4rem);
}

.role-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 190px;
    align-content: space-between;
    overflow: hidden;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    color: inherit;
    text-decoration: none;
    isolation: isolate;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.92), rgba(248,250,252,0.78)),
        rgba(255,255,255,0.82);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.role-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    background: var(--geo-panel-frame) center / 100% 100% no-repeat;
    opacity: 0.38;
}

.role-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    right: -2rem;
    bottom: -2.5rem;
    width: 8rem;
    height: 8rem;
    border-radius: 999px;
    background: rgba(4, 120, 87, 0.1);
}

.role-card > * {
    position: relative;
    z-index: 3;
}

.role-icon {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 1;
    width: 3.6rem;
    aspect-ratio: 1;
    background: center / contain no-repeat;
    opacity: 0.94;
    filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.14));
}

.role-card.admin .role-icon { background-image: url("/geoguess/assets/icon-host.svg"); }
.role-card.display .role-icon { background-image: url("/geoguess/assets/icon-display.svg"); }
.role-card.student .role-icon { background-image: url("/geoguess/assets/icon-player.svg"); }

.role-card.admin { border-color: rgba(4, 120, 87, 0.22); }
.role-card.display { border-color: rgba(37, 99, 235, 0.22); }
.role-card.student { border-color: rgba(109, 40, 217, 0.22); }
.role-card.display::after { background: rgba(37, 99, 235, 0.1); }
.role-card.student::after { background: rgba(109, 40, 217, 0.1); }

.role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.role-card h2 {
    margin: 0.9rem 0 0.4rem;
    font-size: 1.45rem;
}

.role-card p {
    color: var(--muted);
    line-height: 1.55;
}

.role-badge,
.open-link,
.connection-pill,
.status-row span,
.list-pill {
    width: fit-content;
    border-radius: 999px;
    padding: 0.42rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.role-badge { background: #ecfdf5; color: var(--green-dark); }
.open-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    border: 2px solid rgba(15, 23, 42, 0.18);
    border-radius: 14px;
    color: #0f172a;
    background-color: #d1fae5;
    background-image:
        var(--geo-button-frame),
        linear-gradient(135deg, #dcfce7, #f8fafc);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    box-shadow: 3px 4px 0 rgba(15, 23, 42, 0.16);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.qr-card {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
    gap: clamp(1rem, 3vw, 1.6rem);
    margin-top: 1rem;
    overflow: hidden;
    padding: clamp(1rem, 3vw, 1.5rem);
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.85rem;
    min-width: 0;
}

.qr-item {
    position: relative;
    display: grid;
    min-width: 0;
    gap: 0.55rem;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: rgba(248, 250, 252, 0.88);
    padding: 0.8rem;
}

.qr-item strong,
.qr-item a {
    min-width: 0;
}

.qr-item img {
    display: block;
    width: min(100%, 142px);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #fff;
    padding: 0.45rem;
}

.qr-item a {
    color: #475569;
    font-size: 0.72rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.qr-item a:hover {
    color: var(--green-dark);
    text-decoration: underline;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 1rem;
    width: min(1800px, calc(100% - 1.2rem));
    min-height: 100vh;
    margin: 0 auto;
    padding: 0.6rem 0;
}

.main-panel {
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.15rem;
}

.panel-header h1 {
    margin: 0;
    font-size: 2.1rem;
    letter-spacing: 0;
}

.panel-header.compact { align-items: center; }

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: flex-end;
    gap: 0.55rem;
}

.duration-control {
    width: 92px;
}

.primary,
.secondary,
.danger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    overflow: hidden;
    border: 2px solid rgba(15, 23, 42, 0.2);
    border-radius: 14px;
    padding: 0.74rem 1.05rem;
    color: #0f172a;
    font-weight: 900;
    line-height: 1;
    background-color: #f8fafc;
    background-image:
        var(--geo-button-frame),
        linear-gradient(135deg, #ffffff, #e2e8f0);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    box-shadow: 3px 4px 0 rgba(15, 23, 42, 0.16);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.primary {
    color: #052e1b;
    background-color: #bbf7d0;
    background-image:
        var(--geo-button-frame),
        linear-gradient(135deg, #bbf7d0, #ecfdf5);
}

.primary:hover {
    background-color: #86efac;
    background-image:
        var(--geo-button-frame),
        linear-gradient(135deg, #86efac, #dcfce7);
}

.secondary {
    color: #172033;
    background-color: #f8fafc;
    background-image:
        var(--geo-button-frame),
        linear-gradient(135deg, #ffffff, #dbeafe);
}

.danger {
    color: #4c0519;
    background-color: #fecdd3;
    background-image:
        var(--geo-button-frame),
        linear-gradient(135deg, #ffe4e6, #fecdd3);
}

.dark-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    overflow: hidden;
    color: #fff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    background-color: rgba(15, 23, 42, 0.78);
    background-image:
        var(--geo-button-frame-dark),
        linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.78));
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.32);
}

.primary:hover,
.secondary:hover,
.danger:hover,
.dark-button:hover,
.open-link:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 6px 0 rgba(15, 23, 42, 0.14);
}

.primary:disabled:hover,
.secondary:disabled:hover,
.danger:disabled:hover {
    transform: none;
    box-shadow: 3px 4px 0 rgba(15, 23, 42, 0.16);
}

.primary:active,
.secondary:active,
.danger:active,
.dark-button:active,
.open-link:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 2px 0 rgba(15, 23, 42, 0.18);
}

.primary:focus-visible,
.secondary:focus-visible,
.danger:focus-visible,
.dark-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem;
}

.status-row span {
    background: #f1f5f9;
    color: #475569;
}

.status-row strong { color: #0f172a; }
.connection-pill.connected { color: #065f46; background: #d1fae5; }
.connection-pill.disconnected { color: #9f1239; background: #ffe4e6; }

.map-box {
    position: relative;
    background: #e2e8f0;
}

.map-large {
    height: min(68vh, 760px);
    min-height: 420px;
}

.helper {
    margin: 0;
    border-top: 1px solid var(--line);
    padding: 0.85rem 1.15rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.side-panel {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.side-panel .card {
    padding: 1rem;
}

.selected-card button {
    width: 100%;
}

.streetview-preview {
    position: relative;
    height: 240px;
    overflow: hidden;
    border-radius: 20px;
    background: #0f172a;
}

.empty-state {
    display: grid;
    place-items: center;
    color: #94a3b8;
    text-align: center;
    padding: 1rem;
}

.list-stack {
    display: grid;
    gap: 0.6rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fafc;
    padding: 0.75rem;
}

.list-item strong { display: block; }
.list-item small { color: var(--muted); }
.list-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; justify-content: end; }
.link-button { padding: 0; color: var(--green-dark); background: none; font-weight: 800; }
.link-button.danger-text { color: var(--red); }

.display-body {
    background: #020617;
}

.hidden { display: none !important; }

.display-waiting {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
}

.dark-card {
    color: #fff;
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(255,255,255,0.1);
}

.centered-card {
    max-width: 720px;
    padding: 2rem;
    text-align: center;
}

.round-display {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.full-streetview {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0f172a;
}

.display-overlay {
    position: absolute;
    z-index: 2;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    color: #fff;
    background: rgba(2, 6, 23, 0.72);
    box-shadow: 0 18px 50px rgba(0,0,0,0.26);
    backdrop-filter: blur(12px);
}

.display-overlay.left {
    left: 1rem;
    top: 1rem;
    padding: 0.75rem 1.1rem;
    font-size: 1.2rem;
}

.display-overlay.right {
    right: 1rem;
    top: 1rem;
    width: min(360px, calc(100% - 2rem));
    padding: 1rem;
}

.display-overlay h1 { font-size: 2rem; margin: 0; }

.results-display {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 1rem;
    min-height: 100vh;
    padding: 1rem;
}

.results-map-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 28px;
    background: #0f172a;
}

.results-map-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    color: #fff;
}

.results-map-card h1 { font-size: 2.1rem; margin: 0; }
.results-map { height: calc(100vh - 128px); min-height: 460px; }
.scoreboard { padding: 1rem; }

.join-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
}

.join-card {
    display: grid;
    gap: 1rem;
    width: min(440px, 100%);
    padding: 1.5rem;
}

.player-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.55fr);
}

.button-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.stat-list {
    display: grid;
    gap: 0.55rem;
}

.stat-list span {
    display: flex;
    justify-content: space-between;
    border-radius: 999px;
    background: #f1f5f9;
    padding: 0.65rem 0.8rem;
    color: #64748b;
}

.stat-list strong { color: var(--ink); }

.toast {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 50;
    max-width: min(520px, calc(100% - 2rem));
    transform: translateX(-50%);
    border-radius: 999px;
    padding: 0.8rem 1rem;
    color: #fff;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
}

.map-error {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    color: #be123c;
    text-align: center;
    background: #fff1f2;
}

@media (max-width: 980px) {
    .role-grid,
    .qr-card,
    .app-layout,
    .results-display {
        grid-template-columns: 1fr;
    }

    .qr-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-actions {
        justify-content: start;
    }

    .map-large {
        height: 62vh;
        min-height: 360px;
    }

    .results-map { height: 60vh; }
}

@media (max-width: 640px) {
    .shell { width: calc(100% - 1rem); }
    .hero { padding: 1rem; }
    h1 { font-size: 3rem; }
    .lead { font-size: 1rem; }
    .panel-header h1 { font-size: 1.65rem; }
    .role-grid { grid-template-columns: 1fr; }
    .role-card { min-height: 160px; }
    .qr-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
    .app-layout { width: calc(100% - 0.6rem); }
    .status-row { padding: 0.65rem; }
    .main-panel, .card, .results-map-card { border-radius: 20px; }
    .map-large { min-height: 330px; }
}

/* Calm arcade pass */
:root {
    --bg: #f5f2eb;
    --paper: #ffffff;
    --paper-solid: #ffffff;
    --ink: #17221e;
    --muted: #5c6a62;
    --line: rgba(23, 34, 30, 0.12);
    --green: #315f52;
    --green-dark: #25483f;
    --violet: #6f679a;
    --blue: #3d7c82;
    --red: #b84f48;
    --amber: #b9893f;
    --shadow: 0 12px 30px rgba(23, 34, 30, 0.08);
    --geo-panel-frame: none;
    --geo-panel-frame-dark: none;
    --geo-button-frame: none;
    --geo-button-frame-dark: none;
    --geo-route-lines: none;
}

body,
.home-page {
    color: var(--ink);
    background: var(--bg);
}

.home-page {
    overflow-x: hidden;
}

.card,
.role-card,
.qr-item,
.list-item,
.results-map-card {
    border-radius: 10px;
    border-color: var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
    backdrop-filter: none;
}

.card::after,
.results-map-card::after,
.display-overlay::after,
.map-box::after,
.streetview-preview::after,
.full-streetview::after,
.qr-item::after,
.role-card::before,
.role-card::after,
.home-page .hero::before {
    display: none;
}

.home-page .hero .hero-compass {
    display: none;
}

.shell,
.home-page .shell {
    width: min(1120px, calc(100% - 2rem));
    padding-top: clamp(1rem, 3vw, 2.5rem);
}

.hero {
    padding: clamp(1.25rem, 4vw, 2.4rem);
}

.eyebrow {
    color: var(--green);
    letter-spacing: 0.08em;
}

h1 {
    font-size: clamp(2.35rem, 6vw, 4rem);
    line-height: 1.02;
}

.lead {
    max-width: 620px;
    font-size: 1.05rem;
}

.role-grid {
    gap: 0.85rem;
}

.role-card {
    min-height: 170px;
    padding: 1rem;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.role-card:hover {
    transform: translateY(-2px);
    border-color: rgba(49, 95, 82, 0.26);
    box-shadow: 0 16px 36px rgba(23, 34, 30, 0.1);
}

.role-card h2 {
    margin-top: 0.75rem;
}

.role-icon {
    width: 3rem;
    opacity: 0.72;
    filter: none;
}

.role-badge,
.open-link,
.connection-pill,
.status-row span,
.list-pill {
    border-radius: 999px;
}

.role-badge {
    background: #edf3f0;
    color: var(--green-dark);
}

.open-link,
.primary,
.secondary,
.danger,
.dark-button {
    min-height: 2.4rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background-image: none;
    box-shadow: none;
    text-shadow: none;
    transition: background-color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.open-link {
    color: var(--green-dark);
    background-color: #edf3f0;
    border-color: rgba(49, 95, 82, 0.16);
}

.primary {
    color: #ffffff;
    background-color: var(--green);
}

.primary:hover {
    background-color: var(--green-dark);
}

.secondary {
    color: var(--ink);
    background-color: #f4f1ea;
    border-color: var(--line);
}

.danger {
    color: #ffffff;
    background-color: var(--red);
}

.dark-button {
    color: #ffffff;
    background-color: rgba(23, 34, 30, 0.88);
}

.primary:hover,
.secondary:hover,
.danger:hover,
.dark-button:hover,
.open-link:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

.primary:active,
.secondary:active,
.danger:active,
.dark-button:active,
.open-link:active {
    transform: translateY(0);
    box-shadow: none;
}

input {
    border-radius: 8px;
}

.qr-card {
    gap: 1rem;
}

.qr-item {
    box-shadow: none;
}

.qr-item img {
    border-radius: 8px;
}

.app-layout,
.results-display {
    gap: 0.8rem;
}

.panel-header {
    padding: 1rem;
}

.panel-header h1 {
    font-size: clamp(1.55rem, 3vw, 2rem);
}

.status-row {
    padding: 0.75rem 1rem;
}

.status-row span,
.stat-list span {
    background: #f4f1ea;
}

.map-box,
.streetview-preview,
.display-overlay,
.results-map-card {
    border-radius: 10px;
}

.display-overlay {
    background: rgba(23, 34, 30, 0.84);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: none;
}

.dark-card {
    background: rgba(23, 34, 30, 0.9);
}

.toast {
    border-radius: 8px;
}

@media (max-width: 640px) {
    .shell,
    .home-page .shell {
        width: calc(100% - 1rem);
    }

    h1 {
        font-size: 2.45rem;
    }

    .main-panel,
    .card,
    .results-map-card {
        border-radius: 10px;
    }
}

/* Scribble arcade pass */
:root {
    --bg: #f4dfb7;
    --paper: rgba(255, 249, 236, 0.94);
    --paper-solid: #fff9ec;
    --ink: #24322d;
    --muted: #5e685f;
    --line: #2e3c35;
    --green: #315f52;
    --green-dark: #25483f;
    --violet: #a99af0;
    --blue: #2f8ba0;
    --red: #d8554c;
    --amber: #c28743;
    --shadow: 6px 7px 0 rgba(46, 60, 53, 0.18), 0 20px 48px rgba(51, 37, 24, 0.16);
    --geo-panel-frame: url("/geoguess/assets/panel-frame.svg");
    --geo-panel-frame-dark: url("/geoguess/assets/dark-panel-frame.svg");
    --geo-button-frame: url("/geoguess/assets/button-frame.svg");
    --geo-button-frame-dark: url("/geoguess/assets/button-frame-dark.svg");
    --geo-route-lines: url("/geoguess/assets/route-lines.svg");
}

body,
.home-page {
    color: var(--ink);
    font-family: "Comic Sans MS", "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        linear-gradient(180deg, rgba(255, 250, 239, 0.9), rgba(244, 225, 187, 0.96)),
        repeating-linear-gradient(0deg, rgba(46, 60, 53, 0.04) 0 1px, transparent 1px 30px),
        #f4dfb7;
}

.card,
.role-card,
.qr-item,
.list-item,
.results-map-card {
    border: 2px solid var(--line);
    border-radius: 24px 18px 28px 20px;
    background:
        linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 247, 231, 0.92)),
        repeating-linear-gradient(0deg, rgba(60, 50, 38, 0.035) 0 1px, transparent 1px 28px);
    box-shadow: var(--shadow);
}

.card::after,
.results-map-card::after,
.display-overlay::after,
.map-box::after,
.streetview-preview::after,
.full-streetview::after,
.qr-item::after {
    display: block;
    background: var(--geo-panel-frame) center / 100% 100% no-repeat;
    opacity: 0.42;
}

.dark-card::after,
.results-map-card::after,
.display-overlay::after,
.full-streetview::after {
    background-image: var(--geo-panel-frame-dark);
    opacity: 0.48;
}

.home-page .hero::before {
    display: block;
    background: var(--geo-route-lines) center / 100% 100% no-repeat;
    opacity: 0.58;
}

.home-page .hero .hero-compass {
    display: block;
    opacity: 0.18;
    filter: drop-shadow(4px 5px 0 rgba(46, 60, 53, 0.14));
}

.hero {
    overflow: visible;
    transform: rotate(-0.15deg);
}

.eyebrow {
    color: var(--green);
    letter-spacing: 0.11em;
    font-weight: 900;
}

h1 {
    color: var(--ink);
    font-size: clamp(2.65rem, 6vw, 5rem);
    text-shadow: 3px 3px 0 #ffd974;
}

.lead,
.role-card p,
.muted {
    color: #4f5c54;
    font-weight: 700;
}

.role-grid {
    gap: 1rem;
}

.role-card {
    min-height: 190px;
    border-radius: 24px 18px 28px 20px;
    transform: rotate(-0.25deg);
}

.role-card:nth-child(even) {
    transform: rotate(0.35deg);
}

.role-card::before {
    display: block;
    background: var(--geo-panel-frame) center / 100% 100% no-repeat;
    opacity: 0.38;
}

.role-card::after {
    display: block;
    right: 1rem;
    bottom: 0.85rem;
    width: 70px;
    height: 24px;
    border: 1px solid rgba(130, 95, 50, 0.2);
    border-radius: 6px 9px 5px 8px;
    background:
        linear-gradient(110deg, rgba(255, 236, 166, 0.92), rgba(255, 207, 124, 0.82)),
        repeating-linear-gradient(90deg, transparent 0 7px, rgba(137, 101, 48, 0.1) 7px 8px);
    transform: rotate(-3deg);
}

.role-card:hover {
    transform: translateY(-4px) rotate(0deg);
    box-shadow: 8px 9px 0 rgba(46, 60, 53, 0.2), 0 26px 58px rgba(51, 37, 24, 0.2);
}

.role-icon {
    width: 3.7rem;
    opacity: 0.95;
    filter: drop-shadow(3px 4px 0 rgba(46, 60, 53, 0.12));
}

.role-badge,
.open-link,
.connection-pill,
.status-row span,
.list-pill {
    border: 2px dashed rgba(46, 60, 53, 0.24);
    border-radius: 18px 14px 20px 15px;
    background: rgba(255, 249, 236, 0.84);
    color: var(--green-dark);
}

.open-link,
.primary,
.secondary,
.danger,
.dark-button {
    border: 2px solid var(--line);
    border-radius: 18px 15px 20px 14px;
    background-image:
        var(--geo-button-frame),
        linear-gradient(180deg, #77c8bf, #2f7a6e);
    box-shadow: 0 5px 0 #24322d, 0 12px 20px rgba(31, 48, 41, 0.16);
    transform: rotate(-0.25deg);
    font-weight: 900;
}

.open-link,
.primary {
    color: #fffaf0;
    background-color: #315f52;
}

.secondary {
    color: #24322d;
    background-image:
        var(--geo-button-frame),
        linear-gradient(180deg, #fff9ec, #f2dfb7);
}

.danger {
    color: #fffaf0;
    background-image:
        var(--geo-button-frame),
        linear-gradient(180deg, #ef806f, #b94c42);
}

.dark-button {
    color: #fffaf0;
    background-image:
        var(--geo-button-frame-dark),
        linear-gradient(180deg, #33413b, #1f2c27);
}

.primary:hover,
.secondary:hover,
.danger:hover,
.dark-button:hover,
.open-link:hover {
    transform: translateY(-2px) rotate(0.2deg);
    box-shadow: 0 7px 0 #24322d, 0 16px 24px rgba(31, 48, 41, 0.2);
}

input {
    border: 2px solid rgba(46, 60, 53, 0.34);
    border-radius: 16px 13px 18px 14px;
    background: #fffdf7;
    box-shadow: 2px 3px 0 rgba(46, 60, 53, 0.14);
}

.panel-header h1 {
    text-shadow: 2px 2px 0 #ffd974;
}

.status-row span,
.stat-list span {
    background: #fff4d6;
}

.map-box,
.streetview-preview,
.display-overlay,
.results-map-card {
    border: 2px solid var(--line);
    border-radius: 24px 18px 28px 20px;
}

.map-box {
    box-shadow: inset 0 0 0 5px rgba(255, 249, 236, 0.38);
}

.display-body {
    background:
        linear-gradient(180deg, rgba(22, 39, 39, .9), rgba(42, 55, 40, .95)),
        #182b28;
}

.display-overlay {
    background:
        linear-gradient(180deg, rgba(31, 48, 43, 0.9), rgba(28, 43, 39, 0.82));
    box-shadow: 6px 7px 0 rgba(0, 0, 0, 0.28), 0 18px 45px rgba(0,0,0,0.28);
}

.dark-card {
    background:
        linear-gradient(180deg, rgba(31, 48, 43, 0.9), rgba(28, 43, 39, 0.82));
}

.toast {
    border: 2px solid var(--line);
    border-radius: 18px 14px 20px 15px;
    box-shadow: 0 5px 0 rgba(46, 60, 53, 0.45);
}

@media (max-width: 640px) {
    h1 {
        font-size: 3rem;
    }

    .role-card,
    .main-panel,
    .card,
    .results-map-card {
        border-radius: 20px 16px 22px 17px;
    }
}
