@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/jetbrains-mono-500.woff2") format("woff2");
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/jetbrains-mono-600.woff2") format("woff2");
}

:root {
    --bg-light: #ffffff;
    --text-light: #2d3748;
    --muted-light: #64748b;
    --shadow-light-1: #ffffff;
    --shadow-light-2: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.035);
    --bg-dark: #202124;
    --text-dark: #e8eaed;
    --muted-dark: #9aa0a6;
    --shadow-dark-1: #303236;
    --shadow-dark-2: #101112;
    --border-dark: rgba(232, 234, 237, 0.1);
    --transition-speed: 0.35s;
    --green: #1f8f4e;
    --green-paused: #5d6d64;
    --danger: #d1242f;
    --danger-dark: #ff8b8b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: Inter, "Segoe UI", sans-serif;
    overflow-x: hidden;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.mono {
    font-family: "JetBrains Mono", Consolas, monospace;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "zero" 0;
}

body.theme-light {
    background: #ffffff;
    color: var(--text-light);
}
body.theme-dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

body.theme-light .neo-box {
    background: #ffffff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.055), 0 3px 12px rgba(0, 0, 0, 0.025), 0 0 0 1px rgba(0, 0, 0, 0.03);
}
body.theme-light .neo-box-sm {
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.025), 0 0 0 1px rgba(0, 0, 0, 0.03);
}
body.theme-light .neo-box-inset {
    background: #ffffff;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04), inset 0 0 0 1px rgba(0, 0, 0, 0.035);
}
body.theme-light .neo-button:active:not(:disabled) {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

body.theme-dark .neo-box {
    background: var(--bg-dark);
    box-shadow: 6px 6px 12px var(--shadow-dark-2), -6px -6px 12px var(--shadow-dark-1);
}
body.theme-dark .neo-box-sm {
    background: var(--bg-dark);
    box-shadow: 3px 3px 7px var(--shadow-dark-2), -3px -3px 7px var(--shadow-dark-1);
}
body.theme-dark .neo-box-inset {
    background: var(--bg-dark);
    box-shadow: inset 4px 4px 8px var(--shadow-dark-2), inset -4px -4px 8px var(--shadow-dark-1);
}
body.theme-dark .neo-button:active:not(:disabled) {
    box-shadow: inset 3px 3px 6px var(--shadow-dark-2), inset -3px -3px 6px var(--shadow-dark-1);
}

.neo-button {
    border: none;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 14px;
    font-weight: 600;
    user-select: none;
    color: inherit;
    font-family: inherit;
}
.neo-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.neo-input {
    border: none;
    outline: none;
    border-radius: 14px;
    padding: 12px 16px;
    width: 100%;
    background: transparent;
    color: inherit;
    font: inherit;
    transition: all 0.2s ease;
}
textarea.neo-input { resize: vertical; min-height: 64px; }
#person-name[readonly] { cursor: text; }
.wish-textarea-wrap { position: relative; width: 100%; }
#person-wish { display: block; resize: none; height: 120px; min-height: 120px; padding: 10px 14px 22px; line-height: 1.4; }
.wish-counter {
    position: absolute;
    right: 12px;
    bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted-light);
    opacity: 0.85;
    pointer-events: none;
    user-select: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}
body.theme-dark .wish-counter { color: var(--muted-dark); }
.wish-counter.near-limit { color: #d97706; opacity: 1; font-weight: 600; }
body.theme-dark .wish-counter.near-limit { color: #fbbf24; }
.wish-counter.at-limit { color: var(--danger); opacity: 1; font-weight: 600; }
body.theme-dark .wish-counter.at-limit { color: var(--danger-dark); }

[hidden] { display: none !important; }

.wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 72px;
}

body.on-wish .wrap,
body.on-admin-login .wrap,
html.admin-open .wrap {
    padding: 12px 0 12px;
}

body.has-timer .wrap { padding-top: 72px; }
body.has-timer .actions { display: none; }

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

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand h1 {
    margin: 0;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    letter-spacing: -0.03em;
    font-weight: 700;
}

.live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
    animation: subtlePulse 1.8s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% { opacity: 0.35; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.08); }
}

.icon-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.icon-button svg { width: 20px; height: 20px; }

.progress {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
}

.stat {
    border-radius: 18px;
    padding: 16px 18px 14px;
    min-width: 0;
}
.eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.6;
}
.stat strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.global-hash {
    grid-column: 1 / -1;
    border-radius: 18px;
    padding: 10px 14px 12px;
    min-width: 0;
}
.global-hash strong {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
}

body.on-wish .top,
body.on-admin-login .top { display: none; }

html.admin-open .top,
html.admin-open #view-home { display: none !important; }

.actions { margin: 22px 0 8px; }

.cta { padding: 14px 22px; font-size: 0.95rem; }

.muted { color: var(--muted-light); }
body.theme-dark .muted { color: var(--muted-dark); }
.center { text-align: center; }

.home-note {
    margin: 8px 0 0;
    color: var(--danger);
    font-weight: 600;
}
body.theme-dark .home-note { color: var(--danger-dark); }

.files {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    margin-top: 18px;
}

.file-card {
    position: relative;
    border-radius: 22px;
    padding: 18px 16px 14px;
    min-height: 176px;
    overflow: hidden;
    min-width: 0;
}
.file-ear {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.04) 50%);
    border-bottom-left-radius: 12px;
}
body.theme-dark .file-ear {
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.08) 50%);
}
.file-kind {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.55;
}
.file-id {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    word-break: break-all;
}
.file-label {
    margin-top: 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
}
.file-ticks {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.file-hash {
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-all;
}

.empty {
    margin-top: 18px;
    padding: 36px 20px;
    border-radius: 24px;
    text-align: center;
    opacity: 0.7;
}

.timer-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 46px;
    padding: 10px 16px;
    background: var(--green);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 18px rgba(20, 80, 40, 0.25);
}
.timer-bar.paused { background: var(--green-paused); }
.timer-bar .mono { font-size: 1.15rem; font-weight: 600; }

.modal-back {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 17, 18, 0.45);
    backdrop-filter: blur(6px);
}
.modal {
    width: min(460px, 100%);
    padding: 26px 24px 20px;
    border-radius: 24px;
}
.modal h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}
.modal p {
    margin: 0;
    line-height: 1.55;
}
.modal-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 20px;
}

.polaroid {
    width: min(260px, 74vw);
    margin: 0 auto 10px;
    padding: 18px 18px 0;
    border-radius: 18px;
    background: #ffffff;
    color: #7c818a;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.03);
}
body.theme-dark .polaroid {
    background: #ffffff;
    color: #7c818a;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42), 0 2px 10px rgba(0, 0, 0, 0.28);
}
.polaroid-inner {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 11px;
    background: #ffffff;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04), inset 0 0 0 1px rgba(0, 0, 0, 0.035);
}
.polaroid figcaption {
    margin: 0;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px 2px;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: #7c818a;
}

.wish-column { width: min(440px, 100%); margin: 0 auto 4px; }
.wish-form { display: flex; flex-direction: column; gap: 3px; }
.wish-form label {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
}
.wish-form .neo-input {
    padding: 9px 14px;
}
.wish-form #person-wish {
    padding: 10px 14px 22px;
}
.hint {
    margin: 1px 0 2px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--muted-light);
}
body.theme-dark .hint { color: var(--muted-dark); }
.reason {
    margin: 6px 0 0;
    color: var(--danger);
    font-weight: 600;
    line-height: 1.4;
}
body.theme-dark .reason { color: var(--danger-dark); }
.net { margin: 6px 0 0; line-height: 1.4; }
.wish-form .cta { margin-top: 5px; padding: 11px 20px; }
.text-button {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.65;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}
.text-button:hover { opacity: 1; }
.wish-done {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}
.done-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
}

.admin-login-wrap {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-login-card {
    width: 100%;
    padding: 26px 24px 20px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-login-title {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.admin-login-card label {
    font-size: 13px;
    font-weight: 600;
}
.admin-login-card .cta {
    margin-top: 8px;
}

.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: 14px;
    margin-bottom: 2px;
}
.admin-toggle-label {
    font-size: 13px;
    font-weight: 600;
}
.neo-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0 !important;
}
.neo-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.neo-switch-track {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    position: relative;
    transition: all 0.25s ease;
    background: #eef1f5;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
body.theme-dark .neo-switch-track {
    background: var(--bg-dark);
    box-shadow: inset 3px 3px 6px var(--shadow-dark-2), inset -3px -3px 6px var(--shadow-dark-1);
}
.neo-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, background-color 0.25s ease;
}
body.theme-dark .neo-switch-thumb {
    background: #9aa0a6;
    box-shadow: 2px 2px 4px var(--shadow-dark-2);
}
.neo-switch input:checked + .neo-switch-track {
    background: var(--green);
}
.neo-switch input:checked + .neo-switch-track .neo-switch-thumb {
    transform: translateX(20px);
    background: #ffffff;
}

@media (max-width: 640px) {
    .progress { grid-template-columns: 1fr; }
    .files { grid-template-columns: 1fr; }
    .stat strong { font-size: 1.35rem; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.35); border-radius: 3px; }
