:root {
    color-scheme: dark;

    --background: #090910;
    --surface: #15151f;
    --surface-light: #1f1f2c;
    --surface-hover: #252536;
    --border: #303043;

    --text: #f7f7fb;
    --text-muted: #a7a7b7;

    --accent: #e5a00d;
    --accent-hover: #f4b323;

    --success: #62d391;
    --warning: #f1aa62;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at top left,
            rgba(229, 160, 13, 0.08),
            transparent 35%
        ),
        var(--background);

    color: var(--text);
}

a {
    color: inherit;
}

.main-header {
    position: sticky;
    z-index: 10;
    top: 0;

    padding: 18px 32px;
    border-bottom: 1px solid var(--border);

    background: rgba(9, 9, 16, 0.9);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    color: var(--text);
    text-decoration: none;
}

.brand-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;

    border-radius: 12px;
    background: var(--accent);

    font-size: 22px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 19px;
}

.brand small {
    margin-top: 2px;
    color: var(--text-muted);
}

.page-container {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 40px 32px 60px;
}

.welcome-section {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 7px;

    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1;
}

h2 {
    margin-bottom: 0;
    font-size: 27px;
}

.intro {
    max-width: 620px;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 17px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form input {
    width: min(430px, 45vw);
    padding: 13px 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    outline: none;
    background: var(--surface);
    color: var(--text);
}

.search-form input:focus {
    border-color: var(--accent);
}

.search-form button {
    padding: 13px 18px;

    border: 0;
    border-radius: 10px;

    background: var(--accent);
    color: #111;

    font-weight: 800;
    cursor: pointer;
}

.search-form button:hover {
    background: var(--accent-hover);
}

.reset-link,
.back-link {
    color: var(--text-muted);
    text-decoration: none;
}

.reset-link:hover,
.back-link:hover {
    color: var(--text);
}

.statistics {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 42px;
}

.stat-card {
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: rgba(21, 21, 31, 0.82);
}

.stat-card span {
    color: var(--text-muted);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 31px;
}

.collection-section,
.production-section {
    margin-top: 30px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.result-count {
    color: var(--text-muted);
    font-size: 14px;
}

.musical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.musical-card {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 17px;

    background: var(--surface);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.musical-card:hover {
    transform: translateY(-4px);
    border-color: rgba(229, 160, 13, 0.65);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
}

.poster-placeholder {
    display: grid;
    height: 240px;
    place-items: center;

    background:
        linear-gradient(
            145deg,
            rgba(229, 160, 13, 0.78),
            rgba(84, 42, 121, 0.82)
        );

    font-size: 76px;
    font-weight: 900;
}

.musical-card-content {
    padding: 18px;
}

.musical-card h3 {
    margin-bottom: 7px;
    font-size: 20px;
}

.production-count {
    margin-bottom: 14px;
    color: var(--text-muted);
}

.musical-meta {
    display: flex;
    min-height: 55px;
    flex-direction: column;
    gap: 7px;

    color: var(--text-muted);
    font-size: 13px;
}

.open-button {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 18px;
    padding-top: 14px;

    border-top: 1px solid var(--border);

    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
}

.detail-hero {
    display: flex;
    align-items: center;
    gap: 28px;

    padding: 28px;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: var(--surface);
}

.detail-poster {
    display: grid;
    width: 150px;
    min-width: 150px;
    height: 200px;
    place-items: center;

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(229, 160, 13, 0.85),
            rgba(84, 42, 121, 0.9)
        );

    font-size: 65px;
    font-weight: 900;
}

.production-list {
    display: grid;
    gap: 15px;
}

.production-card {
    padding: 21px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: var(--surface);
}

.production-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.production-title h3 {
    margin-bottom: 5px;
    font-size: 21px;
}

.production-title p {
    margin-bottom: 0;
    color: var(--text-muted);
}

.quality-badge {
    padding: 6px 10px;
    border-radius: 999px;

    background: rgba(229, 160, 13, 0.14);
    color: var(--accent);

    font-size: 13px;
    font-weight: 800;
}

.production-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;

    margin: 20px 0 0;
    padding-top: 17px;

    border-top: 1px solid var(--border);
}

.production-details div {
    min-width: 0;
}

.production-details dt {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.production-details dd {
    margin: 0;
}

.production-note {
    margin: 17px 0 0;
    padding: 12px 14px;

    border-radius: 9px;
    background: var(--surface-light);

    color: var(--text-muted);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 60px 20px;

    border: 1px dashed var(--border);
    border-radius: 15px;

    color: var(--text-muted);
    text-align: center;
}

.empty-state span {
    display: block;
    margin-bottom: 12px;
    font-size: 42px;
}

@media (max-width: 900px) {
    .welcome-section {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form input {
        width: 100%;
    }

    .statistics {
        grid-template-columns: repeat(2, 1fr);
    }

    .production-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .page-container,
    .main-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .statistics {
        grid-template-columns: 1fr 1fr;
    }

    .detail-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-poster {
        width: 100%;
    }

    .production-title {
        flex-direction: column;
    }

    .production-details {
        grid-template-columns: 1fr 1fr;
    }
}

.production-open-button {
    margin-top: 18px;
}

.production-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 22px;
}

.summary-card,
.note-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.summary-card span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 13px;
}

.summary-card strong {
    display: block;
    overflow-wrap: anywhere;
}

.note-card {
    margin-top: 18px;
}

.note-card p:last-child {
    margin-bottom: 0;
    color: var(--text-muted);
}

.file-section {
    margin-top: 36px;
}

.file-list {
    display: grid;
    gap: 12px;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);
}

.file-icon {
    display: grid;
    width: 46px;
    min-width: 46px;
    height: 46px;
    place-items: center;

    border-radius: 11px;
    background: var(--surface-light);

    font-size: 21px;
}

.file-main {
    min-width: 0;
    flex: 1;
}

.file-main h3 {
    margin-bottom: 5px;
    overflow-wrap: anywhere;
    font-size: 16px;
}

.file-main p {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 13px;
}

.file-main small {
    display: block;
    overflow-wrap: anywhere;
    color: #777789;
}

.primary-button,
.danger-button {
    padding: 10px 14px;
    border: 0;
    border-radius: 9px;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    background: var(--accent);
    color: #111;
}

.primary-button:hover {
    background: var(--accent-hover);
}

.danger-button {
    background: rgba(232, 89, 89, 0.14);
    color: #ff8d8d;
}

.danger-button:hover {
    background: rgba(232, 89, 89, 0.24);
}

.file-search-form {
    margin-bottom: 8px;
}

.search-help {
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.compact-empty {
    padding: 35px 20px;
}

@media (max-width: 900px) {
    .production-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .production-summary {
        grid-template-columns: 1fr;
    }

    .file-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .file-card form {
        width: 100%;
    }

    .file-card button {
        width: 100%;
    }
}

.registration-parts {
    display: grid;
    gap: 9px;
    margin-top: 17px;
}

.registration-part {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 13px 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-light);
    color: var(--text);
    text-decoration: none;

    transition:
        border-color 150ms ease,
        transform 150ms ease,
        background 150ms ease;
}

.registration-part:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.registration-part span:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.registration-part strong {
    font-size: 14px;
}

.registration-part small {
    color: var(--text-muted);
    font-size: 12px;
}

.registration-arrow {
    color: var(--accent);
    font-weight: 900;
}
