:root {
    color-scheme: dark;
    --bg-top: #07111c;
    --bg-bottom: #03070c;
    --panel-border: rgba(143, 211, 255, 0.14);
    --text: #eef5ff;
    --muted: #a7b6c8;
    --accent: #8fd3ff;
    --danger: #ffb4b4;
    --success: #a5f0c5;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    --menu-width: min(280px, 82vw);
    --logo-width: min(148px, 28vw);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top, rgba(76, 120, 168, 0.18), transparent 34%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    color: var(--text);
    font-family: Consolas, "Courier New", monospace;
}

body {
    position: relative;
    padding: 8rem 1rem 2.5rem;
}

#waves {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    user-select: none;
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.logo-link {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    width: var(--logo-width);
    z-index: 4;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: block;
    line-height: 0;
    transition: left 220ms ease, transform 180ms ease;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.logo-link:hover {
    transform: scale(1.16);
}

.logo-link.menu-open {
    left: calc((var(--menu-width) - var(--logo-width)) / 2);
}

.logo {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 180ms ease;
}

.logo-color {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.logo-link:hover .logo-color {
    opacity: 1;
}

.logo-link:hover .logo-white {
    opacity: 0;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3;
    height: 100svh;
    width: var(--menu-width);
    padding: 10.25rem 1.25rem clamp(6.75rem, 22svh, 9rem);
    background: rgba(3, 7, 12, 0.84);
    border-right: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transform: translateX(-100%);
    transition: transform 220ms ease;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.side-menu.is-open {
    transform: translateX(0);
}

.side-menu a {
    display: block;
    padding: 0.75rem 0;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(143, 211, 255, 0.12);
}

.side-menu a:hover {
    color: var(--accent);
}

.menu-goblin {
    position: absolute;
    left: 50%;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: min(112px, 46%);
    max-height: 20svh;
    height: auto;
    object-fit: contain;
    transform: translateX(-50%);
    opacity: 0.9;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4));
    cursor: pointer;
}

.cursor-note {
    position: fixed;
    z-index: 5;
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(143, 211, 255, 0.22);
    border-radius: 6px;
    background: rgba(3, 7, 12, 0.86);
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transform: translate(0.75rem, 0.75rem);
    transition: opacity 120ms ease;
}

.cursor-note.is-visible {
    opacity: 1;
}

.camera-panel,
.gallery-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: rgba(6, 10, 18, 0.74);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.camera-panel::before,
.gallery-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../hlavy.png") center / 180% auto;
    opacity: 0.12;
    z-index: -1;
}

.camera-panel {
    padding: clamp(1rem, 2.4vw, 1.5rem);
}

.gallery-panel {
    padding: clamp(1rem, 2.4vw, 1.5rem);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.eyebrow {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    color: var(--accent);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-pill {
    flex: 0 0 auto;
    max-width: 50%;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(143, 211, 255, 0.18);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.camera-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(143, 211, 255, 0.16);
    border-radius: 8px;
    background: rgba(3, 7, 12, 0.7);
    aspect-ratio: 4 / 3;
}

.camera-view,
.camera-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.camera-view {
    object-fit: cover;
}

.captured-preview {
    z-index: 1;
}

.camera-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    place-items: center;
    background: rgba(3, 7, 12, 0.58);
}

.loading-overlay.is-visible {
    display: grid;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(143, 211, 255, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 760ms linear infinite;
}

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

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

label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

.consent-check {
    grid-template-columns: auto 1fr;
    align-items: start;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.45;
}

.consent-check input {
    width: auto;
    margin-top: 0.2rem;
}

input,
button {
    font: inherit;
}

input {
    width: 100%;
    border: 1px solid rgba(143, 211, 255, 0.18);
    border-radius: 8px;
    background: rgba(3, 7, 12, 0.7);
    color: var(--text);
    padding: 0.75rem;
}

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

button {
    border: 1px solid rgba(143, 211, 255, 0.28);
    border-radius: 8px;
    background: rgba(143, 211, 255, 0.12);
    color: var(--text);
    padding: 0.7rem 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

button:hover:not(:disabled) {
    border-color: rgba(143, 211, 255, 0.7);
    color: var(--accent);
}

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

.ghost {
    background: rgba(3, 7, 12, 0.32);
}

.message {
    min-height: 1.25rem;
    margin: 1rem 0 0;
    color: var(--muted);
}

.message.is-success {
    color: var(--success);
}

.message.is-error {
    color: var(--danger);
}

.notice {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(143, 211, 255, 0.12);
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.notice h2 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.notice p {
    margin: 0.5rem 0 0;
}

.gallery-grid {
    columns: 4 180px;
    column-gap: 0.85rem;
}

.gallery-item {
    display: block;
    width: 100%;
    margin: 0 0 0.85rem;
    padding: 0;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(3, 7, 12, 0.52);
    color: inherit;
    cursor: zoom-in;
    overflow: hidden;
    break-inside: avoid;
    text-align: left;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-meta {
    padding: 0.6rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.gallery-meta strong {
    color: var(--accent);
    font-weight: 400;
}

.empty-gallery {
    margin: 0;
    color: var(--muted);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 6;
    display: grid;
    grid-template-rows: 1fr auto;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.88);
}

.modal[hidden] {
    display: none;
}

.modal img {
    max-width: min(100%, 1200px);
    max-height: calc(100vh - 5rem);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    text-transform: none;
    font-size: 1.2rem;
}

.modal-caption {
    padding-top: 0.75rem;
    color: var(--muted);
    text-align: center;
}

@media (min-width: 900px) {
    .page {
        grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
        align-items: start;
    }
}

@media (max-width: 720px) {
    body {
        padding-top: 11.5rem;
    }

    .logo-link {
        --logo-width: 110px;
        width: 110px;
    }

    .side-menu {
        padding-top: 9.25rem;
        padding-bottom: clamp(5.75rem, 19svh, 7rem);
    }

    .menu-goblin {
        width: min(92px, 40%);
        max-height: 16svh;
    }

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

    .status-pill {
        max-width: none;
        align-self: start;
    }

    .actions button {
        flex: 1 1 100%;
    }
}

@media (max-height: 620px) {
    .side-menu {
        padding-top: 7rem;
        padding-bottom: 5.5rem;
    }

    .side-menu a {
        padding: 0.55rem 0;
    }

    .menu-goblin {
        bottom: 0.5rem;
        width: min(76px, 34%);
        max-height: 14svh;
    }
}
