* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(circle at top,
            #252525,
            #111);

    color: #fff;
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    background: #5865f2;
    color: white;
    font-weight: 600;
}

button:hover {
    filter: brightness(1.15);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.secondary {
    background: #333;
}

/* ---------------- LOGIN ---------------- */

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: min(400px, calc(100% - 40px));
    padding: 40px;
    background: #1c1c1c;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    text-align: center;
}

.login-box h1 {
    margin-top: 0;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-box input {
    padding: 13px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #111;
    color: white;
}

.error {
    color: #ff6b6b;
    margin-top: 12px;
}

/* ---------------- APP ---------------- */

.hidden {
    display: none !important;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 20px 30px;

    background: #181818;
    border-bottom: 1px solid #333;
}

header h1 {
    margin: 0 0 4px;
}

header span {
    color: #aaa;
}

main {
    width: min(1200px, calc(100% - 30px));
    margin: auto;
}

/* ---------------- WHEEL ---------------- */

.wheel-section {
    text-align: center;
    padding: 40px 0;
}

.wheel-wrapper {
    position: relative;

    width: min(600px, 90vw);
    aspect-ratio: 1;

    margin: auto;
}

#wheel {
    width: 100%;
    height: 100%;

    display: block;

    transition:
        transform 0s;
}

.pointer {
    position: absolute;

    top: -4px;
    left: 50%;

    transform: translateX(-50%);

    width: 0;
    height: 0;

    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 45px solid white;

    z-index: 5;

    filter:
        drop-shadow(0 3px 5px rgba(0, 0, 0, .7));
}

.spin-button {
    margin-top: 25px;

    font-size: 22px;
    padding: 16px 50px;

    border-radius: 12px;
}

.winner {
    margin: 25px auto 0;

    width: fit-content;

    padding: 15px 30px;

    border-radius: 12px;

    background: #202020;

    font-size: 24px;
    font-weight: 700;
}

.remove-winner-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: fit-content;
    margin: 15px auto 0;

    color: #bbb;
    cursor: pointer;
    user-select: none;
}

.remove-winner-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ---------------- PANELS ---------------- */

.panel {
    background: #1c1c1c;

    border: 1px solid #333;

    border-radius: 12px;

    padding: 20px;

    margin-bottom: 25px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.panel-header h2 {
    margin: 0;
}

.description {
    color: #999;
}

/* ---------------- ADD MOVIE ---------------- */

.add-movie {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.add-movie input {
    flex: 1;

    min-width: 0;

    padding: 12px;

    background: #111;

    border: 1px solid #444;

    border-radius: 8px;

    color: white;
}

#movieMessage {
    min-height: 24px;
}

.success {
    color: #6ee7a0;
}

.error-message {
    color: #ff6b6b;
}

/* ---------------- MOVIE LIST ---------------- */

.movie-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.movie-item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 15px;

    background: #111;

    border-radius: 8px;

    border: 1px solid #292929;
}

.movie-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-button {
    background: #b33a3a;
    padding: 7px 12px;
}

/* ---------------- BACKUPS ---------------- */

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;

    padding: 12px;

    margin-top: 8px;

    background: #111;

    border-radius: 8px;
}

.backup-info {
    display: flex;
    flex-direction: column;
}

.backup-info small {
    color: #888;
}

.restore-button {
    background: #b06a20;
}

/* ---------------- AUDIT ---------------- */

.audit-entry {
    display: grid;

    grid-template-columns:
        180px 100px 1fr;

    gap: 10px;

    padding: 9px;

    border-bottom: 1px solid #292929;

    font-size: 14px;
}

.audit-time {
    color: #888;
}

.audit-action {
    font-weight: 700;
}

/* ---------------- MOVIE HISTORY ---------------- */

.movie-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: grid;

    grid-template-columns:
        60px 1fr 220px;

    align-items: center;

    gap: 12px;

    padding: 12px 15px;

    background: #111;

    border: 1px solid #292929;

    border-radius: 8px;
}

.history-number {
    color: #777;
    font-weight: 700;
}

.history-title {
    font-weight: 600;
}

.history-time {
    color: #888;
    text-align: right;
    font-size: 14px;
}

/* ---------------- MOBILE ---------------- */

@media (max-width: 650px) {

    header {
        padding: 15px;
    }

    header h1 {
        font-size: 22px;
    }

    main {
        width: calc(100% - 20px);
    }

    .add-movie {
        flex-direction: column;
    }

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

    .backup-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .audit-entry {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .history-item {
        grid-template-columns:
            45px 1fr;
    }

    .history-time {
        grid-column: 2;
        text-align: left;
    }
}