:root {
    color-scheme: light;
    --paper: #f4f0e7;
    --ink: #222821;
    --green: #174b45;
    --red: #bd503b;
    --muted: #77766e;
    --line: #d8d0c1;
    --serif: Georgia, "Times New Roman", serif;
    --sans: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--paper);
    background-image: repeating-linear-gradient(0deg, transparent 0, transparent 47px, rgb(34 40 33 / 3%) 48px);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

button {
    font: inherit;
}

.page-shell {
    width: min(1280px, calc(100% - 72px));
    margin: 0 auto;
}

.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-decoration: none;
}

.wordmark-icon {
    display: grid;
    width: 30px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background: var(--red);
    color: #fffaf0;
    font-family: var(--serif);
    font-size: 18px;
    font-style: italic;
}

.topbar-note,
.eyebrow,
.meta-label,
.result-kicker,
.footer {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.25px;
}

.topbar-note {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
}

.live-dot,
.movie-marker {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #d6a53c;
}

.intro {
    padding: 54px 0 37px;
    animation: arrive 650ms both;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--red);
}

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

h1 {
    margin-bottom: 14px;
    font-family: var(--serif);
    font-size: 64px;
    font-weight: 400;
    line-height: 0.98;
}

h1 em {
    color: var(--red);
    font-weight: 400;
}

.intro-copy {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
}

.movie-night {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    animation: arrive 650ms 100ms both;
}

.wheel-column {
    min-width: 0;
    padding: 25px 52px 34px 0;
}

.wheel-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
}

.meta-rule {
    height: 1px;
    flex: 1;
    background: var(--line);
}

.meta-label {
    color: var(--muted);
    white-space: nowrap;
}

.wheel-wrapper {
    position: relative;
    width: min(100%, 530px);
    aspect-ratio: 1;
    margin: 30px auto 25px;
}

#wheel {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    border: 7px solid #e5dac5;
    border-radius: 50%;
    box-shadow: 0 12px 30px rgb(34 40 33 / 16%), 0 0 0 1px rgb(34 40 33 / 10%);
    transform: rotate(0deg);
    transform-origin: center;
}

.pointer {
    position: absolute;
    z-index: 2;
    top: -7px;
    left: 50%;
    width: 26px;
    height: 34px;
    transform: translateX(-50%);
    background: var(--red);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    filter: drop-shadow(0 2px 1px rgb(34 40 33 / 20%));
}

.wheel-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 66px;
    aspect-ratio: 1;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 4px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 2px 8px rgb(0 0 0 / 25%);
    color: #f2c45a;
    font-family: var(--serif);
    font-size: 15px;
    font-style: italic;
}

.wheel-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spin-button,
.watched-button {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 3px;
    background: var(--green);
    color: #fffaf0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: background 150ms ease, transform 150ms ease;
}

.spin-button {
    min-width: 220px;
    padding: 0 25px;
}

.spin-button:hover:not(:disabled),
.watched-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #103a35;
}

.spin-button:disabled,
.watched-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.spin-icon {
    color: #f2c45a;
    font-size: 22px;
    line-height: 1;
}

.spin-caption {
    margin: 10px 0 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 13px;
    font-style: italic;
}

.result {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    min-height: 65px;
    margin-top: 27px;
    padding: 11px 15px;
    border-left: 3px solid var(--red);
    background: rgb(255 255 255 / 48%);
}

.result-kicker {
    color: var(--red);
    white-space: nowrap;
}

.result-title {
    overflow-wrap: anywhere;
    font-family: var(--serif);
    font-size: 17px;
}

.watched-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 11px;
}

.watched-button[hidden] {
    display: none;
}

.watchlist-panel {
    min-width: 0;
    padding: 29px 0 25px 34px;
    border-left: 1px solid var(--line);
}

.watchlist-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 23px;
}

.watchlist-heading .eyebrow {
    margin-bottom: 7px;
}

.collection-actions {
    display: flex;
    align-items: center;
    gap: 11px;
}

.add-movie-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: var(--green);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.add-movie-toggle span {
    color: var(--red);
    font-size: 19px;
    font-weight: 400;
    line-height: 0.8;
}

.add-movie-toggle:hover,
.cancel-add:hover {
    color: var(--red);
}

.add-movie-form {
    display: grid;
    gap: 12px;
    margin: -4px 0 17px;
    padding: 15px;
    border: 1px solid var(--line);
    background: rgb(255 255 255 / 42%);
}

.add-movie-form[hidden] {
    display: none;
}

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 10px;
}

.form-field {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: #fffdf8;
    color: var(--ink);
    font: 13px var(--sans);
}

.form-field input:focus {
    border-color: var(--green);
    outline: 2px solid rgb(23 75 69 / 16%);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.add-submit {
    min-height: 36px;
    padding: 0 13px;
    border: 0;
    border-radius: 2px;
    background: var(--green);
    color: #fffaf0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.add-submit:hover:not(:disabled) {
    background: #103a35;
}

.add-submit:disabled {
    cursor: wait;
    opacity: 0.6;
}

.cancel-add {
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
}

.manage-error {
    margin: 0;
    color: #a23d50;
    font-size: 11px;
    line-height: 1.45;
}

.manage-error[hidden] {
    display: none;
}

h2 {
    margin-bottom: 0;
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 400;
}

.count-badge {
    display: grid;
    min-width: 32px;
    height: 32px;
    padding: 0 7px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

.list-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--line);
}

.list-tab {
    position: relative;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.list-tab::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: transparent;
    content: "";
}

.list-tab.is-active {
    color: var(--green);
}

.list-tab.is-active::after {
    background: var(--red);
}

.movie-list {
    max-height: 430px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.movie-row {
    display: flex;
    min-height: 69px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.movie-details {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.movie-title {
    overflow: hidden;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-metadata {
    color: var(--muted);
    font-size: 10px;
}

.movie-marker {
    width: 8px;
    height: 8px;
    background: var(--red);
}

.restore-button {
    flex: 0 0 auto;
    padding: 7px 0 7px 8px;
    border: 0;
    background: transparent;
    color: var(--green);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.remove-button {
    display: grid;
    width: 28px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #928b7e;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.remove-button:hover:not(:disabled) {
    color: var(--red);
}

.remove-button:disabled {
    cursor: wait;
    opacity: 0.5;
}

.restore-button:hover {
    color: var(--red);
    text-decoration: underline;
}

.empty-row {
    padding: 25px 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 14px;
    font-style: italic;
}

.list-footnote {
    margin: 17px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 22px 0 28px;
    color: var(--muted);
    font-size: 9px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #d6a53c;
    outline-offset: 3px;
}

@keyframes arrive {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
    .page-shell {
        width: min(100% - 40px, 640px);
    }

    .movie-night {
        grid-template-columns: 1fr;
    }

    .wheel-column {
        padding: 23px 0 30px;
    }

    .wheel-wrapper {
        width: min(100%, 500px);
    }

    .watchlist-panel {
        padding: 26px 0 25px;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .movie-list {
        max-height: 320px;
    }
}

@media (max-width: 480px) {
    .page-shell {
        width: calc(100% - 32px);
    }

    .topbar {
        min-height: 68px;
    }

    .topbar-note {
        font-size: 8px;
        letter-spacing: 0.7px;
    }

    .intro {
        padding: 38px 0 28px;
    }

    h1 {
        font-size: 46px;
    }

    .wheel-meta {
        gap: 8px;
        font-size: 9px;
    }

    .meta-label {
        font-size: 8px;
        letter-spacing: 0.7px;
    }

    .wheel-wrapper {
        margin: 24px auto 22px;
    }

    .wheel-hub {
        width: 52px;
        font-size: 12px;
    }

    .result {
        grid-template-columns: auto 1fr;
        gap: 8px 12px;
    }

    .watched-button {
        grid-column: 2;
        justify-self: start;
    }

    .footer {
        font-size: 8px;
        letter-spacing: 0.7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}