:root {
    --coral: #8b1e2d;
    --coral-dark: #6a1520;
    --lavender: #f3e4d2;
    --lavender-2: #e2cbb4;
    --ink: #2b1714;
    --ink-soft: #6d5348;
    --paper: #fbf6ee;
    --gold: #c4a056;
    --gold-soft: #e8c97a;
    --house: #1c1014;
    --line: rgba(80, 32, 28, 0.14);
    --shadow: 0 18px 40px rgba(60, 16, 20, 0.16);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "spartan-variable", "Spartan", sans-serif;
    background:
        radial-gradient(1100px 420px at 50% -90px, rgba(232, 201, 122, 0.32) 0%, transparent 58%),
        #e8d5c4;
    color: var(--ink);
    min-height: 100vh;
}

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

a { color: var(--coral-dark); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: var(--coral);
    color: #fff8ee;
    box-shadow: 0 8px 24px rgba(80, 16, 24, 0.38);
    border-bottom: 2px solid var(--gold);
}

.header-inner {
    max-width: 85rem;
    margin: 0 auto;
    padding: 0.85rem 1.25rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-text strong {
    font-size: 1.65rem;
    font-weight: 600;
}

.brand-text small {
    font-size: 0.78rem;
    opacity: 0.85;
    font-weight: 500;
}

.nav {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.nav a {
    color: #fff8ee;
    text-decoration: none;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
}

.nav a.is-active,
.nav a:hover {
    background: rgba(196, 160, 86, 0.28);
    color: var(--gold-soft);
}

.header-scallop {
    height: 12px;
    background:
        radial-gradient(circle at 10px 0, var(--coral) 10px, transparent 11px) 0 0 / 20px 12px;
    transform: translateY(6px);
}

.stage {
    max-width: 85rem;
    margin: 0 auto;
    padding: 1rem 1rem 2.5rem;
}

.panel {
    background: var(--paper);
    border-radius: 8px;
    min-height: calc(100vh - 10rem);
    padding: 1.5rem 1.4rem 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(196, 160, 86, 0.32);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0.25rem 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 700;
    margin: 0 0 0.35rem;
}

h1, h2 {
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 650; }
h2 { font-size: 1.25rem; }

.lede, .muted { color: var(--ink-soft); }
.lede { margin: 0; max-width: 38rem; }
.center { text-align: center; }

.btn, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--coral);
    color: #fff;
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.btn:hover { background: var(--coral-dark); }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--lavender); color: var(--ink); }

.search {
    display: flex;
    gap: 0.4rem;
}

.search input, .form input, .form textarea, .form select {
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    background: #fff;
    color: var(--ink);
    width: 100%;
}

.search input { min-width: 16rem; }
.search button { border-radius: 10px; }

.count {
    color: var(--ink-soft);
    margin: 0 0 1rem;
}

.playbills {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
    gap: 1.15rem;
}

.playbill {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(60, 16, 20, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.playbill:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.playbill-poster {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(160deg, var(--house), var(--coral));
    overflow: hidden;
}

.playbill-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--gold-soft);
    font-size: 4rem;
    font-weight: 700;
}

.playbill-poster time {
    position: absolute;
    left: 0.7rem;
    bottom: 0.7rem;
    background: #fff;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.playbill-body { padding: 0.9rem 1rem 1.1rem; }
.playbill-body h2 { font-size: 1.15rem; }
.author { margin: 0; color: var(--ink-soft); font-style: italic; }
.meta {
    list-style: none;
    padding: 0.7rem 0 0;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.meta li + li { margin-top: 0.15rem; }

.empty {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-art { margin-bottom: 0.6rem; }

.flash {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin: 0 0 1rem;
}
.flash-ok { background: #e7f8ee; color: #146c3a; }
.flash-err { background: #ffe8ea; color: #9b1c2a; }

.show-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 18rem;
    margin: 0.75rem 0 1.5rem;
    background: var(--house);
}

.show-hero img {
    width: 100%;
    height: 22rem;
    object-fit: cover;
    filter: brightness(0.72);
}

.show-hero-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem 1.4rem;
    color: #fff;
    background: linear-gradient(transparent, rgba(28, 16, 20, 0.9));
}

.show-hero.no-photo { min-height: 10rem; }
.show-hero.no-photo .show-hero-text {
    position: relative;
    background: linear-gradient(160deg, var(--house), var(--coral));
}

.show-hero .author { color: var(--gold-soft); }
.show-hero .my-role {
    margin: 0.55rem 0 0;
    font-weight: 650;
}
.back { display: inline-block; margin-bottom: 0.4rem; }

.show-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1.5rem;
}

.facts {
    display: grid;
    gap: 0.8rem;
    margin: 0 0 1.5rem;
}
.facts div {
    border-top: 1px dashed var(--line);
    padding-top: 0.7rem;
}
.facts dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold);
}
.facts dd { margin: 0.2rem 0 0; }
.facts small { display: block; color: var(--ink-soft); margin-top: 0.2rem; }

.cast {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.cast li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line);
}
.cast li:nth-child(odd) { background: #f7efe4; }
.cast li:last-child { border-bottom: 0; }
.cast span { color: var(--ink-soft); }

.map {
    position: relative;
    z-index: 0;
    isolation: isolate;
    width: 100%;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    margin: 0.4rem 0 1rem;
}
.map-lg { height: 380px; }

.video {
    position: relative;
    z-index: 0;
    isolation: isolate;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--house);
    margin: 0.4rem 0 0.6rem;
}
.video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-link { margin: 0 0 1.1rem; }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 0.5rem;
}
.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.stat-card {
    background: linear-gradient(180deg, #fffdf8, #f3e6d0);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
}
.stat-card span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--coral-dark);
}
.stat-card small { color: var(--ink-soft); }

.block { margin: 1.6rem 0; }
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.bars { list-style: none; margin: 0; padding: 0; }
.bars li {
    display: grid;
    grid-template-columns: 4rem 1fr 2rem;
    gap: 0.6rem;
    align-items: center;
    margin: 0.4rem 0;
}
.bar-track {
    height: 10px;
    background: #ead9c4;
    border-radius: 99px;
    overflow: hidden;
}
.bar-fill {
    display: block;
    height: 100%;
    background: var(--coral);
    border-radius: 99px;
}

.rank { list-style: none; margin: 0; padding: 0; }
.rank li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}
.rank small { display: block; color: var(--ink-soft); }
.rank span {
    font-weight: 700;
    color: var(--coral-dark);
}

.auth-card {
    max-width: 28rem;
    margin: 2rem auto;
}

.form {
    display: grid;
    gap: 0.9rem;
}
.form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.92rem;
}
.form fieldset {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem 1rem 1.15rem;
    margin: 0;
    display: grid;
    gap: 0.85rem;
}
.form legend {
    padding: 0 0.4rem;
    font-weight: 700;
    color: var(--coral-dark);
}
.form-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.hint { margin: 0; color: var(--ink-soft); font-size: 0.88rem; font-weight: 500; }

.cast-editor { display: grid; gap: 0.6rem; }
.cast-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    align-items: end;
}
.icon-btn {
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    font-size: 1.3rem;
    cursor: pointer;
}

.photo-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.7rem;
}
.photo-admin-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    font-weight: 500;
}
.photo-admin-item img {
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
}
.photo-admin-item span {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
}

.table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.admin-table small { display: block; color: var(--ink-soft); }
.actions {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
}
.actions form { margin: 0; }
.link-danger {
    background: none;
    border: 0;
    color: #b42318;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.suggest {
    position: relative;
}
.suggest-menu, .suggest-list {
    position: absolute;
    z-index: 30;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: min(28rem, 100%);
    max-height: 16rem;
    overflow: auto;
    margin-top: 0.2rem;
}
.suggest-list { position: relative; width: 100%; }
.suggest-menu button, .suggest-list button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 0.65rem 0.8rem;
    font: inherit;
    cursor: pointer;
}
.suggest-menu button:hover,
.suggest-menu button.is-active,
.suggest-list button:hover { background: var(--lavender); }
.suggest-menu small { color: var(--ink-soft); margin-left: 0.35rem; }

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(28, 16, 20, 0.9);
    display: none;
    place-items: center;
    z-index: 2000;
    padding: 1.5rem;
}
.lightbox.is-open { display: grid; }
.lightbox img {
    max-width: min(96vw, 1100px);
    max-height: 90vh;
    object-fit: contain;
}

.map-tools {
    display: flex;
    gap: 0.4rem;
}
.map-tools input { flex: 1; }

@media (max-width: 800px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .show-grid, .split, .cast-row { grid-template-columns: 1fr; }
    .search input { min-width: 0; }
    .panel { padding: 1.1rem 0.9rem 2rem; }
    .show-hero img { height: 16rem; }
}
