:root {
    --bg: #080707;
    --panel: #111111;
    --panel-soft: rgba(17, 17, 17, 0.82);
    --card: #f5f0e7;
    --text: #f8f4eb;
    --muted: #c9bfab;
    --gold: #b98a3d;
    --gold-strong: #d8a85a;
    --line: rgba(185, 138, 61, 0.28);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Source Sans 3", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(185, 138, 61, 0.22), transparent 32%),
        linear-gradient(180deg, #060606 0%, #100d0a 52%, #ece4d7 52%, #efe8de 100%);
    color: var(--text);
}

img {
    display: block;
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 4.5rem;
    background: rgba(7, 7, 7, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border: 1px solid rgba(216, 168, 90, 0.5);
    border-radius: 1rem;
    color: var(--gold-strong);
    font-family: "Cinzel", serif;
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(185, 138, 61, 0.18), rgba(185, 138, 61, 0.04));
}

.eyebrow {
    margin: 0 0 0.3rem;
    color: var(--gold-strong);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 700;
}

.site-header h1,
.hero h2,
.results-header h3 {
    margin: 0;
    font-family: "Cinzel", serif;
}

.site-header h1 {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.partner-logos {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.partner-logos img {
    height: 3.8rem;
    width: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.35rem 0.65rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 38rem;
    padding: 5rem 4.5rem 8rem;
    background:
        linear-gradient(90deg, rgba(4, 4, 4, 0.95), rgba(4, 4, 4, 0.72)),
        radial-gradient(circle at top right, rgba(96, 21, 21, 0.28), transparent 24%),
        radial-gradient(circle at 15% 20%, rgba(185, 138, 61, 0.12), transparent 18%),
        linear-gradient(135deg, #050505 10%, #1c1a1e 38%, #0a0a0b 100%);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    inset: auto;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(2px);
    transform: rotate(-12deg);
}

.hero::before {
    top: 5%;
    left: 12%;
    width: 18rem;
    height: 18rem;
    clip-path: polygon(24% 0, 100% 8%, 76% 100%, 0 84%);
}

.hero::after {
    right: 8%;
    top: 12%;
    width: 24rem;
    height: 16rem;
    clip-path: polygon(18% 0, 100% 22%, 82% 100%, 0 78%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7)),
        repeating-linear-gradient(115deg, transparent 0 7rem, rgba(255, 255, 255, 0.03) 7rem 8rem);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 50rem;
    margin: 0 auto;
    text-align: center;
}

.hero h2 {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    margin-bottom: 1rem;
}

.hero-text {
    margin: 0 auto 2rem;
    max-width: 42rem;
    color: #f0e8da;
    font-size: 1.15rem;
    line-height: 1.7;
}

.castle-link {
    color: #7c5315;
    text-decoration: none;
}

.castle-link:hover {
    color: #a56c1f;
    text-decoration: underline;
}

.search-panel {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: var(--panel-soft);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

label span {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    text-align: left;
}

input,
select,
button,
a {
    font: inherit;
}

input,
select {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.97);
    color: #161616;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
}

.form-actions button,
.form-actions a {
    min-width: 10rem;
    padding: 0.9rem 1.4rem;
    border-radius: 999px;
    text-decoration: none;
    text-align: center;
    transition: transform 160ms ease, background 160ms ease;
}

.form-actions button {
    border: none;
    background: linear-gradient(135deg, var(--gold), var(--gold-strong));
    color: #120e08;
    font-weight: 700;
    cursor: pointer;
}

.form-actions a {
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.form-actions button:hover,
.form-actions a:hover {
    transform: translateY(-1px);
}

.hero-divider {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 6.25rem;
    background: #efe8de;
    clip-path: polygon(0 65%, 5% 71%, 10% 63%, 16% 72%, 24% 62%, 31% 69%, 38% 61%, 45% 74%, 54% 63%, 61% 72%, 68% 60%, 76% 75%, 83% 62%, 90% 71%, 96% 64%, 100% 70%, 100% 100%, 0 100%);
}

.stats-section,
.content-section {
    width: min(1200px, calc(100% - 3rem));
    margin: 0 auto;
}

.stats-section {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: -3rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    padding: 1.35rem 1.5rem;
    border: 1px solid rgba(185, 138, 61, 0.16);
    border-radius: 1.25rem;
    background: rgba(255, 248, 237, 0.95);
    color: #2a2014;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    margin-bottom: 0.45rem;
    color: #7b6442;
    font-weight: 700;
}

.stat-card strong {
    font-size: 1.8rem;
}

.content-section {
    padding-bottom: 3rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1.5rem;
    color: #1d160f;
    margin-bottom: 1.4rem;
}

.results-header h3 {
    font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.results-note {
    margin: 0;
    max-width: 24rem;
    color: #69543a;
}

.table-shell {
    overflow: auto;
    border: 1px solid rgba(77, 53, 18, 0.08);
    border-radius: 1.4rem;
    background: rgba(255, 251, 245, 0.95);
    box-shadow: 0 18px 40px rgba(30, 17, 4, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #1f1913;
}

th,
td {
    padding: 1rem 1.1rem;
    text-align: left;
    vertical-align: top;
}

thead {
    background: linear-gradient(180deg, #1a130d, #2b2014);
    color: #f4e8d6;
}

tbody tr:nth-child(even) {
    background: rgba(185, 138, 61, 0.05);
}

tbody tr:hover {
    background: rgba(185, 138, 61, 0.11);
}

.row-summary {
    margin: 0.45rem 0 0;
    color: #6d5c48;
    max-width: 28rem;
}

.message {
    padding: 1.4rem 1.5rem;
    border-radius: 1rem;
}

.error {
    background: #2b1111;
    border: 1px solid rgba(255, 120, 120, 0.28);
}

.empty {
    margin-top: 1rem;
    background: rgba(185, 138, 61, 0.1);
    color: #2b2012;
}

.error-detail {
    color: #ffbdbd;
    word-break: break-word;
}

.detail-main {
    padding-bottom: 3rem;
}

.detail-hero {
    padding: 3.5rem 1.5rem 1.5rem;
    background:
        linear-gradient(90deg, rgba(4, 4, 4, 0.95), rgba(4, 4, 4, 0.72)),
        radial-gradient(circle at top right, rgba(96, 21, 21, 0.28), transparent 24%),
        linear-gradient(135deg, #050505 10%, #1c1a1e 38%, #0a0a0b 100%);
    border-bottom: 1px solid var(--line);
}

.detail-heading {
    width: min(1200px, calc(100% - 3rem));
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--gold-strong);
    text-decoration: none;
    font-weight: 700;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-heading h2 {
    margin: 0;
    font-family: "Cinzel", serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.detail-subtitle {
    margin: 0.7rem 0 0;
    color: #e6d7c1;
    font-size: 1.05rem;
}

.detail-section {
    margin-top: 2rem;
}

.detail-grid,
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.detail-info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.2rem;
}

.detail-card {
    padding: 1.25rem;
    border: 1px solid rgba(77, 53, 18, 0.08);
    border-radius: 1.4rem;
    background: rgba(255, 251, 245, 0.95);
    color: #1f1913;
    box-shadow: 0 18px 40px rgba(30, 17, 4, 0.08);
}

.detail-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: "Cinzel", serif;
}

.detail-image,
.map-frame,
.image-fallback {
    width: 100%;
    min-height: 22rem;
    border: 0;
    border-radius: 1rem;
}

.detail-image {
    object-fit: cover;
    background: #ddd3c4;
}

.map-frame,
.image-fallback {
    background: #e9decd;
}

.image-fallback {
    display: grid;
    place-items: center;
    padding: 2rem;
    color: #6b5639;
    text-align: center;
}

.photo-meta,
.detail-description {
    margin-bottom: 0;
    color: #6b5639;
    line-height: 1.7;
}

.info-list {
    display: grid;
    gap: 0.9rem;
}

.info-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(77, 53, 18, 0.08);
}

.info-list span {
    color: #7a6240;
}

.activity-list {
    display: grid;
    gap: 0.9rem;
}

.activity-item {
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(185, 138, 61, 0.08);
}

.activity-item span {
    display: block;
    margin-top: 0.2rem;
    color: #8c734d;
    font-size: 0.95rem;
}

.activity-item p {
    margin: 0.45rem 0 0;
    color: #5e4f3b;
}

code {
    font-family: Consolas, monospace;
}

@media (max-width: 980px) {
    .site-header,
    .hero {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .site-header {
        position: static;
        flex-direction: column;
        align-items: flex-start;
    }

    .partner-logos {
        justify-content: flex-start;
    }

    .form-grid,
    .stats-section {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-grid,
    .detail-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hero {
        min-height: auto;
        padding-top: 3.5rem;
    }

    .partner-logos img {
        height: 3.1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button,
    .form-actions a {
        width: 100%;
    }
}
