:root {
    --ink: #241b18;
    --muted: #6d5c55;
    --paper: #fff8ef;
    --paper-deep: #f5e4cf;
    --brick: #9f4938;
    --brick-dark: #733023;
    --gold: #e1a84b;
    --green: #315f55;
    --blue: #315a78;
    --line: rgba(36, 27, 24, 0.16);
    --shadow: 0 18px 60px rgba(61, 36, 25, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(36, 27, 24, 0.08) 0.7px, transparent 0.7px);
    background-size: 6px 6px;
    opacity: 0.32;
    mix-blend-mode: multiply;
}

a {
    color: inherit;
}

.language-nav {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 248, 239, 0.38);
    border-radius: 8px;
    background: rgba(36, 27, 24, 0.48);
    color: #fff8ef;
    font: 800 0.9rem Arial, sans-serif;
}

.language-nav a {
    color: #fff8ef;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.language-nav--fixed {
    position: fixed;
}

.hero {
    min-height: 0;
    aspect-ratio: 16 / 9;
    position: relative;
    display: grid;
    align-items: center;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(49, 90, 120, 0.25), rgba(115, 48, 35, 0.58)),
        linear-gradient(135deg, #dda657, #9f4938 48%, #315f55);
}

.hero--with-image {
    background:
        linear-gradient(180deg, rgba(36, 27, 24, 0.06), rgba(36, 27, 24, 0.62)),
        url('banner.jpg') center / contain no-repeat,
        linear-gradient(135deg, #dda657, #9f4938 48%, #315f55);
}

.hero__art {
    position: absolute;
    inset: 0;
}

.hero--with-image .hero__art {
    display: none;
}

.train-line {
    position: absolute;
    left: -5%;
    right: -5%;
    top: 30%;
    height: 18px;
    background: rgba(36, 27, 24, 0.52);
    box-shadow: 0 22px 0 rgba(36, 27, 24, 0.26);
    transform: rotate(-2deg);
}

.train-line::after {
    content: '';
    position: absolute;
    left: 12%;
    top: -38px;
    width: 230px;
    height: 42px;
    border-radius: 4px;
    background: rgba(245, 228, 207, 0.7);
    box-shadow: 28px 0 0 rgba(49, 90, 120, 0.55), 56px 0 0 rgba(245, 228, 207, 0.7), 84px 0 0 rgba(49, 90, 120, 0.55);
}

.building {
    position: absolute;
    bottom: 0;
    width: 28%;
    min-width: 220px;
    height: 48%;
    background:
        repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 248, 239, 0.32) 28px 43px, transparent 43px 68px),
        linear-gradient(#70372e, #4d2a24);
}

.building-a {
    left: 5%;
}

.building-b {
    right: 2%;
    height: 58%;
    background:
        repeating-linear-gradient(90deg, transparent 0 24px, rgba(255, 248, 239, 0.28) 24px 38px, transparent 38px 62px),
        linear-gradient(#315f55, #253d39);
}

.court {
    position: absolute;
    right: 16%;
    bottom: 11%;
    width: 90px;
    height: 68px;
    border: 5px solid rgba(255, 248, 239, 0.62);
    border-bottom: 0;
}

.court::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -35px;
    width: 5px;
    height: 35px;
    background: rgba(255, 248, 239, 0.62);
}

.hero__overlay {
    position: relative;
    max-width: 980px;
    padding: 6vh 7vw;
    color: #fff8ef;
    text-shadow: 0 2px 22px rgba(0, 0, 0, 0.34);
}

.hero h1,
.thank-you h1,
.login-box h1,
.admin-header h1 {
    margin: 0;
    font-size: clamp(2.3rem, 7vw, 5.6rem);
    line-height: 0.96;
    letter-spacing: 0;
}

.hero p {
    max-width: 720px;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.kicker {
    margin: 0 0 0.7rem;
    color: var(--gold);
    font-family: Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page,
.admin-page {
    width: min(1040px, calc(100% - 28px));
    margin: 0 auto;
    padding: 38px 0 70px;
}

.memory-card,
.form-section,
.submission-card {
    background: rgba(255, 248, 239, 0.86);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.intro {
    padding: clamp(22px, 4vw, 42px);
    margin-bottom: 28px;
    font-size: 1.08rem;
}

.language-control {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-family: Arial, sans-serif;
}

.language-control label {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.language-control select {
    min-height: 42px;
    border: 1px solid rgba(36, 27, 24, 0.24);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    font: 800 0.95rem Arial, sans-serif;
    padding: 8px 12px;
}

.photo-memory-band {
    display: grid;
    grid-template-columns: minmax(220px, 0.82fr) 1.18fr;
    gap: clamp(18px, 4vw, 34px);
    align-items: center;
    margin: 28px 0;
    padding: clamp(20px, 4vw, 34px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.photo-memory-band h2 {
    margin: 0 0 10px;
    color: var(--brick-dark);
    font-size: clamp(1.65rem, 3.6vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.photo-memory-band p {
    margin-bottom: 0;
}

.photo-slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
}

.photo-slot {
    position: relative;
    min-height: 190px;
    border: 1px solid rgba(36, 27, 24, 0.22);
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(rgba(255, 248, 239, 0.18), rgba(36, 27, 24, 0.22)),
        repeating-linear-gradient(90deg, rgba(49, 90, 120, 0.34) 0 18px, transparent 18px 40px),
        linear-gradient(135deg, #e1a84b, #9f4938 56%, #315f55);
    box-shadow: 0 14px 34px rgba(61, 36, 25, 0.16);
}

.photo-slot::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(255, 248, 239, 0.72);
    border-radius: 6px;
}

.photo-slot span {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    color: #fff8ef;
    font: 800 0.86rem Arial, sans-serif;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

.photo-slot--tall {
    min-height: 246px;
}

.form-section {
    padding: clamp(18px, 4vw, 34px);
    margin: 22px 0;
}

.form-section h2 {
    margin: 0 0 20px;
    color: var(--brick-dark);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    letter-spacing: 0;
}

.section-intro,
.required-note {
    margin: 0 0 20px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 1rem;
}

.field {
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.field:first-of-type {
    border-top: 0;
    padding-top: 0;
}

label {
    display: block;
    font-weight: 700;
}

.question-number {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--green);
    color: #fff8ef;
    font-family: Arial, sans-serif;
    font-size: 0.82rem;
}

input[type='text'],
input[type='password'],
input[type='search'],
input[type='email'],
textarea {
    width: 100%;
    margin-top: 10px;
    border: 1px solid rgba(36, 27, 24, 0.24);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    font: 1rem Arial, sans-serif;
    padding: 13px 14px;
}

input[type='file'] {
    width: 100%;
    margin-top: 12px;
    border: 1px dashed rgba(36, 27, 24, 0.3);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    font: 0.95rem Arial, sans-serif;
    padding: 14px;
}

textarea {
    resize: vertical;
    min-height: 126px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(225, 168, 75, 0.38);
    border-color: var(--brick);
}

.help {
    margin: 8px 0 0 40px;
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 0.92rem;
}

.field-error {
    margin: 8px 0 0 40px;
    color: #8d241a;
    font-family: Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
}

.error-summary {
    margin-bottom: 24px;
    padding: clamp(18px, 4vw, 30px);
    border-color: rgba(141, 36, 26, 0.34);
    background: #fff3ee;
}

.error-summary h2 {
    margin: 0 0 10px;
    color: #8d241a;
    font-size: 1.35rem;
}

.error-summary ul {
    margin: 0;
    padding-left: 20px;
}

[hidden] {
    display: none !important;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.choice-stack {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.choice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-height: 46px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(245, 228, 207, 0.42);
    font-family: Arial, sans-serif;
    font-weight: 700;
}

.choice input {
    margin-top: 4px;
    accent-color: var(--brick);
}

.consent {
    padding: 18px;
}

.consent-choice {
    background: #fffdf8;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 8px;
    font: 800 1rem Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    width: 100%;
    margin-top: 18px;
    background: var(--brick);
    color: #fff8ef;
}

.secondary-button {
    background: #fffdf8;
    color: var(--brick-dark);
    border: 1px solid var(--line);
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.center-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.thank-you,
.login-box {
    width: min(620px, 100%);
    padding: clamp(24px, 5vw, 44px);
}

.thank-you .primary-button,
.login-box .primary-button {
    width: auto;
}

.error {
    padding: 12px;
    border-radius: 8px;
    background: #f7d8d0;
    color: #6f1f17;
    font-family: Arial, sans-serif;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 22px;
}

.admin-header h1 {
    font-size: clamp(2.3rem, 5vw, 4.2rem);
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form {
    margin-bottom: 20px;
}

.search-form div {
    display: flex;
    gap: 10px;
}

.search-form .primary-button {
    width: auto;
    margin-top: 10px;
}

.submission-card {
    padding: clamp(18px, 4vw, 30px);
    margin: 18px 0;
}

.submission-card__header {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) 1.2fr;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.submission-card h2 {
    margin: 0;
    color: var(--brick-dark);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.summary-grid div,
.answer-card {
    border-radius: 8px;
    background: rgba(245, 228, 207, 0.48);
    padding: 12px;
}

.visits-grid dd + dd {
    margin-top: 4px;
}

.visit-referrer {
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

dt,
.answer-card h3 {
    margin: 0 0 4px;
    color: var(--muted);
    font: 800 0.78rem Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

dd,
.answer-card p {
    margin: 0;
}

.answer-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.admin-photo-section {
    margin-top: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.admin-photo-section h3 {
    margin: 0 0 12px;
    color: var(--muted);
    font: 800 0.78rem Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-photo {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(245, 228, 207, 0.48);
    text-decoration: none;
}

.admin-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.admin-photo span {
    display: block;
    padding: 9px 10px;
    color: var(--muted);
    font: 700 0.82rem Arial, sans-serif;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .hero {
        aspect-ratio: 16 / 9;
    }

    .language-nav {
        top: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }

    .choice-grid,
    .photo-memory-band,
    .admin-photo-grid,
    .submission-card__header,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .photo-slots {
        grid-template-columns: 1fr;
    }

    .photo-slot,
    .photo-slot--tall {
        min-height: 170px;
    }

    .admin-header,
    .search-form div {
        display: block;
    }

    .admin-actions {
        margin-top: 14px;
    }

    .language-control {
        justify-content: stretch;
        align-items: stretch;
        flex-direction: column;
    }

    .secondary-button,
    .language-control select,
    .search-form .primary-button {
        width: 100%;
        margin-top: 10px;
    }

    .help {
        margin-left: 0;
    }

    .field-error {
        margin-left: 0;
    }
}
