/* ---------- Base ---------- */

html, body {
    background: #fff;
    color: #000;
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a {
    color: #000;
}

.ph-display {
    font-family: "Bebas Neue", "Impact", sans-serif;
    font-weight: 400;
    letter-spacing: 0.04em;
}

/* Big "PandaHunt IV" title shown on every page. */
.ph-title {
    font-size: clamp(3.5rem, 13vw, 7rem);
    line-height: 0.9;
    margin: 0;
    text-align: center;
}

/* The title doubles as a link to the landing page. */
.ph-title-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

    .ph-title-link:hover {
        opacity: 0.7;
    }

    .ph-title-link:focus-visible {
        outline: 3px solid #000;
        outline-offset: 4px;
    }

/* ---------- Page shell (all pages except the landing page) ---------- */

.ph-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem 2rem; /* same top spacing as the landing page, so the title doesn't jump */
}

    .ph-page > .ph-title {
        margin-bottom: 2rem;
    }

.ph-card {
    width: 100%;
    max-width: 480px;
    border: 3px solid #000;
    background: #fff;
    padding: 1.5rem 1.5rem 0.75rem;
    box-shadow: 8px 8px 0 #000;
}

.ph-page-title {
    font-size: 3rem;
    line-height: 1;
    margin: 0.25rem 0 1rem;
}

.ph-card > p:not(.ph-form-alt) {
    margin: 0 0 0.75rem;
}

.ph-card > p + .ph-form {
    margin-top: 1.25rem;
}

/* A boxed note at the top of a card (admin previews, "hunt is over", ...). */
.ph-banner {
    margin: 1rem 0 0;
    padding: 0.6rem 0.9rem;
    border: 2px solid #000;
    font-size: 0.9rem;
}

.ph-card-footer {
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #d9d9d9;
}

/* ---------- Forms (account pages render statically, so they use plain inputs) ---------- */

.ph-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ph-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

    .ph-field label {
        font-weight: 500;
        font-size: 0.9rem;
    }

.ph-input {
    font: inherit;
    padding: 0.7rem 0.8rem;
    border: 2px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
}

    .ph-input:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }

    .ph-input.invalid {
        border-style: dashed;
    }

/* Segmented code input: one box per character. Filled boxes turn black. */
.ph-code {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.ph-code-box {
    flex: 0 1 3.5rem;
    min-width: 0;
    height: 4.5rem;
    padding: 0;
    border: 3px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
    font-family: "Bebas Neue", "Impact", sans-serif;
    font-size: 2.75rem;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    caret-color: transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .ph-code-box:not(:placeholder-shown) {
        background: #000;
        color: #fff;
    }

    .ph-code-box:focus {
        outline: 3px solid #000;
        outline-offset: 3px;
    }

.ph-code.is-wrong {
    animation: ph-shake 0.4s ease;
}

@keyframes ph-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
    .ph-code.is-wrong {
        animation: none;
    }
}

.validation-message {
    font-size: 0.85rem;
    font-weight: 500;
}

    .validation-message::before {
        content: "⚠ ";
    }

.ph-form-errors {
    margin: 0;
    padding: 0.75rem 1rem 0.75rem 2rem;
    background: #000;
    color: #fff;
}

.ph-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

    .ph-check input {
        width: 1.1rem;
        height: 1.1rem;
        accent-color: #000;
    }

.ph-form-alt {
    margin: 1rem 0 0;
}

    .ph-form-alt a {
        font-weight: 700;
    }

/* ---------- Admin page ---------- */

.ph-card.ph-card-wide {
    max-width: 960px;
}

.ph-pill {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border: 2px solid #000;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

    .ph-pill.on {
        background: #000;
        color: #fff;
    }

.ph-pill-small {
    padding: 0 0.4rem;
    border-width: 1px;
    font-size: 0.7rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.ph-admin-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0.5rem;
}

.ph-admin-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid #d9d9d9;
}

    .ph-admin-section h2 {
        font-size: 1.6rem;
        margin: 0 0 0.5rem;
    }

.ph-admin-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

    .ph-admin-heading h2 {
        margin: 0;
    }

.ph-admin-code {
    max-width: 22rem;
}

.ph-admin-narrow {
    max-width: 22rem;
}

    .ph-admin-code input {
        letter-spacing: 0.3em;
        text-transform: uppercase;
        font-weight: 700;
    }

.ph-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.5rem 1.5rem;
}

.ph-admin-datetime {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

    .ph-admin-datetime > .mud-input-control {
        flex: 1;
    }

    .ph-admin-datetime > .mud-button-root {
        margin-top: 1.1rem;
    }

    .ph-admin-datetime > .mud-icon-button {
        margin-top: 0.9rem;
    }

.ph-admin-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
}

.ph-admin-type {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ph-admin-muted {
    color: #555;
    font-size: 0.8rem;
}

.ph-admin-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    max-height: 50vh;
    overflow-y: auto;
}

.ph-admin-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.25rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #555;
}

.ph-admin-search {
    max-width: 20rem;
}

.ph-admin-row-actions {
    white-space: nowrap;
    text-align: right;
}

/* ---------- Maps (bonus events; Leaflet builds the inside, so these can't be scoped) ---------- */

.ph-map {
    position: relative;
    isolation: isolate; /* keeps Leaflet's z-indexes inside the map */
    height: 16rem;
    border: 3px solid #000;
    background: #e6e6e6;
}

    /* Black & white like the rest of the app. */
    .ph-map .leaflet-tile-pane {
        filter: grayscale(1) contrast(1.05);
    }

    .ph-map .leaflet-control-zoom a {
        color: #000;
    }

.ph-map-pin span {
    display: block;
    box-sizing: border-box;
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    background: #000;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    transform: rotate(-45deg);
    transform-origin: 50% 50%;
}

    .ph-map-pin span::after {
        content: "";
        position: absolute;
        inset: 7px;
        border-radius: 50%;
        background: #fff;
    }

.ph-map-error {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 1rem;
    text-align: center;
    color: #555;
}

/* ---------- Points: number + green bamboo (PointsBadge) ---------- */

.ph-pts {
    display: inline-flex;
    align-items: center;
    gap: 0.15em;
    white-space: nowrap;
}

.ph-bamboo {
    flex: none;
    width: 0.65em; /* viewBox is 15.5 × 23 */
    height: 0.95em;
}

.ph-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Blazor error boundary ---------- */

.blazor-error-boundary {
    background: #000;
    padding: 1rem;
    color: #fff;
}

    .blazor-error-boundary::after {
        content: "Něco se pokazilo.";
    }
