:root {
        --v66-revolution-red: #ff273f;
        --v66-revolution-dark: #330007;
        --v66-revolution-gold: #ffd56a;
        --v66-revolution-ink: #090306;
    }

    #v66-revolution-frame,
    #v66-revolution-banner {
        display: none;
        pointer-events: none;
    }

    body.v45-battle-active.v66-revolution-active #v66-revolution-frame {
        position: fixed;
        z-index: 38;
        inset: 7px;
        display: block;
        overflow: hidden;
        border: 3px solid var(--v66-revolution-red);
        border-radius: 13px;
        box-shadow:
            0 0 0 1px rgba(255, 221, 116, .78),
            0 0 24px rgba(255, 25, 55, .88),
            inset 0 0 34px rgba(255, 25, 55, .45);
        animation: v66-revolution-frame-pulse 1.35s ease-in-out infinite alternate;
    }

    body.v45-battle-active.v66-revolution-active #v66-revolution-frame::before,
    body.v45-battle-active.v66-revolution-active #v66-revolution-frame::after {
        position: absolute;
        inset: -30%;
        content: "";
    }

    body.v45-battle-active.v66-revolution-active #v66-revolution-frame::before {
        background:
            repeating-linear-gradient(
                118deg,
                transparent 0 54px,
                rgba(255, 28, 56, .075) 55px 82px,
                rgba(255, 213, 106, .055) 83px 86px
            );
        animation: v66-revolution-drift 8s linear infinite;
    }

    body.v45-battle-active.v66-revolution-active #v66-revolution-frame::after {
        inset: 0;
        background:
            linear-gradient(90deg, rgba(255, 16, 45, .18), transparent 8%, transparent 92%, rgba(255, 16, 45, .18)),
            linear-gradient(0deg, rgba(255, 16, 45, .16), transparent 10%, transparent 90%, rgba(255, 16, 45, .16));
    }

    body.v45-battle-active.v66-revolution-active #v66-revolution-banner {
        position: fixed;
        z-index: 39;
        top: clamp(60px, 8.4vh, 88px);
        left: 50%;
        display: grid;
        min-width: min(520px, calc(100vw - 36px));
        transform: translateX(-50%);
        place-items: center;
        padding: 8px 24px 9px;
        color: #fff9df;
        border: 1px solid rgba(255, 224, 126, .92);
        border-left: 5px solid var(--v66-revolution-red);
        border-right: 5px solid var(--v66-revolution-red);
        border-radius: 8px;
        background:
            linear-gradient(90deg, rgba(32, 0, 6, .94), rgba(123, 0, 20, .97) 42%, rgba(50, 0, 8, .94));
        box-shadow:
            0 0 0 2px rgba(75, 0, 12, .85),
            0 8px 28px rgba(0, 0, 0, .74),
            0 0 26px rgba(255, 30, 57, .58);
        text-align: center;
        isolation: isolate;
    }

    body.v45-battle-active.v66-revolution-active #v66-revolution-banner::before {
        position: absolute;
        z-index: -1;
        inset: 3px;
        content: "";
        border: 1px solid rgba(255, 213, 106, .38);
        border-radius: 4px;
    }

    #v66-revolution-title {
        color: var(--v66-revolution-gold);
        font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
        font-size: clamp(18px, 2.15vw, 28px);
        font-weight: 900;
        line-height: 1;
        letter-spacing: .22em;
        text-shadow:
            0 2px 0 #390008,
            0 0 13px rgba(255, 210, 88, .55);
    }

    #v66-revolution-title strong {
        color: #fff;
        letter-spacing: .08em;
    }

    #v66-revolution-order {
        margin-top: 5px;
        color: #ffe8ac;
        font-size: clamp(10px, 1.08vw, 13px);
        font-weight: 800;
        line-height: 1.15;
        letter-spacing: .05em;
    }

    body.v45-battle-active.v66-revolution-active #phase-bar {
        border-color: rgba(255, 69, 79, .96) !important;
        box-shadow:
            0 0 0 1px rgba(255, 213, 106, .62),
            0 0 19px rgba(255, 25, 55, .54) !important;
    }

    body.v45-battle-active.v66-revolution-active #phase-bar::before {
        display: inline-flex;
        align-items: center;
        min-height: 20px;
        margin-right: 9px;
        padding: 2px 8px;
        content: "REVOLUTION";
        color: #fff9de;
        border: 1px solid #ffd56a;
        border-radius: 3px;
        background: #a6001d;
        box-shadow: 0 0 12px rgba(255, 35, 62, .65);
        font-family: Impact, Haettenschweiler, sans-serif;
        font-size: 11px;
        letter-spacing: .12em;
        vertical-align: middle;
    }

    body.v45-battle-active.v66-revolution-active #revolution-status {
        display: block !important;
        min-height: 25px !important;
        max-height: none !important;
        padding: 4px 12px !important;
        color: #fff7d6 !important;
        border: 1px solid #ffd56a !important;
        border-radius: 5px !important;
        background: linear-gradient(90deg, #51000c, #bb0a26, #51000c) !important;
        box-shadow: 0 0 15px rgba(255, 36, 63, .62) !important;
        font-size: 12px !important;
        font-weight: 900 !important;
        letter-spacing: .08em !important;
    }

    body.v45-battle-active.v66-revolution-active .field-area {
        border-color: rgba(255, 61, 77, .62) !important;
        box-shadow:
            inset 0 0 34px rgba(140, 0, 20, .15),
            0 0 17px rgba(255, 21, 52, .18) !important;
    }

    body.v45-battle-active.v66-revolution-active #player-field,
    body.v45-battle-active.v66-revolution-active #opponent-field {
        border-color: rgba(255, 91, 99, .88) !important;
        background:
            radial-gradient(circle at 50% 50%, rgba(128, 0, 19, .24), transparent 70%),
            linear-gradient(180deg, rgba(48, 0, 7, .22), rgba(8, 1, 3, .18)) !important;
        box-shadow:
            inset 0 0 30px rgba(255, 25, 50, .19),
            0 0 17px rgba(255, 37, 59, .28) !important;
    }

    body.v45-battle-active.v66-revolution-active #player-field::before,
    body.v45-battle-active.v66-revolution-active #opponent-field::before {
        position: absolute;
        z-index: 4;
        top: 5px;
        left: 50%;
        padding: 2px 8px;
        transform: translateX(-50%);
        content: "↕ 強さ反転中";
        color: #ffe7a5;
        border: 1px solid rgba(255, 213, 106, .55);
        border-radius: 999px;
        background: rgba(82, 0, 11, .88);
        box-shadow: 0 0 10px rgba(255, 30, 58, .45);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .08em;
        white-space: nowrap;
    }

    body.v45-battle-active.v66-revolution-active #player-field,
    body.v45-battle-active.v66-revolution-active #opponent-field {
        position: relative;
    }

    body.v45-battle-active.v66-revolution-active .deck-pile {
        border-color: var(--v66-revolution-gold) !important;
        box-shadow:
            0 0 0 2px rgba(164, 0, 25, .72),
            0 0 15px rgba(255, 31, 55, .52) !important;
    }

    body.v45-battle-active.v66-revolution-active .deck-label::after {
        margin-left: 5px;
        content: "↕";
        color: #ffcc65;
        font-weight: 900;
    }

    body.v45-battle-active.v66-revolution-active .card:not(.card-back) {
        box-shadow:
            0 0 0 1px rgba(255, 197, 92, .42),
            0 0 10px rgba(255, 40, 64, .22);
    }

    body.v45-battle-active.v66-opponent-lily-lock #v38-hand-action-controls {
        display: none !important;
    }

    body.v45-battle-active.v66-opponent-digna-lock #player-chain-menu::after,
    body.v45-battle-active.v66-opponent-digna-lock #counter-menu::after {
        display: block;
        margin-top: 5px;
        content: "ディグナ覚醒：特殊チェーン戦では相手の場札を墓地へ送れません";
        color: #ffd58e;
        font-size: 11px;
        font-weight: 800;
    }

    #opponent-battle-character[data-v66-ai-ability="active"]::after {
        position: absolute;
        right: -5px;
        bottom: -5px;
        min-width: 28px;
        padding: 2px 5px;
        content: "AI";
        color: #fff5ce;
        border: 1px solid #ffd56a;
        border-radius: 999px;
        background: #780018;
        box-shadow: 0 0 10px rgba(255, 36, 64, .52);
        font-size: 9px;
        font-weight: 900;
        letter-spacing: .08em;
    }

    #opponent-battle-character.v66-ai-awakened {
        box-shadow:
            0 0 0 2px rgba(255, 214, 106, .72),
            0 0 19px var(--character-glow, rgba(255, 62, 88, .55)) !important;
    }

    @keyframes v66-revolution-frame-pulse {
        from {
            border-color: #d7062b;
            filter: saturate(.92);
        }
        to {
            border-color: #ff6a66;
            filter: saturate(1.23);
        }
    }

    @keyframes v66-revolution-drift {
        from { transform: translate3d(-8%, -4%, 0); }
        to { transform: translate3d(8%, 4%, 0); }
    }

    @media (max-width: 760px) {
        body.v45-battle-active.v66-revolution-active #v66-revolution-banner {
            top: 48px;
            min-width: calc(100vw - 26px);
            padding: 6px 13px 7px;
        }

        #v66-revolution-title {
            font-size: 17px;
        }

        #v66-revolution-order {
            font-size: 9px;
        }

        body.v45-battle-active.v66-revolution-active #player-field::before,
        body.v45-battle-active.v66-revolution-active #opponent-field::before {
            font-size: 8px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        body.v45-battle-active.v66-revolution-active #v66-revolution-frame,
        body.v45-battle-active.v66-revolution-active #v66-revolution-frame::before {
            animation: none !important;
        }
    }
