:root {
    color-scheme: dark;
    --background: #0f0f0f;
    --surface: #1a1a1a;
    --card: #252525;
    --accent: #7c3aed;
    --muted: #aaa;
    --border: #383838;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    background: var(--background);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
header, footer { background: var(--surface); padding: 1.25rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
header { border-bottom: 1px solid var(--border); }
.brand { color: #fff; font-weight: 650; font-size: 1.2rem; text-decoration: none; }
.brand span { color: var(--muted); font-weight: 400; margin-left: .5rem; }
main { width: 100%; max-width: 1140px; margin: 0 auto; padding: 2.5rem 2rem; flex: 1; }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 0; }
.intro, .muted, .environment-description, .unlock-card > p { color: var(--muted); }
.intro { margin: 0 0 2rem; }
.environments { display: inline-flex; gap: .35rem; padding: .35rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
button, input, select, .preview-link { font: inherit; border-radius: 7px; }
button, .preview-link { cursor: pointer; transition: background .15s ease, border-color .15s ease; }
button { color: #fff; padding: .65rem 1rem; border: 1px solid var(--border); background: var(--surface); }
button:disabled { opacity: .6; cursor: wait; }
button:hover:not(:disabled), .preview-link:hover { border-color: #9c74ee; }
.environments button { background: transparent; border-color: transparent; min-width: 85px; }
.environments button[aria-pressed="true"] { background: var(--accent); }
.primary-button, .preview-link { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.primary-button:hover:not(:disabled), .preview-link:hover { background: #8b5cf6; }
.secondary-button { font-size: .875rem; }
.environment-description { font-size: .85rem; margin: .75rem 0 1.75rem; }
.unlock-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; max-width: 620px; }
.unlock-card > p { line-height: 1.5; margin: .75rem 0 1.5rem; }
label { display: block; color: var(--muted); font-size: .8rem; margin-bottom: .5rem; }
input, select { padding: .7rem .85rem; width: 100%; min-width: 0; background: var(--background); border: 1px solid var(--border); color: #fff; }
:focus-visible { outline: 2px solid #b69af5; outline-offset: 3px; }
.unlock-fields { display: flex; gap: .75rem; }
.unlock-fields input { flex: 1; }
.unlock-fields button { flex-shrink: 0; }
.notice { min-height: 1.5rem; color: var(--muted); margin: 1.25rem 0; line-height: 1.5; }
.notice.error { color: #fca5a5; }
.notice:empty { margin: 0; min-height: 0; }
.directory-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.directory-heading .muted { margin: .5rem 0 0; font-size: .85rem; }
.search-field { width: 300px; max-width: 100%; }
.festival-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 1.25rem; }
.festival-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.festival-card h3 { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.festival-aliases { margin: -.5rem 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.festival-id { margin: 0; color: var(--muted); font: .7rem ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.version-field { margin-top: auto; }
.version-help { color: var(--muted); font-size: .75rem; line-height: 1.5; margin: .5rem 0 0; }
.preview-link { padding: .75rem 1rem; text-align: center; text-decoration: none; font-size: .9rem; }
.preview-link[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.empty-state { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border-radius: 12px; }
footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; line-height: 1.5; }
footer a { color: #c4b5fd; }
@media (max-width: 600px) {
    header, footer { padding: 1rem; flex-wrap: wrap; }
    main { padding: 2rem 1rem; }
    h1 { font-size: 1.65rem; }
    .unlock-fields, .directory-heading { flex-direction: column; align-items: stretch; }
    .search-field { width: 100%; }
    .festival-grid { grid-template-columns: 1fr; }
}
