:root {
    color-scheme: dark;
    --bg: #15100b;
    --panel: #20150f;
    --panel-2: #302117;
    --line: #6b4b2f;
    --text: #f8ead8;
    --muted: #c7ad8b;
    --gold: #d9a441;
    --red: #9e3a2f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    background-color: #1e1209;
    background-image:
        linear-gradient(rgba(12, 8, 5, .12), rgba(12, 8, 5, .44)),
        url("../images/small_desert_tile.webp");
    background-position: center top, center top;
    background-size: auto, 512px 512px;
    background-repeat: repeat, repeat;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #3a281b;
    cursor: pointer;
}

button:hover {
    border-color: var(--gold);
}

button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.primary {
    background: var(--red);
    border-color: #c75c42;
}

.shell {
    min-height: 100vh;
}

.landing-hero {
    --sky-top: #99dcff;
    --sky-bottom: #225f9c;
    --sun-color: #fff8bc;
    --sun-glow: rgba(255, 236, 125, .72);
    --sun-y: 0px;
    --sun-scale: 1;
    --rim-glow: rgba(255, 91, 43, 0);
    --rim-glow-soft: rgba(255, 126, 54, 0);
    position: relative;
    display: block;
    height: clamp(980px, 170vh, 1900px);
    min-height: 980px;
    overflow: visible;
    isolation: isolate;
    background: transparent;
}

.landing-hero::after {
    content: "";
    position: absolute;
    z-index: 12;
    left: 0;
    right: 0;
    bottom: 0;
    height: 13.3854167vw;
    min-height: 52px;
    pointer-events: none;
    background: url("../images/separator.webp") center bottom / 100% auto no-repeat;
    transform: translateY(62%);
}

.parallax-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 560px;
    overflow: hidden;
    isolation: isolate;
    background: #6fbce8;
}

.parallax-sky {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

.parallax-sun {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 4%;
    width: clamp(92px, 12vw, 190px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--sun-color) 0 82%, rgba(255, 95, 45, .96) 100%);
    box-shadow: 0 0 58px var(--sun-glow), 0 0 148px rgba(255, 189, 73, .5), 0 0 230px rgba(255, 87, 43, .3);
    transform: translate3d(-50%, var(--sun-y), 0) scale(var(--sun-scale));
    transform-origin: center;
    animation: sunHeatGlow 3.8s ease-in-out infinite;
    will-change: transform, background, box-shadow;
}

.parallax-sun::after {
    content: "";
    position: absolute;
    inset: -60%;
    border-radius: inherit;
    background: radial-gradient(circle, var(--sun-glow) 0 20%, rgba(255, 164, 70, .2) 46%, transparent 72%);
    animation: sunPulse 4.8s ease-in-out infinite;
}

.parallax-layer {
    position: absolute;
    left: 0;
    right: auto;
    bottom: 0;
    width: 100vw;
    height: auto;
    max-width: none;
    pointer-events: none;
    user-select: none;
    transform: translate3d(0, var(--layer-y, 0px), 0);
    transform-origin: left bottom;
    will-change: transform;
}

.parallax-layer-1 { z-index: 2; }
.parallax-layer-2 { z-index: 3; }
.parallax-layer-3 { z-index: 4; }
.parallax-layer-4 { z-index: 5; }
.parallax-layer-5 { z-index: 7; }
.parallax-layer-6 { z-index: 9; }
.parallax-layer-7 { z-index: 10; }

.landing-hero-logo {
    position: absolute;
    z-index: 8;
    left: 50%;
    top: 33.333%;
    width: min(640px, 72vw);
    max-height: 260px;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    transform: translate(-50%, -50%) translateY(var(--layer-y, 0px));
    filter: drop-shadow(0 16px 20px rgba(50, 22, 7, .45)) drop-shadow(0 0 18px rgba(255, 222, 130, .22));
    will-change: transform;
}

.parallax-ground {
    display: none;
}

@keyframes sunHeatGlow {
    0%, 100% { box-shadow: 0 0 52px var(--sun-glow), 0 0 132px rgba(255, 189, 73, .44), 0 0 210px rgba(255, 87, 43, .26); filter: saturate(1.04) brightness(1.03); }
    50% { box-shadow: 0 0 78px var(--sun-glow), 0 0 190px rgba(255, 178, 78, .62), 0 0 300px rgba(255, 74, 36, .4); filter: saturate(1.12) brightness(1.07); }
}

@keyframes sunPulse {
    0%, 100% { opacity: .54; transform: scale(.95); }
    50% { opacity: .94; transform: scale(1.1); }
}

@media (max-width: 720px) {
    .landing-hero {
        height: 165vh;
        min-height: 860px;
    }

    .parallax-stage {
        min-height: 560px;
    }

    .landing-hero-logo {
        width: min(82vw, 540px);
    }

    .parallax-sun {
        left: 50%;
        top: 3%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .parallax-sun,
    .parallax-sun::after {
        animation: none;
    }
}
.lobby {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    padding: clamp(70px, 8vh, 110px) 24px 10px;
}

.brand {
    position: fixed;
    top: 22px;
    left: 24px;
    display: grid;
    gap: 3px;
}

.brand span {
    font-size: 42px;
    font-weight: 900;
}

.brand strong {
    color: var(--gold);
    font-size: 18px;
}

.lobby-panel {
    width: min(560px, 100%);
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(36, 24, 17, .84);
    backdrop-filter: blur(2px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.lobby-panel h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.lobby-panel p {
    color: var(--muted);
    line-height: 1.45;
}

.join-info {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 18px;
}

.join-info span {
    grid-column: 1 / -1;
    color: var(--muted);
}

.join-info input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 10px;
    color: var(--text);
    background: #120c08;
}

.new-game-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.cpu-level-picker {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid rgba(217, 164, 65, .35);
    border-radius: 8px;
    background: rgba(18, 12, 8, .48);
}

.cpu-level-picker[hidden] {
    display: none;
}

.cpu-level-picker span {
    color: #fff3af;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.cpu-level-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.cpu-level-options button {
    min-width: 0;
    min-height: 32px;
    padding-inline: 0;
}

.cpu-level-options button.is-selected {
    border-color: #fff18f;
    color: #fff;
    background: #8f2f24;
    box-shadow: 0 0 0 2px rgba(255, 241, 143, .28), 0 0 18px rgba(217, 164, 65, .42);
}

.captcha-box {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 8px;
    align-items: center;
    margin: 16px 0 12px;
}

.captcha-box span {
    color: var(--gold);
    font-weight: 700;
}

.recaptcha-box {
    grid-template-columns: 1fr;
}

.captcha-box input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 10px;
    color: var(--text);
    background: #120c08;
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.rules-section {
    width: min(1120px, calc(100% - 32px));
    margin: 14px auto 42px;
    padding: 24px;
    border: 1px solid rgba(107, 75, 47, .65);
    border-radius: 8px;
    background: rgba(28, 18, 12, .7);
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .06);
}

.rules-section h1,
.rules-section h2,
.rules-section h3 {
    margin: 0;
    color: var(--gold);
}

.rules-section h1 {
    font-size: 34px;
}

.rules-section h2 {
    margin-top: 24px;
    font-size: 24px;
}

.rules-section h3 {
    margin-top: 16px;
    font-size: 19px;
}

.rules-section p,
.rules-section li {
    color: #ecd9bd;
    line-height: 1.48;
}

.rules-section ul,
.rules-section ol {
    padding-left: 22px;
}

.rules-ui-example {
    margin: 12px 0 16px;
}

.rules-stack-example {
    width: min(210px, 100%);
}

.rules-stack-example .zone {
    min-height: 0;
}

.rules-stack-example .pile-card {
    width: 112px;
    margin: 0 auto;
}

.rules-stack-example .stack-pile {
    cursor: default;
}

.rules-combo-example {
    width: min(760px, 100%);
}

.rules-combo-meter {
    min-height: 34px;
    height: 40px;
    max-width: 100%;
}

.rules-combo-meter .combo-segment {
    min-height: 24px;
}

.rules-startdeck-example {
    display: flex;
    align-items: center;
    width: min(980px, 100%);
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding: 8px 10px 14px;
}

.rules-startdeck-example .rules-startdeck-card {
    flex: 0 0 clamp(44px, 7vw, 78px);
    width: clamp(44px, 7vw, 78px);
    aspect-ratio: 700 / 1075;
    cursor: pointer;
    transition: filter .16s ease, transform .16s ease;
}

.rules-startdeck-example .rules-startdeck-card + .rules-startdeck-card {
    margin-left: calc(-1 * clamp(22px, 4vw, 34px));
}

.rules-startdeck-example .rules-startdeck-card:hover,
.rules-startdeck-example .rules-startdeck-card:focus-visible {
    z-index: 5;
    filter: brightness(1.13) saturate(1.08);
    transform: translateY(-8px);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 28px;
}

.card-library {
    display: grid;
    gap: 22px;
    margin-top: 16px;
}

.card-library-group h3 {
    margin-bottom: 10px;
    color: #f0c067;
}

.card-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.library-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-height: 126px;
    padding: 10px;
    border: 1px solid rgba(107, 75, 47, .72);
    border-radius: 8px;
    background: rgba(18, 12, 8, .54);
    cursor: zoom-in;
}

.library-card img {
    width: 82px;
    aspect-ratio: 2.5 / 3.5;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .32);
}

.library-card strong,
.library-card span {
    display: block;
}

.library-card strong {
    color: var(--text);
}

.library-card span {
    margin-top: 3px;
    color: var(--gold);
    font-size: 14px;
}

.library-card p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.35;
}

.table {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    align-content: start;
    gap: 10px;
    min-height: 100vh;
    padding: 10px;
}

.topbar,
.upper-zone,
.player-zone {
    border: 1px solid rgba(107, 75, 47, .75);
    border-radius: 8px;
    background: rgba(23, 15, 10, .72);
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .08);
    backdrop-filter: blur(1px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 56px;
    padding: 10px 14px;
}

.session-counters {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    letter-spacing: 0;
    white-space: nowrap;
}

.session-counters span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 4px 6px;
    border: 1px solid rgba(217, 164, 65, .32);
    border-radius: 6px;
    background: rgba(18, 12, 8, .52);
}

.session-counters b {
    color: var(--muted);
    font-size: 10px;
}

.session-counters strong {
    color: #fff4d0;
    font-size: 14px;
    text-shadow: 0 0 8px rgba(217, 164, 65, .48);
}

.gamepad-status {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    gap: 2px;
    color: #fff3af;
    font-size: 14px;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 209, 65, .9), 0 2px 8px rgba(0, 0, 0, .85);
    transform: translate(-50%, -50%);
    pointer-events: none;
    white-space: nowrap;
}

.gamepad-status span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 2px 7px rgba(0, 0, 0, .85);
}

.gamepad-status[hidden] {
    display: none;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.autoselect-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid rgba(217, 164, 65, .42);
    border-radius: 999px;
    color: #f6e0b3;
    background: rgba(18, 12, 8, .48);
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
}

.autoselect-toggle input {
    appearance: none;
    width: 26px;
    height: 15px;
    margin: 0;
    border: 1px solid rgba(217, 164, 65, .46);
    border-radius: 999px;
    background: rgba(80, 80, 80, .45);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .2);
    cursor: pointer;
}

.autoselect-toggle input::before {
    content: "";
    display: block;
    width: 11px;
    height: 11px;
    margin: 1px;
    border-radius: 50%;
    background: rgba(230, 220, 196, .76);
    transition: transform .12s ease, background .12s ease;
}

.autoselect-toggle input:checked {
    background: rgba(217, 164, 65, .68);
}

.autoselect-toggle input:checked::before {
    transform: translateX(11px);
    background: #fff5c8;
}

.icon-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    min-width: 38px;
    width: auto;
    padding: 0 7px;
}

.icon-button img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.resign-button {
    border-color: rgba(205, 92, 72, .55);
}

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

.resign-button:hover,
.resign-button:focus-visible {
    border-color: #ef9b86;
    background: rgba(111, 39, 28, .72);
}

.landing-sound-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 40;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-color: rgba(248, 234, 216, .45);
    background: rgba(32, 21, 15, .68);
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

.landing-sound-toggle:hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(217, 164, 65, .18), 0 12px 34px rgba(0, 0, 0, .34);
}

.landing-sound-toggle::after {
    content: "(SEL)";
    position: absolute;
    left: 50%;
    bottom: -19px;
    display: none;
    padding: 1px 5px 2px;
    border: 1px solid rgba(248, 234, 216, .34);
    border-radius: 999px;
    color: #fff2c5;
    background: rgba(18, 12, 8, .72);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
}

.has-gamepad .landing-sound-toggle::after {
    display: block;
}

.upper-zone {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    overflow: visible;
    transition: max-height .18s ease, padding .18s ease;
}

.upper-zone.is-collapsed {
    min-height: 66px;
    max-height: 66px;
    overflow: hidden;
    padding-block: 8px;
}

.shop-wrap,
.log-panel {
    min-width: 0;
}

.shop-wrap {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.panel-head,
.zone-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    min-height: 30px;
}

.panel-head {
    display: grid;
    grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr);
    gap: 8px;
    min-height: 44px;
}

.zone-head h2,
.log-panel h2 {
    margin: 0;
    font-size: 16px;
    color: var(--gold);
}

.shop-toggle {
    --shop-risk-color: #59d96b;
    min-height: 0;
    border: 0;
    padding: 0;
    color: var(--shop-risk-color);
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    justify-self: start;
    white-space: nowrap;
    text-shadow: 0 0 7px var(--shop-risk-color), 0 1px 2px rgba(0, 0, 0, .9);
    transition: color .18s ease, filter .18s ease, text-shadow .18s ease;
}

.shop-toggle:hover {
    color: #fff;
    filter: brightness(1.22);
}

.shop-toggle.risk-0 {
    --shop-risk-color: #59d96b;
}

.shop-toggle.risk-1 {
    --shop-risk-color: #bfe45a;
}

.shop-toggle.risk-2 {
    --shop-risk-color: #ffb83e;
}

.shop-toggle.risk-3 {
    --shop-risk-color: #ff4d3e;
}

.shop-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.log-toggle {
    min-height: 0;
    border: 0;
    padding: 0;
    color: var(--gold);
    background: transparent;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.log-toggle:hover,
.log-toggle.is-open {
    color: var(--text);
}


#shopGamepadHint {
    display: none;
}

.shop-turn-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    justify-self: center;
    min-width: 144px;
    white-space: nowrap;
}

.shop-turn-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
    min-width: 58px;
}

.shop-turn-stat img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}

.shop-resource-stat img {
    width: 27px;
    height: 27px;
}

.shop-turn-value {
    min-width: 16px;
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    color: var(--text);
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
}

.shop-turn-status.role-attacker .shop-turn-value {
    color: #ffd4cc;
    text-shadow: 0 0 8px rgba(255, 78, 58, .8), 0 1px 2px rgba(0, 0, 0, .9);
}

.shop-turn-status.role-defender .shop-turn-value {
    color: #d5ffd0;
    text-shadow: 0 0 8px rgba(92, 230, 118, .8), 0 1px 2px rgba(0, 0, 0, .9);
}

.shop-graveyard-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ead9c2;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.shop-graveyard-icon {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8));
}

.shop-graveyard-value {
    min-width: 9px;
    font-size: 14px;
    font-weight: 950;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}

.shop-graveyard-value.role-attacker {
    color: #ff7564;
}

.shop-graveyard-value.role-defender {
    color: #69df7c;
}


.has-gamepad #shopGamepadHint {
    display: inline;
}

.shop-wrap.is-collapsed .shop-content,
.shop-wrap.is-collapsed .shop-grid {
    display: none;
}

.shop-wrap.is-collapsed {
    min-height: 0;
}

.shop-wrap.is-collapsed .panel-head {
    grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr);
    min-height: 48px;
    overflow: visible;
}

.shop-wrap.is-collapsed .shop-turn-status {
    min-width: 0;
    flex: 0 0 auto;
}

.shop-wrap.is-collapsed .shop-head-actions {
    min-width: max-content;
}

.shop-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.shop-wrap.is-log-open .shop-content {
    grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr);
}

.log-panel.is-collapsed,
.shop-wrap:not(.is-log-open) .log-panel {
    display: none;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(var(--shop-columns, 1), var(--shop-card-width, 108px));
    justify-content: start;
    align-content: start;
    gap: 8px;
    max-height: 416px;
    margin-top: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 16px 22px 16px;
}

.log-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    border-left: 1px solid rgba(107, 75, 47, .45);
    padding: 8px 0 8px 12px;
    overflow: hidden;
}

.log {
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
    padding-right: 4px;
}

.log div {
    padding: 4px 0;
    border-bottom: 1px solid rgba(107, 75, 47, .25);
}

.player-zone {
    display: grid;
    gap: 7px;
    padding: 8px 10px;
    overflow: visible;
}

.player-zone.role-attacker {
    background:
        linear-gradient(rgba(96, 22, 20, .2), rgba(96, 22, 20, .1)),
        rgba(23, 15, 10, .72);
    box-shadow: inset 0 0 0 999px rgba(120, 26, 20, .05);
}

.player-zone.role-defender {
    background:
        linear-gradient(rgba(18, 70, 41, .18), rgba(18, 70, 41, .1)),
        rgba(23, 15, 10, .72);
    box-shadow: inset 0 0 0 999px rgba(20, 96, 48, .05);
}

.player-zone.is-active-turn.role-attacker {
    animation: activePanelPulseRed 1.45s ease-in-out infinite;
}

.player-zone.is-active-turn.role-defender {
    animation: activePanelPulseGreen 1.45s ease-in-out infinite;
}

.player-zone.is-user-inactive,
.player-zone.is-opponent-inactive {
    filter: saturate(.4) grayscale(.35);
    opacity: .88;
    transition: filter .22s ease, opacity .22s ease;
}

@keyframes activePanelPulseRed {
    0%, 100% { box-shadow: inset 0 0 0 999px rgba(120, 26, 20, .05), 0 0 0 1px rgba(255, 92, 78, .36), 0 0 12px rgba(255, 54, 46, .3); }
    50% { box-shadow: inset 0 0 0 999px rgba(120, 26, 20, .07), 0 0 0 1px rgba(255, 132, 116, .72), 0 0 28px rgba(255, 54, 46, .68); }
}

@keyframes activePanelPulseGreen {
    0%, 100% { box-shadow: inset 0 0 0 999px rgba(20, 96, 48, .05), 0 0 0 1px rgba(95, 236, 143, .34), 0 0 12px rgba(54, 211, 105, .28); }
    50% { box-shadow: inset 0 0 0 999px rgba(20, 96, 48, .07), 0 0 0 1px rgba(134, 255, 174, .72), 0 0 28px rgba(54, 211, 105, .66); }
}

.player-zone > .zone-head {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr) max-content;
    container-type: inline-size;
}

.player-zone > .zone-head h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opponent-zone > .zone-head {
    grid-template-columns: 128px minmax(80px, 1fr) minmax(0, auto);
    align-items: center;
}

.opponent-zone .combo-meter {
    justify-self: stretch;
    min-width: 80px;
    max-width: none;
}

.opponent-zone .stats {
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow: hidden;
}

.opponent-zone .mini-hand {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(48vw, 300px);
    flex-wrap: nowrap;
    margin-left: auto;
}

.player-zone:not(.opponent-zone) .stats {
    min-width: max-content;
    justify-content: flex-end;
}

.player-zone:not(.opponent-zone) .combo-meter {
    min-width: 0;
}

.opponent-zone .stat,
.opponent-zone .compact-piles {
    flex: 0 0 auto;
}

.combo-meter {
    display: grid;
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 3px;
    align-items: stretch;
    justify-self: stretch;
    min-height: 35px;
    height: 100%;
    max-height: 64px;
    max-height: clamp(35px, 5cqi, 64px);
    padding: 4px;
    border: 1px solid rgba(112, 78, 38, .45);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(24, 15, 9, .6), rgba(54, 33, 16, .43));
    box-shadow: inset 0 1px 6px rgba(0, 0, 0, .65), 0 0 10px rgba(217, 164, 65, .14);
    overflow: hidden;
}

.combo-segment {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 25px;
    border-radius: 6px;
    background: rgba(75, 48, 25, .42);
    box-shadow: inset 0 0 0 1px rgba(255, 229, 148, .08);
    overflow: hidden;
}

.combo-segment::before {
    content: "";
    position: absolute;
    inset: -45% -120%;
    border-radius: inherit;
    background:
        var(--combo-fill, linear-gradient(115deg, #8b5a16 0%, #e79b17 32%, #fff1a0 48%, #ffcf45 62%, #b87413 100%));
    transform: translateX(-36%) scaleX(0);
    transform-origin: left center;
    background-size: 220% 100%;
    opacity: 0;
}

.combo-segment.is-filled::before {
    opacity: 1;
    transform: translateX(0) scaleX(1);
    animation: comboMeltFlow 4.8s ease-in-out infinite;
}

.combo-segment.is-new::before {
    animation: comboLiquidFill .42s cubic-bezier(.2, .8, .2, 1) both, comboGoldGlow .82s ease-out both, comboMeltFlow 4.8s ease-in-out .42s infinite;
}


.combo-reward-icon {
    position: relative;
    z-index: 2;
    width: min(76%, 18px);
    height: min(76%, 18px);
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .95)) drop-shadow(0 0 7px rgba(255, 62, 43, .92));
}

.combo-meter.is-mini {
    grid-template-columns: 1fr;
    width: 54px;
    min-width: 48px;
    max-width: 58px;
    padding: 3px;
}

.combo-meter.is-mini .combo-segment {
    min-height: 24px;
}

.combo-meter.is-mini .combo-segment strong {
    font-size: 11px;
}

.combo-segment strong {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: clamp(12px, 1.05vw, 18px);
    line-height: 1;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 8px rgba(255, 255, 255, .8);
}

.combo-bonus-label {
    color: #fff7c6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 8px rgba(255, 205, 57, .92), 0 0 14px rgba(255, 169, 20, .68);
}

.combo-segment.combo-reward-gold::after,
.combo-segment.combo-reward-threat::after,
.combo-segment.has-trap::after,
.combo-segment.has-trap-bonus::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: var(--combo-marker-glow, radial-gradient(circle at 50% 50%, rgba(130, 215, 255, .72), rgba(28, 119, 222, .42) 48%, rgba(18, 45, 120, .16) 76%));
    box-shadow: var(--combo-marker-shadow, inset 0 0 0 1px rgba(163, 229, 255, .68), 0 0 12px rgba(67, 172, 255, .52));
    animation: trapBlueShimmer 2.4s ease-in-out infinite;
}

.combo-segment.combo-reward-gold {
    --combo-marker-glow: radial-gradient(circle at 50% 50%, rgba(255, 238, 144, .74), rgba(231, 157, 26, .42) 50%, rgba(117, 72, 11, .16) 78%);
    --combo-marker-shadow: inset 0 0 0 1px rgba(255, 233, 145, .68), 0 0 12px rgba(255, 190, 47, .54);
}

.combo-segment.combo-reward-threat {
    --combo-marker-glow: radial-gradient(circle at 50% 50%, rgba(255, 138, 116, .74), rgba(216, 38, 31, .45) 50%, rgba(94, 8, 12, .18) 78%);
    --combo-marker-shadow: inset 0 0 0 1px rgba(255, 151, 132, .72), 0 0 13px rgba(255, 49, 42, .62);
}

.combo-trap-label {
    position: relative;
    z-index: 3;
    color: #eefaff;
    font-size: clamp(9px, .78vw, 13px);
    line-height: 1;
    font-weight: 950;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 8px rgba(83, 190, 255, .9);
}

.combo-trap-bonus-label {
    color: #eefaff;
}

.combo-segment.trap-choice {
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(153, 223, 255, .45), 0 0 8px rgba(65, 167, 255, .22);
}

.combo-segment.trap-choice:hover,
.combo-segment.trap-choice.is-selected,
.combo-segment.trap-choice.is-gamepad-selected {
    box-shadow: inset 0 0 0 2px rgba(211, 246, 255, .95), 0 0 18px rgba(58, 185, 255, .78);
    filter: brightness(1.24);
}

@keyframes trapBlueShimmer {
    0%, 100% { opacity: .48; filter: saturate(1) brightness(.95); }
    50% { opacity: .78; filter: saturate(1.35) brightness(1.18); }
}

@keyframes comboLiquidFill {
    0% { transform: translateX(-42%) scaleX(0); filter: brightness(.85) saturate(1); }
    68% { transform: translateX(-5%) scaleX(1.08); filter: brightness(1.45) saturate(1.25); }
    100% { transform: translateX(0) scaleX(1); filter: brightness(1) saturate(1); }
}

@keyframes comboMeltFlow {
    0% { background-position: 0% 50%; transform: translateX(0) scaleX(1) skewX(0deg); filter: brightness(1); }
    50% { background-position: 85% 50%; transform: translateX(2%) scaleX(1.05) skewX(-7deg); filter: brightness(1.18); }
    100% { background-position: 0% 50%; transform: translateX(0) scaleX(1) skewX(0deg); filter: brightness(1); }
}

@keyframes comboGoldGlow {
    0% { box-shadow: inset 0 0 0 rgba(255, 240, 160, 0), 0 0 0 rgba(255, 207, 69, 0); }
    45% { box-shadow: inset 0 0 12px rgba(255, 249, 185, .95), 0 0 14px rgba(255, 207, 69, .9); }
    100% { box-shadow: inset 0 0 4px rgba(255, 234, 128, .32), 0 0 4px rgba(255, 207, 69, .2); }
}

.combo-meter.is-reward-flash {
    animation: comboRewardFlash .82s cubic-bezier(.18, .85, .2, 1);
}

.combo-meter.is-trap-flash {
    animation: comboTrapFlash .82s cubic-bezier(.18, .85, .2, 1);
}

.combo-segment.is-transfer-target {
    box-shadow: inset 0 0 0 2px rgba(228, 251, 255, .98), 0 0 18px rgba(58, 185, 255, .98), 0 0 38px rgba(75, 121, 255, .7);
    filter: brightness(1.35) saturate(1.25);
}

.resource-tone-gold {
    --resource-bright: rgba(255, 255, 218, 1);
    --resource-core: rgba(255, 208, 58, .98);
    --resource-glow: rgba(255, 163, 20, .92);
    --resource-deep: rgba(184, 92, 0, .72);
}

.resource-tone-ammo {
    --resource-bright: rgba(255, 248, 214, 1);
    --resource-core: rgba(255, 155, 48, .98);
    --resource-glow: rgba(255, 55, 32, .94);
    --resource-deep: rgba(136, 15, 8, .76);
}

.resource-tone-action {
    --resource-bright: rgba(255, 255, 255, 1);
    --resource-core: rgba(226, 242, 255, .98);
    --resource-glow: rgba(174, 218, 255, .9);
    --resource-deep: rgba(95, 143, 214, .7);
}

.resource-tone-buy {
    --resource-bright: rgba(255, 255, 221, 1);
    --resource-core: rgba(224, 255, 76, .98);
    --resource-glow: rgba(142, 226, 49, .94);
    --resource-deep: rgba(49, 138, 31, .74);
}

.resource-tone-combo {
    --resource-bright: rgba(236, 252, 255, 1);
    --resource-core: rgba(35, 151, 255, 1);
    --resource-glow: rgba(0, 82, 255, .98);
    --resource-deep: rgba(0, 22, 148, .88);
}

.resource-transfer-arc,
.resource-transfer-flash,
.resource-transfer-pulse,
.resource-transfer-spark {
    position: fixed;
    z-index: 94;
    pointer-events: none;
}

.resource-transfer-arc {
    height: 18px;
    margin-top: -9px;
    border-radius: 999px;
    transform: rotate(var(--resource-transfer-angle));
    transform-origin: left center;
    overflow: visible;
    opacity: 0;
    mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .38) 18%, #000 42%, #000 58%, rgba(0, 0, 0, .38) 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .38) 18%, #000 42%, #000 58%, rgba(0, 0, 0, .38) 82%, transparent 100%);
    background: radial-gradient(ellipse at center,
        var(--resource-bright) 0%,
        var(--resource-core) 9%,
        var(--resource-glow) 28%,
        var(--resource-deep) 48%,
        transparent 74%);
    box-shadow: 0 0 10px var(--resource-glow), 0 0 28px var(--resource-deep);
    animation: resourceTransferArc .38s cubic-bezier(.18, .78, .24, 1) forwards;
}

.resource-transfer-arc::before,
.resource-transfer-arc::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--resource-core) 5%,
        var(--resource-bright) 28%,
        var(--resource-core) 54%,
        var(--resource-bright) 78%,
        transparent 100%);
    filter: drop-shadow(0 0 3px var(--resource-bright)) drop-shadow(0 0 8px var(--resource-glow));
    clip-path: polygon(
        0 49%, 8% 24%, 16% 57%, 25% 34%, 35% 61%, 45% 27%, 56% 54%, 66% 37%, 77% 66%, 88% 31%, 100% 48%,
        100% 58%, 88% 42%, 77% 76%, 66% 47%, 56% 64%, 45% 38%, 35% 71%, 25% 45%, 16% 67%, 8% 35%, 0 59%
    );
    animation: resourceArcCore .16s steps(2, end) infinite;
}

.resource-transfer-arc::after {
    opacity: .58;
    filter: blur(.35px) drop-shadow(0 0 5px var(--resource-glow));
    clip-path: polygon(
        0 58%, 12% 43%, 23% 69%, 36% 45%, 49% 62%, 61% 38%, 73% 55%, 86% 35%, 100% 52%,
        100% 57%, 86% 42%, 73% 64%, 61% 45%, 49% 70%, 36% 53%, 23% 77%, 12% 51%, 0 64%
    );
    animation: resourceArcBranch .11s steps(2, end) infinite;
}

.resource-transfer-flash {
    width: 90px;
    height: 90px;
    margin: -45px 0 0 -45px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--resource-bright) 0 8%, var(--resource-core) 16%, var(--resource-glow) 32%, var(--resource-deep) 49%, transparent 69%);
    box-shadow: 0 0 20px var(--resource-bright), 0 0 64px var(--resource-glow), 0 0 108px var(--resource-deep);
    animation: resourceTransferFlash .29s cubic-bezier(.18, .82, .2, 1) forwards;
}

.resource-transfer-pulse {
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--resource-bright) 0 16%, var(--resource-core) 34%, var(--resource-glow) 62%, transparent 77%);
    box-shadow: 0 0 16px var(--resource-bright), 0 0 36px var(--resource-glow), 0 0 70px var(--resource-deep);
    animation: resourceTransferPulse .36s cubic-bezier(.12, .9, .22, 1) forwards;
}

.resource-transfer-spark {
    width: 7px;
    height: 7px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--resource-bright);
    box-shadow: 0 0 10px var(--resource-bright), 0 0 24px var(--resource-glow);
    opacity: 0;
    transform: rotate(var(--resource-spark-angle)) translateY(0) scale(.55);
    animation: resourceTransferSpark .20s ease-out var(--resource-spark-delay) forwards;
}

.resource-transfer-highlight {
    position: relative;
    z-index: 95 !important;
    outline: 2px solid var(--resource-bright);
    outline-offset: 2px;
    box-shadow: inset 0 0 12px var(--resource-core), 0 0 18px var(--resource-glow), 0 0 38px var(--resource-deep) !important;
    filter: brightness(1.32) saturate(1.18);
}

.resource-transfer-highlight .shop-turn-value {
    color: var(--resource-bright) !important;
    text-shadow: 0 0 7px var(--resource-bright), 0 0 15px var(--resource-glow), 0 1px 2px rgba(0, 0, 0, .95);
}

@keyframes resourceTransferArc {
    0% { clip-path: inset(0 100% 0 0); opacity: 0; filter: brightness(1.6) saturate(1.3); }
    9% { opacity: .72; }
    38% { clip-path: inset(0 0 0 0); opacity: .96; filter: brightness(2.2) saturate(1.55); }
    62% { opacity: .68; filter: brightness(1.45) saturate(1.18); }
    100% { clip-path: inset(0 0 0 100%); opacity: 0; filter: brightness(1); }
}

@keyframes resourceArcCore {
    0%, 100% { transform: translateY(-1px) scaleY(.78); opacity: .72; }
    50% { transform: translateY(1px) scaleY(1.18); opacity: 1; }
}

@keyframes resourceArcBranch {
    0%, 100% { transform: translateY(-3px) scaleY(.72); opacity: .32; }
    50% { transform: translateY(3px) scaleY(1.28); opacity: .7; }
}

@keyframes resourceTransferFlash {
    0% { transform: scale(.22); opacity: 0; filter: blur(0) brightness(1.5); }
    18% { opacity: .96; }
    45% { transform: scale(1.32); opacity: .82; filter: blur(1px) brightness(2.15); }
    100% { transform: scale(2); opacity: 0; filter: blur(5px) brightness(1.3); }
}

@keyframes resourceTransferPulse {
    0% { transform: translate(0, 0) scale(.42); opacity: 0; filter: brightness(1.8); }
    10% { opacity: 1; }
    52% { transform: translate(calc(var(--resource-transfer-x) * .58), calc(var(--resource-transfer-y) * .58)) scale(1.35); opacity: 1; }
    100% { transform: translate(var(--resource-transfer-x), var(--resource-transfer-y)) scale(.45); opacity: 0; filter: brightness(2.35); }
}

@keyframes resourceTransferSpark {
    0% { opacity: 0; transform: rotate(var(--resource-spark-angle)) translateY(0) scale(.4); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--resource-spark-angle)) translateY(calc((var(--resource-spark-sign, 1)) * -24px)) scale(1.2); }
}

@keyframes comboTrapFlash {
    0% { filter: brightness(1); box-shadow: inset 0 1px 6px rgba(0, 0, 0, .65), 0 0 10px rgba(67, 172, 255, .14); }
    24% { filter: brightness(1.48) saturate(1.25); box-shadow: inset 0 0 22px rgba(201, 242, 255, .9), 0 0 0 2px rgba(147, 225, 255, .82), 0 0 34px rgba(43, 167, 255, .95); }
    58% { filter: brightness(1.12) saturate(1.12); box-shadow: inset 0 0 16px rgba(91, 192, 255, .7), 0 0 24px rgba(58, 185, 255, .6); }
    100% { filter: brightness(1); box-shadow: inset 0 1px 6px rgba(0, 0, 0, .65), 0 0 10px rgba(67, 172, 255, .14); }
}

@keyframes comboRewardFlash {
    0% { filter: brightness(1); box-shadow: inset 0 1px 6px rgba(0, 0, 0, .65), 0 0 10px rgba(217, 164, 65, .14); }
    24% { filter: brightness(1.55) saturate(1.35); box-shadow: inset 0 0 22px rgba(255, 251, 203, .95), 0 0 0 2px rgba(255, 250, 199, .85), 0 0 34px rgba(255, 207, 69, .95); }
    58% { filter: brightness(1.18) saturate(1.12); box-shadow: inset 0 0 16px rgba(255, 226, 102, .72), 0 0 24px rgba(255, 207, 69, .62); }
    100% { filter: brightness(1); box-shadow: inset 0 1px 6px rgba(0, 0, 0, .65), 0 0 10px rgba(217, 164, 65, .14); }
}

@media (max-width: 680px) {
    .table.is-trap-focus .opponent-zone > .zone-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .table.is-trap-focus .opponent-zone > .zone-head h2,
    .table.is-trap-focus .opponent-zone #opponentStats {
        display: none;
    }

    .table.is-trap-focus .opponent-zone .combo-meter {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .player-zone > .zone-head {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .combo-meter {
        grid-column: 1 / -1;
        order: 3;
        min-height: 18px;
        height: 22px;
        max-height: 22px;
        gap: 2px;
        padding: 2px;
    }

    .combo-segment {
        min-height: 14px;
        border-radius: 4px;
    }

    .combo-segment strong,
    .combo-trap-label {
        font-size: 8px;
    }

    .combo-reward-icon {
        width: min(82%, 13px);
        height: min(82%, 13px);
    }

    .opponent-zone > .zone-head {
        grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
    }

    .opponent-zone .combo-meter {
        grid-column: 1 / -1;
        order: 3;
        min-height: 18px;
    }
}

.opponent-zone {
    opacity: .88;
}

.stats {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 5px;
    align-items: center;
}

.opponent-zone .stats {
    justify-content: flex-start;
}

.stat {
    flex: 0 0 auto;
    min-width: 62px;
    white-space: nowrap;
    padding: 4px 7px;
    border: 1px solid rgba(107, 75, 47, .65);
    border-radius: 6px;
    text-align: center;
    background: rgba(50, 34, 23, .9);
}

.lp-stat {
    font-weight: 900;
}

.attacker-lp {
    color: #ffc7bd;
    box-shadow: 0 0 12px rgba(255, 76, 58, .75), inset 0 0 10px rgba(255, 76, 58, .18);
    border-color: rgba(255, 104, 84, .7);
}

.defender-lp {
    color: #caffbf;
    box-shadow: 0 0 12px rgba(83, 220, 116, .75), inset 0 0 10px rgba(83, 220, 116, .18);
    border-color: rgba(109, 235, 127, .7);
}

.shop-stat {
    position: relative;
    overflow: hidden;
}

.shop-stat.shop-damage-flash {
    animation: shopDamageFlash .86s ease-out both;
}

.shop-stat.shop-damage-flash::after {
    content: "";
    position: absolute;
    inset: -35%;
    border-radius: inherit;
    background:
        radial-gradient(circle at 35% 55%, rgba(120, 116, 106, .65), transparent 22%),
        radial-gradient(circle at 62% 42%, rgba(220, 214, 194, .42), transparent 18%),
        radial-gradient(circle at 52% 65%, rgba(55, 52, 48, .5), transparent 30%);
    filter: blur(5px);
    animation: shopDamageSmoke .86s ease-out both;
    pointer-events: none;
}


.compact-piles {
    display: none;
    gap: 5px;
    align-items: center;
}

.mini-pile {
    position: relative;
    width: 30px;
    border: 1px solid rgba(217, 164, 65, .4);
    border-radius: 3px;
    background: #120c08;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .32);
}

.mini-pile img {
    display: block;
    width: 100%;
    aspect-ratio: 700 / 1075;
    border-radius: 3px;
    object-fit: cover;
}

.mini-pile span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff8d8;
    background: transparent;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .95), 0 0 8px rgba(0, 0, 0, .75);
    pointer-events: none;
}
.mini-hand {
    display: flex;
    gap: 4px;
    align-items: center;
    max-width: 260px;
    overflow: hidden;
    padding: 2px;
}

.mini-card {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    border: 1px solid rgba(217, 164, 65, .35);
    border-radius: 3px;
    background: #120c08;
    cursor: pointer;
}

.mini-card img {
    display: block;
    width: 100%;
    aspect-ratio: 700 / 1075;
    border-radius: 3px;
    object-fit: cover;
}

.mini-card.is-selected {
    box-shadow: 0 0 0 2px rgba(217, 164, 65, .85);
}

.mini-card.is-revealed {
    width: 42px;
}

.mini-card button {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 18px;
    min-height: 18px;
    padding: 0;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    background: var(--red);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.field-row {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr) 128px;
    gap: 10px;
    min-height: 205px;
}

.table.is-shop-compressed .opponent-zone {
    max-height: 74px;
    min-height: 0;
    overflow: hidden;
}

.table.is-shop-compressed .opponent-zone .field-row {
    display: none;
}

.table.compact-hand .hand {
    display: none;
}

.table.compact-hand .hand-deck-row {
    grid-template-columns: 1fr;
}

.table.compact-hand .deck-wrap {
    display: none;
}

.zone {
    min-width: 0;
    border: 1px solid rgba(107, 75, 47, .55);
    border-radius: 8px;
    background: rgba(32, 21, 15, .58);
    padding: 8px;
    overflow: visible;
}

.zone-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.pile-title {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.pile-title-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.pile-owned-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-height: 14px;
    font-size: 12px;
}

.pile-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pile-owned-row strong,
.stock-count {
    min-width: 1.5em;
    text-align: center;
}

.stock-count {
    color: #fff7df;
}

.pile-sep {
    color: rgba(255, 247, 223, .45);
    font-weight: 800;
}

.owned-count.role-attacker {
    color: #ffb4a8;
    text-shadow: 0 0 8px rgba(255, 76, 58, .76);
}

.owned-count.role-defender {
    color: #c8ffbd;
    text-shadow: 0 0 8px rgba(83, 220, 116, .76);
}

.stack-zone,
.aside-zone {
    display: grid;
    align-content: start;
}

.action-zone {
    position: relative;
    overflow: visible;
}

.phase-counter {
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    padding: 0;
    color: #fff2a8;
    background: transparent;
    font-size: 28px;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(255, 205, 67, .95), 0 3px 10px rgba(0, 0, 0, .9);
    pointer-events: none;
    white-space: nowrap;
}

.action-lane {
    --card-overlap: 0px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    min-height: 168px;
    overflow-x: clip;
    overflow-y: visible;
    padding: 18px 16px 22px 16px;
}

.empty-zone {
    color: rgba(199, 173, 139, .6);
    font-size: 14px;
    padding: 26px 8px;
}

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

.hand-wrap {
    min-width: 0;
}

.hand {
    --card-overlap: 0px;
    display: flex;
    gap: 8px;
    min-height: 182px;
    overflow: visible;
    padding: 18px 16px 22px 16px;
}

.phase-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 34px;
    border-top: 1px solid rgba(107, 75, 47, .4);
    padding-top: 5px;
}

#phaseLabel {
    color: var(--gold);
    font-size: 15px;
    font-weight: 700;
}

.deck-wrap {
    display: grid;
    gap: 10px;
    align-content: start;
}

#deckPile {
    min-width: 0;
    border: 1px solid rgba(107, 75, 47, .55);
    border-radius: 8px;
    background: rgba(32, 21, 15, .58);
    padding: 8px;
}

.shop-pile,
.pile {
    display: grid;
    gap: 6px;
    width: 108px;
}

.shop-pile.is-tracking-only {
    filter: saturate(.4);
    opacity: .72;
}

.shop-pile.is-tracking-only .card {
    cursor: default;
}

.shop-pile.is-empty-stock {
    filter: saturate(.4);
    opacity: .66;
}

.shop-pile.is-empty-stock .card {
    cursor: default;
}

.shop-pile.is-signature.role-attacker .card {
    border-color: rgba(255, 104, 84, .76);
    box-shadow: 0 0 15px rgba(255, 76, 58, .82), 0 10px 20px rgba(0, 0, 0, .3), inset 0 0 12px rgba(255, 76, 58, .16);
}

.shop-pile.is-signature.role-defender .card {
    border-color: rgba(109, 235, 127, .76);
    box-shadow: 0 0 15px rgba(83, 220, 116, .82), 0 10px 20px rgba(0, 0, 0, .3), inset 0 0 12px rgba(83, 220, 116, .16);
}

.card {
    position: relative;
    flex: 0 0 auto;
    width: 108px;
    border: 1px solid #5b3a21;
    border-radius: 7px;
    overflow: visible;
    background: #120c08;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .3);
    transform-origin: center center;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease;
    z-index: 1;
}

.card:hover {
    box-shadow: 0 18px 34px rgba(0, 0, 0, .5);
    transform: scale(1.12);
    z-index: 10;
}

.card.is-gamepad-selected,
.mini-card.is-gamepad-selected {
    box-shadow: 0 0 0 3px rgba(255, 241, 143, .9), 0 0 28px rgba(255, 210, 54, .85), 0 18px 34px rgba(0, 0, 0, .55);
    transform: scale(1.08);
    z-index: 12;
}

.card-flip {
    animation: cardFlipIn .42s cubic-bezier(.2, .8, .2, 1);
}

.effect-glow {
    animation: cardFlipIn .42s cubic-bezier(.2, .8, .2, 1), actionGlow 1.2s ease;
}

.effect-shake {
    animation: effectCardShake .16s ease-in-out var(--effect-shake-count, 1);
}

.effect-bounce {
    animation: effectCardBounce .18s cubic-bezier(.22, .9, .3, 1) var(--effect-bounce-count, 1);
}

.effect-buy {
    animation: effectCardBuy .21s cubic-bezier(.25, .9, .25, 1) var(--effect-buy-count, 1);
}

.card img {
    display: block;
    width: 100%;
    aspect-ratio: 700 / 1075;
    object-fit: cover;
    border-radius: 7px;
}

.pile-card,
.deck-wrap .card {
    width: 110px;
}

.deck-shot-hole-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
    pointer-events: none;
    opacity: 0;
}

.card.is-shot {
    animation: deckShotKick .32s cubic-bezier(.2, .85, .25, 1);
}

.card.is-shot .deck-shot-hole-overlay {
    animation: shotHoleFlash .42s ease forwards;
}

.deck-shot-smoke {
    position: fixed;
    z-index: 62;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(circle at 45% 48%, rgba(236, 226, 207, .72) 0 8%, rgba(174, 158, 137, .34) 18%, rgba(80, 70, 60, 0) 58%),
        radial-gradient(circle at 62% 38%, rgba(230, 220, 203, .54) 0 7%, rgba(119, 108, 95, .26) 20%, rgba(80, 70, 60, 0) 56%);
    mix-blend-mode: screen;
    transform: translate(-50%, -50%) scale(.35);
    animation: deckShotSmoke .9s ease-out forwards;
}

.shot-card-ghost {
    position: fixed;
    z-index: 63;
    width: 110px;
    aspect-ratio: 700 / 1075;
    border-radius: 7px;
    overflow: visible;
    pointer-events: none;
    transform: rotate(-5deg) scale(1.02);
    opacity: .98;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, .55));
    transition: left .72s cubic-bezier(.22, .75, .2, 1), top .72s cubic-bezier(.22, .75, .2, 1), transform .72s ease, opacity .72s ease;
}

.shot-card-ghost img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.shot-card-ghost .shot-card-hole {
    z-index: 2;
}

.shot-card-ghost.is-moving {
    transform: translate(var(--shot-drift-x, 0), var(--shot-drift-y, 0)) rotate(19deg) scale(.8);
    opacity: 0;
}

.stack-fire-attacker,
.stack-fire-defender {
    isolation: isolate;
}

.stack-fire-attacker::before,
.stack-fire-defender::before {
    content: "";
    position: absolute;
    inset: -5px;
    z-index: -1;
    border-radius: 11px;
    pointer-events: none;
    opacity: .95;
    animation: stackFireFlicker .62s ease-in-out infinite alternate;
}

.stack-fire-attacker::before {
    background:
        radial-gradient(circle at 18% 6%, rgba(255, 210, 210, .82) 0 7%, rgba(255, 22, 34, .72) 18%, transparent 34%),
        radial-gradient(circle at 84% 92%, rgba(255, 126, 126, .58) 0 7%, rgba(190, 0, 24, .68) 19%, transparent 36%),
        linear-gradient(135deg, rgba(220, 0, 25, .9), rgba(255, 48, 54, .34), rgba(178, 0, 32, .9));
    box-shadow: 0 0 18px rgba(255, 24, 36, .92), 0 0 34px rgba(210, 0, 28, .62);
}

.stack-fire-defender::before {
    background:
        radial-gradient(circle at 16% 8%, rgba(220, 255, 167, .88) 0 8%, rgba(58, 229, 91, .56) 18%, transparent 34%),
        radial-gradient(circle at 86% 90%, rgba(182, 255, 146, .68) 0 7%, rgba(38, 181, 77, .54) 19%, transparent 36%),
        linear-gradient(135deg, rgba(43, 213, 78, .78), rgba(214, 255, 113, .22), rgba(39, 206, 92, .78));
    box-shadow: 0 0 18px rgba(77, 245, 102, .86), 0 0 34px rgba(131, 255, 103, .48);
}

@keyframes stackFireFlicker {
    0% { transform: scale(.98) rotate(-.5deg); filter: blur(1px) brightness(.9); }
    45% { transform: scale(1.03) rotate(.4deg); filter: blur(1.5px) brightness(1.18); }
    100% { transform: scale(1.01) rotate(-.2deg); filter: blur(.8px) brightness(1.05); }
}

.hand-card.is-inactive {
    filter: brightness(.82) saturate(.9);
    opacity: .92;
}

.hand-card.is-inactive::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(80, 80, 80, .18);
    border-radius: 7px;
    pointer-events: none;
}

.hand-card.is-active {
    border-color: var(--gold);
}

.hand-card.is-selected {
    box-shadow: 0 0 0 3px rgba(217, 164, 65, .8), 0 14px 28px rgba(0, 0, 0, .45);
}

.ammo-reveal {
    border-color: #b85a4a;
}

.gold-reveal {
    border-color: var(--gold);
}

.set-aside-card {
    border-color: #b78f5c;
}

.discard-pile.empty-card img {
    filter: grayscale(1) brightness(.62);
    opacity: .74;
}

.is-dim {
    filter: brightness(.55);
}

.is-lit {
    box-shadow: 0 0 0 2px rgba(217, 164, 65, .55), 0 12px 24px rgba(0, 0, 0, .4);
}

.card button {
    position: absolute;
    inset: auto 5px 5px 5px;
    min-height: 30px;
    font-size: 13px;
    background: rgba(20, 12, 7, .9);
}

.stack-zone .card button {
    position: relative;
    inset: auto;
    display: block;
    width: calc(100% - 10px);
    margin: 5px;
}

.badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 26px;
    padding: 3px 5px;
    border-radius: 999px;
    color: #160d07;
    text-align: center;
    font-weight: 700;
    background: var(--gold);
}

.badge-total {
    left: 5px;
    right: auto;
}

.badge-run {
    right: 5px;
}

.shop-pile .badge {
    left: auto;
    right: 5px;
}

.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #21150e;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
    z-index: 30;
}

.turn-splash {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff4dc;
    font-size: clamp(42px, 8vw, 92px);
    font-weight: 900;
    text-align: center;
    text-shadow: 0 5px 18px rgba(0, 0, 0, .8);
    background: rgba(12, 8, 5, .36);
    opacity: 0;
    transform: scale(.96);
    transition: opacity .24s ease, transform .24s ease;
    pointer-events: auto;
    z-index: 35;
    display: grid;
    gap: 2px;
    line-height: 1.05;
}

.turn-splash.is-small {
    font-size: clamp(24px, 4vw, 48px);
    background: rgba(12, 8, 5, .24);
}

.splash-detail {
    color: #fff6d2;
    font-size: clamp(28px, 4vw, 54px);
    letter-spacing: 0;
    text-shadow: 0 0 18px rgba(217, 164, 65, .82), 0 4px 16px rgba(0, 0, 0, .82);
}

.splash-detail.splash-tone-attacker {
    color: #ffc7bd;
}

.splash-detail.splash-tone-defender {
    color: #caffbf;
}

.turn-splash.tone-attacker {
    color: #ffc7bd;
    text-shadow: 0 0 18px rgba(255, 76, 58, .95), 0 5px 18px rgba(0, 0, 0, .85);
}

.turn-splash.tone-defender {
    color: #caffbf;
    text-shadow: 0 0 18px rgba(83, 220, 116, .95), 0 5px 18px rgba(0, 0, 0, .85);
}

.turn-splash[hidden] {
    display: none;
}

.turn-splash.is-visible {
    opacity: 1;
    transform: scale(1);
}

.turn-splash.is-game-over {
    pointer-events: none;
    background: rgba(12, 8, 5, .48);
    overflow: hidden;
    isolation: isolate;
}

.turn-splash.is-game-over .splash-line,
.turn-splash.is-game-over .splash-detail {
    position: relative;
    z-index: 3;
}

.turn-splash.is-game-over::before,
.turn-splash.is-game-over::after {
    content: "";
    position: absolute;
    inset: -10%;
    z-index: 0;
    pointer-events: none;
}

.turn-splash.game-over-win::before {
    background:
        radial-gradient(ellipse at 14% -8%, rgba(255, 209, 65, .32), transparent 38%),
        radial-gradient(ellipse at 86% -8%, rgba(255, 209, 65, .32), transparent 38%);
    animation: victoryPulse 1.8s ease-in-out infinite;
}

.turn-splash.game-over-win::after {
    background: radial-gradient(circle at 50% 52%, rgba(255, 210, 75, .35), transparent 38%);
    animation: victoryPulse 1.8s ease-in-out infinite;
}

.turn-splash.game-over-loss::before {
    background:
        linear-gradient(90deg, rgba(5, 5, 5, .68), transparent 24%, transparent 76%, rgba(5, 5, 5, .68)),
        linear-gradient(180deg, rgba(10, 9, 8, .58), transparent 22%, transparent 72%, rgba(8, 8, 7, .66));
}

.turn-splash.game-over-loss::after {
    background:
        radial-gradient(ellipse at 50% 50%, transparent 0 34%, rgba(12, 11, 10, .2) 62%, rgba(4, 4, 4, .5) 100%);
}

.game-over-atmosphere {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
}

.victory-spark,
.gold-fountain-spark {
    position: absolute;
    width: var(--fx-size, 5px);
    height: var(--fx-size, 5px);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    mix-blend-mode: screen;
    background: radial-gradient(circle, #fffef0 0 16%, #ffe169 34%, rgba(255, 166, 24, .92) 60%, transparent 76%);
    filter: drop-shadow(0 0 4px rgba(255, 253, 205, 1)) drop-shadow(0 0 12px rgba(255, 165, 24, .98));
}

.victory-spark.is-streak,
.gold-fountain-spark.is-streak {
    width: max(2px, calc(var(--fx-size, 5px) * .34));
    height: calc(var(--fx-size, 5px) * 3.8);
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, #fffbd2 18%, #ffc43e 58%, transparent);
}

.victory-spark.is-star,
.gold-fountain-spark.is-star {
    clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
    background: linear-gradient(135deg, #fff 0 18%, #fff3a1 34%, #ffb829 62%, transparent 84%);
    filter: drop-shadow(0 0 5px rgba(255, 255, 225, 1)) drop-shadow(0 0 17px rgba(255, 178, 28, 1));
}

.loss-smoke-cloud,
.card-smoke-cloud {
    position: absolute;
    border-radius: 47% 53% 61% 39% / 58% 42% 58% 42%;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.card-smoke-cloud {
    background:
        radial-gradient(ellipse at 24% 45%, rgba(244, 239, 225, .68) 0 10%, rgba(153, 146, 133, .32) 28%, transparent 52%),
        radial-gradient(ellipse at 58% 28%, rgba(205, 198, 184, .56) 0 12%, rgba(104, 99, 91, .3) 32%, transparent 55%),
        radial-gradient(ellipse at 74% 64%, rgba(181, 174, 162, .5) 0 13%, rgba(79, 75, 70, .28) 34%, transparent 58%),
        radial-gradient(ellipse at 38% 78%, rgba(127, 121, 112, .42) 0 12%, transparent 52%);
    -webkit-mask-image:
        radial-gradient(ellipse at 25% 48%, #000 0 24%, transparent 62%),
        radial-gradient(ellipse at 58% 30%, #000 0 26%, transparent 64%),
        radial-gradient(ellipse at 70% 70%, #000 0 28%, transparent 66%);
    mask-image:
        radial-gradient(ellipse at 25% 48%, #000 0 24%, transparent 62%),
        radial-gradient(ellipse at 58% 30%, #000 0 26%, transparent 64%),
        radial-gradient(ellipse at 70% 70%, #000 0 28%, transparent 66%);
    filter: blur(4px);
    mix-blend-mode: screen;
}

.card-smoke-cloud.is-deep {
    background:
        radial-gradient(ellipse at 28% 44%, rgba(152, 146, 135, .58) 0 12%, rgba(61, 58, 54, .42) 34%, transparent 56%),
        radial-gradient(ellipse at 66% 34%, rgba(108, 103, 96, .5) 0 14%, rgba(37, 35, 33, .34) 38%, transparent 60%),
        radial-gradient(ellipse at 58% 76%, rgba(76, 72, 67, .46) 0 13%, transparent 56%);
    filter: blur(6px);
    mix-blend-mode: normal;
}

.loss-smoke-cloud {
    background:
        radial-gradient(ellipse at 22% 48%, rgba(80, 78, 74, .58) 0 13%, rgba(38, 37, 35, .4) 34%, transparent 54%),
        radial-gradient(ellipse at 53% 27%, rgba(104, 101, 95, .5) 0 14%, rgba(43, 42, 39, .36) 36%, transparent 58%),
        radial-gradient(ellipse at 76% 62%, rgba(71, 69, 65, .55) 0 14%, rgba(26, 25, 24, .4) 38%, transparent 60%),
        radial-gradient(ellipse at 40% 80%, rgba(55, 53, 50, .52) 0 12%, transparent 52%);
    -webkit-mask-image:
        radial-gradient(ellipse at 22% 48%, #000 0 25%, transparent 62%),
        radial-gradient(ellipse at 55% 28%, #000 0 27%, transparent 64%),
        radial-gradient(ellipse at 72% 70%, #000 0 29%, transparent 66%);
    mask-image:
        radial-gradient(ellipse at 22% 48%, #000 0 25%, transparent 62%),
        radial-gradient(ellipse at 55% 28%, #000 0 27%, transparent 64%),
        radial-gradient(ellipse at 72% 70%, #000 0 29%, transparent 66%);
    filter: blur(13px);
    mix-blend-mode: normal;
}

.loss-smoke-cloud.is-light {
    background:
        radial-gradient(ellipse at 20% 48%, rgba(214, 208, 195, .48) 0 9%, rgba(123, 118, 108, .3) 27%, transparent 55%),
        radial-gradient(ellipse at 48% 25%, rgba(187, 181, 169, .43) 0 11%, rgba(91, 87, 81, .28) 31%, transparent 58%),
        radial-gradient(ellipse at 75% 58%, rgba(159, 153, 143, .4) 0 12%, rgba(72, 69, 64, .25) 34%, transparent 61%),
        radial-gradient(ellipse at 42% 82%, rgba(132, 127, 118, .34) 0 10%, transparent 54%);
    filter: blur(12px);
    mix-blend-mode: screen;
}

.loss-smoke-cloud.is-deep {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(42, 41, 39, .76) 0 15%, rgba(12, 12, 12, .58) 42%, transparent 64%),
        radial-gradient(ellipse at 70% 62%, rgba(31, 30, 29, .7) 0 18%, rgba(8, 8, 8, .52) 46%, transparent 66%);
    filter: blur(15px);
}

.preview {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(7, 4, 2, .82);
    z-index: 40;
}

.preview[hidden] {
    display: none;
}

.preview.is-opening img {
    animation: previewZoomIn .18s cubic-bezier(.16, .9, .24, 1) both;
}

.preview.is-closing img {
    animation: previewZoomOut .16s cubic-bezier(.55, 0, .8, .25) both;
}

.preview img {
    position: relative;
    z-index: 2;
    width: min(82vw, 560px, calc(90vh * 700 / 1075));
    aspect-ratio: 700 / 1075;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .7);
}

.preview img.preview-swap-in {
    animation: previewDirectionalIn .2s cubic-bezier(.16, .92, .2, 1) both;
}

.preview img.preview-swap-out {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    animation: previewDirectionalOut .2s cubic-bezier(.45, 0, .7, .2) both;
    pointer-events: none;
    z-index: 3;
}

.preview button {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    min-height: 42px;
    font-size: 24px;
}

.preview .preview-action {
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: clamp(24px, 7vh, 72px);
    z-index: 4;
    width: auto;
    min-width: min(360px, calc(100vw - 48px));
    min-height: 58px;
    padding: 12px 30px;
    font-size: 24px;
    letter-spacing: 0;
    transform: translateX(-50%);
    border: 1px solid rgba(217, 164, 65, .58);
    border-radius: 7px;
    color: #fff4dc;
    background: rgba(20, 12, 7, .84);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .72), 0 10px 28px rgba(0, 0, 0, .58);
    backdrop-filter: blur(2px);
}

.preview .preview-action[hidden] {
    display: none;
}

@keyframes previewZoomIn {
    0% { opacity: 0; transform: scale(.84); filter: blur(.5px) brightness(1.05); }
    100% { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
}

@keyframes previewZoomOut {
    0% { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
    100% { opacity: 0; transform: scale(.84); filter: blur(.5px) brightness(1.04); }
}

@keyframes previewDirectionalIn {
    0% { opacity: 1; transform: translate(var(--preview-in-x, 42vw), var(--preview-in-y, 0)) scale(1); filter: brightness(1.02); }
    100% { opacity: 1; transform: translate(0, 0) scale(1); filter: brightness(1); }
}

@keyframes previewDirectionalOut {
    0% { opacity: 1; transform: translate(0, 0) scale(1); filter: brightness(1); }
    82% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--preview-out-x, -42vw), var(--preview-out-y, 0)) scale(1); filter: brightness(1.02); }
}

.stapelblock-ghost {
    position: fixed;
    z-index: 60;
    width: 110px;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(255, 223, 115, .85), 0 0 34px rgba(255, 223, 115, .9);
    transform: scale(1);
    transition: left .65s ease, top .65s ease, transform .35s ease;
    pointer-events: none;
}

.stapelblock-ghost.is-active {
    transform: scale(1.28);
}

.effect-burst {
    position: absolute;
    left: 50%;
    top: 42%;
    z-index: 12;
    width: max-content;
    color: #fff6b9;
    font-size: 22px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 211, 71, .95), 0 3px 8px rgba(0, 0, 0, .95);
    transform: translate(-50%, -50%) scale(.72);
    pointer-events: none;
    animation: effectBurst .9s ease forwards;
}

.attack-fire-burst {
    position: absolute;
    inset: -18%;
    z-index: 13;
    border-radius: 9px;
    pointer-events: none;
    overflow: hidden;
}

.fixed-card-fx {
    position: fixed;
    inset: 0;
    z-index: 96;
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
}

.gold-fountain-fx {
    mix-blend-mode: screen;
}

.card-edge-smoke-fx {
    z-index: 95;
}

.attack-fire-burst {
    inset: 0;
    overflow: visible;
}

.attack-fire-burst::before,
.attack-fire-burst::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34%;
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(.2);
    opacity: 0;
    mix-blend-mode: screen;
    pointer-events: none;
}

.attack-fire-burst::before {
    background:
        radial-gradient(circle, rgba(255, 253, 190, 1) 0 12%, rgba(255, 170, 41, .96) 24%, rgba(255, 38, 28, .78) 42%, transparent 68%),
        conic-gradient(from 18deg, transparent 0deg, rgba(255, 48, 28, .96) 24deg, rgba(255, 220, 82, .98) 38deg, transparent 62deg, rgba(215, 20, 18, .86) 114deg, transparent 144deg, rgba(255, 96, 28, .95) 204deg, transparent 236deg, rgba(255, 232, 96, .92) 306deg, transparent 342deg);
    filter: drop-shadow(0 0 14px rgba(255, 45, 24, .95));
    animation: attackFireBurst .64s cubic-bezier(.16, .8, .22, 1) forwards;
}

.attack-fire-burst::after {
    width: 18%;
    background:
        radial-gradient(circle at 50% -70%, rgba(255, 232, 92, .95) 0 8%, transparent 12%),
        radial-gradient(circle at 120% 20%, rgba(255, 65, 25, .9) 0 8%, transparent 12%),
        radial-gradient(circle at 80% 140%, rgba(255, 188, 44, .9) 0 8%, transparent 12%),
        radial-gradient(circle at -40% 90%, rgba(255, 42, 28, .9) 0 8%, transparent 12%),
        radial-gradient(circle at -20% 0%, rgba(255, 245, 168, .9) 0 7%, transparent 11%);
    filter: drop-shadow(0 0 9px rgba(255, 80, 28, .9));
    animation: attackFireSparks .58s cubic-bezier(.18, .85, .26, 1) .04s forwards;
}

.motion-ghost {
    position: fixed;
    z-index: 58;
    width: 80px;
    border-radius: 7px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .48);
    transform: scale(.86) rotate(-4deg);
    opacity: .92;
    transition: left .48s cubic-bezier(.2, .85, .25, 1), top .48s cubic-bezier(.2, .85, .25, 1), transform .48s ease, opacity .48s ease;
    pointer-events: none;
}

.motion-ghost.is-moving {
    transform: scale(.7) rotate(5deg);
    opacity: .35;
}

@keyframes deckShotKick {
    0% { transform: translate(0, 0) rotate(0); filter: brightness(1); }
    35% { transform: translate(-5px, 2px) rotate(-3deg) scale(1.04); filter: brightness(1.35); }
    100% { transform: translate(0, 0) rotate(0); filter: brightness(1); }
}

@keyframes shotHoleFlash {
    0% { opacity: 0; transform: scale(.92); }
    18%, 78% { opacity: 1; transform: scale(1.01); }
    100% { opacity: 0; transform: scale(1.04); }
}

@keyframes deckShotSmoke {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.25) rotate(0deg); filter: blur(1px); }
    18% { opacity: .9; }
    100% { opacity: 0; transform: translate(-50%, -72%) scale(1.28) rotate(14deg); filter: blur(9px); }
}

@keyframes cardFlipIn {
    0% {
        transform: rotateY(88deg) scale(.92);
        filter: brightness(1.28);
    }
    70% {
        transform: rotateY(-8deg) scale(1.04);
    }
    100% {
        transform: rotateY(0) scale(1);
        filter: brightness(1);
    }
}

@keyframes actionGlow {
    0%, 100% {
        box-shadow: 0 10px 20px rgba(0, 0, 0, .3);
    }
    28%, 70% {
        box-shadow: 0 0 0 2px rgba(255, 224, 108, .78), 0 0 28px rgba(255, 207, 64, .95), 0 18px 34px rgba(0, 0, 0, .55);
    }
}

@keyframes effectCardShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    24% { transform: translateX(-2px) rotate(-.65deg); }
    52% { transform: translateX(2px) rotate(.65deg); }
    76% { transform: translateX(-1px) rotate(-.35deg); }
}

@keyframes effectCardBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    42% { transform: translateY(-11px) scale(1.045); }
    72% { transform: translateY(2px) scale(.99); }
}

@keyframes effectCardBuy {
    0%, 100% { transform: rotate(0deg) scale(1); box-shadow: 0 10px 20px rgba(0, 0, 0, .3); }
    34% { transform: rotate(-4deg) scale(1.035); box-shadow: 0 0 0 2px rgba(105, 220, 255, .86), 0 0 24px rgba(92, 206, 255, .76), 0 14px 28px rgba(0, 0, 0, .42); }
    68% { transform: rotate(4deg) scale(1.025); box-shadow: 0 0 0 2px rgba(144, 243, 255, .72), 0 0 18px rgba(92, 206, 255, .55), 0 14px 28px rgba(0, 0, 0, .42); }
}

@keyframes attackFireBurst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.18) rotate(0deg); filter: blur(0); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(8deg); filter: blur(0); }
    68% { opacity: .72; transform: translate(-50%, -50%) scale(2.25) rotate(28deg); filter: blur(1px); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.9) rotate(38deg); filter: blur(3px); }
}

@keyframes attackFireSparks {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(0deg); }
    22% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(4.1) rotate(42deg); }
}

@keyframes effectBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -30%) scale(.62);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.12);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -86%) scale(1.28);
    }
}

@media (max-width: 980px) {
    .upper-zone,
    .hand-deck-row {
        grid-template-columns: 1fr;
    }

    .field-row {
        grid-template-columns: 104px minmax(0, 1fr) 104px;
    }

    .card,
    .shop-pile {
        width: 92px;
    }

    .pile-card,
    .deck-wrap .card {
        width: 94px;
    }

    .brand {
        position: static;
        margin-bottom: 20px;
    }

    .lobby {
        place-items: start stretch;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .new-game-actions {
        grid-template-columns: 1fr;
    }

    .library-card {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .library-card img {
        width: 70px;
    }

    .rules-section {
        width: calc(100% - 20px);
        padding: 18px;
    }

    .rules-combo-meter {
        min-height: 22px;
        height: 24px;
    }

    .rules-combo-meter .combo-segment {
        min-height: 16px;
    }

    .rules-stack-example .pile-card {
        width: 88px;
    }
}

.legal-footer {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 16px 20px 28px;
    color: var(--muted);
}

.legal-footer a,
.legal-footer button,
.legal-header a {
    color: var(--gold);
    background: transparent;
    border: 0;
    min-height: 0;
    padding: 0;
    text-decoration: underline;
}

.legal-page {
    padding-top: 18px;
}

.legal-header {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 0;
}

.privacy-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
    border: 1px solid rgba(217, 164, 65, .75);
    border-radius: 8px;
    background: rgba(24, 15, 10, .96);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .58);
}

.privacy-banner p {
    margin: 8px 0 10px;
    color: #ecd9bd;
    line-height: 1.4;
}

.privacy-banner label,
.privacy-banner nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 7px;
    color: var(--muted);
}

.privacy-banner a {
    color: var(--gold);
}

.privacy-actions {
    display: grid;
    align-content: end;
    gap: 8px;
}

@media (max-width: 760px) {
    .privacy-banner {
        grid-template-columns: 1fr;
    }
}
.action-lane .card:not(:first-child),
.hand .card:not(:first-child) {
    margin-left: calc(-1 * var(--card-overlap, 0px));
}

.action-lane .card:hover,
.hand .card:hover,
.action-lane .card.is-gamepad-selected,
.hand .card.is-gamepad-selected,
.action-lane .card.is-selected,
.hand .card.is-selected {
    z-index: 80 !important;
}

@media (max-width: 680px) {
    button {
        min-height: 30px;
        font-size: 13px;
    }

    .table {
        gap: 6px;
        padding: 6px;
    }

    .topbar {
        min-height: 46px;
        padding: 7px 9px;
    }

    .session-counters {
        gap: 4px;
        font-size: 10px;
    }

    .session-counters span {
        gap: 3px;
        padding: 3px 4px;
    }

    .session-counters b {
        display: none;
    }

    .session-counters strong {
        font-size: 12px;
    }

    .top-actions {
        gap: 5px;
    }

    .autoselect-toggle {
        min-height: 32px;
        padding: 0 6px;
        font-size: 10px;
    }

    .autoselect-toggle span {
        display: none;
    }

    .icon-button {
        width: 32px;
        min-width: 32px;
        padding-inline: 5px;
    }

    .icon-button img {
        width: 18px;
        height: 18px;
    }

    .gamepad-status {
        font-size: 11px;
    }

    .gamepad-status span {
        font-size: 9px;
    }

    .upper-zone {
        grid-template-columns: 1fr;
        padding: 7px;
    }

    .panel-head {
        grid-template-columns: minmax(54px, 1fr) auto minmax(54px, 1fr);
        gap: 6px;
    }

    .shop-wrap.is-collapsed .panel-head {
        grid-template-columns: minmax(54px, 1fr) auto minmax(54px, 1fr);
    }

    .shop-wrap.is-collapsed .shop-turn-status {
        min-width: 0;
    }

    .shop-turn-status {
        gap: 6px;
        min-width: 0;
    }

    .shop-turn-stat {
        min-width: 38px;
        height: 32px;
    }

    .shop-turn-stat img {
        width: 28px;
        height: 28px;
    }

    .shop-graveyard-status {
        gap: 3px;
        font-size: 9px;
    }

    .shop-graveyard-value {
        min-width: 7px;
        font-size: 11px;
    }

    .log-panel.is-collapsed {
        display: none;
    }

    .player-zone {
        gap: 5px;
        padding: 6px;
    }

    .zone-head {
        gap: 6px;
        min-height: 24px;
    }

    .zone-head h2,
    .log-panel h2 {
        font-size: 13px;
    }

    .field-row {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 6px;
        min-height: 156px;
    }

    .zone {
        padding: 5px;
        border-radius: 6px;
    }

    .zone-title,
    .pile-title {
        margin-bottom: 4px;
        font-size: 10px;
    }

    .aside-zone,
    .deck-wrap {
        display: none;
    }

    .card,
    .shop-pile {
        width: 74px;
    }

    .pile-card,
    .deck-wrap .card {
        width: 76px;
    }

    .action-lane {
        min-height: 126px;
        gap: 5px;
        padding: 12px 6px 14px;
    }

    .hand {
        min-height: 134px;
        padding: 12px 10px 14px;
    }

    .hand-deck-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .phase-footer {
        min-height: 29px;
        gap: 8px;
        padding-top: 4px;
    }

    #phaseLabel {
        font-size: 12px;
    }

    .phase-counter {
        top: 2px;
        font-size: 18px;
        text-shadow: 0 0 9px rgba(255, 205, 67, .9), 0 2px 7px rgba(0, 0, 0, .9);
    }

    .turn-splash {
        font-size: clamp(28px, 10vw, 54px);
        padding: 18px;
    }

    .turn-splash.is-small {
        font-size: clamp(18px, 6vw, 32px);
    }

    .compact-piles {
        display: flex;
    }

    .opponent-zone .compact-piles {
        display: none;
    }

    .stats {
        gap: 4px;
        align-items: center;
    }

    .stat {
        min-width: 46px;
        padding: 2px 4px;
        font-size: 11px;
    }

    .stat span {
        font-size: 8px;
    }

    .mini-pile {
        width: 25px;
    }

    .mini-card {
        width: 24px;
    }

    .mini-card.is-revealed {
        width: 34px;
    }

    .badge {
        min-width: 20px;
        padding: 2px 4px;
        font-size: 11px;
    }

    .shop-grid {
        max-height: 310px;
        gap: 6px;
        padding: 12px 10px 14px;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding-inline: 6px;
    }

    .session-counters,
    .top-actions {
        gap: 3px;
    }

    .session-counters span {
        padding-inline: 3px;
    }

    .icon-button {
        width: 30px;
        min-width: 30px;
        padding-inline: 4px;
    }

    .autoselect-toggle {
        min-width: 30px;
        padding-inline: 4px;
    }

    .shop-turn-status {
        gap: 3px;
    }

    .shop-turn-stat {
        min-width: 28px;
        height: 28px;
        gap: 2px;
    }

    .shop-turn-stat img {
        width: 21px;
        height: 21px;
    }

    .shop-resource-stat img {
        width: 20px;
        height: 20px;
    }

    .shop-turn-value {
        min-width: 7px;
        font-size: 11px;
    }

    .shop-graveyard-status {
        gap: 2px;
    }

    .shop-graveyard-icon {
        width: 15px;
        height: 15px;
    }

    .shop-graveyard-value {
        min-width: 5px;
        font-size: 9px;
    }
}
.game-shell,
.game-shell .table {
    min-height: 100svh;
}

.table.is-height-tight {
    gap: 5px;
    padding-block: 5px;
}

.table.is-height-tight .topbar {
    min-height: 34px;
    padding-block: 4px;
}

.table.is-height-tight #statusLine {
    font-size: 10px;
}

.table.is-height-tight .gamepad-status {
    font-size: 10px;
}

.table.is-height-tight .gamepad-status span {
    display: none;
}

.table.is-height-tight .icon-button {
    width: auto;
    min-width: 30px;
    min-height: 28px;
    padding-inline: 5px;
}

.table.is-height-tight .top-actions button {
    min-height: 28px;
    font-size: 12px;
}

.table.is-height-tight .panel-head {
    min-height: 36px;
}

.table.is-height-tight .upper-zone.is-collapsed {
    min-height: 48px;
    max-height: 48px;
    padding-block: 5px;
}

.table.is-height-tight .shop-toggle {
    font-size: 15px;
}

.table.is-height-tight .log-toggle {
    font-size: 13px;
}

.table.is-height-tight .shop-turn-status {
    gap: 8px;
}

.table.is-height-tight .shop-turn-stat {
    gap: 4px;
    height: 32px;
    min-width: 46px;
}

.table.is-height-tight .shop-turn-stat img {
    width: 28px;
    height: 28px;
}

.table.is-height-tight .shop-turn-value {
    min-width: 13px;
    font-size: 14px;
}

.table.is-height-tight .shop-graveyard-status {
    gap: 3px;
    font-size: 10px;
}

.table.is-height-tight .shop-graveyard-value {
    font-size: 12px;
}

.table.is-height-tight .player-zone {
    padding-block: 5px;
}

.table.is-height-tight .field-row {
    min-height: 142px;
}

.table.is-height-tight .action-lane {
    min-height: 116px;
    padding-block: 9px 10px;
}

.table.is-height-tight .hand {
    min-height: 120px;
    padding-block: 9px 10px;
}

.table.is-height-tight .phase-footer {
    min-height: 25px;
}

.table.is-height-critical .upper-zone:not(.is-collapsed) {
    max-height: 48px;
    overflow: hidden;
    padding-block: 6px;
}

.table.is-height-critical .upper-zone.is-collapsed {
    min-height: 40px;
    max-height: 40px;
    padding-block: 4px;
}

.table.is-height-critical .panel-head {
    min-height: 30px;
    gap: 5px;
}

.table.is-height-critical .shop-toggle {
    font-size: 13px;
}

.table.is-height-critical .log-toggle {
    font-size: 11px;
}

.table.is-height-critical .shop-turn-status {
    gap: 5px;
}

.table.is-height-critical .shop-turn-stat {
    gap: 3px;
    height: 27px;
    min-width: 36px;
}

.table.is-height-critical .shop-turn-stat img {
    width: 23px;
    height: 23px;
}

.table.is-height-critical .shop-turn-value {
    min-width: 10px;
    font-size: 12px;
}

.table.is-height-critical .shop-graveyard-status {
    gap: 2px;
    font-size: 8px;
}

.table.is-height-critical .shop-graveyard-value {
    min-width: 6px;
    font-size: 10px;
}

.table.is-height-critical .shop-grid,
.table.is-height-critical .log-panel {
    display: none;
}

.table.is-height-critical .shop-wrap.is-log-open .log-panel {
    display: grid;
    min-height: 0;
}

.table.is-height-critical .opponent-zone {
    max-height: 64px;
    min-height: 0;
    overflow: hidden;
}

.table.is-height-critical .opponent-zone .field-row {
    display: none;
}

.table.is-height-critical .card,
.table.is-height-critical .shop-pile {
    width: 68px;
}

.table.is-height-critical .pile-card,
.table.is-height-critical .deck-wrap .card {
    width: 70px;
}

.game-body {
    overflow: hidden;
}

.game-body .game-shell,
.game-body .table {
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
}

.table.is-height-critical.is-shop-open {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.table.is-height-critical.is-shop-open .upper-zone:not(.is-collapsed) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 6px;
}

.table.is-height-critical.is-shop-open .shop-wrap {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.table.is-height-critical.is-shop-open .shop-grid {
    display: grid;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 10px 12px;
}

.table.is-height-critical.is-shop-open .log-panel.is-collapsed {
    display: none;
}

.table.is-height-critical.is-shop-open .player-zone {
    max-height: 52px;
    min-height: 0;
    overflow: hidden;
    padding-block: 6px;
}

.table.is-height-critical.is-shop-open .player-zone .field-row,
.table.is-height-critical.is-shop-open .player-zone .hand-deck-row {
    display: none;
}

@media (min-width: 1800px) and (min-height: 980px) {
    .card,
    .shop-pile {
        width: 124px;
    }

    .pile-card,
    .deck-wrap .card {
        width: 126px;
    }

    .action-lane {
        min-height: 192px;
        padding: 22px 18px 26px;
    }

    .hand {
        min-height: 206px;
        padding: 22px 18px 26px;
    }

    .hand-deck-row {
        grid-template-columns: minmax(0, 1fr) 150px;
    }

    .player-zone > .zone-head,
    .field-row {
        grid-template-columns: 140px minmax(0, 1fr) 140px;
    }

    .player-zone:not(.opponent-zone) > .zone-head {
        grid-template-columns: 140px minmax(0, 1fr) max-content;
    }

    .opponent-zone > .zone-head {
        grid-template-columns: 140px minmax(120px, 1fr) minmax(0, auto);
    }

    .opponent-zone .mini-hand {
        max-width: min(42vw, 380px);
    }

    .field-row {
        min-height: 222px;
    }

    .combo-segment strong {
        font-size: 16px;
    }

    .shop-grid {
        max-height: 500px;
    }

    .phase-counter {
        font-size: 32px;
    }
}

@media (min-width: 2400px) and (min-height: 1300px) {
    .card,
    .shop-pile {
        width: 144px;
    }

    .pile-card,
    .deck-wrap .card {
        width: 146px;
    }

    .action-lane {
        min-height: 224px;
        padding: 26px 22px 30px;
    }

    .hand {
        min-height: 238px;
        padding: 26px 22px 30px;
    }

    .hand-deck-row {
        grid-template-columns: minmax(0, 1fr) 172px;
    }

    .player-zone > .zone-head,
    .field-row {
        grid-template-columns: 160px minmax(0, 1fr) 160px;
    }

    .player-zone:not(.opponent-zone) > .zone-head {
        grid-template-columns: 160px minmax(0, 1fr) max-content;
    }

    .opponent-zone > .zone-head {
        grid-template-columns: 160px minmax(140px, 1fr) minmax(0, auto);
    }

    .opponent-zone .mini-hand {
        max-width: min(38vw, 460px);
    }

    .field-row {
        min-height: 256px;
    }

    .combo-segment strong {
        font-size: 18px;
    }

    .shop-grid {
        max-height: 620px;
    }

    .phase-counter {
        font-size: 38px;
    }
}
button.is-gamepad-selected,
a.is-gamepad-selected {
    outline: 3px solid rgba(255, 241, 143, .9);
    box-shadow: 0 0 28px rgba(255, 210, 54, .75), 0 10px 22px rgba(0, 0, 0, .45);
}

.gamepad-button-hint {
    display: inline-block;
    margin-left: 2px;
    font-size: 10px;
    line-height: 1;
}

.splash-line {
    position: relative;
    z-index: 2;
    display: block;
    grid-area: 1 / 1;
}

.splash-age-0 {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.splash-age-1 {
    opacity: .48;
    transform: translateY(-8px) scale(.62);
}

.splash-age-2 {
    opacity: .24;
    transform: translateY(-12px) scale(.46);
}

.splash-age-3 {
    opacity: .12;
    transform: translateY(-16px) scale(.36);
}
.splash-tone-attacker {
    color: #ffc7bd;
    text-shadow: 0 0 18px rgba(255, 76, 58, .95), 0 5px 18px rgba(0, 0, 0, .85);
}

.splash-tone-defender {
    color: #caffbf;
    text-shadow: 0 0 18px rgba(83, 220, 116, .95), 0 5px 18px rgba(0, 0, 0, .85);
}
.compact-phase-button {
    display: none;
    margin-left: auto;
    white-space: nowrap;
}

.table.is-height-critical.is-shop-open .player-zone > .zone-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table.is-height-critical.is-shop-open .player-zone #playerStats {
    margin-left: auto;
}

.table.is-height-critical.is-shop-open .compact-phase-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding-inline: 10px;
    font-size: 12px;
}
.share-palette {
    position: fixed;
    right: 12px;
    top: 64px;
    display: flex;
    gap: 6px;
    z-index: 80;
    padding: 8px;
    border: 1px solid rgba(217, 164, 65, .55);
    border-radius: 8px;
    background: rgba(26, 17, 11, .96);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .45);
}

.share-palette[hidden] {
    display: none;
}

.share-palette a,
.share-palette button {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #3a281b;
    font-size: 13px;
    text-decoration: none;
}

@media (max-width: 520px) {
    .gamepad-status {
        display: none !important;
    }
}

@media (max-width: 680px) {
    .table.is-height-tight .shop-wrap.is-collapsed .shop-turn-status,
    .table.is-height-critical .shop-wrap.is-collapsed .shop-turn-status {
        min-width: 0;
    }

    .table.is-height-critical.is-shop-open .player-zone > .zone-head h2 {
        display: none;
    }

    .table.is-height-critical.is-shop-open .player-zone #playerStats {
        margin-left: 0;
        flex: 1 1 auto;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .table.is-height-critical.is-shop-open .player-zone #playerStats .stat {
        min-width: 36px;
        padding-inline: 3px;
    }

    .table.is-height-critical.is-shop-open .player-zone #playerStats .mini-pile {
        width: 22px;
    }

    .table.is-height-critical.is-shop-open .compact-phase-button {
        flex: 0 0 auto;
    }
}

@media (max-width: 420px) {
    .table.is-height-tight .shop-turn-status,
    .table.is-height-critical .shop-turn-status {
        gap: 3px;
    }

    .table.is-height-tight .shop-turn-stat,
    .table.is-height-critical .shop-turn-stat {
        min-width: 28px;
        height: 28px;
        gap: 2px;
    }

    .table.is-height-tight .shop-turn-stat img,
    .table.is-height-critical .shop-turn-stat img {
        width: 21px;
        height: 21px;
    }

    .table.is-height-tight .shop-resource-stat img,
    .table.is-height-critical .shop-resource-stat img {
        width: 20px;
        height: 20px;
    }

    .table.is-height-tight .shop-turn-value,
    .table.is-height-critical .shop-turn-value {
        min-width: 7px;
        font-size: 11px;
    }

    .table.is-height-tight .shop-graveyard-icon,
    .table.is-height-critical .shop-graveyard-icon {
        width: 15px;
        height: 15px;
    }

    .table.is-height-tight .shop-graveyard-value,
    .table.is-height-critical .shop-graveyard-value {
        min-width: 5px;
        font-size: 9px;
    }
}
.running-game-panel {
    margin-top: 18px;
}

.create-limit-info {
    margin: 10px 0 0;
    color: #ffd88b;
    font-weight: 700;
}

.running-games-table {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.running-game-row {
    display: grid;
    grid-template-columns: 48px 24px 24px minmax(96px, auto) 42px 54px minmax(112px, 1fr) 32px;
    gap: 6px;
    align-items: center;
}

.running-game-resume {
    min-width: 48px;
    min-height: 32px;
    padding: 4px 7px;
    border-color: color-mix(in srgb, var(--slot-color), white 22%);
    background: var(--slot-color);
    color: #fff8ea;
    font-weight: 900;
    display: inline-flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.running-game-resume img {
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.running-game-icon {
    position: relative;
    width: 24px;
    height: 30px;
    display: inline-grid;
    place-items: center;
}

.running-game-icon img {
    width: 19px;
    height: 19px;
    object-fit: contain;
}

.running-game-cpu-level {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .95), 0 0 8px rgba(0, 0, 0, .8);
    pointer-events: none;
}

.running-game-date {
    white-space: nowrap;
    font-size: .9rem;
}

.running-game-stat {
    min-width: 0;
    color: #fff3af;
    font-size: .86rem;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0, 0, 0, .85);
}

.running-game-score {
    color: var(--gold);
}

.running-game-row input {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 4px 7px;
    border: 1px solid rgba(107, 75, 47, .75);
    border-radius: 6px;
    color: var(--text);
    background: rgba(18, 12, 8, .74);
}

.running-game-delete {
    min-width: 30px;
    width: 30px;
    min-height: 30px;
    padding: 0;
}

.running-game-delete img {
    width: 16px;
    height: 16px;
}

@media (max-width: 760px) {
    .running-game-row {
        grid-template-columns: 42px 22px 22px minmax(82px, auto) 34px 46px 1fr 30px;
        gap: 4px;
    }

    .running-game-resume {
        min-width: 42px;
        padding-inline: 5px;
    }

    .running-game-icon {
        width: 22px;
    }

    .running-game-icon img {
        width: 17px;
        height: 17px;
    }

    .running-game-date {
        font-size: .78rem;
    }
}

@keyframes shopDamageFlash {
    0% { color: #fff5df; border-color: rgba(255, 78, 56, .95); box-shadow: 0 0 0 rgba(255, 78, 56, 0), inset 0 0 0 rgba(255, 78, 56, 0); }
    22% { color: #ffd5cc; background: rgba(95, 24, 18, .96); box-shadow: 0 0 18px rgba(255, 65, 45, .95), inset 0 0 16px rgba(255, 68, 48, .42); }
    100% { color: inherit; box-shadow: inset 0 0 0 rgba(255, 78, 56, 0); }
}

@keyframes shopDamageSmoke {
    0% { opacity: 0; transform: translateY(12px) scale(.7); }
    28% { opacity: .95; }
    100% { opacity: 0; transform: translateY(-18px) scale(1.35); }
}

@keyframes victoryPulse {
    0%, 100% { opacity: .38; transform: scale(.96); }
    50% { opacity: .72; transform: scale(1.04); }
}

.table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) > .field-row,
.table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) .hand-deck-row {
    display: none;
}

.table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) {
    min-height: 0;
}

.table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) > .zone-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table.is-cowboy-user-collapsed .player-zone #playerStats {
    margin-left: auto;
}

.table.is-cowboy-user-collapsed .compact-phase-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding-inline: 10px;
    font-size: 12px;
}

.table.is-cowboy-focus .opponent-zone {
    max-height: none !important;
    opacity: 1;
    overflow: visible !important;
}

.table.is-cowboy-selecting .opponent-zone {
    filter: none;
    opacity: 1;
}

.table.is-cowboy-focus .opponent-zone .zone-head {
    align-items: center;
}

.table.is-cowboy-focus .opponent-zone .stats {
    overflow: visible;
}

.opponent-expanded-hand {
    display: none;
}

.table.is-cowboy-focus .opponent-expanded-hand {
    display: block;
}

.opponent-hand-deck-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 10px;
}

.opponent-full-hand {
    min-height: 142px;
}

.opponent-full-hand .opponent-hand-card {
    width: clamp(76px, 7vw, 118px);
}

.opponent-hand-card[data-select-cowboy],
.mini-card[data-select-cowboy] {
    cursor: pointer;
}

.opponent-hand-card.is-selected,
.mini-card[data-select-cowboy].is-selected {
    border-color: #fff18f;
    box-shadow: 0 0 0 4px rgba(255, 241, 143, .95), 0 0 34px rgba(255, 210, 54, .9), 0 18px 34px rgba(0, 0, 0, .58);
    z-index: 24;
}

.opponent-hand-card.is-selected {
    transform: translateY(-8px) scale(1.06);
}

.mini-card[data-select-cowboy].is-selected {
    transform: scale(1.18);
}

.opponent-hand-card.is-selected::before,
.mini-card[data-select-cowboy].is-selected::before {
    content: "";
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(255, 241, 143, .92);
    border-radius: 10px;
    box-shadow: 0 0 18px rgba(255, 210, 54, .82);
    pointer-events: none;
}

.opponent-hand-card.is-selected::after,
.mini-card[data-select-cowboy].is-selected::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, #fff6c2, #d9a441 68%, #6d2e1f 100%);
    box-shadow: 0 0 14px rgba(255, 210, 54, .92), 0 2px 6px rgba(0, 0, 0, .5);
    pointer-events: none;
}

.opponent-deck-zone {
    display: grid;
    align-content: start;
}

.opponent-deck-piles {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.table.is-cowboy-focus .opponent-zone .mini-hand {
    display: none;
}

@media (max-width: 680px) {
    .opponent-hand-deck-row {
        grid-template-columns: 1fr;
    }

    .opponent-deck-zone {
        display: none;
    }

    .opponent-full-hand .opponent-hand-card {
        width: 74px;
    }
}

.table.is-shop-open {
    height: 100svh;
    max-height: 100svh;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.table.is-shop-open .opponent-zone,
.table.is-shop-open .player-zone:not(.opponent-zone) {
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding-block: 6px;
}

.table.is-shop-open .opponent-zone > .zone-head,
.table.is-shop-open .player-zone:not(.opponent-zone) > .zone-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
}

.table.is-shop-open .opponent-zone .field-row,
.table.is-shop-open .opponent-expanded-hand,
.table.is-shop-open .player-zone:not(.opponent-zone) > .field-row,
.table.is-shop-open .player-zone:not(.opponent-zone) .hand-deck-row {
    display: none;
}

.table.is-shop-open .opponent-zone .combo-meter,
.table.is-shop-open .player-zone:not(.opponent-zone) .combo-meter {
    flex: 0 0 auto;
}

.table.is-shop-open .opponent-zone .stats,
.table.is-shop-open .player-zone #playerStats {
    margin-left: auto;
    overflow: visible;
}

.table.is-shop-open .compact-phase-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 30px;
    padding-inline: 10px;
    font-size: 12px;
}

.table.is-shop-open .upper-zone:not(.is-collapsed) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 6px;
}

.table.is-shop-open .shop-wrap {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.table.is-shop-open .shop-grid {
    display: grid;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 10px 12px;
}

.table.is-shop-open .log-panel.is-collapsed {
    display: none;
}

@media (max-width: 680px) {
    .table.is-shop-open .opponent-zone > .zone-head h2,
    .table.is-shop-open .player-zone:not(.opponent-zone) > .zone-head h2 {
        display: none;
    }

    .table.is-shop-open .opponent-zone .stat,
    .table.is-shop-open .player-zone #playerStats .stat {
        min-width: 36px;
        padding-inline: 3px;
    }

    .table.is-shop-open .opponent-zone .mini-pile,
    .table.is-shop-open .player-zone #playerStats .mini-pile {
        width: 22px;
    }
}

.table.is-shop-open .player-zone:not(.opponent-zone) > .zone-head,
.table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) > .zone-head {
    flex-wrap: nowrap;
}

.table.is-shop-open .player-zone:not(.opponent-zone) .combo-meter,
.table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) .combo-meter {
    flex: 1 1 auto;
    min-width: 90px;
    max-width: none;
}

.table.is-shop-open .player-zone #playerStats,
.table.is-cowboy-user-collapsed .player-zone #playerStats {
    order: 3;
    flex: 0 0 auto;
    margin-left: 0;
}

.table.is-shop-open .compact-phase-button,
.table.is-cowboy-user-collapsed .compact-phase-button {
    order: 4;
    margin-left: 0;
}

.table.is-shop-open .player-zone:not(.opponent-zone) > .zone-head::before,
.table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) > .zone-head::before {
    content: "";
    order: 2;
    flex: 0 1 10px;
}

.table.is-height-critical.is-opponent-turn .opponent-zone {
    max-height: none;
    min-height: 0;
    overflow: visible;
}

.table.is-height-critical.is-opponent-turn .opponent-zone .field-row {
    display: grid;
}

.table.is-height-critical.is-opponent-turn .player-zone:not(.opponent-zone) {
    min-height: 0;
    max-height: 64px;
    overflow: hidden;
    align-content: start;
}

.table.is-height-critical.is-opponent-turn .player-zone:not(.opponent-zone) > .field-row,
.table.is-height-critical.is-opponent-turn .player-zone:not(.opponent-zone) .hand-deck-row,
.table.is-height-critical.is-opponent-turn .player-zone:not(.opponent-zone) .phase-footer {
    display: none;
}

.table.is-height-critical.is-opponent-turn .player-zone:not(.opponent-zone) > .zone-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}

.table.is-height-critical.is-opponent-turn .player-zone:not(.opponent-zone) .combo-meter {
    flex: 1 1 auto;
    min-width: 90px;
}

.table.is-height-critical.is-opponent-turn .player-zone:not(.opponent-zone) #playerStats {
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 680px) {
    .table.is-shop-open .opponent-zone > .zone-head,
    .table.is-shop-open .player-zone:not(.opponent-zone) > .zone-head,
    .table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) > .zone-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .table.is-shop-open .opponent-zone .combo-meter,
    .table.is-shop-open .player-zone:not(.opponent-zone) .combo-meter,
    .table.is-cowboy-user-collapsed .player-zone:not(.opponent-zone) .combo-meter {
        grid-column: 1 / -1;
        order: 3;
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .new-game-actions {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 760px) {
    .shop-wrap.is-log-open .shop-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .shop-wrap.is-log-open .shop-grid {
        display: none;
    }

    .shop-wrap.is-log-open .log-panel {
        display: grid;
        border-left: 0;
        padding: 8px 10px 12px;
    }

    .shop-wrap.is-log-open .log {
        min-height: 0;
        max-height: 100%;
    }
}

.table.is-shop-open .shop-wrap.is-log-open .log-panel {
    display: grid;
    min-height: 0;
}

.table.is-shop-open .shop-wrap.is-log-open .log {
    min-height: 0;
    max-height: 100%;
}

.rules-actions {
    display: flex;
    justify-content: flex-start;
    margin: 14px 0 20px;
}

.rules-actions button {
    min-width: 180px;
    font-weight: 900;
    letter-spacing: 0;
}

.tutorial-start-prompt {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(10, 6, 3, .72);
    backdrop-filter: blur(3px);
}

.tutorial-start-dialog {
    width: min(520px, 100%);
    padding: 22px;
    border: 1px solid rgba(217, 164, 65, .72);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(48, 33, 23, .98), rgba(28, 18, 12, .98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .62), 0 0 28px rgba(217, 164, 65, .18);
}

.tutorial-start-dialog h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.tutorial-start-dialog p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.tutorial-start-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.tutorial-coach-layer {
    position: absolute;
    z-index: 90;
    top: clamp(84px, 12vh, 132px);
    left: clamp(14px, 15vw, 220px);
    right: clamp(14px, 15vw, 220px);
    pointer-events: none;
}

.tutorial-coach-layer[hidden] {
    display: none;
}

.table.is-tutorial-opponent-turn .tutorial-coach-layer {
    top: clamp(420px, 58vh, 560px);
}

.tutorial-coach {
    width: 100%;
    min-width: 0;
    max-width: 960px;
    margin: 0 auto;
    padding: 18px 22px;
    border: 2px solid rgba(255, 219, 122, .82);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(76, 43, 22, .98), rgba(30, 19, 13, .98));
    box-shadow: 0 16px 46px rgba(0, 0, 0, .42), 0 0 0 2px rgba(255, 216, 117, .18), 0 0 34px rgba(255, 186, 57, .32), inset 0 1px 0 rgba(255, 236, 178, .16);
    pointer-events: auto;
}

.tutorial-coach strong {
    display: block;
    margin-bottom: 8px;
    color: #ffe1a0;
    font-size: clamp(20px, 2vw, 30px);
    line-height: 1.08;
}

.tutorial-coach p {
    margin: 0;
    color: var(--text);
    font-size: clamp(16px, 1.25vw, 20px);
    line-height: 1.36;
}

.tutorial-coach-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.tutorial-coach-actions button {
    min-height: 42px;
    padding: 9px 16px;
    font-size: 16px;
    font-weight: 900;
}

.tutorial-highlight {
    position: relative;
    z-index: 30;
    filter: brightness(1.14) saturate(1.18);
    box-shadow: 0 0 0 2px rgba(255, 238, 158, .95), 0 0 24px rgba(255, 205, 69, .82), 0 0 44px rgba(255, 83, 50, .34) !important;
    animation: tutorialPulse 1.2s ease-in-out infinite;
}

button.tutorial-highlight,
.card button.tutorial-highlight,
.shop-pile button.tutorial-highlight {
    outline: 2px solid rgba(255, 239, 159, .95);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(255, 196, 78, .45), 0 0 24px rgba(255, 205, 69, .88) !important;
}

@keyframes tutorialPulse {
    0%, 100% { filter: brightness(1.08) saturate(1.12); }
    50% { filter: brightness(1.28) saturate(1.26); }
}

@media (max-width: 780px) {
    .tutorial-coach-layer {
        top: 76px;
        left: 10px;
        right: 10px;
    }

    .table.is-tutorial-opponent-turn .tutorial-coach-layer {
        top: min(54vh, 430px);
    }

    .tutorial-coach {
        padding: 14px 16px;
    }

    .tutorial-coach p {
        font-size: 15px;
    }

    .tutorial-coach-actions button {
        flex: 1 1 160px;
    }

    .tutorial-start-actions {
        justify-content: stretch;
    }

    .tutorial-start-actions button {
        flex: 1;
    }
}


body.is-cpu-picker-open {
    overflow: hidden;
}

.cpu-opponent-picker {
    position: fixed;
    inset: 0;
    z-index: 120;
    overflow: auto;
    padding: clamp(14px, 3vh, 32px);
    background: rgba(20, 12, 7, .78);
    backdrop-filter: blur(8px) saturate(.82);
}

.cpu-opponent-picker[hidden] {
    display: none;
}

.cpu-opponent-screen {
    width: min(1500px, 100%);
    min-height: calc(100dvh - clamp(28px, 6vh, 64px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.cpu-opponent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 2px 4px 18px;
}

.cpu-opponent-header span {
    color: #f1c45e;
    font-size: 14px;
    font-weight: 900;
}

.cpu-opponent-header h1 {
    margin: 2px 0 0;
    color: #fff8e8;
    font-size: clamp(28px, 4vw, 54px);
    line-height: 1;
    letter-spacing: 0;
    text-shadow: 0 3px 12px rgba(0, 0, 0, .8);
}

.cpu-opponent-close {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    padding: 0 0 4px;
    border-color: rgba(255, 235, 190, .55);
    border-radius: 50%;
    color: #fff8e8;
    background: rgba(34, 20, 12, .86);
    font-family: Arial, sans-serif;
    font-size: 34px;
    line-height: 1;
}

.cpu-character-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: clamp(8px, 1.2vw, 18px);
    align-items: stretch;
}

.cpu-character {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-rows: minmax(170px, 1fr) auto auto;
    overflow: hidden;
    border: 1px solid rgba(217, 164, 65, .5);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(76, 45, 25, .74), rgba(27, 17, 11, .96));
    box-shadow: 0 16px 34px rgba(0, 0, 0, .4);
}

.cpu-character-portrait {
    position: relative;
    min-height: 0;
    display: grid;
    place-items: end center;
    overflow: hidden;
    background: radial-gradient(circle at 50% 65%, rgba(234, 170, 76, .2), transparent 58%);
}

.cpu-character-portrait img {
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 8px 9px rgba(0, 0, 0, .55));
}

.cpu-character-copy {
    min-height: 112px;
    padding: 10px 12px 8px;
    border-top: 1px solid rgba(217, 164, 65, .28);
}

.cpu-character-copy h2 {
    margin: 0 0 5px;
    color: #fff3c2;
    font-size: clamp(22px, 2vw, 30px);
    letter-spacing: 0;
}

.cpu-character-copy p {
    margin: 0;
    color: #d9c1a4;
    font-size: 13px;
    line-height: 1.35;
}

.cpu-character-levels {
    display: grid;
    gap: 4px;
    padding: 9px 10px 11px;
    background: rgba(14, 9, 6, .45);
}

.cpu-level-control {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

.cpu-level-control > span {
    color: #ecd8b8;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.cpu-level-control button {
    min-width: 0;
    min-height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, .35vw, 6px);
    padding: 3px 5px;
    background: #3b281b;
}

.cpu-level-control button:not(:disabled):hover,
.cpu-level-control button:not(:disabled):focus-visible {
    border-color: #ffd75f;
    background: #6d3024;
    box-shadow: 0 0 16px rgba(217, 164, 65, .32);
}

.cpu-star {
    color: transparent;
    font-family: Arial, sans-serif;
    font-size: clamp(15px, 1.4vw, 21px);
    line-height: 1;
    -webkit-text-stroke: 1px rgba(255, 231, 164, .7);
    text-shadow: none;
}

.cpu-star.is-earned {
    color: #f6c747;
    -webkit-text-stroke-color: #ffe69b;
    text-shadow: 0 0 8px rgba(246, 199, 71, .6);
}

.cpu-character.is-locked .cpu-character-portrait img,
.cpu-character.is-locked .cpu-character-copy,
.cpu-character.is-locked .cpu-character-levels {
    filter: grayscale(1);
    opacity: .38;
}

.cpu-character.is-locked .cpu-character-copy {
    filter: grayscale(1) blur(.7px);
}

.cpu-character-lock {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 18px;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 8px #000;
    pointer-events: none;
}

.cpu-character-lock > span {
    font-size: 28px;
}

.cpu-character-lock strong {
    font-size: 18px;
}

.cpu-character-lock small {
    max-width: 190px;
    color: #f2dfc6;
    font-size: 11px;
    line-height: 1.3;
}

@media (max-width: 1050px) {
    .cpu-character-grid {
        grid-template-columns: repeat(5, minmax(210px, 240px));
        overflow-x: auto;
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
    }

    .cpu-character {
        min-height: min(690px, calc(100dvh - 115px));
        scroll-snap-align: start;
    }
}

@media (max-width: 560px) {
    .cpu-opponent-picker {
        padding: 12px;
    }

    .cpu-opponent-header {
        padding-bottom: 12px;
    }

    .cpu-opponent-header h1 {
        font-size: 27px;
    }

    .cpu-opponent-header span {
        font-size: 11px;
    }

    .cpu-character-grid {
        grid-template-columns: minmax(0, 1fr);
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: 0;
        scroll-snap-type: y proximity;
    }

    .cpu-character {
        width: 100%;
        min-height: calc(100dvh - 100px);
    }

    .cpu-character-copy {
        min-height: 98px;
    }
}
