:root {
    color-scheme: light;
    --ink: #061426;
    --muted: #5d6978;
    --line: #bfd0d8;
    --blue: #08bce8;
    --pink: #f32f9a;
    --orange: #f26403;
    --green: #39ff14;
    --gold: #ffe45e;
    --paper: #f7fbf8;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        repeating-linear-gradient(112deg, rgba(6, 20, 38, 0.05) 0 0.08rem, transparent 0.08rem 0.34rem),
        radial-gradient(circle at 18% 45%, rgba(8, 188, 232, 0.2), transparent 18rem),
        radial-gradient(circle at 76% 30%, rgba(243, 47, 154, 0.16), transparent 18rem),
        radial-gradient(circle at 42% 78%, rgba(57, 255, 20, 0.13), transparent 16rem),
        linear-gradient(120deg, #ffffff, #f7fffb);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
.secondary-button {
    border: 0;
    background: var(--orange);
    color: white;
    font-weight: 950;
    padding: 0.8rem 1.1rem;
    cursor: pointer;
    box-shadow: 0 0.6rem 1.2rem rgba(243, 47, 154, 0.22);
}

.secondary-button {
    background: white;
    border: 1px solid var(--line);
    color: var(--ink);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

input,
select {
    width: 100%;
    border: 2px solid rgba(6, 20, 38, 0.12);
    background: white;
    color: var(--ink);
    padding: 0.85rem 0.95rem;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 0.22rem rgba(243, 47, 154, 0.16);
}

@keyframes noticeAutoDismiss {
    0%,
    75% {
        opacity: 1;
        transform: translateY(0);
        max-height: 9rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    100% {
        opacity: 0;
        transform: translateY(-0.4rem);
        max-height: 0;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
        overflow: hidden;
    }
}

label {
    display: grid;
    gap: 0.35rem;
    color: #26364b;
    font-weight: 900;
}

.app-shell {
    min-height: 100vh;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem clamp(1rem, 4vw, 3rem);
    background: linear-gradient(180deg, #e62a96 0%, #bd0f6a 100%);
    border-bottom: 0.22rem solid var(--ink);
    backdrop-filter: blur(12px);
    box-shadow: 0 0.65rem 1.25rem rgba(6, 20, 38, 0.28);
    position: relative;
    z-index: 5;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #ffffff;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.brand-mark {
    width: 3.65rem;
    height: 3.65rem;
    flex: 0 0 3.65rem;
    display: grid;
    place-items: center;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 0.22rem 0.28rem rgba(6, 20, 38, 0.45));
}

.brand-wordmark {
    width: clamp(12.5rem, 22vw, 18.5rem);
    max-width: 48vw;
    height: auto;
    display: block;
    filter:
        brightness(0) invert(1)
        drop-shadow(0.12rem 0.14rem 0 rgba(6, 20, 38, 0.38));
}

.brand-dotcom {
    margin-left: -0.25rem;
    color: #ffffff;
    font-size: clamp(1rem, 1.7vw, 1.45rem);
    font-style: italic;
    font-weight: 950;
    letter-spacing: 0;
    text-shadow: 0.1rem 0.12rem 0 rgba(6, 20, 38, 0.38);
    transform: skewX(-10deg);
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-header nav a {
    color: #ffffff;
    font-weight: 850;
    padding: 0.5rem 0.95rem;
    border: 0.12rem solid rgba(255, 255, 255, 0.55);
    border-radius: 999rem;
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        0 0.3rem 0.55rem rgba(6, 20, 38, 0.22);
}

.site-header nav a:hover {
    background: rgba(255, 255, 255, 0.24);
}

.site-header nav a.active {
    color: var(--ink);
    background: #ffffff;
    border-color: #ffffff;
    box-shadow:
        inset 0 -0.12rem 0 rgba(6, 20, 38, 0.08),
        0 0.35rem 0.7rem rgba(6, 20, 38, 0.28);
}

.site-header nav a.active:hover {
    background: #ffffff;
}

.site-header nav .owner-link {
    width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
    font-size: 1.25rem;
    line-height: 1;
}

main {
    min-height: calc(100vh - 4rem);
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--pink);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.portal-kicker {
    margin: 0 0 0.75rem;
    color: var(--pink);
    font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
    font-size: clamp(1rem, 2vw, 1.45rem);
    font-weight: 950;
    letter-spacing: 0.04em;
    line-height: 1;
    text-shadow: 0.08em 0.08em 0 rgba(255, 255, 255, 0.9);
}

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

.kid-portal {
    min-height: calc(100vh - 4rem);
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    overflow: hidden;
}

.portal-stage {
    position: relative;
    width: min(100%, 74rem);
    min-height: 35rem;
    display: grid;
    grid-template-columns: minmax(17rem, 0.9fr) minmax(20rem, 1.1fr);
    align-items: start;
    gap: clamp(1rem, 4vw, 3rem);
}

.portal-stage::before {
    content: "06";
    position: absolute;
    right: -1.5rem;
    bottom: -2rem;
    color: rgba(6, 20, 38, 0.045);
    font: 950 18rem/1 Georgia, "Times New Roman", serif;
}

.mascot-panel,
.portal-card {
    position: relative;
    z-index: 1;
}

.mascot-panel {
    align-self: start;
    min-height: 32rem;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.mascot-panel::after {
    content: "";
    position: absolute;
    width: min(78%, 22rem);
    height: min(78%, 22rem);
    border-radius: 50%;
    background: rgba(6, 20, 38, 0.34);
    filter: blur(1.15rem);
    transform: translate(0.65rem, 1.15rem);
    z-index: 0;
}

.burst {
    position: absolute;
    width: 24.5rem;
    height: 24.5rem;
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 0 59%, rgba(57, 255, 20, 0.95) 60% 66%, transparent 67%),
        conic-gradient(from 210deg, var(--pink), var(--orange), var(--green), var(--blue), var(--pink));
    filter: saturate(1.18);
    opacity: 0.95;
    z-index: 1;
}

.burst::after {
    content: "";
    position: absolute;
    inset: 1rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #061426 0 62%, rgba(57, 255, 20, 0.8) 63% 66%, #061426 67% 100%);
}

.hero-mascot {
    position: relative;
    width: min(88%, 25rem);
    filter:
        drop-shadow(0 1.25rem 1.25rem rgba(6, 20, 38, 0.34))
        drop-shadow(0 0.2rem 0.08rem rgba(6, 20, 38, 0.35));
    z-index: 2;
}

.portal-card {
    align-self: start;
    width: min(100%, 33rem);
    margin-right: clamp(1rem, 4vw, 3rem);
    padding: clamp(1.25rem, 4vw, 2.4rem);
}

.portal-title {
    margin: 0;
    display: grid;
    gap: 0.14em;
    color: var(--ink);
    font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
    font-size: clamp(3.3rem, 8.2vw, 6.4rem);
    font-style: italic;
    font-weight: 950;
    line-height: 0.82;
    letter-spacing: 0;
    text-transform: uppercase;
    transform: skewX(-8deg);
    text-shadow:
        0.06em 0.055em 0 rgba(255, 255, 255, 0.92),
        0.095em 0.09em 0 rgba(6, 20, 38, 0.12);
}

.portal-title span {
    display: block;
}

.portal-title span:first-child {
    translate: -0.075em 0;
}

.portal-copy {
    margin: 1rem 0 0;
    color: #33445a;
    font-size: 1.1rem;
    font-weight: 800;
}

.lookup-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.lookup-row,
.inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
}

.notice {
    position: relative;
    margin-top: 1rem;
    padding: 0.85rem 3rem 0.85rem 1rem;
    background: #fff9e8;
    border: 1px solid #ead58f;
    color: #513b03;
    font-weight: 850;
    animation: noticeAutoDismiss 5s ease forwards;
    overflow: hidden;
}

.notice-danger {
    background: #ffecec;
    border-color: #e2aaa9;
    color: #7b1515;
}

.notice:hover,
.notice:focus-within {
    animation-play-state: paused;
}

.notice.notice-dismissed {
    animation: noticeAutoDismiss 0.18s ease forwards;
}

.notice-close {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: currentColor;
    box-shadow: none;
    font-size: 1.25rem;
    line-height: 1;
}

.notice-close:hover,
.notice-close:focus {
    background: rgba(6, 20, 38, 0.08);
    outline: 2px solid rgba(6, 20, 38, 0.16);
}

.balance-ticket,
.selected-balance {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.18rem;
    padding: 1.1rem;
    background:
        linear-gradient(135deg, rgba(8, 188, 232, 0.2), rgba(243, 47, 154, 0.16)),
        #061426;
    color: white;
    border: 0.18rem solid white;
    box-shadow: 0 0 0 0.16rem #061426;
}

.ticket-label,
.selected-balance span {
    color: #b9f5ff;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.balance-ticket strong,
.selected-balance strong {
    font-size: clamp(4rem, 16vw, 8rem);
    line-height: 0.85;
    color: var(--gold);
    text-shadow: 0.12rem 0.12rem 0 var(--pink);
}

.admin-card .selected-balance strong {
    font-size: clamp(2.3rem, 6vw, 4rem);
    line-height: 0.95;
}

.ticket-unit {
    color: white;
    font-size: 1.6rem;
    font-weight: 950;
    text-transform: uppercase;
}

.balance-ticket small,
.selected-balance small {
    color: #d9ffe8;
    font-weight: 900;
}

.admin-login {
    min-height: calc(100vh - 4rem);
    display: grid;
    place-items: center;
    padding: clamp(2rem, 7vw, 5rem) 1rem;
}

.admin-card {
    width: min(100%, 34rem);
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86)),
        repeating-linear-gradient(112deg, rgba(6, 20, 38, 0.04) 0 0.06rem, transparent 0.06rem 0.28rem);
    border: 0.1rem solid rgba(6, 20, 38, 0.16);
    box-shadow:
        0 1.25rem 2.5rem rgba(6, 20, 38, 0.13),
        0 0.45rem 0 rgba(243, 47, 154, 0.1);
    padding: clamp(1.6rem, 5vw, 2.45rem);
}

.admin-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 0.35rem;
    background: linear-gradient(90deg, var(--pink), var(--orange), var(--gold), var(--green));
}

.admin-card > * {
    position: relative;
    z-index: 1;
}

.admin-login-card {
    width: min(100%, 39rem);
    padding: clamp(2rem, 5vw, 2.8rem) clamp(1.75rem, 6vw, 3rem) clamp(1.8rem, 5vw, 2.5rem);
}

.admin-card-mark {
    position: absolute;
    right: -3.5rem;
    bottom: -4.5rem;
    width: 16rem;
    height: 16rem;
    background: url("/assets/warbucks-mascot-vector.svg") center / contain no-repeat;
    opacity: 0.075;
    filter: grayscale(1);
    transform: rotate(-8deg);
}

.admin-title {
    margin: 0;
    color: var(--ink);
    font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
    font-size: clamp(2.6rem, 6vw, 4.3rem);
    font-style: italic;
    font-weight: 950;
    line-height: 0.9;
    letter-spacing: 0;
    text-transform: uppercase;
    text-shadow:
        0.045em 0.04em 0 rgba(255, 255, 255, 0.95),
        0.08em 0.075em 0 rgba(6, 20, 38, 0.12);
}

.admin-login-card .admin-title {
    font-size: clamp(2.35rem, 5.6vw, 3.9rem);
    line-height: 1.02;
    margin-bottom: 0.35rem;
}

.admin-kicker {
    margin-bottom: 0.75rem;
}

.god-header .admin-title {
    margin-bottom: 0.7rem;
}

.god-subtitle {
    margin: 0;
}

h1,
h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

h2 {
    color: var(--ink);
    font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
    font-size: 1.65rem;
    font-style: italic;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.admin-page {
    width: min(100%, 78rem);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) 1rem 4rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
    border-bottom: 0.14rem solid rgba(6, 20, 38, 0.12);
}

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

.admin-actions form {
    margin: 0;
}

.voucher-print-menu {
    position: relative;
}

.voucher-print-menu summary {
    list-style: none;
}

.voucher-print-menu summary::-webkit-details-marker {
    display: none;
}

.voucher-print-menu summary::after {
    content: "▾";
    margin-left: 0.55rem;
    font-size: 0.9em;
}

.voucher-print-menu[open] summary {
    border-color: var(--ink);
    box-shadow: 0 0.45rem 1rem rgba(6, 20, 38, 0.12);
}

.voucher-print-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 20;
    display: grid;
    min-width: 13rem;
    padding: 0.35rem;
    border: 2px solid var(--ink);
    background: white;
    box-shadow:
        0.28rem 0.28rem 0 rgba(6, 20, 38, 0.14),
        0 0.8rem 1.8rem rgba(6, 20, 38, 0.12);
}

.voucher-print-options a {
    color: var(--ink);
    font-weight: 950;
    padding: 0.75rem 0.85rem;
    text-decoration: none;
}

.voucher-print-options a:hover,
.voucher-print-options a:focus {
    background: rgba(243, 47, 154, 0.1);
    outline: none;
}

.text-center {
    text-align: center;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 0.85fr) minmax(20rem, 1.15fr);
    gap: 1.1rem;
    align-items: stretch;
}

.admin-page .admin-card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.stack-form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.child-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
    min-height: 0;
    max-height: clamp(9rem, 32vh, 24rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.admin-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
    min-height: 0;
    max-height: 42rem;
    overflow-y: visible;
    padding-right: 0.25rem;
}

.admin-list:has(.admin-user-row:nth-child(4)) {
    max-height: clamp(28rem, 68vh, 42rem);
    overflow-y: auto;
}

.admin-user-row {
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.78);
    border: 0.1rem solid rgba(6, 20, 38, 0.1);
    box-shadow: 0 0.35rem 0.75rem rgba(6, 20, 38, 0.06);
}

.admin-user-row summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 900;
}

.admin-user-row summary span {
    color: var(--muted);
    font-size: 0.88rem;
}

.admin-user-row .stack-form {
    padding-top: 0.9rem;
}

.danger-zone {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 0.12rem solid rgba(6, 20, 38, 0.12);
}

.danger-zone summary {
    cursor: pointer;
    color: #a42b20;
    font-weight: 950;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--ink);
}

.checkbox-label input {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
}

.danger-button {
    background: #a42b20;
    box-shadow: 0 0.6rem 1.2rem rgba(164, 43, 32, 0.2);
}

.child-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    border: 0.1rem solid rgba(6, 20, 38, 0.1);
    text-decoration: none;
    font-weight: 900;
    box-shadow: 0 0.35rem 0.75rem rgba(6, 20, 38, 0.06);
}

.child-row.selected {
    border-color: var(--pink);
    background: linear-gradient(135deg, rgba(243, 47, 154, 0.14), rgba(8, 188, 232, 0.14)), white;
    box-shadow:
        0 0.45rem 1rem rgba(243, 47, 154, 0.14),
        inset 0.35rem 0 0 var(--pink);
}

.ledger-card {
    width: 100%;
    margin-top: 1.1rem;
}

.ledger-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.ledger-controls {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 0.55rem;
}

.ledger-controls label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink);
    font-size: 0.92rem;
}

.ledger-controls select {
    width: auto;
    min-width: 5.5rem;
    padding: 0.6rem 0.85rem;
}

.auto-dismiss-notice {
    overflow: hidden;
}

.ledger-reset-zone {
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
}

th,
td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--ink);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(8, 188, 232, 0.08);
}

.amount {
    font-weight: 900;
}

.positive {
    color: #0a6b41;
}

.negative {
    color: #a42b20;
}

@media (max-width: 820px) {
    .portal-stage {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 1rem;
    }

    .mascot-panel {
        min-height: 17rem;
    }

    .burst {
        display: none;
    }

    .hero-mascot {
        width: min(70%, 16rem);
        filter:
            drop-shadow(0 1rem 1rem rgba(6, 20, 38, 0.36))
            drop-shadow(0 0.16rem 0.08rem rgba(6, 20, 38, 0.32));
    }

    .mascot-panel::after {
        width: min(62%, 14rem);
        height: min(62%, 14rem);
        filter: blur(0.85rem);
        transform: translate(0.45rem, 0.85rem);
    }

    .portal-card {
        width: auto;
        margin: 0 1rem 1rem;
    }
}

@media (max-width: 760px) {
    .site-header,
    .admin-header,
    .lookup-row,
    .inline-form {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}
