@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

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

html,
body {
    margin: 0;
}

html {
    color-scheme: dark;
    background: #0b0d12;
}

body {
    font-family: Outfit, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

button,
input,
textarea {
    font: inherit;
}

button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    cursor: pointer;
}

summary {
    list-style: none;
    cursor: pointer;
}

summary::-webkit-details-marker {
    display: none;
}

details[open] .chevron,
.player-card.is-open .chevron {
    transform: rotate(180deg);
}

.player-card-toggle {
    background: transparent;
    border: 0;
    color: inherit;
}

.player-body {
    display: none;
}

.player-card.is-open .player-body {
    display: block;
}

.min-h-screen { min-height: 100vh; }
.min-h-11 { min-height: 2.75rem; }
.min-h-\[56px\] { min-height: 56px; }
.max-w-5xl { max-width: 64rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-11 { width: 2.75rem; }
.h-4 { height: 1rem; }
.h-10 { height: 2.5rem; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }

.block { display: block; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-4 { grid-column: span 4 / span 4; }

.gap-0\.5 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-3 { padding-top: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }

.rounded-lg { border-radius: 0.85rem; }
.rounded-xl { border-radius: 1.2rem; }
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-slate-700 { border-color: rgba(244, 232, 208, 0.12); }
.border-slate-700\/50 { border-color: rgba(244, 232, 208, 0.08); }
.border-amber-400 { border-color: #f6d78a; }
.border-red-900\/30 { border-color: rgba(127, 29, 29, 0.3); }
.border-red-700\/50 { border-color: rgba(185, 28, 28, 0.5); }
.border-red-800\/60 { border-color: rgba(153, 27, 27, 0.6); }
.border-emerald-700\/50 { border-color: rgba(4, 120, 87, 0.5); }
.border-amber-700\/50 { border-color: rgba(180, 83, 9, 0.5); }
.border-purple-700\/50 { border-color: rgba(126, 34, 206, 0.5); }

.bg-slate-900 { background-color: #10141c; }
.bg-slate-800 { background-color: #171c27; }
.bg-slate-700 { background-color: #262d3c; }
.bg-slate-900\/60 { background-color: rgba(12, 15, 22, 0.72); }
.bg-amber-500 { background-color: #f0c14b; }
.bg-red-600 { background-color: #dc2626; }
.bg-red-600\/80 { background-color: rgba(220, 38, 38, 0.8); }
.bg-red-600\/20 { background-color: rgba(220, 38, 38, 0.2); }
.bg-red-700\/80 { background-color: rgba(185, 28, 28, 0.8); }
.bg-red-900\/40 { background-color: rgba(127, 29, 29, 0.4); }
.bg-emerald-600\/80 { background-color: rgba(5, 150, 105, 0.8); }
.bg-emerald-600\/20 { background-color: rgba(5, 150, 105, 0.2); }
.bg-amber-600\/80 { background-color: rgba(217, 119, 6, 0.8); }
.bg-amber-600\/20 { background-color: rgba(217, 119, 6, 0.2); }
.bg-purple-600\/80 { background-color: rgba(147, 51, 234, 0.8); }
.bg-purple-600\/20 { background-color: rgba(147, 51, 234, 0.2); }

.hover\:bg-slate-600:hover { background-color: #343c4e; }
.hover\:bg-red-700:hover { background-color: #b91c1c; }
.hover\:bg-red-600:hover { background-color: #dc2626; }
.hover\:bg-amber-600:hover { background-color: #d9a63a; }
.hover\:bg-emerald-600:hover { background-color: #059669; }
.hover\:bg-purple-600:hover { background-color: #9333ea; }
.hover\:text-red-400:hover { color: #f87171; }

.active\:bg-slate-600:active { background-color: #343c4e; }
.active\:bg-red-700:active { background-color: #b91c1c; }
.active\:bg-amber-600:active { background-color: #d9a63a; }
.active\:bg-red-800:active { background-color: #991b1b; }
.active\:bg-red-600\/50:active { background-color: rgba(220, 38, 38, 0.5); }
.active\:bg-emerald-600\/50:active { background-color: rgba(5, 150, 105, 0.5); }
.active\:bg-amber-600\/50:active { background-color: rgba(217, 119, 6, 0.5); }
.active\:bg-purple-600\/50:active { background-color: rgba(147, 51, 234, 0.5); }

.text-white { color: #f7f4ee; }
.text-slate-100 { color: #f7f4ee; }
.text-slate-200 { color: #e6e0d4; }
.text-slate-300 { color: #cfc6b6; }
.text-slate-400 { color: #a8a093; }
.text-slate-500 { color: #81786c; }
.text-slate-950 { color: #1c160c; }
.text-amber-300 { color: #f6d78a; }
.text-amber-400 { color: #f3cc6b; }
.text-red-100 { color: #fee2e2; }
.text-red-400 { color: #f87171; }
.text-emerald-100 { color: #d1fae5; }
.text-emerald-400 { color: #34d399; }
.text-purple-100 { color: #f3e8ff; }
.text-purple-400 { color: #c084fc; }

.text-\[10px\] { font-size: 10px; line-height: 1.4; }
.text-\[11px\] { font-size: 11px; line-height: 1.4; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-tight { line-height: 1.25; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow-lg { box-shadow: 0 1px 0 rgba(255, 248, 235, 0.05) inset, 0 18px 40px rgba(0, 0, 0, 0.32); }
.opacity-80 { opacity: 0.8; }
.disabled\:opacity-40:disabled { opacity: 0.4; }
.resize-y { resize: vertical; }

.transition { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, opacity 150ms ease; }
.transition-transform { transition: transform 150ms ease; }

.focus\:outline-none:focus { outline: none; }
.focus\:border-amber-400:focus { border-color: #f0c14b; }

@media (min-width: 640px) {
    .sm\:p-4 { padding: 1rem; }
    .sm\:p-6 { padding: 1.5rem; }
    .sm\:px-4 { padding-left: 1rem; padding-right: 1rem; }
    .sm\:space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:text-xs { font-size: 0.75rem; line-height: 1rem; }
    .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
    .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sm\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.hidden { display: none !important; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.9rem;
    padding: 1.75rem 1rem 2rem;
    overflow: auto;
}

.admin-link {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    color: #81786c;
    font-size: 0.75rem;
    text-align: center;
    text-decoration: underline;
    padding: 0.25rem;
    cursor: pointer;
}

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 1rem;
    background: #10141c;
    border: 1px solid rgba(244, 232, 208, 0.1);
}
.admin-tab {
    flex: 1;
    min-height: 2.6rem;
    border-radius: 0.75rem;
    background: transparent;
    color: #cfc6b6;
    border: 0;
    font-weight: 600;
    cursor: pointer;
}
.admin-tab.is-on {
    background: #f0c14b;
    color: #1c160c;
    box-shadow: 0 8px 18px rgba(240, 193, 75, 0.18);
}

.admin-team {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
    background: rgba(12, 15, 22, 0.55);
    border: 1px solid rgba(244, 232, 208, 0.1);
    border-radius: 0.95rem;
}

.admin-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
}

.admin-dates div { min-width: 0; }

.admin-dates dt {
    font-size: 0.75rem;
    color: #81786c;
}

.admin-dates dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-quiet {
    background: #262d3c;
    border: 0;
    border-radius: 0.8rem;
    padding: 0.4rem 0.75rem;
    min-height: 2.25rem;
    font-size: 0.875rem;
    font-weight: 700;
}

.btn-quiet:hover {
    background: #343c4e;
}

.btn-quiet-delete {
    color: #ff2d2d;
}

.btn-quiet-edit {
    color: #22c55e;
}

.premium-active { color: #34d399; }
.premium-unpaid { color: #fcd34d; }
.premium-expired { color: #f87171; }
.legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    width: 100%;
    max-width: 28rem;
    margin: 0.25rem auto 0;
    font-size: 0.75rem;
}

.legal-links a {
    color: #a8a093;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.legal-links a.featured,
.legal-page a:not(.back-kasa) {
    color: #f3cc6b;
    font-weight: 700;
}

.legal-links a.featured {
    font-size: 0.875rem;
}

.legal-note {
    border: 1px solid rgba(240, 193, 75, 0.55);
    color: #f6d78a;
    border-radius: 0.9rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    background: rgba(240, 193, 75, 0.08);
}

.legal-page {
    text-align: left;
}

.legal-page h2 {
    margin: 1rem 0 0.35rem;
    font-size: 1rem;
    color: #f3cc6b;
}

.legal-page p,
.legal-page li {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.legal-page ul {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
}

a.back-kasa {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    margin-top: 0.75rem;
    padding: 0 1rem;
    text-decoration: none;
    background: #f0c14b;
    color: #1c160c;
    font-weight: 700;
    border-radius: 0.85rem;
}

@media (max-width: 640px) {
    .admin-dates { grid-template-columns: 1fr; }
}

.max-w-md { max-width: 28rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.gap-4 { gap: 1rem; }
.text-red-300 { color: #fca5a5; }

#syncStatus[data-kind="ok"] { color: #6ee7b7; }
#syncStatus[data-kind="saving"],
#syncStatus[data-kind="loading"] { color: #fcd34d; }
#syncStatus[data-kind="offline"],
#syncStatus[data-kind="local"] { color: #fca5a5; }

select,
input[type="number"] {
    font: inherit;
    color: inherit;
}

input::placeholder,
textarea::placeholder {
    color: #81786c;
}

.rule-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    background: rgba(12, 15, 22, 0.55);
    border: 1px solid rgba(244, 232, 208, 0.1);
    border-radius: 0.85rem;
}

.rule-row input[type="text"] {
    min-width: 10rem;
    flex: 1 1 10rem;
}

.rule-row button {
    min-height: 2.75rem;
    background: transparent;
    border: 0;
    padding: 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.rule-edit { color: #22c55e; }
.rule-delete { color: #ff2d2d; }

.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }

.rule-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
    background: rgba(12, 15, 22, 0.55);
    border: 1px solid rgba(244, 232, 208, 0.1);
    border-radius: 0.95rem;
}

.guide h2 {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #f3cc6b;
}

.guide h2:first-of-type {
    margin-top: 0;
    font-size: 1.05rem;
}

.guide p,
.guide li {
    margin: 0.25rem 0 0;
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.45;
}

.guide ul {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
}

.guide li + li { margin-top: 0.25rem; }

.guide strong {
    color: #f8fafc;
    font-weight: 700;
}

@media (max-width: 639px) {
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .quick-actions > button {
        width: 100%;
        min-height: 3.35rem;
        padding: 0.4rem 0.55rem;
    }

    .quick-actions > :not(button) {
        grid-column: 1 / -1;
    }
}

.to-top {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 30;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #f0c14b;
    color: #1c160c;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    align-items: center;
    justify-content: center;
}

.to-top.is-on {
    display: flex;
}

.pwd-field {
    position: relative;
    display: block;
}

.pwd-field input {
    padding-right: 2.75rem;
}

.pwd-eye {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: #a8a093;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.code-input {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.setup-code {
    font-family: ui-monospace, Consolas, monospace;
    letter-spacing: 0.08em;
    font-size: 1.05rem;
    color: #f3cc6b;
}

body.bg-slate-900 {
    background:
        radial-gradient(980px 460px at 50% -12%, rgba(240, 193, 75, 0.28), transparent 62%),
        radial-gradient(720px 480px at 100% 0%, rgba(90, 120, 170, 0.1), transparent 55%),
        #0b0d12;
    color: #f7f4ee;
}

.bg-slate-800.rounded-xl.border {
    background:
        linear-gradient(180deg, rgba(255, 248, 235, 0.035), transparent 42%),
        #171c27;
}

.brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.brand-lockup.is-left {
    justify-content: flex-start;
    min-width: 0;
    text-align: left;
}

.brand-lockup.is-left > div {
    min-width: 0;
}

.brand-mark {
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%,
            #f7f1e4 0 16%,
            #1c160c 16% 27%,
            #c43232 27% 44%,
            #f4efe4 44% 60%,
            #1d7a45 60% 78%,
            #141820 78% 100%);
    box-shadow:
        0 0 0 2px rgba(240, 193, 75, 0.7),
        0 8px 16px rgba(0, 0, 0, 0.35);
}

.brand-mark.sm {
    width: 2.15rem;
    height: 2.15rem;
}

.kasa-total {
    min-width: 6.4rem;
    padding: 0.4rem 0.7rem 0.45rem;
    border-radius: 0.95rem;
    background: rgba(240, 193, 75, 0.1);
    border: 1px solid rgba(240, 193, 75, 0.28);
}

#appScreen > div > header,
#adminScreen > div > header {
    position: relative;
    overflow: hidden;
}

#appScreen > div > header::before,
#adminScreen > div > header::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #f0c14b 50%, transparent);
}

input:not([type="checkbox"]):focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(240, 193, 75, 0.2);
}

button.bg-amber-500 {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 18px rgba(240, 193, 75, 0.16);
}

[data-chip],
[data-event-button] {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-chip].bg-slate-900 {
    background-color: #232a39;
}

[data-chip].bg-amber-500 {
    box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.35), 0 8px 18px rgba(240, 193, 75, 0.2);
}

#loginScreen .bg-slate-700,
#adminGate .bg-slate-700 {
    background: transparent;
    border: 1px solid rgba(244, 232, 208, 0.18);
    color: #f7f4ee;
}

#loginScreen .bg-slate-700:hover,
#adminGate .bg-slate-700:hover {
    background: rgba(244, 232, 208, 0.06);
}

#kasaView .uppercase.tracking-wider,
.player-body .uppercase.tracking-wider {
    letter-spacing: 0.12em;
    font-size: 0.68rem;
}

select {
    background-color: #10141c;
}
