/* =========================================================
   YOUR HONOR MY BRAIN IS BEING MEAN AGAIN
   COURTROOM THEME
   FASTER PACING VERSION
   ========================================================= */

* {
    box-sizing: border-box;
}

:root {
    --black: #100a07;
    --deep-brown: #1b100b;
    --wood: #2c1710;
    --wood-light: #44271b;
    --wood-highlight: #633c28;

    --burgundy: #5f1118;
    --burgundy-dark: #37090d;

    --gold: #c8a95f;
    --gold-light: #e0c886;
    --gold-dark: #8b713b;

    --paper: #eadcbc;
    --paper-light: #f4ead2;
    --paper-dark: #cbb98e;

    --ink: #2b2017;
    --cream: #f5ead0;

    --shadow:
        0 25px 70px rgba(0, 0, 0, 0.55);

    --line:
        rgba(202, 171, 97, 0.25);
}


/* =========================================================
   BODY
   ========================================================= */

html {
    scroll-behavior: smooth;
}

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

    background:
        radial-gradient(
            circle at top,
            rgba(115, 70, 42, 0.18),
            transparent 40%
        ),
        linear-gradient(
            180deg,
            #180e0a 0%,
            #0d0806 100%
        );

    color: var(--cream);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    overflow-x: hidden;
}


/* subtle grain */

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    opacity: 0.07;

    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.025) 0px,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px,
            transparent 4px
        );

    z-index: 50;
}


/* =========================================================
   BACKGROUND COURT DETAILS
   ========================================================= */

.court-background {
    position: fixed;
    inset: 0;

    overflow: hidden;
    pointer-events: none;

    opacity: 0.45;
}

.court-column {
    position: absolute;
    top: 0;

    width: 130px;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(104, 63, 38, 0.28),
            rgba(192, 145, 88, 0.12),
            rgba(104, 63, 38, 0.28),
            transparent
        );
}

.court-column::before,
.court-column::after {
    content: "";

    position: absolute;

    left: 10px;
    right: 10px;

    height: 42px;

    border-top:
        1px solid rgba(208, 174, 101, 0.15);

    border-bottom:
        1px solid rgba(208, 174, 101, 0.12);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(150, 98, 57, 0.18),
            transparent
        );
}

.court-column::before {
    top: 40px;
}

.court-column::after {
    bottom: 40px;
}

.court-column-left {
    left: 0;
}

.court-column-right {
    right: 0;
}


/* =========================================================
   MAIN COURTROOM
   ========================================================= */

.courtroom {
    position: relative;
    z-index: 2;

    width:
        min(
            920px,
            calc(100% - 28px)
        );

    margin:
        28px auto 80px;

    border:
        1px solid
        rgba(211, 176, 97, 0.3);

    border-radius: 4px;

    background:
        linear-gradient(
            180deg,
            rgba(56, 31, 20, 0.97),
            rgba(24, 14, 10, 0.98)
        );

    box-shadow: var(--shadow);

    overflow: hidden;
}


/* =========================================================
   HEADER
   ========================================================= */

.court-header {
    position: relative;

    padding:
        52px
        34px
        35px;

    text-align: center;

    background:
        linear-gradient(
            180deg,
            rgba(48, 25, 17, 0.95),
            rgba(29, 16, 11, 0.98)
        );

    border-bottom:
        1px solid
        rgba(202, 169, 95, 0.28);
}

.court-header::before {
    content: "";

    position: absolute;

    top: 13px;
    left: 18px;
    right: 18px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold-dark),
            transparent
        );
}


/* =========================================================
   COURT SEAL
   ========================================================= */

.court-seal {
    display: flex;

    justify-content: center;

    margin-bottom: 22px;
}

.seal-ring {
    width: 78px;
    height: 78px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    border:
        2px solid
        var(--gold);

    box-shadow:
        0 0 0 6px rgba(199, 167, 92, 0.08),
        inset 0 0 18px rgba(199, 167, 92, 0.15);

    position: relative;
}

.seal-ring::before {
    content: "";

    position: absolute;

    inset: 7px;

    border-radius: 50%;

    border:
        1px dashed
        rgba(218, 190, 126, 0.55);
}

.seal-scales {
    font-size: 32px;

    color: var(--gold-light);

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


/* =========================================================
   TITLES
   ========================================================= */

.court-small-title {
    margin:
        0
        0
        12px;

    color:
        var(--gold-light);

    font-size: 0.69rem;

    letter-spacing: 0.21em;

    text-transform: uppercase;

    opacity: 0.75;
}

.court-header h1 {
    margin: 0;

    font-size:
        clamp(
            1.7rem,
            6vw,
            3.35rem
        );

    line-height: 1.05;

    font-weight: 500;

    letter-spacing: 0.04em;

    color:
        var(--paper-light);

    text-shadow:
        0 3px 12px
        rgba(0, 0, 0, 0.65);
}

.court-header h1 span {
    display: block;

    margin-top: 9px;

    color:
        var(--gold-light);

    font-size: 0.55em;

    letter-spacing: 0.12em;
}


/* =========================================================
   META
   ========================================================= */

.court-meta {
    margin-top: 28px;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 20px;

    flex-wrap: wrap;

    color:
        rgba(242, 229, 199, 0.62);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.66rem;

    letter-spacing: 0.15em;
}

.status {
    color: #c87575;
}


/* =========================================================
   JUDGE BENCH
   ========================================================= */

.judge-bench {
    position: relative;

    height: 64px;

    background:
        linear-gradient(
            180deg,
            #4f2d1e,
            #2e180f
        );

    border-top:
        1px solid
        rgba(255, 220, 153, 0.16);

    border-bottom:
        4px solid
        #120907;

    box-shadow:
        inset 0 8px 12px rgba(255, 255, 255, 0.025),
        0 10px 26px rgba(0, 0, 0, 0.4);
}

.judge-bench::before {
    content: "";

    position: absolute;

    inset: 9px 19px;

    border:
        1px solid
        rgba(219, 173, 106, 0.13);
}

.bench-nameplate {
    position: absolute;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -50%);

    width: max-content;

    max-width: 80%;

    padding:
        7px
        15px;

    background: #17100c;

    border:
        1px solid
        var(--gold-dark);

    color:
        rgba(227, 197, 128, 0.85);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.57rem;

    letter-spacing: 0.15em;

    text-align: center;

    box-shadow:
        0 5px 12px
        rgba(0, 0, 0, 0.45);
}


/* =========================================================
   TRANSCRIPT
   FASTER SCREEN CHANGES
   ========================================================= */

.transcript {
    position: relative;

    min-height: 340px;

    padding:
        48px
        42px
        28px;

    background:
        radial-gradient(
            circle at top,
            rgba(184, 139, 77, 0.06),
            transparent 45%
        ),
        rgba(13, 8, 6, 0.46);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.transcript.changing {
    opacity: 0;

    transform:
        translateY(5px);
}


/* =========================================================
   EACH SPEECH ENTRY
   MUCH FASTER FADE-IN
   ========================================================= */

.court-entry {
    width:
        min(
            690px,
            100%
        );

    margin:
        0
        auto
        29px;

    opacity: 0;

    transform:
        translateY(8px);

    animation:
        courtFadeIn
        0.45s
        cubic-bezier(
            0.22,
            1,
            0.36,
            1
        )
        forwards;
}

@keyframes courtFadeIn {

    from {
        opacity: 0;

        transform:
            translateY(8px);

        filter:
            blur(1px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);

        filter:
            blur(0);
    }
}


/* =========================================================
   SPEAKER
   ========================================================= */

.speaker {
    display: block;

    margin-bottom: 9px;

    color:
        var(--gold);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-weight: 700;

    font-size: 0.69rem;

    letter-spacing: 0.18em;

    text-transform: uppercase;
}


/* =========================================================
   COURT TEXT
   ========================================================= */

.court-text {
    margin: 0;

    color:
        rgba(245, 234, 208, 0.95);

    font-size:
        clamp(
            1.05rem,
            3.8vw,
            1.28rem
        );

    line-height: 1.75;

    letter-spacing: 0.005em;
}

.court-text strong {
    color:
        var(--gold-light);

    font-weight: 600;
}


/* =========================================================
   EVIDENCE
   ========================================================= */

.court-entry.evidence {
    padding:
        18px
        20px;

    border-left:
        3px solid
        var(--burgundy);

    background:
        linear-gradient(
            90deg,
            rgba(92, 16, 23, 0.16),
            transparent
        );
}


/* =========================================================
   QUOTE
   ========================================================= */

.court-entry.quote {
    padding:
        21px
        22px;

    border:
        1px solid
        rgba(199, 168, 94, 0.19);

    background:
        rgba(235, 218, 181, 0.045);
}

.court-entry.quote .court-text {
    color:
        var(--paper-light);

    font-style: italic;
}


/* =========================================================
   BIG TITLE
   ========================================================= */

.court-entry.big-title {
    text-align: center;

    margin-top: 14px;

    margin-bottom: 35px;
}

.court-entry.big-title .speaker {
    display: none;
}

.court-entry.big-title .court-text {
    color:
        var(--gold-light);

    font-size:
        clamp(
            1.5rem,
            6vw,
            2.65rem
        );

    line-height: 1.2;

    letter-spacing: 0.07em;

    text-transform: uppercase;
}


/* =========================================================
   VERDICT
   ========================================================= */

.court-entry.verdict {
    text-align: center;

    padding:
        29px
        20px;

    border:
        2px solid
        rgba(209, 174, 94, 0.48);

    background:
        radial-gradient(
            circle,
            rgba(115, 20, 25, 0.26),
            rgba(55, 9, 13, 0.08)
        );

    box-shadow:
        inset
        0
        0
        35px
        rgba(190, 139, 64, 0.05);
}

.court-entry.verdict .speaker {
    display: none;
}

.court-entry.verdict .court-text {
    color: #f3dda5;

    font-size:
        clamp(
            2rem,
            9vw,
            4.3rem
        );

    line-height: 1;

    letter-spacing: 0.07em;

    font-weight: 700;
}


/* =========================================================
   EMOJI
   ========================================================= */

.court-entry.emoji {
    text-align: center;
}

.court-entry.emoji .court-text {
    font-size: 3.1rem;

    line-height: 1;
}


/* =========================================================
   CLARENCE COO
   STILL DRAMATIC BUT NOT PAINFULLY SLOW
   ========================================================= */

.court-entry.clarence {
    text-align: center;

    margin-top: 40px;

    margin-bottom: 45px;

    animation-duration: 0.85s;
}

.court-entry.clarence .speaker {
    text-align: center;

    color:
        var(--gold-light);
}

.court-entry.clarence .court-text {
    font-size: 1.7rem;

    font-style: italic;

    letter-spacing: 0.2em;

    color:
        var(--paper-light);
}


/* =========================================================
   DRAMATIC PAUSE
   ========================================================= */

.court-entry.pause {
    text-align: center;
}

.court-entry.pause .speaker {
    display: none;
}

.court-entry.pause .court-text {
    color:
        rgba(227, 206, 164, 0.4);

    letter-spacing: 0.5em;
}


/* =========================================================
   CASE CLOSED
   ========================================================= */

.court-entry.case-closed {
    text-align: center;

    margin-top: 40px;

    padding:
        30px
        15px;

    border-top:
        1px solid
        rgba(201, 166, 88, 0.3);

    border-bottom:
        1px solid
        rgba(201, 166, 88, 0.3);
}

.court-entry.case-closed .speaker {
    display: none;
}

.court-entry.case-closed .court-text {
    color:
        var(--gold-light);

    font-size:
        clamp(
            1.9rem,
            8vw,
            3.5rem
        );

    letter-spacing: 0.07em;
}


/* =========================================================
   WAIT DOTS
   FASTER
   ========================================================= */

.court-waiting {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 7px;

    min-height: 35px;

    margin:
        0
        auto
        12px;
}

.court-waiting span {
    width: 5px;

    height: 5px;

    border-radius: 50%;

    background:
        var(--gold-dark);

    animation:
        waitingDot
        0.9s
        infinite
        ease-in-out;
}

.court-waiting span:nth-child(2) {
    animation-delay: 0.12s;
}

.court-waiting span:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes waitingDot {

    0%,
    70%,
    100% {
        opacity: 0.2;

        transform:
            translateY(0);
    }

    35% {
        opacity: 0.9;

        transform:
            translateY(-4px);
    }
}

.hidden {
    display: none !important;
}


/* =========================================================
   BUTTON AREA
   ========================================================= */

.choices {
    width:
        min(
            720px,
            calc(100% - 36px)
        );

    margin:
        12px
        auto
        55px;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(190px, 1fr)
        );

    gap: 13px;

    opacity: 1;

    transition:
        opacity 0.25s ease;
}


/* =========================================================
   CHOICE BUTTON
   ========================================================= */

.choice-button {
    position: relative;

    min-height: 58px;

    padding:
        15px
        18px;

    border:
        1px solid
        rgba(209, 175, 98, 0.46);

    border-radius: 3px;

    background:
        linear-gradient(
            180deg,
            #55311f,
            #382015
        );

    color:
        var(--paper-light);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.75rem;

    font-weight: 700;

    line-height: 1.35;

    letter-spacing: 0.06em;

    cursor: pointer;

    box-shadow:
        0 7px 0 #1b0d08,
        0 13px 22px rgba(0, 0, 0, 0.28),
        inset 0 1px rgba(255, 255, 255, 0.08);

    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;

    animation:
        buttonArrival
        0.42s
        ease
        backwards;
}


/* buttons don't wait as long */

.choice-button:nth-child(2) {
    animation-delay: 0.06s;
}

.choice-button:nth-child(3) {
    animation-delay: 0.12s;
}

.choice-button:nth-child(4) {
    animation-delay: 0.18s;
}


@keyframes buttonArrival {

    from {
        opacity: 0;

        transform:
            translateY(8px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}


.choice-button::before {
    content: "";

    position: absolute;

    inset: 4px;

    border:
        1px solid
        rgba(225, 194, 123, 0.1);

    pointer-events: none;
}


.choice-button:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(230, 201, 134, 0.8);

    background:
        linear-gradient(
            180deg,
            #6a3c27,
            #432519
        );

    box-shadow:
        0 8px 0 #1b0d08,
        0 16px 28px rgba(0, 0, 0, 0.33),
        inset 0 1px rgba(255, 255, 255, 0.1);
}


.choice-button:active {
    transform:
        translateY(5px);

    box-shadow:
        0 2px 0 #1b0d08,
        0 6px 14px rgba(0, 0, 0, 0.25);
}


.choice-button:disabled {
    opacity: 0.45;

    cursor: default;
}


/* =========================================================
   RESTART BUTTON
   ========================================================= */

.choice-button.restart {
    background:
        linear-gradient(
            180deg,
            #67161e,
            #3f0d12
        );
}


/* =========================================================
   COURT DIVIDER
   ========================================================= */

.court-divider {
    width:
        min(
            700px,
            calc(100% - 50px)
        );

    margin:
        0
        auto
        25px;

    display: flex;

    align-items: center;

    gap: 15px;

    color:
        rgba(196, 163, 89, 0.55);
}

.court-divider span {
    flex: 1;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(196, 163, 89, 0.35)
        );
}

.court-divider span:last-child {
    transform:
        rotate(180deg);
}


/* =========================================================
   FOOTER
   ========================================================= */

.court-footer {
    padding:
        0
        25px
        32px;

    text-align: center;

    color:
        rgba(233, 216, 180, 0.33);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.62rem;

    letter-spacing: 0.08em;
}


/* =========================================================
   SCREEN TRANSITION
   FASTER
   ========================================================= */

.transition-curtain {
    position: fixed;

    inset: 0;

    z-index: 40;

    pointer-events: none;

    background:
        radial-gradient(
            circle,
            rgba(91, 51, 31, 0.2),
            rgba(10, 6, 5, 0.88)
        );

    opacity: 0;

    transition:
        opacity 0.18s ease;
}

.transition-curtain.active {
    opacity: 0.32;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .courtroom {
        width:
            calc(100% - 14px);

        margin:
            8px
            auto
            45px;
    }

    .court-header {
        padding:
            40px
            18px
            28px;
    }

    .court-small-title {
        line-height: 1.7;
    }

    .seal-ring {
        width: 66px;

        height: 66px;
    }

    .seal-scales {
        font-size: 27px;
    }

    .transcript {
        padding:
            39px
            20px
            25px;

        min-height: 310px;
    }

    .court-entry {
        margin-bottom: 25px;

        animation-duration: 0.4s;
    }

    .court-entry.clarence {
        animation-duration: 0.8s;
    }

    .court-text {
        line-height: 1.68;
    }

    .choices {
        width:
            calc(100% - 30px);

        grid-template-columns:
            1fr;

        margin-bottom: 45px;
    }

    .choice-button {
        min-height: 57px;
    }

    .court-column {
        display: none;
    }
}


/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 380px) {

    .court-header h1 {
        font-size: 1.55rem;
    }

    .court-header h1 span {
        line-height: 1.35;
    }

    .bench-nameplate {
        font-size: 0.5rem;
    }

    .transcript {
        padding-left: 17px;

        padding-right: 17px;
    }
}


/* =========================================================
   CASE CLOSED EFFECT
   ========================================================= */

body.finished .court-seal {
    animation:
        sealFinish
        0.85s
        ease;
}

@keyframes sealFinish {

    0% {
        transform:
            scale(1);
    }

    35% {
        transform:
            scale(1.18)
            rotate(-4deg);
    }

    100% {
        transform:
            scale(1);
    }
}


/* =========================================================
   ACCESSIBILITY
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;
    }
}
