:root {
    --amazon-navy: #131921;
    --amazon-navy-2: #232f3e;
    --amazon-orange: #ff9900;
    --amazon-orange-dark: #f08804;
    --amazon-gold: #febd69;
    --amazon-star: #ffa41c;
    --amazon-star-dark: #de7921;
    --amazon-link: #007185;
    --amazon-bg: #f3f3f3;
    --admin-bg: #eaeded;
    --amazon-border: #d5d9d9;
    --surface: #ffffff;
    --text-main: #0f1111;
}

/* Online duel final layout pass: separate the active game screen from lobby/shop chrome. */
.tcg-counter-page.is-online-game .tcg-online-panel {
    display: none !important;
    visibility: hidden !important;
}

.tcg-counter-page.is-online-game .tcg-player::after,
.tcg-counter-page.is-online-game .tcg-player-actions {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-player-name {
    pointer-events: none !important;
}

body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-toggle,
body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-mobile-sidebar,
body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-backdrop {
    display: none !important;
}

body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-main {
    padding: 0 !important;
}

@media (min-width: 981px) {
    body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) {
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game {
        gap: 12px !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        padding: 12px 20px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-topbar {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        align-items: center !important;
        display: flex !important;
        flex: 0 0 auto !important;
        justify-content: space-between !important;
        margin: 0 auto !important;
        max-width: min(1460px, calc(100vw - 40px)) !important;
        min-height: 58px !important;
        padding: 8px 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head span {
        font-size: .66rem !important;
        letter-spacing: .08em !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head strong {
        font-size: 1.25rem !important;
        line-height: 1.1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head small {
        font-size: .78rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game {
        min-height: 38px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 12px !important;
        grid-template-areas:
            "opponent tools"
            "you tools" !important;
        grid-template-columns: minmax(560px, 1.18fr) minmax(430px, .82fr) !important;
        grid-template-rows: minmax(170px, .32fr) minmax(380px, .68fr) !important;
        height: calc(100dvh - 96px) !important;
        margin: 0 auto !important;
        max-width: min(1460px, calc(100vw - 40px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        grid-area: tools !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        align-items: center !important;
        display: grid !important;
        gap: 20px !important;
        grid-template-columns: minmax(190px, .34fr) minmax(0, 1fr) 96px !important;
        grid-template-rows: 1fr !important;
        min-height: 0 !important;
        padding: 18px 24px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-head {
        min-width: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-name {
        background: linear-gradient(135deg, var(--tcg-player-color-soft), rgba(15, 23, 42, .86)) !important;
        border-color: var(--tcg-player-color-ring) !important;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 14px 36px var(--tcg-player-color-soft) !important;
        color: #fff !important;
        opacity: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(5rem, 9vw, 8.1rem) !important;
        justify-content: center !important;
        line-height: .86 !important;
        min-height: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 12px !important;
        grid-template-rows: 52px minmax(110px, 1fr) auto auto !important;
        min-height: 0 !important;
        padding: 16px 18px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(4.4rem, 7vw, 7rem) !important;
        justify-content: center !important;
        line-height: .88 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row button,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button {
        min-height: 42px !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 10px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 64px 132px 96px minmax(0, 1fr) !important;
        padding: 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card,
    .tcg-counter-page.is-online-game .tcg-tool-grid,
    .tcg-counter-page.is-online-game .tcg-timer,
    .tcg-counter-page.is-online-game .tcg-history {
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool {
        min-height: 116px !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        grid-template-columns: 118px minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions {
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions button {
        min-height: 34px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history {
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-history ol {
        max-height: none !important;
        overflow: auto !important;
    }
}

@media (max-width: 980px) {
    html:has(.tcg-counter-page.is-online-game),
    body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) {
        height: 100% !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game {
        gap: 4px !important;
        height: var(--tcg-vh, 100dvh) !important;
        max-height: var(--tcg-vh, 100dvh) !important;
        min-height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-topbar {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head {
        border-radius: 12px !important;
        display: flex !important;
        flex: 0 0 34px !important;
        margin: 0 !important;
        min-height: 34px !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head span,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head strong {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head small {
        display: block !important;
        font-size: 10px !important;
        max-width: 58vw !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-exit-game {
        border-radius: 10px !important;
        font-size: 11px !important;
        min-height: 28px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "opponent"
            "tools"
            "you" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 17% 40% 43% !important;
        height: calc(var(--tcg-vh, 100dvh) - 42px - env(safe-area-inset-bottom, 0px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top {
        grid-area: opponent !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        grid-area: tools !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom {
        grid-area: you !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-inner {
        display: grid !important;
        gap: 3px !important;
        grid-template-rows: 23px minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-name {
        font-size: 11px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
        text-align: center !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(2rem, 13vw, 3.35rem) !important;
        justify-content: center !important;
        line-height: .84 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 30px 44px 45px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        border-radius: 10px !important;
        min-height: 0 !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(48px, .34fr) repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card p {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card strong {
        font-size: 14px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card .tcg-reset {
        font-size: 10px !important;
        min-height: 24px !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid {
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        height: 44px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool {
        align-items: center !important;
        display: grid !important;
        grid-template-columns: 24px minmax(0, 1fr) !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 3px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool strong {
        font-size: 12px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-stage,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-stage,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-cube,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-face,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-disc,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-face {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: 70px minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer strong {
        font-size: 20px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions {
        display: grid !important;
        gap: 3px !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions button {
        font-size: 10px !important;
        min-height: 28px !important;
        padding: 0 2px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        display: grid !important;
        grid-template-rows: 20px minmax(0, 1fr) !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history summary {
        font-size: 11px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history summary button {
        font-size: 10px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history ol {
        gap: 3px !important;
        margin-top: 3px !important;
        max-height: none !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li {
        padding: 3px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li span {
        font-size: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li strong {
        font-size: 10px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 24px minmax(0, 1fr) 76px 34px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-name {
        font-size: 11px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(2.7rem, 15vw, 4.1rem) !important;
        justify-content: center !important;
        line-height: .85 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row {
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row button {
        font-size: 12px !important;
        min-height: 35px !important;
        padding: 0 3px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc {
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(0, 1fr) 38px 38px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc button[data-calc-action="clear"] {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc button {
        font-size: 12px !important;
        min-height: 32px !important;
        padding: 0 4px !important;
    }
}

/* EOF override: polished active online duel layout. */
.tcg-counter-page.is-online-game {
    --duel-bg: #07111f;
    --duel-line: rgba(125, 211, 252, .28);
    --duel-gold: #ffb84d;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 184, 77, .12), transparent 28rem),
        radial-gradient(circle at 82% 10%, rgba(72, 199, 255, .12), transparent 26rem),
        var(--duel-bg) !important;
}

.tcg-counter-page.is-online-game *,
.tcg-counter-page.is-online-game *::before,
.tcg-counter-page.is-online-game *::after {
    box-sizing: border-box !important;
}

.tcg-counter-page.is-online-game .tcg-mode-panel,
.tcg-counter-page.is-online-game .tcg-online-panel,
.tcg-counter-page.is-online-game .tcg-counter-topbar,
.tcg-counter-page.is-online-game .tcg-timer-actions [data-return-lobby],
body:has(.tcg-counter-page.is-online-game) .public-header,
body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-toggle,
body:has(.tcg-counter-page.is-online-game) .public-mobile-sidebar,
body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-backdrop {
    display: none !important;
}

body:has(.tcg-counter-page.is-online-game),
body:has(.tcg-counter-page.is-online-game) .public-main {
    background: #07111f !important;
    margin: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-online-game-head {
    align-items: center !important;
    background:
        linear-gradient(135deg, rgba(17, 24, 39, .98), rgba(3, 7, 18, .94)),
        radial-gradient(circle at 6% 0%, rgba(255, 184, 77, .26), transparent 20rem) !important;
    border: 1px solid rgba(255, 184, 77, .34) !important;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .32) !important;
    display: flex !important;
    flex: 0 0 auto !important;
    justify-content: space-between !important;
    order: 0 !important;
    position: static !important;
    transform: none !important;
}

.tcg-counter-page.is-online-game .tcg-counter-board {
    order: 1 !important;
}

.tcg-counter-page.is-online-game .tcg-player,
.tcg-counter-page.is-online-game .tcg-center-panel {
    background:
        linear-gradient(180deg, rgba(13, 25, 45, .97), rgba(5, 12, 24, .96)),
        radial-gradient(circle at 50% 4%, var(--tcg-player-color-soft, rgba(72, 199, 255, .14)), transparent 16rem) !important;
    border: 1px solid var(--tcg-player-color-ring, var(--duel-line)) !important;
    border-radius: 18px !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035), 0 18px 52px rgba(0, 0, 0, .3) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.tcg-counter-page.is-online-game .tcg-center-panel {
    border-color: rgba(125, 211, 252, .28) !important;
}

.tcg-counter-page.is-online-game .tcg-player::after,
.tcg-counter-page.is-online-game .tcg-player-actions {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-player-name {
    align-items: center !important;
    background: linear-gradient(90deg, var(--tcg-player-color, #38bdf8), color-mix(in srgb, var(--tcg-player-color, #38bdf8) 48%, #020617)) !important;
    border: 1px solid color-mix(in srgb, var(--tcg-player-color, #38bdf8) 72%, #ffffff) !important;
    border-radius: 999px !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 12px 30px var(--tcg-player-color-soft, rgba(56, 189, 248, .18)) !important;
    color: #fff !important;
    display: flex !important;
    font-weight: 950 !important;
    justify-content: center !important;
    max-width: none !important;
    opacity: 1 !important;
    pointer-events: none !important;
    text-align: center !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .36) !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-lp-display {
    align-items: center !important;
    background: transparent !important;
    border: 0 !important;
    color: #f8fbff !important;
    display: flex !important;
    font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif !important;
    justify-content: center !important;
    letter-spacing: .01em !important;
    line-height: .82 !important;
    min-height: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    text-shadow: 0 0 28px rgba(255, 255, 255, .12), 0 0 52px var(--tcg-player-color-soft, rgba(72, 199, 255, .2)) !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-quick-row,
.tcg-counter-page.is-online-game .tcg-calc,
.tcg-counter-page.is-online-game .tcg-timer-actions,
.tcg-counter-page.is-online-game .tcg-tool-grid {
    display: grid !important;
    min-height: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-quick-row button,
.tcg-counter-page.is-online-game .tcg-calc button,
.tcg-counter-page.is-online-game .tcg-calc-input,
.tcg-counter-page.is-online-game .tcg-timer-actions button,
.tcg-counter-page.is-online-game .tcg-reset,
.tcg-counter-page.is-online-game .tcg-tool {
    background: linear-gradient(180deg, rgba(21, 39, 64, .98), rgba(8, 17, 32, .98)) !important;
    border: 1px solid rgba(125, 211, 252, .24) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
    color: #f8fafc !important;
    font-weight: 950 !important;
    overflow: hidden !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.tcg-counter-page.is-online-game .tcg-calc-input {
    text-align: left !important;
}

.tcg-counter-page.is-online-game .tcg-tool,
.tcg-counter-page.is-online-game .tcg-timer,
.tcg-counter-page.is-online-game .tcg-history,
.tcg-counter-page.is-online-game .tcg-round-card {
    background: rgba(2, 8, 20, .56) !important;
    border: 1px solid rgba(125, 211, 252, .22) !important;
    border-radius: 14px !important;
    min-height: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-round-card {
    align-items: center !important;
    display: grid !important;
}

.tcg-counter-page.is-online-game .tcg-round-card p,
.tcg-counter-page.is-online-game .tcg-timer span,
.tcg-counter-page.is-online-game .tcg-tool span:not(.tcg-dice-stage):not(.tcg-coin-stage) {
    color: #9fb3c8 !important;
    font-weight: 950 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
}

.tcg-counter-page.is-online-game .tcg-history {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: hidden !important;
}

.tcg-counter-page.is-online-game .tcg-history ol {
    align-content: start !important;
    display: grid !important;
    list-style: none !important;
    margin: 0 !important;
    min-height: 0 !important;
    overflow: auto !important;
    padding: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-history li {
    background: rgba(248, 250, 252, .055) !important;
    border: 1px solid color-mix(in srgb, var(--tcg-entry-color, #94a3b8) 38%, transparent) !important;
    border-left: 5px solid var(--tcg-entry-color, #94a3b8) !important;
    border-radius: 10px !important;
    color: #f8fafc !important;
}

@media (min-width: 981px) {
    .tcg-counter-page.is-online-game {
        display: grid !important;
        grid-template-rows: 60px minmax(0, 1fr) !important;
        height: 100dvh !important;
        min-height: 720px !important;
        overflow: hidden !important;
        padding: 14px 22px !important;
        row-gap: 12px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        border-radius: 16px !important;
        grid-row: 1 !important;
        height: 60px !important;
        margin: 0 auto !important;
        max-width: min(1540px, calc(100vw - 44px)) !important;
        min-height: 0 !important;
        padding: 8px 14px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head span {
        font-size: .64rem !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head strong {
        font-size: 1.08rem !important;
        line-height: 1.05 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head small {
        font-size: .74rem !important;
        line-height: 1.05 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game {
        font-size: .9rem !important;
        min-height: 38px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 12px !important;
        grid-row: 2 !important;
        grid-template-areas:
            "opponent tools"
            "you tools" !important;
        grid-template-columns: minmax(600px, 1.22fr) minmax(420px, .78fr) !important;
        grid-template-rows: minmax(180px, 29%) minmax(0, 1fr) !important;
        height: 100% !important;
        margin: 0 auto !important;
        max-width: min(1540px, calc(100vw - 44px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 12px !important;
        grid-area: tools !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 58px 126px 98px minmax(0, 1fr) !important;
        padding: 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        align-items: center !important;
        display: grid !important;
        gap: 24px !important;
        grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) !important;
        grid-template-rows: 1fr !important;
        height: 100% !important;
        padding: 18px 26px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name {
        font-size: clamp(1rem, 1.7vw, 1.35rem) !important;
        height: 58px !important;
        min-height: 58px !important;
        padding: 0 18px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        font-size: clamp(5rem, 9vw, 8.2rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-quick-row,
    .tcg-counter-page.is-online-game .tcg-player-top .tcg-calc {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 12px !important;
        grid-template-rows: 52px minmax(0, 1fr) 82px 44px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-name {
        font-size: 1rem !important;
        height: 52px !important;
        min-height: 52px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(4.4rem, 7.6vw, 7.2rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row {
        gap: 8px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row button,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button {
        font-size: .92rem !important;
        min-height: 38px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc {
        gap: 8px !important;
        grid-template-columns: minmax(0, 1fr) 48px 48px 48px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card {
        gap: 10px !important;
        grid-template-columns: minmax(0, 1fr) 112px 92px !important;
        padding: 8px 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool-grid {
        gap: 10px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool {
        align-content: center !important;
        display: grid !important;
        gap: 5px !important;
        grid-template-rows: auto 30px auto !important;
        justify-items: center !important;
        min-height: 0 !important;
        padding: 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-dice-stage,
    .tcg-counter-page.is-online-game .tcg-coin-stage,
    .tcg-counter-page.is-online-game .tcg-dice-cube,
    .tcg-counter-page.is-online-game .tcg-dice-face,
    .tcg-counter-page.is-online-game .tcg-coin-disc,
    .tcg-counter-page.is-online-game .tcg-coin-face {
        height: 30px !important;
        width: 30px !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 88px minmax(0, 1fr) !important;
        padding: 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions {
        gap: 7px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions button {
        font-size: .82rem !important;
        min-height: 34px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history {
        padding: 10px !important;
    }
}

@media (max-width: 980px) {
    body:has(.tcg-counter-page.is-online-game) {
        height: 100dvh !important;
        min-height: 100dvh !important;
    }

    .tcg-counter-page.is-online-game {
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 32px minmax(0, 1fr) !important;
        height: var(--tcg-vh, 100dvh) !important;
        max-height: var(--tcg-vh, 100dvh) !important;
        min-height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
        padding: 4px !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        border-radius: 10px !important;
        grid-row: 1 !important;
        height: 32px !important;
        margin: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
        padding: 3px 5px !important;
        width: 100% !important;
        z-index: 3 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head span,
    .tcg-counter-page.is-online-game .tcg-online-game-head strong {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head small {
        color: #ffcc80 !important;
        display: block !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        max-width: calc(100vw - 128px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game {
        border-radius: 9px !important;
        font-size: 10px !important;
        gap: 4px !important;
        min-height: 25px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game svg {
        height: 13px !important;
        width: 13px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 4px !important;
        grid-row: 2 !important;
        grid-template-areas:
            "opponent"
            "tools"
            "you" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 15% 36% 49% !important;
        height: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        grid-area: tools !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        display: grid !important;
        gap: 3px !important;
        grid-template-rows: 22px minmax(0, 1fr) !important;
        height: 100% !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name {
        font-size: 10px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        font-size: clamp(2rem, 12vw, 3.25rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-quick-row,
    .tcg-counter-page.is-online-game .tcg-player-top .tcg-calc {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 28px 42px 42px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card {
        gap: 4px !important;
        grid-template-columns: minmax(42px, .34fr) repeat(2, minmax(0, 1fr)) !important;
        padding: 3px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card p {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card strong {
        font-size: 13px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-reset {
        border-radius: 8px !important;
        font-size: 9px !important;
        min-height: 22px !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool-grid {
        gap: 4px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: 22px minmax(0, 1fr) 24px !important;
        height: 42px !important;
        min-height: 0 !important;
        padding: 4px 5px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool > svg,
    .tcg-counter-page.is-online-game .tcg-tool span:not(.tcg-dice-stage):not(.tcg-coin-stage) {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-dice-stage,
    .tcg-counter-page.is-online-game .tcg-coin-stage,
    .tcg-counter-page.is-online-game .tcg-dice-cube,
    .tcg-counter-page.is-online-game .tcg-dice-face,
    .tcg-counter-page.is-online-game .tcg-coin-disc,
    .tcg-counter-page.is-online-game .tcg-coin-face {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool strong {
        font-size: 11px !important;
        justify-self: start !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: 64px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer span {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer strong {
        font-size: 19px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions {
        gap: 3px !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions button {
        border-radius: 8px !important;
        font-size: 9px !important;
        min-height: 27px !important;
        padding: 0 2px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history {
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history summary {
        align-items: center !important;
        display: flex !important;
        font-size: 10px !important;
        justify-content: space-between !important;
        line-height: 1 !important;
        margin-bottom: 3px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history summary button {
        font-size: 9px !important;
        padding: 0 2px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history ol {
        gap: 3px !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li {
        border-left-width: 4px !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li span {
        font-size: 8px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li strong {
        font-size: 9px !important;
        line-height: 1.08 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 23px minmax(0, 1fr) 74px 32px !important;
        height: 100% !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-name {
        font-size: 10px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(2.8rem, 15vw, 4.25rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row {
        gap: 4px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row button {
        border-radius: 10px !important;
        font-size: 12px !important;
        min-height: 34px !important;
        padding: 0 3px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc {
        gap: 4px !important;
        grid-template-columns: minmax(0, 1fr) 36px 36px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button[data-calc-action="clear"] {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button {
        border-radius: 10px !important;
        font-size: 12px !important;
        min-height: 30px !important;
        padding: 0 4px !important;
    }
}

/* Polished online duel HUD. This is the final cascade layer for the active game screen. */
.tcg-counter-page.is-online-game {
    --duel-bg: #07111f;
    --duel-line: rgba(125, 211, 252, .28);
    --duel-panel: rgba(9, 18, 34, .94);
    --duel-panel-2: rgba(12, 25, 45, .92);
    --duel-gold: #ffb84d;
    --duel-blue: #48c7ff;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 184, 77, .12), transparent 28rem),
        radial-gradient(circle at 82% 10%, rgba(72, 199, 255, .12), transparent 26rem),
        var(--duel-bg) !important;
    box-sizing: border-box !important;
}

.tcg-counter-page.is-online-game *,
.tcg-counter-page.is-online-game *::before,
.tcg-counter-page.is-online-game *::after {
    box-sizing: border-box !important;
}

.tcg-counter-page.is-online-game .tcg-mode-panel,
.tcg-counter-page.is-online-game .tcg-online-panel,
.tcg-counter-page.is-online-game .tcg-counter-topbar,
.tcg-counter-page.is-online-game .tcg-timer-actions [data-return-lobby],
body:has(.tcg-counter-page.is-online-game) .public-header,
body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-toggle,
body:has(.tcg-counter-page.is-online-game) .public-mobile-sidebar,
body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-backdrop {
    display: none !important;
}

body:has(.tcg-counter-page.is-online-game),
body:has(.tcg-counter-page.is-online-game) .public-main {
    background: #07111f !important;
    margin: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-online-game-head {
    background:
        linear-gradient(135deg, rgba(17, 24, 39, .98), rgba(3, 7, 18, .94)),
        radial-gradient(circle at 6% 0%, rgba(255, 184, 77, .26), transparent 20rem) !important;
    border: 1px solid rgba(255, 184, 77, .34) !important;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .32) !important;
    display: flex !important;
    flex: 0 0 auto !important;
    position: static !important;
    transform: none !important;
}

.tcg-counter-page.is-online-game .tcg-player,
.tcg-counter-page.is-online-game .tcg-center-panel {
    background:
        linear-gradient(180deg, rgba(13, 25, 45, .97), rgba(5, 12, 24, .96)),
        radial-gradient(circle at 50% 4%, var(--tcg-player-color-soft, rgba(72, 199, 255, .14)), transparent 16rem) !important;
    border: 1px solid var(--tcg-player-color-ring, var(--duel-line)) !important;
    border-radius: 18px !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035), 0 18px 52px rgba(0, 0, 0, .3) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.tcg-counter-page.is-online-game .tcg-center-panel {
    border-color: rgba(125, 211, 252, .28) !important;
}

.tcg-counter-page.is-online-game .tcg-player::after {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-player-actions {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-player-name {
    align-items: center !important;
    background: linear-gradient(90deg, var(--tcg-player-color, #38bdf8), color-mix(in srgb, var(--tcg-player-color, #38bdf8) 48%, #020617)) !important;
    border: 1px solid color-mix(in srgb, var(--tcg-player-color, #38bdf8) 72%, #ffffff) !important;
    border-radius: 999px !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 12px 30px var(--tcg-player-color-soft, rgba(56, 189, 248, .18)) !important;
    color: #fff !important;
    display: flex !important;
    font-weight: 950 !important;
    justify-content: center !important;
    max-width: none !important;
    min-width: 0 !important;
    opacity: 1 !important;
    pointer-events: none !important;
    text-align: center !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .36) !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-lp-display {
    align-items: center !important;
    background: transparent !important;
    border: 0 !important;
    color: #f8fbff !important;
    display: flex !important;
    font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif !important;
    justify-content: center !important;
    letter-spacing: .01em !important;
    line-height: .82 !important;
    min-height: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    text-shadow: 0 0 28px rgba(255, 255, 255, .12), 0 0 52px var(--tcg-player-color-soft, rgba(72, 199, 255, .2)) !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-quick-row,
.tcg-counter-page.is-online-game .tcg-calc,
.tcg-counter-page.is-online-game .tcg-timer-actions,
.tcg-counter-page.is-online-game .tcg-tool-grid {
    display: grid !important;
    min-height: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-quick-row button,
.tcg-counter-page.is-online-game .tcg-calc button,
.tcg-counter-page.is-online-game .tcg-calc-input,
.tcg-counter-page.is-online-game .tcg-timer-actions button,
.tcg-counter-page.is-online-game .tcg-reset,
.tcg-counter-page.is-online-game .tcg-tool {
    background: linear-gradient(180deg, rgba(21, 39, 64, .98), rgba(8, 17, 32, .98)) !important;
    border: 1px solid rgba(125, 211, 252, .24) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
    color: #f8fafc !important;
    font-weight: 950 !important;
    overflow: hidden !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.tcg-counter-page.is-online-game .tcg-calc-input {
    text-align: left !important;
}

.tcg-counter-page.is-online-game .tcg-tool,
.tcg-counter-page.is-online-game .tcg-timer,
.tcg-counter-page.is-online-game .tcg-history,
.tcg-counter-page.is-online-game .tcg-round-card {
    background: rgba(2, 8, 20, .56) !important;
    border: 1px solid rgba(125, 211, 252, .22) !important;
    border-radius: 14px !important;
    min-height: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-round-card {
    align-items: center !important;
    display: grid !important;
}

.tcg-counter-page.is-online-game .tcg-round-card p,
.tcg-counter-page.is-online-game .tcg-timer span,
.tcg-counter-page.is-online-game .tcg-tool span:not(.tcg-dice-stage):not(.tcg-coin-stage) {
    color: #9fb3c8 !important;
    font-weight: 950 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
}

.tcg-counter-page.is-online-game .tcg-round-card strong,
.tcg-counter-page.is-online-game .tcg-timer strong {
    color: #fff !important;
    font-weight: 950 !important;
}

.tcg-counter-page.is-online-game .tcg-history {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: hidden !important;
}

.tcg-counter-page.is-online-game .tcg-history summary {
    cursor: default !important;
    min-height: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-history ol {
    align-content: start !important;
    display: grid !important;
    list-style: none !important;
    margin: 0 !important;
    min-height: 0 !important;
    overflow: auto !important;
    padding: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-history li {
    background: rgba(248, 250, 252, .055) !important;
    border: 1px solid color-mix(in srgb, var(--tcg-entry-color, #94a3b8) 38%, transparent) !important;
    border-left: 5px solid var(--tcg-entry-color, #94a3b8) !important;
    border-radius: 10px !important;
    color: #f8fafc !important;
}

.tcg-counter-page.is-online-game .tcg-dice-stage,
.tcg-counter-page.is-online-game .tcg-coin-stage {
    flex: 0 0 auto !important;
}

@media (min-width: 981px) {
    .tcg-counter-page.is-online-game {
        display: grid !important;
        grid-template-rows: 60px minmax(0, 1fr) !important;
        height: 100dvh !important;
        min-height: 720px !important;
        overflow: hidden !important;
        padding: 14px 22px !important;
        row-gap: 12px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        border-radius: 16px !important;
        height: 60px !important;
        margin: 0 auto !important;
        max-width: min(1540px, calc(100vw - 44px)) !important;
        min-height: 0 !important;
        padding: 8px 14px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head span {
        font-size: .64rem !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head strong {
        font-size: 1.08rem !important;
        line-height: 1.05 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head small {
        font-size: .74rem !important;
        line-height: 1.05 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game {
        font-size: .9rem !important;
        min-height: 38px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 12px !important;
        grid-template-areas:
            "opponent tools"
            "you tools" !important;
        grid-template-columns: minmax(600px, 1.22fr) minmax(420px, .78fr) !important;
        grid-template-rows: minmax(180px, 29%) minmax(0, 1fr) !important;
        height: 100% !important;
        margin: 0 auto !important;
        max-width: min(1540px, calc(100vw - 44px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 12px !important;
        grid-area: tools !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 58px 126px 98px minmax(0, 1fr) !important;
        padding: 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        align-items: center !important;
        display: grid !important;
        gap: 24px !important;
        grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) !important;
        grid-template-rows: 1fr !important;
        height: 100% !important;
        padding: 18px 26px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-head {
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name {
        font-size: clamp(1rem, 1.7vw, 1.35rem) !important;
        height: 58px !important;
        min-height: 58px !important;
        padding: 0 18px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        font-size: clamp(5rem, 9vw, 8.2rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-quick-row,
    .tcg-counter-page.is-online-game .tcg-player-top .tcg-calc {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 12px !important;
        grid-template-rows: 52px minmax(0, 1fr) 82px 44px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-name {
        font-size: 1rem !important;
        height: 52px !important;
        min-height: 52px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(4.4rem, 7.6vw, 7.2rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row {
        gap: 8px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row button,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button {
        font-size: .92rem !important;
        min-height: 38px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc {
        gap: 8px !important;
        grid-template-columns: minmax(0, 1fr) 48px 48px 48px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card {
        gap: 10px !important;
        grid-template-columns: minmax(0, 1fr) 112px 92px !important;
        padding: 8px 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card p {
        font-size: .65rem !important;
        margin: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card strong {
        font-size: 1.12rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-reset {
        font-size: .86rem !important;
        min-height: 38px !important;
        padding: 0 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool-grid {
        gap: 10px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool {
        align-content: center !important;
        display: grid !important;
        gap: 5px !important;
        grid-template-rows: auto 30px auto !important;
        justify-items: center !important;
        min-height: 0 !important;
        padding: 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-dice-stage,
    .tcg-counter-page.is-online-game .tcg-coin-stage,
    .tcg-counter-page.is-online-game .tcg-dice-cube,
    .tcg-counter-page.is-online-game .tcg-dice-face,
    .tcg-counter-page.is-online-game .tcg-coin-disc,
    .tcg-counter-page.is-online-game .tcg-coin-face {
        height: 30px !important;
        width: 30px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool strong {
        font-size: .96rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 88px minmax(0, 1fr) !important;
        padding: 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer strong {
        font-size: 1.55rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions {
        gap: 7px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions button {
        font-size: .82rem !important;
        min-height: 34px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history {
        padding: 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history summary {
        align-items: center !important;
        display: flex !important;
        font-size: .9rem !important;
        justify-content: space-between !important;
        margin-bottom: 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history ol {
        gap: 7px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li {
        padding: 8px 10px !important;
    }
}

@media (max-width: 980px) {
    body:has(.tcg-counter-page.is-online-game) {
        height: 100dvh !important;
        min-height: 100dvh !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game,
    .tcg-counter-page.is-online-game {
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 32px minmax(0, 1fr) !important;
        height: var(--tcg-vh, 100dvh) !important;
        max-height: var(--tcg-vh, 100dvh) !important;
        min-height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
        padding: 4px !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        border-radius: 10px !important;
        height: 32px !important;
        margin: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
        padding: 3px 5px !important;
        width: 100% !important;
        z-index: 3 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head span,
    .tcg-counter-page.is-online-game .tcg-online-game-head strong {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head small {
        color: #ffcc80 !important;
        display: block !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        max-width: calc(100vw - 128px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game {
        border-radius: 9px !important;
        font-size: 10px !important;
        gap: 4px !important;
        min-height: 25px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game svg {
        height: 13px !important;
        width: 13px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "opponent"
            "tools"
            "you" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 15% 36% 49% !important;
        height: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        grid-area: tools !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        display: grid !important;
        gap: 3px !important;
        grid-template-rows: 22px minmax(0, 1fr) !important;
        height: 100% !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name {
        font-size: 10px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        font-size: clamp(2rem, 12vw, 3.25rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-quick-row,
    .tcg-counter-page.is-online-game .tcg-player-top .tcg-calc {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 28px 42px 42px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card {
        gap: 4px !important;
        grid-template-columns: minmax(42px, .34fr) repeat(2, minmax(0, 1fr)) !important;
        padding: 3px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card p {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card strong {
        font-size: 13px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-reset {
        border-radius: 8px !important;
        font-size: 9px !important;
        min-height: 22px !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool-grid {
        gap: 4px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: 22px minmax(0, 1fr) 24px !important;
        height: 42px !important;
        min-height: 0 !important;
        padding: 4px 5px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool > svg,
    .tcg-counter-page.is-online-game .tcg-tool span:not(.tcg-dice-stage):not(.tcg-coin-stage) {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-dice-stage,
    .tcg-counter-page.is-online-game .tcg-coin-stage,
    .tcg-counter-page.is-online-game .tcg-dice-cube,
    .tcg-counter-page.is-online-game .tcg-dice-face,
    .tcg-counter-page.is-online-game .tcg-coin-disc,
    .tcg-counter-page.is-online-game .tcg-coin-face {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool strong {
        font-size: 11px !important;
        justify-self: start !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: 64px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer span {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer strong {
        font-size: 19px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions {
        gap: 3px !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions button {
        border-radius: 8px !important;
        font-size: 9px !important;
        min-height: 27px !important;
        padding: 0 2px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history {
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history summary {
        align-items: center !important;
        display: flex !important;
        font-size: 10px !important;
        justify-content: space-between !important;
        line-height: 1 !important;
        margin-bottom: 3px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history summary button {
        font-size: 9px !important;
        padding: 0 2px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history ol {
        gap: 3px !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li {
        border-left-width: 4px !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li span {
        font-size: 8px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-history li strong {
        font-size: 9px !important;
        line-height: 1.08 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 23px minmax(0, 1fr) 74px 32px !important;
        height: 100% !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-name {
        font-size: 10px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(2.8rem, 15vw, 4.25rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row {
        gap: 4px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row button {
        border-radius: 10px !important;
        font-size: 12px !important;
        min-height: 34px !important;
        padding: 0 3px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc {
        gap: 4px !important;
        grid-template-columns: minmax(0, 1fr) 36px 36px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button[data-calc-action="clear"] {
        display: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button {
        border-radius: 10px !important;
        font-size: 12px !important;
        min-height: 30px !important;
        padding: 0 4px !important;
    }
}

body {
    background: var(--amazon-bg);
    color: var(--text-main);
}

.password-toggle-field {
    position: relative;
}

.password-toggle-field > .form-control {
    padding-right: 5.25rem;
}

.password-toggle-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--amazon-border);
    bottom: 7px;
    color: #007185;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    gap: 4px;
    padding: 0 10px;
    position: absolute;
    right: 4px;
    top: 7px;
    z-index: 3;
}

.password-toggle-button:hover,
.password-toggle-button:focus {
    color: #c45500;
}

.password-toggle-button svg {
    height: 16px;
    width: 16px;
}

.public-navbar {
    background: var(--amazon-navy);
    border-bottom: 4px solid var(--amazon-orange);
    box-shadow: 0 8px 24px rgba(15, 17, 17, .16);
}

.public-navbar .navbar-brand {
    color: #ffffff;
    letter-spacing: 0;
}

.public-brand-lockup {
    align-items: center;
    display: inline-flex;
    gap: 10px;
}

.public-brand-lockup img {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 6px;
    height: 34px;
    object-fit: cover;
    width: 34px;
}

.public-main {
    min-height: calc(100vh - 170px);
}

.qr-experience {
    margin: 0 auto;
    max-width: 820px;
    padding-bottom: 32px;
}

.experience-hero {
    background:
        linear-gradient(135deg, rgba(19, 25, 33, .96), rgba(35, 47, 62, .94)),
        linear-gradient(90deg, rgba(255, 153, 0, .16), transparent 58%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(15, 17, 17, .2);
    color: #ffffff;
    margin-bottom: 16px;
    overflow: hidden;
    padding: 22px 26px;
    position: relative;
}

.experience-hero::after {
    background: rgba(255, 153, 0, .92);
    bottom: 0;
    content: "";
    height: 5px;
    left: 0;
    position: absolute;
    right: 0;
}

.experience-brand {
    align-items: center;
    color: var(--amazon-gold);
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    gap: 8px;
    letter-spacing: .04em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.experience-brand svg,
.support-note svg,
.mini-badge svg {
    height: 18px;
    width: 18px;
}

.experience-hero h1 {
    font-size: clamp(1.9rem, 4.4vw, 3.15rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
    margin: 0 0 12px;
    max-width: 720px;
}

.experience-hero p {
    color: rgba(255, 255, 255, .78);
    font-size: 1.05rem;
    margin: 0;
    max-width: 620px;
}

.experience-grid {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr;
}

.product-panel,
.experience-card {
    background: var(--surface);
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 17, 17, .1);
}

.product-panel {
    overflow: hidden;
    padding: 18px 20px;
    position: relative;
}

.product-panel::before {
    background: linear-gradient(90deg, var(--amazon-orange), var(--amazon-gold));
    content: "";
    display: block;
    height: 5px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.product-panel-icon {
    align-items: center;
    background: #fff7e6;
    border: 1px solid #ffd28a;
    border-radius: 8px;
    color: #b06000;
    display: inline-flex;
    height: 46px;
    justify-content: center;
    margin-bottom: 14px;
    width: 46px;
}

.product-panel-icon svg {
    height: 26px;
    width: 26px;
}

.panel-kicker {
    color: #565959;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.product-panel h2,
.experience-card h2 {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.18;
    margin: 0;
}

.product-panel h2 {
    font-size: 1.25rem;
}

.product-detail-list {
    border-top: 1px solid var(--amazon-border);
    display: grid;
    gap: 0;
    margin-top: 16px;
}

.product-detail-row {
    align-items: center;
    border-bottom: 1px solid var(--amazon-border);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 11px 0;
}

.product-detail-row span {
    color: #565959;
    font-size: .86rem;
}

.product-detail-row strong {
    font-size: .95rem;
    overflow-wrap: anywhere;
    text-align: right;
}

.support-note {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    color: #37475a;
    display: flex;
    font-size: .92rem;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
}

.experience-card {
    padding: 22px;
}

.experience-card-header {
    align-items: start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.mini-badge {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    color: #37475a;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .85rem;
    font-weight: 700;
    gap: 6px;
    padding: 7px 12px;
}

.rating-block {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    padding: 13px 15px 15px;
}

.rating-block .form-label {
    color: #0f1111;
    font-size: .96rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.star-rating {
    align-items: center;
    display: inline-flex;
    gap: .08rem;
    max-width: 100%;
    padding: 2px 0;
}

.star-option {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    color: #d5d9d9;
    cursor: pointer;
    display: inline-flex;
    font-size: clamp(2.1rem, 8vw, 2.7rem);
    height: 2.9rem;
    justify-content: center;
    line-height: 1;
    padding: 0 .08rem;
    text-shadow: 0 1px 0 rgba(15, 17, 17, .12);
    transition: color .12s ease, transform .12s ease, filter .12s ease;
    width: 2.55rem;
}

.star-option:hover,
.star-option:focus-within {
    color: var(--amazon-star);
    filter: drop-shadow(0 2px 2px rgba(222, 121, 33, .22));
    outline: 2px solid rgba(255, 164, 28, .22);
    outline-offset: 2px;
}

.star-option.is-selected {
    color: var(--amazon-star);
    transform: translateY(-1px);
}

.comment-box {
    min-height: 88px !important;
}

.action-panel {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    padding: 14px;
}

.altcha-widget-wrap {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
    padding: 10px;
}

.altcha-widget-wrap altcha-widget {
    --altcha-border-width: 0;
    --altcha-border-radius: 7px;
    --altcha-color-border: transparent;
    --altcha-color-base: #f7fafa;
    --altcha-color-text: #0f1111;
    width: 100%;
}

.secondary-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-top: 10px;
}

.secondary-actions .btn {
    justify-content: center;
}

.customer-website-field {
    height: 0;
    left: -10000px;
    overflow: hidden;
    position: absolute;
    top: auto;
    width: 1px;
}

.support-modal {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 17, 17, .22);
}

.public-main .card,
.admin-content .card,
.admin-content section.border,
.public-main section.border {
    border-color: var(--amazon-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(15, 17, 17, .08) !important;
}

.admin-body {
    background:
        linear-gradient(180deg, #f7fafa 0, var(--admin-bg) 210px),
        var(--admin-bg);
}

.admin-content {
    margin-left: 248px;
    min-height: 100vh;
    padding: 18px 28px 42px;
}

.admin-sidebar {
    background:
        linear-gradient(180deg, rgba(255, 153, 0, .08), transparent 160px),
        linear-gradient(180deg, var(--amazon-navy), #182330 58%, var(--amazon-navy-2));
    bottom: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0 14px 14px 0;
    box-shadow: 10px 0 30px rgba(15, 17, 17, .2);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    left: 0;
    padding: 18px 14px;
    position: fixed;
    top: 12px;
    width: 248px;
    z-index: 1030;
}

.admin-sidebar-brand {
    align-items: center;
    display: flex;
    font-size: 1rem;
    font-weight: 700;
    gap: 10px;
    line-height: 1.2;
    margin-bottom: 18px;
    padding: 8px 8px 18px;
    position: relative;
}

.admin-sidebar-brand::after {
    background: linear-gradient(90deg, var(--amazon-orange), transparent);
    bottom: 0;
    content: "";
    height: 1px;
    left: 8px;
    position: absolute;
    right: 8px;
}

.admin-brand-mark {
    align-items: center;
    background: var(--amazon-orange);
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(255, 153, 0, .25);
    color: var(--amazon-navy);
    display: inline-flex;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.admin-sidebar-nav {
    display: grid;
    gap: 5px;
    overflow-y: auto;
    padding-right: 2px;
}

.admin-sidebar-nav a,
.admin-logout {
    align-items: center;
    border-radius: 9px;
    color: rgba(255, 255, 255, .82);
    display: flex;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active,
.admin-logout:hover {
    background: rgba(255, 255, 255, .11);
    color: #ffffff;
}

.admin-sidebar-nav a.active {
    background: rgba(255, 255, 255, .13);
    box-shadow: inset 3px 0 0 var(--amazon-orange), 0 8px 18px rgba(15, 17, 17, .16);
}

.admin-sidebar-nav svg,
.admin-logout svg {
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.admin-nav-badge {
    background: var(--amazon-orange);
    border-radius: 999px;
    color: var(--amazon-navy);
    font-size: .75rem;
    font-weight: 800;
    margin-left: auto;
    min-width: 24px;
    padding: 2px 7px;
    text-align: center;
}

.admin-sidebar-nav a.low-alert-pending {
    background: rgba(255, 153, 0, .18);
    color: #ffffff;
    outline: 1px solid rgba(255, 153, 0, .45);
}

.admin-logout {
    margin-top: auto;
}

.admin-permission-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    background: #f7fafa;
}

.admin-permission-picker.is-disabled {
    opacity: .55;
}

.admin-permission-group {
    display: grid;
    gap: 6px;
}

.admin-permission-group strong {
    color: #0f1111;
    font-size: .9rem;
}

.product-image-manager-row {
    align-items: center;
    background: #f7fafa;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    display: flex;
    gap: 14px;
    padding: 12px;
}

.product-image-manager-row img,
.product-image-manager-row video,
.product-media-preview {
    aspect-ratio: 1;
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 6px;
    height: 86px;
    object-fit: contain;
    width: 86px;
}

.admin-product-modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

.admin-product-modal-dialog {
    --bs-modal-width: min(1180px, calc(100vw - 32px));
}

.admin-product-modal-form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--bs-modal-margin) * 2);
    min-height: 0;
}

.admin-product-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.admin-product-modal-footer {
    background: #ffffff;
    border-top: 1px solid var(--amazon-border);
    bottom: 0;
    box-shadow: 0 -10px 24px rgba(15, 17, 17, .08);
    flex-shrink: 0;
    position: sticky;
    z-index: 5;
}

.admin-product-modal .modal-header {
    align-items: flex-start;
    background:
        linear-gradient(135deg, rgba(255, 153, 0, .13), transparent 58%),
        #ffffff;
    padding: 20px 24px;
}

.media-modal-footer {
    align-items: center;
    background: #ffffff;
    border-top: 1px solid var(--amazon-border);
    bottom: 0;
    box-shadow: 0 -10px 24px rgba(15, 17, 17, .08);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 14px 20px;
    position: sticky;
    z-index: 3;
}

.media-save-hint {
    color: #565959;
    font-size: .9rem;
}

.media-footer-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.media-save-button {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    min-width: 132px;
    justify-content: center;
}

.media-save-button svg {
    height: 17px;
    width: 17px;
}

.modal-kicker {
    color: #565959;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-product-modal .modal-title {
    color: var(--amazon-navy);
    font-weight: 900;
}

.product-form-body {
    background: #f7fafa;
    padding: 18px;
}

.product-form-body .row {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 17, 17, .06);
    margin: 0;
    padding: 16px;
}

.product-form-body .form-label {
    color: #37475a;
    font-size: .86rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.product-form-body .form-control,
.product-form-body .form-select {
    background-color: #ffffff;
    border-color: #c7d0d0;
}

.product-form-body .form-control:focus,
.product-form-body .form-select:focus {
    border-color: var(--amazon-orange);
    box-shadow: 0 0 0 .2rem rgba(255, 153, 0, .18);
}

.product-form-section-title {
    align-items: center;
    background: #fff7e6;
    border: 1px solid #ffd28a;
    border-radius: 8px;
    color: var(--amazon-navy);
    display: inline-flex;
    gap: 8px;
    font-size: .9rem;
    font-weight: 900;
    margin: 6px 0 2px;
    padding: 8px 11px;
}

.product-form-section-title svg {
    color: var(--amazon-orange-dark);
    height: 17px;
    width: 17px;
}

.product-form-section {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 17, 17, .06);
    display: grid;
    gap: 14px;
    padding: 16px;
}

.product-form-section + .product-form-section {
    margin-top: 16px;
}

.product-form-section-head {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.product-form-section-head h3 {
    color: var(--amazon-navy);
    font-size: 1rem;
    font-weight: 900;
    margin: 0 0 4px;
}

.product-form-section-head p {
    color: #565959;
    font-size: .88rem;
    margin: 0;
}

.media-sort-list {
    display: grid;
    gap: 10px;
}

.media-sort-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: 38px 112px minmax(0, 1fr) auto;
    min-width: 0;
    padding: 12px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.media-sort-card:hover {
    border-color: #ffce73;
    box-shadow: 0 10px 24px rgba(15, 17, 17, .1);
}

.media-sort-card.is-dragging {
    border-color: var(--amazon-orange);
    box-shadow: 0 16px 30px rgba(15, 17, 17, .18);
    opacity: .68;
    transform: scale(.995);
}

.media-drag-handle {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    color: #565959;
    cursor: grab;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 34px;
    touch-action: none;
}

.media-drag-handle:active {
    cursor: grabbing;
}

.media-drag-handle svg {
    height: 20px;
    width: 20px;
}

.media-preview-frame {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.media-preview-frame .product-media-preview {
    border: 0;
    border-radius: 0;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.media-sort-content {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.media-sort-title {
    display: grid;
    gap: 2px;
}

.media-sort-title strong {
    color: var(--amazon-navy);
    font-weight: 900;
}

.media-sort-title span {
    color: #565959;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-replace-field {
    display: grid;
    gap: 5px;
}

.media-replace-field span {
    color: #37475a;
    font-size: .82rem;
    font-weight: 800;
}

.media-delete-check,
.media-delete-button {
    align-items: center;
    background: #fff5f5;
    border: 1px solid #f5c2c7;
    border-radius: 999px;
    color: #842029;
    cursor: pointer;
    display: inline-flex;
    font-size: .86rem;
    font-weight: 800;
    gap: 7px;
    padding: 8px 11px;
    white-space: nowrap;
}

.media-delete-check:hover,
.media-delete-button:hover {
    background: #ffe7e7;
    border-color: #dc3545;
    color: #842029;
}

.media-delete-check:has(input:checked) {
    background: #dc3545;
    border-color: #b02a37;
    color: #ffffff;
}

.media-delete-check input {
    cursor: pointer;
}

.media-delete-button svg {
    height: 16px;
    width: 16px;
}

.empty-media-state {
    align-items: center;
    background: #f7fafa;
    border: 1px dashed #c7d0d0;
    border-radius: 8px;
    color: #565959;
    display: grid;
    justify-items: center;
    min-height: 170px;
    padding: 24px;
    text-align: center;
}

.empty-media-state svg {
    color: var(--amazon-orange-dark);
    height: 38px;
    width: 38px;
}

.empty-media-state strong {
    color: var(--amazon-navy);
}

.media-upload-drop {
    align-items: center;
    background: #f7fafa;
    border: 2px dashed #c7d0d0;
    border-radius: 8px;
    color: #565959;
    cursor: pointer;
    display: grid;
    gap: 7px;
    justify-items: center;
    min-height: 150px;
    padding: 22px;
    text-align: center;
    transition: border-color .16s ease, background .16s ease;
}

.media-upload-drop:hover {
    background: #fff7e6;
    border-color: var(--amazon-orange);
}

.media-upload-drop svg {
    color: var(--amazon-orange-dark);
    height: 34px;
    width: 34px;
}

.media-upload-drop strong {
    color: var(--amazon-navy);
    font-size: 1.05rem;
}

.media-upload-drop span {
    max-width: 640px;
}

.media-upload-drop input {
    max-width: 560px;
    width: 100%;
}

.admin-topbar {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 17, 17, .08);
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    min-height: 58px;
    padding: 12px 16px;
}

.admin-content > form.row,
.admin-content .table-responsive {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 17, 17, .06);
    padding: 14px;
}

.admin-content .table-responsive {
    padding: 0;
}

.admin-content .table {
    margin-bottom: 0;
}

.admin-content .table thead th {
    background: #f7fafa;
    color: #37475a;
    font-size: .82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-topbar-title,
.admin-topbar-status {
    align-items: center;
    display: inline-flex;
    gap: 9px;
}

.admin-topbar-title {
    color: var(--amazon-navy);
    font-weight: 800;
}

.admin-topbar-title svg {
    color: var(--amazon-orange-dark);
    height: 20px;
    width: 20px;
}

.admin-topbar-status {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    color: #37475a;
    font-size: .85rem;
    font-weight: 700;
    padding: 7px 12px;
}

.admin-language-switch {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    color: var(--text-main);
    display: inline-flex;
    gap: 6px;
    margin-right: 6px;
    padding: 3px 8px 3px 10px;
}

.admin-language-switch svg {
    height: 16px;
    width: 16px;
}

.admin-language-switch select {
    background: transparent;
    border: 0;
    color: var(--text-main);
    font-size: .84rem;
    font-weight: 800;
    outline: 0;
}

.admin-status-dot {
    background: #067d62;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(6, 125, 98, .12);
    display: inline-block;
    height: 8px;
    width: 8px;
}

.btn {
    border-radius: 7px;
    font-weight: 600;
}

.btn svg {
    height: 18px;
    vertical-align: -3px;
    width: 18px;
}

.btn-primary {
    background: var(--amazon-orange);
    border-color: var(--amazon-orange);
    color: var(--amazon-navy);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--amazon-orange-dark);
    border-color: var(--amazon-orange-dark);
    color: var(--amazon-navy);
}

.btn-amazon-secondary {
    align-items: center;
    background: linear-gradient(#ffffff, #f7fafa);
    border-color: #adb1b8 #a2a6ac #8d9096;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset;
    color: #0f1111;
    display: inline-flex;
    font-weight: 700;
    gap: 6px;
}

.btn-amazon-secondary:hover,
.btn-amazon-secondary:focus {
    background: linear-gradient(#f7fafa, #eef2f2);
    border-color: #8d9096;
    color: #0f1111;
}

.btn-amazon-secondary svg {
    height: 15px;
    width: 15px;
}

.btn-outline-primary {
    border-color: var(--amazon-orange);
    color: #7a4b00;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--amazon-orange);
    border-color: var(--amazon-orange);
    color: var(--amazon-navy);
}

.btn-success {
    background: #007600;
    border-color: #007600;
}

a {
    color: var(--amazon-link);
}

.admin-content > .mb-4,
.admin-content > .d-flex.mb-4 {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-left: 5px solid var(--amazon-orange);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 17, 17, .07);
    margin-bottom: 18px !important;
    padding: 18px 20px;
}

.admin-content h1 {
    color: var(--amazon-navy);
    font-weight: 800;
    letter-spacing: 0;
}

.admin-content h2 {
    color: var(--amazon-navy);
    font-weight: 800;
}

.admin-content .row.g-3 > [class*="col-"] > .card {
    border: 1px solid var(--amazon-border) !important;
    overflow: hidden;
    position: relative;
}

.admin-content .row.g-3 > [class*="col-"] > .card::before {
    background: linear-gradient(90deg, var(--amazon-orange), var(--amazon-gold));
    content: "";
    display: block;
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.admin-content .display-6 {
    color: var(--amazon-navy);
    font-weight: 800;
}

.admin-content form.row.g-2,
.admin-content form.row.g-3,
.admin-content section.border {
    background: #ffffff;
    border: 1px solid var(--amazon-border) !important;
    border-radius: 8px;
    box-shadow: 0 5px 16px rgba(15, 17, 17, .06);
    padding: 16px;
}

.table-responsive {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 17, 17, .07);
    overflow: hidden;
}

.table {
    --bs-table-striped-bg: #fafafa;
    background: var(--surface);
    border-color: var(--amazon-border);
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(#f7fafa, #edf1f1);
    border-bottom-color: var(--amazon-border);
    color: #37475a;
    font-size: .85rem;
    font-weight: 800;
    padding-bottom: 13px;
    padding-top: 13px;
    white-space: nowrap;
}

.table tbody td {
    border-color: #e7e7e7;
    padding-bottom: 13px;
    padding-top: 13px;
}

.table tbody tr:hover {
    --bs-table-accent-bg: #fffaf2;
}

.form-control,
.form-select {
    border-color: var(--amazon-border);
    border-radius: 7px;
    min-height: 40px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--amazon-orange);
    box-shadow: 0 0 0 .2rem rgba(255, 153, 0, .2);
}

.badge.text-bg-secondary {
    background: #37475a !important;
}

.badge.text-bg-warning {
    background: var(--amazon-gold) !important;
    color: var(--amazon-navy) !important;
}

.pagination {
    gap: 4px;
    margin-top: 14px;
}

.page-link {
    border-color: var(--amazon-border);
    border-radius: 7px;
    color: var(--amazon-link);
    font-weight: 700;
}

.page-item.active .page-link {
    background: var(--amazon-orange);
    border-color: var(--amazon-orange);
    color: var(--amazon-navy);
}

.modal-content {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 22px 44px rgba(15, 17, 17, .24);
}

.modal-header {
    background: #f7fafa;
    border-bottom-color: var(--amazon-border);
}

.storefront-auth-modal .modal-dialog {
    max-width: 520px;
}

.storefront-auth-modal .modal-content {
    border: 1px solid rgba(213, 217, 217, .94);
    overflow: hidden;
}

.storefront-auth-modal .modal-header {
    align-items: flex-start;
    background:
        linear-gradient(135deg, rgba(255, 153, 0, .12), transparent 56%),
        #ffffff;
    border-bottom: 1px solid var(--amazon-border);
    padding: 22px 24px;
}

.storefront-auth-kicker {
    color: #565959;
    display: block;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .06em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.storefront-auth-modal .modal-title {
    color: var(--amazon-navy);
    font-weight: 950;
    letter-spacing: 0;
}

.storefront-auth-modal .modal-body {
    padding: 22px 24px 24px;
}

.storefront-auth-tabs {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
    padding: 4px;
}

.storefront-auth-tabs button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #37475a;
    font-weight: 900;
    min-height: 40px;
}

.storefront-auth-tabs button.is-active {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 17, 17, .1);
    color: var(--amazon-navy);
}

.storefront-auth-footnote {
    color: #565959;
    font-size: .92rem;
    margin: 15px 0 0;
    text-align: center;
}

.storefront-auth-footnote button {
    background: transparent;
    border: 0;
    color: var(--amazon-link);
    font-weight: 800;
    padding: 0;
}

.storefront-auth-footnote button:hover,
.storefront-auth-footnote button:focus {
    text-decoration: underline;
}

.dashboard-hero {
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(19, 25, 33, .98), rgba(35, 47, 62, .97)),
        linear-gradient(90deg, rgba(255, 153, 0, .18), transparent 62%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 5px solid var(--amazon-orange);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(15, 17, 17, .18);
    color: #ffffff;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    overflow: hidden;
    padding: 24px;
}

.dashboard-hero h1 {
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0;
}

.dashboard-hero p {
    color: rgba(255, 255, 255, .75);
    max-width: 680px;
}

.dashboard-time-pill,
.dashboard-section-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .86rem;
    font-weight: 800;
    gap: 8px;
    white-space: normal;
}

.dashboard-time-pill {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    color: var(--amazon-gold);
    flex-wrap: wrap;
    max-width: 100%;
    padding: 8px 12px;
}

.dashboard-time-pill svg,
.dashboard-section-badge svg {
    height: 17px;
    width: 17px;
}

.dashboard-time-separator {
    background: rgba(255, 255, 255, .26);
    display: inline-block;
    height: 14px;
    width: 1px;
}

.dashboard-hero-total {
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    flex: 0 0 260px;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    text-decoration: none;
}

.dashboard-hero-link {
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.dashboard-hero-link:hover,
.dashboard-hero-link:focus {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 153, 0, .55);
    color: #ffffff;
    transform: translateY(-2px);
}

.dashboard-hero-total span {
    color: rgba(255, 255, 255, .76);
    font-size: .9rem;
    font-weight: 800;
}

.dashboard-hero-total strong {
    color: var(--amazon-gold);
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin: 8px 0;
}

.dashboard-hero-total small {
    color: rgba(255, 255, 255, .66);
}

.dashboard-warning svg {
    height: 18px;
    width: 18px;
}

.dashboard-section {
    background: transparent;
}

.dashboard-section-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dashboard-section-heading h2 {
    color: var(--amazon-navy);
    font-weight: 900;
}

.dashboard-section-badge {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    color: #37475a;
    flex-wrap: wrap;
    padding: 8px 12px;
}

.dashboard-section-badge.is-today {
    background: #fff7e6;
    border-color: #ffd28a;
    color: #7a4b00;
}

.dashboard-metric-grid,
.dashboard-today-grid {
    display: grid;
    gap: 14px;
}

.dashboard-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.dashboard-today-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dashboard-metric-card,
.dashboard-today-card {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 17, 17, .07);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 148px;
    overflow: hidden;
    padding: 16px;
    position: relative;
    text-decoration: none;
}

.dashboard-metric-card::before,
.dashboard-today-card::before {
    background: linear-gradient(90deg, var(--amazon-orange), var(--amazon-gold));
    content: "";
    display: block;
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.dashboard-metric-link {
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.dashboard-metric-link:hover,
.dashboard-metric-link:focus {
    border-color: var(--amazon-gold);
    box-shadow: 0 12px 26px rgba(15, 17, 17, .12);
    color: var(--text-main);
    transform: translateY(-2px);
}

.dashboard-metric-icon,
.dashboard-today-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    margin-bottom: 12px;
    width: 38px;
}

.dashboard-metric-icon {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    color: #37475a;
}

.dashboard-today-icon {
    background: #fff7e6;
    border: 1px solid #ffd28a;
    color: #b06000;
}

.dashboard-metric-icon svg,
.dashboard-today-icon svg {
    height: 20px;
    width: 20px;
}

.dashboard-metric-label {
    color: #565959;
    font-size: .82rem;
    font-weight: 800;
}

.dashboard-metric-card strong,
.dashboard-today-card strong {
    color: var(--amazon-navy);
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 1.1;
    margin: 7px 0 5px;
}

.dashboard-metric-card small,
.dashboard-today-card small {
    color: #565959;
}

.dashboard-today-card:first-child {
    background:
        linear-gradient(135deg, var(--amazon-navy), var(--amazon-navy-2)),
        linear-gradient(90deg, rgba(255, 153, 0, .14), transparent);
    color: #ffffff;
}

.dashboard-today-card:first-child .dashboard-metric-label,
.dashboard-today-card:first-child small {
    color: rgba(255, 255, 255, .72);
}

.dashboard-today-card:first-child strong {
    color: var(--amazon-gold);
}

.dashboard-today-card:first-child .dashboard-today-icon {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .18);
    color: var(--amazon-gold);
}

.dashboard-hourly-card {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 17, 17, .07);
    overflow-x: auto;
    padding: 18px;
}

.dashboard-hourly-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-hourly-legend span {
    align-items: center;
    color: #37475a;
    display: inline-flex;
    font-size: .86rem;
    font-weight: 800;
    gap: 7px;
}

.legend-dot {
    border-radius: 999px;
    display: inline-block;
    height: 9px;
    width: 9px;
}

.legend-dot.is-scan {
    background: var(--amazon-orange);
}

.legend-dot.is-registration {
    background: #007185;
}

.legend-dot.is-feedback {
    background: #ffa41c;
}

.legend-dot.is-whatsapp {
    background: #067d62;
}

.dashboard-hourly-chart {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(24, minmax(30px, 1fr));
    min-height: 220px;
    min-width: 820px;
}

.dashboard-hourly-column {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 220px;
    justify-content: end;
}

.dashboard-hourly-value {
    color: #37475a;
    font-size: .76rem;
    font-weight: 800;
    margin-bottom: 5px;
    min-height: 18px;
}

.dashboard-hourly-stack {
    align-items: stretch;
    background: #eef2f2;
    border-radius: 6px 6px 2px 2px;
    box-shadow: 0 6px 12px rgba(35, 47, 62, .12);
    display: flex;
    flex-direction: column-reverse;
    height: calc(var(--bar-height) * 1%);
    max-height: 150px;
    min-height: 8px;
    overflow: hidden;
    width: 100%;
}

.dashboard-hourly-segment {
    min-height: 4px;
}

.dashboard-hourly-segment.is-registration {
    background: #007185;
}

.dashboard-hourly-segment.is-feedback {
    background: #ffa41c;
}

.dashboard-hourly-segment.is-whatsapp {
    background: #067d62;
}

.dashboard-hourly-column.is-empty .dashboard-hourly-stack {
    background: #e7e7e7;
    box-shadow: none;
    height: 3px;
    min-height: 3px;
}

.dashboard-hourly-column.is-empty .dashboard-hourly-value {
    color: #8b8f94;
}

.dashboard-hourly-label {
    color: #565959;
    font-size: .72rem;
    font-weight: 700;
    margin-top: 8px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}

.dashboard-hourly-label span,
.dashboard-hourly-label small {
    display: block;
}

.dashboard-hourly-label small {
    color: #7a4b00;
    font-size: .67rem;
    font-weight: 800;
    margin-top: 2px;
}

.activity-type-pill {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    color: #37475a;
    display: inline-flex;
    font-size: .84rem;
    font-weight: 800;
    gap: 7px;
    padding: 6px 10px;
    white-space: nowrap;
}

.activity-type-pill svg {
    color: var(--amazon-orange-dark);
    height: 16px;
    width: 16px;
}

.country-access-card {
    overflow: hidden;
}

.country-access-card .card-body {
    padding: 0;
}

.country-access-header {
    align-items: flex-start;
    background: linear-gradient(180deg, #232f3e, #131921);
    border-bottom: 4px solid var(--amazon-orange);
    color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    padding: 18px 20px;
}

.country-access-header h2 {
    color: #ffffff;
    font-weight: 800;
}

.country-access-header .text-muted {
    color: rgba(255, 255, 255, .72) !important;
}

.country-count-pill {
    background: var(--amazon-gold);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    color: var(--amazon-navy);
    display: inline-flex;
    font-size: .92rem;
    font-weight: 800;
    padding: 7px 12px;
    white-space: nowrap;
}

.country-count-pill.is-open {
    background: #f7fafa;
}

.country-access-card .alert,
.country-access-card form {
    margin-left: 20px;
    margin-right: 20px;
}

.country-access-card .alert {
    margin-top: 18px;
}

.country-search-panel {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    margin-bottom: 14px;
    margin-top: 18px;
    padding: 14px;
}

.country-search-panel .form-label {
    color: #37475a;
    font-weight: 800;
}

.country-search-box {
    align-items: center;
    display: flex;
    position: relative;
}

.country-search-box svg {
    color: #565959;
    height: 18px;
    left: 12px;
    pointer-events: none;
    position: absolute;
    width: 18px;
    z-index: 2;
}

.country-search-box .form-control {
    padding-left: 40px;
}

.country-picker {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 0 0 8px 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    max-height: 420px;
    overflow-y: auto;
    padding: 10px;
}

.country-list-toolbar {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 0;
    padding: 13px 14px;
}

.country-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.country-picker-item {
    align-items: center;
    background: linear-gradient(#ffffff, #fafafa);
    border: 1px solid #e7e7e7;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
}

.country-picker-item:hover {
    background: #fffaf2;
    border-color: var(--amazon-gold);
}

.country-picker-item:has(input:checked) {
    background: #fff7e6;
    border-color: var(--amazon-orange);
    box-shadow: inset 3px 0 0 var(--amazon-orange);
}

.country-picker-name {
    flex: 1;
    font-weight: 700;
    min-width: 0;
}

.country-picker-item code {
    color: #37475a;
    font-size: .78rem;
}

.country-save-bar {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 20px;
    margin-top: 14px;
    padding: 13px 14px;
}

.update-soft-icon {
    align-items: center;
    background: #fff7e6;
    border: 1px solid #ffd28a;
    border-radius: 8px;
    color: #b06000;
    display: inline-flex;
    flex: 0 0 auto;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.update-soft-icon svg {
    height: 22px;
    width: 22px;
}

.update-status-list code,
.admin-content code {
    overflow-wrap: anywhere;
    white-space: normal;
}

.update-log-view {
    background:
        linear-gradient(180deg, rgba(255, 153, 0, .08), transparent 85px),
        #111820;
    border: 1px solid #2d3844;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
    color: #e8f0f2;
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
    font-size: .86rem;
    line-height: 1.55;
    margin: 0;
    max-height: 520px;
    overflow: auto;
    padding: 16px;
    white-space: pre-wrap;
}

.update-empty-log {
    align-items: center;
    background: #f7fafa;
    border: 1px dashed var(--amazon-border);
    border-radius: 8px;
    color: #565959;
    display: flex;
    gap: 10px;
    padding: 18px;
}

.update-empty-log svg {
    color: var(--amazon-orange-dark);
    height: 22px;
    width: 22px;
}

.product-thumb {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 7px;
    display: inline-flex;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.product-thumb.is-empty {
    align-items: center;
    color: #8b8f94;
    justify-content: center;
}

.product-thumb.is-empty svg {
    height: 22px;
    width: 22px;
}

.product-admin-panel,
.product-table-card {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 17, 17, .08);
}

.product-admin-panel {
    overflow: visible;
}

.product-table-card {
    overflow: hidden;
}

.product-admin-hero {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(255, 153, 0, .14), transparent 48%),
        #ffffff;
    border-bottom: 1px solid var(--amazon-border);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 20px 22px;
}

.product-admin-kicker {
    color: #6b7280;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.product-admin-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.product-total-pill,
.product-table-summary span {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    color: #37475a;
    display: inline-flex;
    font-size: .9rem;
    font-weight: 800;
    padding: 7px 12px;
}

.product-filter-bar {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(240px, 1.2fr) minmax(240px, 1fr) auto;
    padding: 16px 22px 18px;
}

.product-filter-bar .form-label {
    color: #37475a;
    font-size: .82rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.product-filter-bar .form-control,
.product-filter-bar .store-filter-toggle {
    min-height: 42px;
}

.product-filter-actions {
    align-items: end;
    display: flex;
    gap: 8px;
}

.product-filter-actions .btn {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    min-height: 42px;
    white-space: nowrap;
}

.product-filter-actions svg {
    height: 17px;
    width: 17px;
}

.product-filter-help {
    color: #6b7280;
    font-size: .84rem;
    grid-column: 1 / -1;
    margin-top: -4px;
}

.product-table-card {
    margin-top: 18px;
}

.product-table-head {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--amazon-border);
    display: flex;
    justify-content: space-between;
    padding: 16px 18px;
}

.admin-content .product-table-responsive {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.product-admin-table {
    min-width: 1320px;
}

.product-admin-table thead th {
    border-bottom: 1px solid var(--amazon-border);
    padding: 12px 14px;
    white-space: nowrap;
}

.product-admin-table tbody td {
    padding: 14px;
    vertical-align: middle;
}

.product-admin-table .btn-group {
    gap: 4px;
}

.product-admin-table .btn-group > .btn {
    border-radius: 7px !important;
}

.product-child-row td {
    background: #fffaf2;
}

.product-store-group-row td {
    background: #f3f3f3 !important;
    border-top: 2px solid #d5d9d9;
    color: #0f1111;
    padding: 12px 16px;
}

.product-store-group-row svg {
    color: var(--amazon-orange);
    height: 18px;
    width: 18px;
}

.store-filter-combobox {
    width: 100%;
}

.store-filter-toggle {
    align-items: center;
    background: #fff;
    border-color: var(--amazon-border);
    color: #0f1111;
    display: flex;
    justify-content: space-between;
    min-height: 38px;
    text-align: left;
    width: 100%;
}

.store-filter-toggle:hover,
.store-filter-toggle:focus {
    background: #f7fafa;
    border-color: var(--amazon-orange);
    box-shadow: 0 0 0 .2rem rgba(255, 164, 28, .18);
    color: #0f1111;
}

.store-filter-menu {
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 17, 17, .16);
    max-height: 320px;
    min-width: 100%;
    overflow: hidden;
    width: max(100%, 280px);
    z-index: 1080;
}

.store-filter-menu-head {
    align-items: center;
    background: #f7fafa;
    border-bottom: 1px solid var(--amazon-border);
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
}

.store-filter-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 6px;
}

.store-filter-option {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 9px 10px;
}

.store-filter-option:hover {
    background: #f3f3f3;
}

.store-filter-option .form-check-input {
    margin: 0;
}

.tcg-counter-page {
    --tcg-scale: 1;
    --tcg-vh: 100dvh;
    --tcg-vw: 100vw;
    background:
        radial-gradient(circle at 15% 10%, rgba(29, 155, 240, .22), transparent 28rem),
        radial-gradient(circle at 85% 90%, rgba(255, 153, 0, .24), transparent 26rem),
        linear-gradient(135deg, #060a12 0%, #111827 48%, #090b10 100%);
    color: #f8fafc;
    min-height: var(--tcg-vh, calc(100vh - 64px));
    overflow: hidden;
    padding: 18px;
}

.tcg-counter-topbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: 0 auto 18px;
    max-width: 1280px;
}

.tcg-counter-brand {
    align-items: center;
    color: #fff;
    display: inline-flex;
    gap: 10px;
    text-decoration: none;
}

.tcg-counter-brand img,
.tcg-counter-brand span {
    background: #ff9900;
    border-radius: 10px;
    color: #111827;
    display: inline-flex;
    font-weight: 900;
    height: 40px;
    justify-content: center;
    object-fit: contain;
    padding: 3px;
    width: 40px;
}

.tcg-counter-select {
    align-items: center;
    color: #cbd5e1;
    display: flex;
    gap: 10px;
}

.tcg-counter-controls {
    align-items: center;
    display: flex;
    gap: 10px;
}

.tcg-counter-select .form-select {
    background-color: rgba(15, 23, 42, .9);
    border-color: rgba(148, 163, 184, .35);
    color: #fff;
    min-width: 320px;
}

.tcg-fullscreen-btn {
    align-items: center;
    background: rgba(255, 153, 0, .16);
    border: 1px solid rgba(255, 153, 0, .42);
    border-radius: 12px;
    color: #ffcc80;
    display: inline-flex;
    font-weight: 900;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
}

.tcg-fullscreen-btn svg {
    height: 18px;
    width: 18px;
}

.tcg-fullscreen-btn:hover {
    background: rgba(255, 153, 0, .26);
    color: #fff2cc;
}

.tcg-counter-board {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, .8fr) minmax(260px, 1fr);
    height: calc(var(--tcg-vh, 100vh) - 96px);
    margin: 0 auto;
    max-width: 1280px;
    min-height: 0;
}

.tcg-player,
.tcg-center-panel {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.tcg-player {
    background:
        linear-gradient(160deg, rgba(15, 23, 42, .94), rgba(30, 41, 59, .74)),
        radial-gradient(circle at 50% 20%, rgba(56, 189, 248, .18), transparent 18rem);
    display: flex;
    min-height: 0;
}

.tcg-player-inner {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    padding: 24px;
}

.tcg-player-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.tcg-player-name {
    background: rgba(2, 6, 23, .46);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    max-width: 180px;
    padding: 10px 12px;
}

.tcg-lp-badge {
    background: rgba(255, 153, 0, .16);
    border: 1px solid rgba(255, 153, 0, .38);
    border-radius: 999px;
    color: #ffcc80;
    font-size: .8rem;
    font-weight: 900;
    letter-spacing: .08em;
    padding: 8px 12px;
}

.tcg-lp-display {
    background: transparent;
    border: 0;
    color: #f8fafc;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(4rem, min(9vw, 14vh), 8.4rem);
    font-weight: 900;
    line-height: .95;
    text-shadow: 0 0 28px rgba(56, 189, 248, .2);
}

.tcg-lp-display.is-hit {
    animation: tcgLpHit .46s ease;
}

.tcg-lp-display.is-heal {
    animation: tcgLpHeal .46s ease;
}

.tcg-lp-display.is-low {
    color: #ffb4a8;
    text-shadow: 0 0 32px rgba(239, 68, 68, .35);
}

.tcg-quick-row {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
}

.tcg-quick-row button,
.tcg-calc button,
.tcg-timer-actions button,
.tcg-reset {
    background: rgba(248, 250, 252, .08);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 12px;
    color: #f8fafc;
    font-weight: 800;
    min-height: 44px;
}

.tcg-quick-row button:hover,
.tcg-calc button:hover,
.tcg-timer-actions button:hover,
.tcg-reset:hover {
    background: rgba(255, 153, 0, .2);
    border-color: rgba(255, 153, 0, .55);
}

.tcg-calc {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 52px 52px 52px;
}

.tcg-calc-input {
    background: rgba(2, 6, 23, .56);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    min-width: 0;
    padding: 0 14px;
}

.tcg-center-panel {
    background: rgba(15, 23, 42, .74);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 16px;
}

.tcg-round-card,
.tcg-timer,
.tcg-history {
    background: rgba(2, 6, 23, .54);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 18px;
    padding: 14px;
}

.tcg-round-card {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.tcg-round-card p,
.tcg-timer span {
    color: #94a3b8;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.tcg-round-card strong,
.tcg-timer strong {
    color: #fff;
    font-size: 1.4rem;
}

.tcg-reset {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    padding: 0 14px;
}

.tcg-reset svg {
    height: 18px;
    width: 18px;
}

.tcg-tool-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.tcg-tool {
    align-items: center;
    background: linear-gradient(160deg, rgba(30, 41, 59, .88), rgba(15, 23, 42, .9));
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 18px;
    color: #fff;
    display: grid;
    gap: 6px;
    justify-items: center;
    min-height: 128px;
}

.tcg-tool svg {
    color: #38bdf8;
    height: 30px;
    width: 30px;
}

.tcg-tool span {
    color: #cbd5e1;
    font-weight: 800;
}

.tcg-tool strong {
    color: #ffcc80;
    font-size: 2rem;
    line-height: 1;
}

.tcg-timer {
    display: grid;
    gap: 12px;
}

.tcg-timer-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
}

.tcg-history {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tcg-history summary {
    align-items: center;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-weight: 900;
    justify-content: space-between;
    list-style: none;
}

.tcg-history summary::-webkit-details-marker {
    display: none;
}

.tcg-history summary button {
    background: transparent;
    border: 0;
    color: #7dd3fc;
    font-weight: 800;
}

.tcg-history-actions {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.tcg-history ol {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 12px 0 0;
    max-height: clamp(80px, 20vh, 210px);
    overflow-y: auto;
    padding: 0;
}

.tcg-history li {
    background: rgba(248, 250, 252, .06);
    border-radius: 12px;
    display: grid;
    gap: 2px;
    padding: 9px 10px;
}

.tcg-history li span {
    color: #94a3b8;
    font-size: .75rem;
}

.tcg-history li strong {
    color: #f8fafc;
    font-size: .88rem;
}

.tcg-history li.is-empty {
    color: #94a3b8;
    display: block;
}

.tcg-log-overlay,
.tcg-mobile-keypad {
    align-items: center;
    background: rgba(2, 6, 23, .72);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 16px;
    position: fixed;
    z-index: 1090;
}

.tcg-log-overlay.is-showing,
.tcg-mobile-keypad.is-showing {
    display: flex;
}

.tcg-log-card,
.tcg-mobile-keypad-card {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .98), rgba(2, 6, 23, .98)),
        radial-gradient(circle at 50% 0%, rgba(255, 153, 0, .18), transparent 18rem);
    border: 1px solid rgba(255, 153, 0, .28);
    border-radius: 20px;
    box-shadow: 0 34px 92px rgba(0, 0, 0, .54);
    color: #fff;
}

.tcg-log-card {
    display: grid;
    gap: 12px;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: min(620px, 88vh);
    max-width: min(720px, 92vw);
    padding: 18px;
    width: 100%;
}

.tcg-log-card header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.tcg-log-card header p {
    color: #ffcc80;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    margin: 0 0 2px;
    text-transform: uppercase;
}

.tcg-log-card header strong {
    font-size: 1.35rem;
}

.tcg-log-card header button {
    background: linear-gradient(180deg, #ffd814, #f0b90b);
    border: 1px solid #d5a000;
    border-radius: 999px;
    color: #111827;
    font-weight: 900;
    min-height: 36px;
    padding: 0 16px;
}

.tcg-log-card ol {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
}

.tcg-log-card li {
    background: rgba(248, 250, 252, .07);
    border: 1px solid color-mix(in srgb, var(--tcg-entry-color, #94a3b8) 38%, transparent);
    border-left: 5px solid var(--tcg-entry-color, #94a3b8);
    border-radius: 12px;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
}

.tcg-log-card li span {
    color: #94a3b8;
    font-size: .75rem;
}

.tcg-log-card li strong {
    color: #f8fafc;
    font-size: .9rem;
}

.tcg-mobile-keypad-card {
    display: grid;
    gap: 10px;
    max-width: min(760px, 94vw);
    padding: 14px;
    width: 100%;
}

.tcg-mobile-keypad-display {
    align-items: center;
    background: rgba(2, 6, 23, .72);
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
}

.tcg-mobile-keypad-display span {
    color: #ffcc80;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tcg-mobile-keypad-display strong {
    color: #fff;
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    line-height: 1;
}

.tcg-mobile-keypad-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tcg-mobile-keypad-grid button {
    background: rgba(248, 250, 252, .09);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 12px;
    color: #fff;
    font-size: clamp(1rem, 3.6vw, 1.35rem);
    font-weight: 950;
    min-height: 46px;
}

.tcg-mobile-keypad-grid button[data-keypad-action="add"] {
    background: linear-gradient(180deg, rgba(16, 185, 129, .92), rgba(4, 120, 87, .94));
    border-color: rgba(110, 231, 183, .58);
}

.tcg-mobile-keypad-grid button[data-keypad-action="subtract"] {
    background: linear-gradient(180deg, rgba(239, 68, 68, .92), rgba(153, 27, 27, .94));
    border-color: rgba(252, 165, 165, .58);
}

.tcg-player {
    position: relative;
}

.tcg-lp-effect {
    align-items: center;
    display: inline-flex;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    font-stretch: normal;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    justify-content: center;
    left: 50%;
    letter-spacing: 0;
    line-height: .9;
    min-width: max-content;
    pointer-events: none;
    position: absolute;
    text-shadow: 0 0 24px currentColor;
    top: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    white-space: nowrap;
    z-index: 4;
}

.tcg-lp-effect.is-loss {
    animation: tcgLpFloatLoss .9s ease-out forwards;
    color: #ff6b5f;
}

.tcg-lp-effect.is-gain {
    animation: tcgLpFloatGain .9s ease-out forwards;
    color: #74f2ce;
}

.tcg-lp-effect.is-gsap-driven {
    animation: none !important;
}

.tcg-lp-effect.tcg-lp-viewport-effect {
    align-items: center !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid currentColor !important;
    border-radius: 999px !important;
    box-shadow: 0 0 18px currentColor, inset 0 0 18px rgba(255, 255, 255, .08) !important;
    display: inline-flex !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: clamp(1.75rem, 7.5vw, 2.8rem) !important;
    font-stretch: normal !important;
    font-variant-numeric: tabular-nums !important;
    font-weight: 950 !important;
    justify-content: center !important;
    left: 50%;
    line-height: .9 !important;
    max-width: none !important;
    min-width: max-content !important;
    overflow: visible !important;
    padding: .12em .32em .15em !important;
    position: fixed !important;
    right: auto !important;
    text-align: center !important;
    top: 50%;
    transform-origin: center center !important;
    white-space: nowrap !important;
    width: max-content !important;
    writing-mode: horizontal-tb !important;
    z-index: 2147483000 !important;
}

.tcg-lp-effect.tcg-lp-viewport-effect.is-loss {
    background: rgba(127, 29, 29, .78) !important;
    color: #ff8a7c !important;
}

.tcg-lp-effect.tcg-lp-viewport-effect.is-gain {
    background: rgba(6, 78, 59, .78) !important;
    color: #75f2c4 !important;
}

.tcg-quick-row button.is-pressed,
.tcg-calc button.is-pressed,
.tcg-timer-actions button.is-pressed,
.tcg-fullscreen-btn.is-pressed {
    animation: tcgButtonPress .34s ease;
}

.tcg-tool.is-activated,
.tcg-reset.is-activated {
    animation: tcgToolPulse .58s ease;
}

.tcg-tool.is-flipping svg {
    animation: tcgCoinFlip .62s ease;
    color: #ffcc80;
}

.tcg-counter-page.is-fullscreen {
    height: var(--tcg-vh, 100dvh);
    min-height: var(--tcg-vh, 100dvh);
    overflow: hidden;
    padding: 8px;
}

.tcg-counter-page.is-fullscreen .tcg-counter-topbar {
    margin-bottom: 8px;
}

.tcg-counter-page.is-fullscreen .tcg-counter-board {
    height: calc(var(--tcg-vh, 100dvh) - 56px);
    min-height: 0;
}

.tcg-counter-page.is-fullscreen .tcg-player,
.tcg-counter-page.is-fullscreen .tcg-center-panel {
    min-height: 0;
}

.tcg-counter-page.is-fullscreen .tcg-player-inner {
    justify-content: space-evenly;
    overflow: hidden;
}

.tcg-counter-page.is-fullscreen .tcg-history ol {
    max-height: clamp(52px, 14dvh, 150px);
}

.tcg-counter-page.is-fullscreen .tcg-lp-display {
    font-size: clamp(3rem, 8vw, 7rem);
}

@keyframes tcgLpHit {
    0% { transform: scale(1); text-shadow: 0 0 28px rgba(56, 189, 248, .2); }
    35% { transform: scale(1.08); color: #ff8a7a; text-shadow: 0 0 46px rgba(239, 68, 68, .62); }
    100% { transform: scale(1); }
}

@keyframes tcgLpHeal {
    0% { transform: scale(1); text-shadow: 0 0 28px rgba(56, 189, 248, .2); }
    35% { transform: scale(1.08); color: #9fffe0; text-shadow: 0 0 46px rgba(45, 212, 191, .62); }
    100% { transform: scale(1); }
}

@keyframes tcgLpFloatLoss {
    0% { opacity: 0; transform: translate(-50%, -70%) scale(.72); }
    18% { opacity: 1; transform: translate(-50%, -38%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, 62%) scale(.92); }
}

@keyframes tcgLpFloatGain {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(.72); }
    18% { opacity: 1; transform: translate(-50%, -64%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -138%) scale(.92); }
}

@keyframes tcgButtonPress {
    0% { box-shadow: 0 0 0 0 rgba(255, 153, 0, .7); transform: scale(1); }
    50% { box-shadow: 0 0 0 10px rgba(255, 153, 0, 0); transform: scale(.96); }
    100% { transform: scale(1); }
}

@keyframes tcgToolPulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, .7); transform: scale(1); }
    45% { border-color: rgba(255, 153, 0, .9); box-shadow: 0 0 34px rgba(255, 153, 0, .38); transform: scale(1.035); }
    100% { box-shadow: 0 0 0 18px rgba(56, 189, 248, 0); transform: scale(1); }
}

@keyframes tcgCoinFlip {
    0% { transform: rotateY(0deg) scale(1); }
    45% { transform: rotateY(540deg) scale(1.34); }
    100% { transform: rotateY(1080deg) scale(1); }
}

.tcg-dice-stage {
    display: grid;
    height: 68px;
    perspective: 520px;
    place-items: center;
    width: 68px;
}

.tcg-dice-cube {
    height: 48px;
    position: relative;
    transform: rotateX(0deg) rotateY(0deg);
    transform-style: preserve-3d;
    transition: transform .54s cubic-bezier(.16, .84, .31, 1.22);
    width: 48px;
}

.tcg-dice-cube.is-rolling {
    animation: tcgDiceRoll .76s cubic-bezier(.2, .8, .2, 1);
}

.tcg-dice-face {
    background:
        radial-gradient(circle at 34% 34%, rgba(255, 255, 255, .95), transparent 22%),
        linear-gradient(145deg, #ffffff, #dbeafe);
    border: 2px solid rgba(56, 189, 248, .68);
    border-radius: 12px;
    box-shadow:
        inset 0 -8px 14px rgba(15, 23, 42, .12),
        0 0 18px rgba(56, 189, 248, .32);
    height: 48px;
    left: 0;
    position: absolute;
    top: 0;
    transform-style: preserve-3d;
    width: 48px;
}

.tcg-dice-face::before,
.tcg-dice-face::after {
    content: "";
    position: absolute;
}

.tcg-dice-face-1 { transform: rotateY(0deg) translateZ(24px); }
.tcg-dice-face-2 { transform: rotateY(90deg) translateZ(24px); }
.tcg-dice-face-3 { transform: rotateX(90deg) translateZ(24px); }
.tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(24px); }
.tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(24px); }
.tcg-dice-face-6 { transform: rotateX(180deg) translateZ(24px); }

.tcg-dice-face-1::before,
.tcg-dice-face-2::before,
.tcg-dice-face-3::before,
.tcg-dice-face-4::before,
.tcg-dice-face-5::before,
.tcg-dice-face-6::before {
    background: #0f172a;
    border-radius: 50%;
    height: 7px;
    width: 7px;
}

.tcg-dice-face-1::before {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.tcg-dice-face-2::before {
    box-shadow: 24px 24px 0 #0f172a;
    left: 9px;
    top: 9px;
}

.tcg-dice-face-3::before {
    box-shadow: 12px 12px 0 #0f172a, 24px 24px 0 #0f172a;
    left: 9px;
    top: 9px;
}

.tcg-dice-face-4::before {
    box-shadow: 24px 0 0 #0f172a, 0 24px 0 #0f172a, 24px 24px 0 #0f172a;
    left: 9px;
    top: 9px;
}

.tcg-dice-face-5::before {
    box-shadow: 24px 0 0 #0f172a, 12px 12px 0 #0f172a, 0 24px 0 #0f172a, 24px 24px 0 #0f172a;
    left: 9px;
    top: 9px;
}

.tcg-dice-face-6::before {
    box-shadow: 0 12px 0 #0f172a, 0 24px 0 #0f172a, 24px 0 0 #0f172a, 24px 12px 0 #0f172a, 24px 24px 0 #0f172a;
    left: 9px;
    top: 9px;
}

@keyframes tcgDiceRoll {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
    }

    45% {
        transform: rotateX(420deg) rotateY(310deg) rotateZ(180deg) scale(1.16);
    }

    100% {
        transform: rotateX(780deg) rotateY(610deg) rotateZ(360deg) scale(1);
    }
}

@media (max-width: 980px) {
    .product-admin-hero,
    .product-table-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-admin-actions,
    .product-filter-actions {
        justify-content: stretch;
        width: 100%;
    }

    .product-admin-actions .btn,
    .product-filter-actions .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    .product-filter-bar {
        grid-template-columns: 1fr;
    }

    .product-filter-help {
        margin-top: 0;
    }

    .tcg-counter-page {
        height: var(--tcg-vh, 100dvh);
        min-height: var(--tcg-vh, 100dvh);
        overflow: hidden;
        padding: 6px;
    }

    .tcg-counter-topbar {
        align-items: center;
        flex-direction: row;
        gap: 8px;
        margin-bottom: 6px;
        max-width: none;
    }

    .tcg-counter-controls {
        align-items: center;
        flex: 1 1 auto;
        flex-direction: row;
        justify-content: flex-end;
        min-width: 0;
    }

    .tcg-counter-select {
        align-items: center;
        flex: 1 1 auto;
        min-width: 0;
    }

    .tcg-counter-select .form-select {
        min-height: 34px;
        min-width: 0;
        padding-bottom: 4px;
        padding-top: 4px;
        width: 100%;
    }

    .tcg-counter-brand strong,
    .tcg-counter-select > span {
        display: none;
    }

    .tcg-counter-brand img,
    .tcg-counter-brand span {
        border-radius: 8px;
        height: 34px;
        width: 34px;
    }

    .tcg-fullscreen-btn {
        justify-content: center;
        min-height: 34px;
        padding: 0 10px;
        white-space: nowrap;
        width: auto;
    }

    .tcg-counter-board {
        gap: 6px;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(92px, auto) minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 52px);
        max-width: none;
        min-height: 0;
    }

    .tcg-player {
        border-radius: 16px;
        min-height: 0;
    }

    .tcg-player-inner {
        gap: 6px;
        justify-content: space-between;
        overflow: hidden;
        padding: 8px;
    }

    .tcg-lp-display {
        font-size: clamp(2.35rem, calc(15vw * var(--tcg-scale, 1)), 6rem);
    }

    .tcg-center-panel {
        border-radius: 16px;
        display: grid;
        gap: 6px;
        grid-template-areas:
            "round timer"
            "tools history";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        order: 2;
        padding: 8px;
    }

    .tcg-center-panel .tcg-round-card {
        grid-area: round;
    }

    .tcg-center-panel .tcg-tool-grid {
        grid-area: tools;
    }

    .tcg-center-panel .tcg-timer {
        grid-area: timer;
    }

    .tcg-center-panel .tcg-history {
        grid-area: history;
    }

    .tcg-player-top {
        order: 1;
    }

    .tcg-player-top .tcg-player-inner {
        transform: rotate(180deg);
    }

    .tcg-player-bottom {
        order: 3;
    }

    .tcg-player-head {
        gap: 8px;
    }

    .tcg-player-name {
        border-radius: 10px;
        font-size: .85rem;
        max-width: 138px;
        padding: 6px 8px;
    }

    .tcg-lp-badge {
        font-size: .68rem;
        padding: 6px 8px;
    }

    .tcg-quick-row {
        gap: 5px;
    }

    .tcg-quick-row button,
    .tcg-calc button,
    .tcg-timer-actions button,
    .tcg-reset {
        border-radius: 9px;
        font-size: calc(.82rem * var(--tcg-scale, 1));
        min-height: calc(30px * var(--tcg-scale, 1));
    }

    .tcg-calc {
        flex: 0 0 auto;
        gap: 5px;
        grid-template-columns: minmax(0, 1fr) 34px 34px 34px;
    }

    .tcg-calc-input {
        border-radius: 9px;
        font-size: .88rem;
        min-height: 28px;
        padding: 0 8px;
    }

    .tcg-round-card,
    .tcg-timer,
    .tcg-history {
        border-radius: 12px;
        min-height: 0;
        padding: 6px 7px;
    }

    .tcg-round-card {
        align-items: center;
        gap: 6px;
    }

    .tcg-round-card p,
    .tcg-timer span {
        font-size: .66rem;
        margin-bottom: 1px;
    }

    .tcg-round-card strong,
    .tcg-timer strong {
        font-size: 1rem;
    }

    .tcg-tool-grid {
        gap: 6px;
    }

    .tcg-tool {
        border-radius: 12px;
        gap: 3px;
        min-height: 52px;
    }

    .tcg-tool svg {
        height: 19px;
        width: 19px;
    }

    .tcg-tool span {
        font-size: .78rem;
    }

    .tcg-tool strong {
        font-size: 1.15rem;
    }

    .tcg-timer {
        align-items: center;
        gap: 6px;
        grid-template-columns: 1fr;
    }

    .tcg-timer-actions {
        gap: 5px;
    }

    .tcg-timer-actions button {
        font-size: .74rem;
        line-height: 1.05;
        padding: 0 4px;
    }

    .tcg-history summary {
        font-size: .82rem;
    }

    .tcg-history summary button {
        font-size: .78rem;
    }

    .tcg-history ol {
        gap: 4px;
        margin-top: 5px;
        max-height: 30px;
    }

    .tcg-history li {
        border-radius: 8px;
        padding: 5px 7px;
    }

    .tcg-history li span {
        font-size: .64rem;
    }

    .tcg-history li strong {
        font-size: .72rem;
    }

    .tcg-dice-stage {
        height: 32px;
        width: 32px;
    }

    .tcg-dice-cube,
    .tcg-dice-face {
        height: 28px;
        width: 28px;
    }

    .tcg-dice-face {
        border-radius: 8px;
    }

    .tcg-dice-face-1 { transform: rotateY(0deg) translateZ(14px); }
    .tcg-dice-face-2 { transform: rotateY(90deg) translateZ(14px); }
    .tcg-dice-face-3 { transform: rotateX(90deg) translateZ(14px); }
    .tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(14px); }
    .tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(14px); }
    .tcg-dice-face-6 { transform: rotateX(180deg) translateZ(14px); }

    .tcg-dice-face-1::before,
    .tcg-dice-face-2::before,
    .tcg-dice-face-3::before,
    .tcg-dice-face-4::before,
    .tcg-dice-face-5::before,
    .tcg-dice-face-6::before {
        height: 4px;
        width: 4px;
    }

    .tcg-dice-face-2::before {
        box-shadow: 16px 16px 0 #0f172a;
        left: 6px;
        top: 6px;
    }

    .tcg-dice-face-3::before {
        box-shadow: 8px 8px 0 #0f172a, 16px 16px 0 #0f172a;
        left: 6px;
        top: 6px;
    }

    .tcg-dice-face-4::before {
        box-shadow: 16px 0 0 #0f172a, 0 16px 0 #0f172a, 16px 16px 0 #0f172a;
        left: 6px;
        top: 6px;
    }

    .tcg-dice-face-5::before {
        box-shadow: 16px 0 0 #0f172a, 8px 8px 0 #0f172a, 0 16px 0 #0f172a, 16px 16px 0 #0f172a;
        left: 6px;
        top: 6px;
    }

    .tcg-dice-face-6::before {
        box-shadow: 0 8px 0 #0f172a, 0 16px 0 #0f172a, 16px 0 0 #0f172a, 16px 8px 0 #0f172a, 16px 16px 0 #0f172a;
        left: 6px;
        top: 6px;
    }

    .tcg-counter-page.is-fullscreen {
        padding: 6px;
    }

    .tcg-counter-page.is-fullscreen .tcg-counter-topbar {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 6px;
    }

    .tcg-counter-page.is-fullscreen .tcg-counter-brand strong,
    .tcg-counter-page.is-fullscreen .tcg-counter-select > span {
        display: none;
    }

    .tcg-counter-page.is-fullscreen .tcg-counter-controls {
        flex: 1;
        flex-direction: row;
        justify-content: flex-end;
        min-width: 0;
    }

    .tcg-counter-page.is-fullscreen .tcg-counter-select {
        flex: 1;
        min-width: 0;
    }

    .tcg-counter-page.is-fullscreen .tcg-counter-select .form-select {
        min-width: 0;
    }

    .tcg-counter-page.is-fullscreen .tcg-fullscreen-btn {
        flex: 0 0 auto;
        min-width: 74px;
        width: auto;
    }

    .tcg-counter-page.is-tight-height .tcg-counter-board {
        gap: 4px;
        height: calc(var(--tcg-vh, 100dvh) - 48px);
    }

    .tcg-counter-page.is-tight-height .tcg-player-inner,
    .tcg-counter-page.is-tight-height .tcg-center-panel {
        gap: 4px;
        padding: 6px;
    }

    .tcg-counter-page.is-tight-height .tcg-tool {
        min-height: 46px;
    }

    .tcg-counter-page.is-tight-height .tcg-history ol {
        display: none;
    }

    .tcg-counter-page.is-tight-height .tcg-center-panel {
        grid-template-areas:
            "round timer"
            "tools tools";
    }

    .tcg-counter-page.is-tight-height .tcg-history {
        display: none;
    }

    .tcg-counter-page.is-ultra-tight .tcg-counter-brand {
        display: none;
    }

    .tcg-counter-page.is-ultra-tight .tcg-counter-board {
        height: calc(var(--tcg-vh, 100dvh) - 46px);
    }

    .tcg-counter-page.is-ultra-tight .tcg-fullscreen-btn span {
        display: none;
    }

    .tcg-counter-page.is-ultra-tight .tcg-lp-display {
        font-size: clamp(2rem, calc(13vw * var(--tcg-scale, 1)), 4.6rem);
    }

    .tcg-counter-page.is-ultra-tight .tcg-round-card,
    .tcg-counter-page.is-ultra-tight .tcg-timer,
    .tcg-counter-page.is-ultra-tight .tcg-history {
        padding: 4px 5px;
    }

    .tcg-counter-page.is-ultra-tight .tcg-tool {
        min-height: 42px;
    }

    .tcg-counter-page.is-ultra-tight .tcg-tool svg,
    .tcg-counter-page.is-ultra-tight .tcg-tool > span:not(.tcg-dice-stage) {
        display: none;
    }

    .tcg-counter-page.is-ultra-tight .tcg-counter-board {
        grid-template-rows: minmax(0, 1fr) minmax(78px, auto) minmax(0, 1fr);
    }

    .tcg-counter-page.is-ultra-tight .tcg-calc {
        grid-template-columns: minmax(0, 1fr) 30px 30px 30px;
    }
}

/* Website feedback entry and page. */
.tcg-feedback-link {
    align-items: center;
    background: rgba(56, 189, 248, .14);
    border: 1px solid rgba(125, 211, 252, .34);
    border-radius: 12px;
    color: #dff6ff;
    display: inline-flex;
    font-weight: 800;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    text-decoration: none;
}

.tcg-feedback-link:hover {
    background: rgba(56, 189, 248, .24);
    color: #fff;
}

.tcg-feedback-link svg {
    height: 18px;
    width: 18px;
}

.site-feedback-page {
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 153, 0, .16), transparent 26rem),
        radial-gradient(circle at 90% 80%, rgba(35, 47, 62, .16), transparent 28rem),
        #f3f3f3;
    min-height: calc(100dvh - 72px);
    padding: clamp(24px, 5vw, 64px) 16px;
}

.site-feedback-shell {
    margin: 0 auto;
    max-width: 780px;
}

.site-feedback-brand {
    align-items: center;
    color: #111827;
    display: inline-flex;
    gap: 10px;
    margin-bottom: 18px;
    text-decoration: none;
}

.site-feedback-brand img,
.site-feedback-brand span {
    align-items: center;
    background: #ff9900;
    border-radius: 10px;
    color: #111827;
    display: inline-flex;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    object-fit: contain;
    width: 38px;
}

.site-feedback-card {
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(15, 17, 17, .10);
    padding: clamp(22px, 4vw, 38px);
}

.site-feedback-header p {
    color: #b12704;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.site-feedback-header h1 {
    color: #0f1111;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 10px;
}

.site-feedback-header span,
.site-feedback-success p {
    color: #565959;
}

.site-feedback-message {
    min-height: 160px;
}

.site-feedback-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.site-feedback-actions .btn {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.site-feedback-success {
    text-align: center;
}

.site-feedback-success svg {
    color: #067d62;
    height: 56px;
    margin-bottom: 16px;
    width: 56px;
}

.site-feedback-success h1 {
    font-weight: 900;
}

.website-feedback-list {
    display: grid;
    gap: 14px;
}

.website-feedback-item {
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 10px;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    padding: 18px;
}

.website-feedback-message {
    color: #0f1111;
    font-size: 1rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.website-feedback-admin-form {
    background: #f7fafa;
    border: 1px solid #e3e6e6;
    border-radius: 8px;
    padding: 12px;
}

@media (max-width: 760px) {
    .website-feedback-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit .tcg-counter-controls {
        grid-template-columns: minmax(0, 1fr) 34px 34px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-feedback-link {
        align-items: center !important;
        border-radius: 9px !important;
        display: inline-flex !important;
        height: 100% !important;
        justify-content: center !important;
        min-height: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-feedback-link span {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-feedback-link svg {
        height: 17px !important;
        width: 17px !important;
    }
}

@media (orientation: landscape) and (max-height: 620px) {
    .tcg-counter-page {
        height: var(--tcg-vh, 100dvh);
        min-height: var(--tcg-vh, 100dvh);
        overflow: hidden;
        padding: 8px;
    }

    .tcg-counter-topbar {
        align-items: center;
        flex-direction: row;
        gap: 10px;
        margin-bottom: 8px;
    }

    .tcg-counter-brand img,
    .tcg-counter-brand span {
        border-radius: 8px;
        height: 34px;
        width: 34px;
    }

    .tcg-counter-select {
        align-items: center;
        flex-direction: row;
        margin-left: auto;
    }

    .tcg-counter-controls {
        align-items: center;
        flex-direction: row;
        margin-left: auto;
    }

    .tcg-counter-select .form-select {
        min-height: 36px;
        min-width: 0;
        padding-bottom: 4px;
        padding-top: 4px;
    }

    .tcg-fullscreen-btn {
        min-height: 36px;
        white-space: nowrap;
        width: auto;
    }

    .tcg-player-top .tcg-player-inner {
        transform: rotate(180deg);
    }

    .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(0, .95fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 72px);
        min-height: 0;
    }

    .tcg-player,
    .tcg-center-panel {
        min-height: 0;
    }

    .tcg-player-inner {
        gap: 8px;
        justify-content: space-between;
        overflow: hidden;
        padding: 10px;
    }

    .tcg-lp-display {
        font-size: clamp(3rem, 7vw, 5rem);
    }

    .tcg-player-name {
        font-size: .9rem;
        max-width: 140px;
        padding: 8px 10px;
    }

    .tcg-lp-badge {
        padding: 7px 9px;
    }

    .tcg-quick-row,
    .tcg-timer-actions {
        gap: 6px;
    }

    .tcg-quick-row button,
    .tcg-calc button,
    .tcg-timer-actions button,
    .tcg-reset {
        border-radius: 10px;
        min-height: 32px;
    }

    .tcg-calc {
        grid-template-columns: minmax(0, 1fr) 38px 38px 38px;
    }

    .tcg-calc-input {
        font-size: .95rem;
        padding: 0 10px;
    }

    .tcg-center-panel {
        gap: 8px;
        padding: 10px;
    }

    .tcg-round-card,
    .tcg-timer,
    .tcg-history {
        border-radius: 14px;
        padding: 8px 10px;
    }

    .tcg-round-card strong,
    .tcg-timer strong {
        font-size: 1.15rem;
    }

    .tcg-timer {
        align-items: center;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .tcg-timer-actions button {
        font-size: .82rem;
        line-height: 1.05;
        padding: 0 6px;
    }

    .tcg-history ol {
        max-height: 58px;
    }

    .tcg-tool {
        border-radius: 14px;
        min-height: 76px;
    }

    .tcg-tool-grid {
        gap: 8px;
    }

    .tcg-tool svg {
        height: 22px;
        width: 22px;
    }

    .tcg-tool span {
        font-size: .86rem;
    }

    .tcg-tool strong {
        font-size: 1.35rem;
    }

    .tcg-dice-stage {
        height: 38px;
        width: 38px;
    }

    .tcg-dice-cube,
    .tcg-dice-face {
        height: 34px;
        width: 34px;
    }

    .tcg-dice-face-1 { transform: rotateY(0deg) translateZ(17px); }
    .tcg-dice-face-2 { transform: rotateY(90deg) translateZ(17px); }
    .tcg-dice-face-3 { transform: rotateX(90deg) translateZ(17px); }
    .tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(17px); }
    .tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(17px); }
    .tcg-dice-face-6 { transform: rotateX(180deg) translateZ(17px); }

    .tcg-dice-face-1::before,
    .tcg-dice-face-2::before,
    .tcg-dice-face-3::before,
    .tcg-dice-face-4::before,
    .tcg-dice-face-5::before,
    .tcg-dice-face-6::before {
        height: 5px;
        width: 5px;
    }

    .tcg-dice-face-2::before {
        box-shadow: 20px 20px 0 #0f172a;
        left: 7px;
        top: 7px;
    }

    .tcg-dice-face-3::before {
        box-shadow: 10px 10px 0 #0f172a, 20px 20px 0 #0f172a;
        left: 7px;
        top: 7px;
    }

    .tcg-dice-face-4::before {
        box-shadow: 20px 0 0 #0f172a, 0 20px 0 #0f172a, 20px 20px 0 #0f172a;
        left: 7px;
        top: 7px;
    }

    .tcg-dice-face-5::before {
        box-shadow: 20px 0 0 #0f172a, 10px 10px 0 #0f172a, 0 20px 0 #0f172a, 20px 20px 0 #0f172a;
        left: 7px;
        top: 7px;
    }

    .tcg-dice-face-6::before {
        box-shadow: 0 10px 0 #0f172a, 0 20px 0 #0f172a, 20px 0 0 #0f172a, 20px 10px 0 #0f172a, 20px 20px 0 #0f172a;
        left: 7px;
        top: 7px;
    }
}

@media (orientation: landscape) and (max-width: 700px) and (max-height: 620px) {
    .tcg-counter-page {
        padding: 6px;
    }

    .tcg-counter-topbar {
        gap: 6px;
        margin-bottom: 6px;
    }

    .tcg-counter-brand {
        display: none;
    }

    .tcg-counter-board {
        gap: 4px;
        grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 42px);
    }

    .tcg-player-inner,
    .tcg-center-panel {
        gap: 4px;
        padding: 6px;
    }

    .tcg-lp-display {
        font-size: clamp(2.2rem, 6.4vw, 4rem);
    }

    .tcg-player-name {
        font-size: .76rem;
        max-width: 100px;
        padding: 5px 7px;
    }

    .tcg-quick-row {
        gap: 4px;
    }

    .tcg-quick-row button,
    .tcg-calc button,
    .tcg-timer-actions button,
    .tcg-reset {
        font-size: .72rem;
        min-height: 26px;
    }

    .tcg-calc {
        gap: 4px;
        grid-template-columns: minmax(0, 1fr) 28px 28px 28px;
    }

    .tcg-calc-input {
        font-size: .78rem;
        min-height: 26px;
        padding: 0 6px;
    }

    .tcg-round-card,
    .tcg-timer,
    .tcg-history {
        padding: 4px 5px;
    }

    .tcg-history {
        display: none;
    }

    .tcg-center-panel {
        grid-template-areas:
            "round timer"
            "tools tools";
    }

    .tcg-tool {
        min-height: 42px;
    }

    .tcg-tool svg,
    .tcg-tool > span:not(.tcg-dice-stage) {
        display: none;
    }
}

/* NEURON-inspired duel counter redesign. */
.tcg-counter-page {
    background:
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, .18), transparent 34rem),
        linear-gradient(135deg, #020617 0%, #08111f 46%, #010409 100%);
    height: var(--tcg-vh, 100dvh);
    min-height: var(--tcg-vh, 100dvh);
    overflow: hidden;
    padding: clamp(8px, 1.2vw, 16px);
}

.tcg-counter-topbar {
    background: rgba(2, 6, 23, .72);
    border: 1px solid rgba(56, 189, 248, .24);
    border-radius: 14px;
    box-shadow: inset 0 0 24px rgba(14, 165, 233, .08), 0 12px 36px rgba(0, 0, 0, .32);
    height: 46px;
    margin: 0 auto 10px;
    max-width: 1480px;
    padding: 5px 8px;
}

.tcg-counter-brand img,
.tcg-counter-brand span {
    background: linear-gradient(135deg, #22d3ee, #ff9900);
    border-radius: 9px;
    height: 34px;
    width: 34px;
}

.tcg-counter-brand strong {
    color: #e0f2fe;
    font-weight: 950;
    letter-spacing: .02em;
}

.tcg-counter-select .form-select,
.tcg-fullscreen-btn {
    border-radius: 10px;
    min-height: 34px;
}

.tcg-counter-board {
    align-items: stretch;
    display: grid;
    gap: clamp(8px, 1vw, 14px);
    grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr) minmax(0, 1fr);
    height: calc(var(--tcg-vh, 100dvh) - 68px);
    margin: 0 auto;
    max-width: 1480px;
    min-height: 0;
}

.tcg-player,
.tcg-center-panel {
    background:
        linear-gradient(180deg, rgba(8, 18, 34, .96), rgba(4, 10, 20, .94)),
        radial-gradient(circle at 50% 0%, rgba(34, 211, 238, .14), transparent 16rem);
    border: 1px solid rgba(125, 211, 252, .26);
    border-radius: 18px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .03),
        inset 0 0 38px rgba(14, 165, 233, .08),
        0 18px 48px rgba(0, 0, 0, .42);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.tcg-player::before,
.tcg-center-panel::before {
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, .72), transparent);
    content: "";
    height: 1px;
    left: 12%;
    position: absolute;
    right: 12%;
    top: 0;
}

.tcg-player-inner {
    gap: clamp(7px, 1.4vh, 14px);
    height: 100%;
    justify-content: space-between;
    min-height: 0;
    padding: clamp(12px, 2vw, 24px);
}

.tcg-player-name {
    background: rgba(2, 6, 23, .72);
    border-color: rgba(125, 211, 252, .28);
    border-radius: 12px;
    box-shadow: inset 0 0 18px rgba(14, 165, 233, .08);
}

.tcg-lp-badge {
    background: rgba(255, 153, 0, .16);
    border-color: rgba(255, 153, 0, .5);
    color: #ffd18a;
}

.tcg-lp-display {
    color: #f8fbff;
    font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif;
    font-size: clamp(4rem, min(8.5vw, 15vh), 8.2rem);
    letter-spacing: .02em;
    line-height: .84;
    text-shadow:
        0 0 18px rgba(125, 211, 252, .36),
        0 0 48px rgba(14, 165, 233, .18);
}

.tcg-quick-row {
    gap: clamp(5px, .8vw, 8px);
}

.tcg-quick-row button,
.tcg-calc button,
.tcg-timer-actions button,
.tcg-reset,
.tcg-tool {
    background:
        linear-gradient(180deg, rgba(21, 39, 64, .88), rgba(8, 17, 32, .96));
    border-color: rgba(125, 211, 252, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.tcg-calc {
    flex: 0 0 auto;
}

.tcg-center-panel {
    display: grid;
    gap: clamp(8px, 1.2vh, 12px);
    grid-template-rows: auto minmax(108px, .8fr) auto minmax(0, 1fr);
    padding: clamp(10px, 1.5vw, 16px);
    position: relative;
}

.tcg-round-card,
.tcg-timer,
.tcg-history {
    background: rgba(2, 6, 23, .58);
    border-color: rgba(125, 211, 252, .2);
}

.tcg-tool {
    min-height: 108px;
}

.tcg-tool svg {
    color: #22d3ee;
}

.tcg-tool strong {
    color: #ffd18a;
}

.tcg-history ol {
    max-height: min(18vh, 170px);
}

@media (max-width: 980px) {
    .tcg-counter-page {
        padding: 6px;
    }

    .tcg-counter-topbar {
        height: 38px;
        margin-bottom: 6px;
        padding: 3px 5px;
    }

    .tcg-counter-brand strong,
    .tcg-counter-select > span {
        display: none;
    }

    .tcg-counter-brand img,
    .tcg-counter-brand span {
        height: 30px;
        width: 30px;
    }

    .tcg-counter-select .form-select,
    .tcg-fullscreen-btn {
        font-size: .82rem;
        min-height: 30px;
        padding-bottom: 2px;
        padding-top: 2px;
    }

    .tcg-counter-board {
        gap: 5px;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) clamp(86px, 23vh, 150px) minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 44px);
        max-width: none;
    }

    .tcg-player,
    .tcg-center-panel {
        border-radius: 14px;
    }

    .tcg-player-top .tcg-player-inner {
        transform: rotate(180deg);
    }

    .tcg-player-inner {
        gap: 4px;
        padding: 6px;
    }

    .tcg-player-head {
        gap: 6px;
    }

    .tcg-player-name {
        font-size: calc(.78rem * var(--tcg-scale, 1));
        max-width: 128px;
        min-height: 26px;
        padding: 4px 7px;
    }

    .tcg-lp-badge {
        font-size: .64rem;
        padding: 4px 7px;
    }

    .tcg-lp-display {
        font-size: clamp(2.25rem, min(13vw, 8.8vh), 5.4rem);
        line-height: .82;
    }

    .tcg-quick-row {
        gap: 4px;
    }

    .tcg-quick-row button,
    .tcg-calc button,
    .tcg-timer-actions button,
    .tcg-reset {
        border-radius: 8px;
        font-size: calc(.76rem * var(--tcg-scale, 1));
        min-height: 26px;
        padding: 0 5px;
    }

    .tcg-calc {
        gap: 4px;
        grid-template-columns: minmax(0, 1fr) 30px 30px 30px;
    }

    .tcg-calc-input {
        border-radius: 8px;
        font-size: .8rem;
        min-height: 26px;
        padding: 0 7px;
    }

    .tcg-center-panel {
        display: grid;
        gap: 5px;
        grid-template-areas:
            "round timer"
            "tools tools";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, .45fr) minmax(0, .55fr);
        padding: 6px;
    }

    .tcg-center-panel .tcg-round-card {
        grid-area: round;
    }

    .tcg-center-panel .tcg-tool-grid {
        grid-area: tools;
    }

    .tcg-center-panel .tcg-timer {
        grid-area: timer;
    }

    .tcg-center-panel .tcg-history {
        display: none;
    }

    .tcg-round-card,
    .tcg-timer {
        border-radius: 10px;
        min-height: 0;
        padding: 5px 6px;
    }

    .tcg-round-card p,
    .tcg-timer span {
        font-size: .6rem;
        margin-bottom: 0;
    }

    .tcg-round-card strong,
    .tcg-timer strong {
        font-size: .95rem;
    }

    .tcg-tool-grid {
        gap: 5px;
    }

    .tcg-tool {
        border-radius: 10px;
        gap: 2px;
        min-height: 0;
    }

    .tcg-tool svg,
    .tcg-tool > span:not(.tcg-dice-stage) {
        display: none;
    }

    .tcg-tool strong {
        font-size: 1rem;
    }

    .tcg-dice-stage {
        height: 28px;
        width: 28px;
    }

    .tcg-dice-cube,
    .tcg-dice-face {
        height: 24px;
        width: 24px;
    }

    .tcg-dice-face {
        border-radius: 7px;
    }
}

@media (orientation: landscape) and (max-height: 620px) {
    .tcg-counter-topbar {
        height: 38px;
        margin-bottom: 6px;
    }

    .tcg-counter-board {
        gap: 5px;
        grid-template-columns: minmax(0, 1fr) minmax(0, .82fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 50px);
    }

    .tcg-player-inner {
        gap: 4px;
        padding: 6px;
    }

    .tcg-lp-display {
        font-size: clamp(2.2rem, min(6.8vw, 16vh), 4.8rem);
    }

    .tcg-center-panel {
        grid-template-rows: minmax(0, .45fr) minmax(0, .55fr);
    }
}

@media (orientation: landscape) and (max-width: 700px) and (max-height: 620px) {
    .tcg-counter-board {
        height: calc(var(--tcg-vh, 100dvh) - 48px);
    }

    .tcg-counter-brand {
        display: none;
    }

    .tcg-lp-display {
        font-size: clamp(2rem, min(6vw, 14vh), 3.8rem);
    }

    .tcg-player-name {
        max-width: 98px;
    }
}

.product-variant-list {
    display: grid;
    gap: 10px;
}

/* TCG Counter final duel-console layout inspired by modern LP counter apps. */
body.tcg-immersive-active {
    overflow: hidden;
}

.tcg-counter-page {
    --tcg-gap: clamp(8px, 1.1vw, 14px);
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 174, 239, .18), transparent 34rem),
        linear-gradient(135deg, #060a10 0%, #111827 48%, #08090d 100%);
    height: var(--tcg-vh, 100vh);
    min-height: var(--tcg-vh, 100vh);
    overflow: hidden;
    padding: clamp(8px, 1.2vw, 16px);
}

.tcg-counter-topbar {
    height: clamp(42px, 6vh, 56px);
    margin: 0 auto var(--tcg-gap);
    max-width: 1600px;
}

.tcg-counter-board {
    display: grid;
    gap: var(--tcg-gap);
    grid-template-columns: minmax(0, 1fr) minmax(230px, .72fr) minmax(0, 1fr);
    height: calc(var(--tcg-vh, 100vh) - clamp(86px, 12vh, 112px));
    margin: 0 auto;
    max-width: 1600px;
    min-height: 0;
}

.tcg-player,
.tcg-center-panel {
    border: 1px solid rgba(87, 121, 165, .45);
    border-radius: clamp(14px, 1.6vw, 22px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 22px 70px rgba(0, 0, 0, .34);
    min-height: 0;
}

.tcg-player {
    background:
        radial-gradient(circle at 50% 18%, rgba(46, 196, 255, .18), transparent 18rem),
        linear-gradient(180deg, rgba(16, 27, 46, .98), rgba(8, 13, 23, .96));
}

.tcg-player-inner {
    gap: clamp(8px, 1.2vh, 16px);
    justify-content: space-between;
    min-height: 0;
    overflow: hidden;
    padding: clamp(12px, 1.6vw, 24px);
}

.tcg-player-top .tcg-player-inner {
    transform: none;
}

.tcg-player-name {
    max-width: min(230px, 56%);
}

.tcg-lp-display {
    flex: 1 1 auto;
    font-size: clamp(4.3rem, min(11vw, 18vh), 10rem);
    min-height: 0;
}

.tcg-quick-row {
    flex: 0 0 auto;
}

.tcg-calc {
    flex: 0 0 auto;
}

.tcg-center-panel {
    background:
        linear-gradient(180deg, rgba(10, 17, 31, .98), rgba(7, 10, 18, .96));
    display: grid;
    gap: clamp(7px, 1vh, 12px);
    grid-template-rows: auto minmax(88px, .72fr) auto minmax(0, .9fr);
    padding: clamp(10px, 1.2vw, 16px);
}

.tcg-round-card,
.tcg-timer,
.tcg-history {
    padding: clamp(8px, 1vw, 14px);
}

.tcg-tool {
    min-height: clamp(82px, 16vh, 132px);
}

.tcg-history ol {
    max-height: clamp(70px, 22vh, 220px);
}

@media (max-width: 980px) {
    .tcg-counter-page {
        padding: max(5px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    }

    .tcg-counter-topbar {
        height: 34px;
        margin-bottom: 5px;
    }

    .tcg-counter-board {
        max-width: none;
    }

    .tcg-player-top .tcg-player-inner {
        transform: rotate(180deg);
    }

    .tcg-player-inner {
        gap: max(4px, calc(7px * var(--tcg-scale, 1)));
        padding: max(6px, calc(9px * var(--tcg-scale, 1)));
    }

    .tcg-player-name {
        font-size: max(.72rem, calc(.86rem * var(--tcg-scale, 1)));
        max-width: 48%;
        padding: 5px 7px;
    }

    .tcg-lp-badge {
        font-size: max(.62rem, calc(.72rem * var(--tcg-scale, 1)));
        padding: 5px 7px;
    }

    .tcg-lp-display {
        font-size: clamp(2.5rem, calc(15vw * var(--tcg-scale, 1)), 6rem);
        line-height: .86;
    }

    .tcg-quick-row {
        gap: 4px;
    }

    .tcg-quick-row button,
    .tcg-calc button,
    .tcg-timer-actions button,
    .tcg-reset {
        font-size: max(.68rem, calc(.78rem * var(--tcg-scale, 1)));
        min-height: max(25px, calc(29px * var(--tcg-scale, 1)));
    }

    .tcg-calc {
        gap: 4px;
        grid-template-columns: minmax(0, 1fr) max(28px, calc(34px * var(--tcg-scale, 1))) max(28px, calc(34px * var(--tcg-scale, 1))) max(28px, calc(34px * var(--tcg-scale, 1)));
    }

    .tcg-calc-input {
        font-size: max(.74rem, calc(.86rem * var(--tcg-scale, 1)));
        min-height: max(25px, calc(29px * var(--tcg-scale, 1)));
    }

    .tcg-center-panel {
        gap: 5px;
        padding: max(5px, calc(7px * var(--tcg-scale, 1)));
    }

    .tcg-round-card,
    .tcg-timer,
    .tcg-history {
        padding: 5px 6px;
    }

    .tcg-tool {
        min-height: max(46px, calc(62px * var(--tcg-scale, 1)));
    }

    .tcg-history ol {
        max-height: 30px;
    }
}

@media (max-width: 980px) and (orientation: portrait) {
    .tcg-counter-board {
        gap: 5px;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(96px, auto) minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 45px);
    }

    .tcg-center-panel {
        grid-template-areas:
            "round timer"
            "tools history";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto auto;
    }
}

@media (max-width: 980px) and (orientation: landscape) {
    .tcg-counter-board {
        gap: 5px;
        grid-template-columns: minmax(0, 1fr) minmax(170px, .82fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 45px);
    }

    .tcg-center-panel {
        display: grid;
        grid-template-areas:
            "round"
            "tools"
            "timer";
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .tcg-center-panel .tcg-history {
        display: none;
    }

    .tcg-tool-grid {
        gap: 5px;
    }
}

@media (max-width: 700px) and (orientation: landscape) {
    .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(132px, .72fr) minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 42px);
    }

    .tcg-counter-brand,
    .tcg-tool svg,
    .tcg-tool > span:not(.tcg-dice-stage) {
        display: none;
    }

    .tcg-lp-display {
        font-size: clamp(2.05rem, 6vw, 3.8rem);
    }

    .tcg-tool {
        min-height: 38px;
    }
}

/* TCG Counter requested layout: mobile is landscape-style without inverted players; center log fills desktop space. */
.tcg-center-panel {
    grid-template-rows: auto minmax(104px, auto) auto minmax(0, 1fr);
}

.tcg-history {
    display: flex;
    flex-direction: column;
}

.tcg-history ol {
    flex: 1 1 auto;
    height: 100%;
    max-height: none;
    min-height: 0;
}

@media (min-width: 981px) {
    .tcg-center-panel {
        height: 100%;
    }

    .tcg-tool-grid {
        min-height: 0;
    }
}

@media (max-width: 980px) {
    .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(138px, .78fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 44px);
    }

    .tcg-player-top .tcg-player-inner {
        transform: none;
    }

    .tcg-center-panel {
        grid-template-areas:
            "round"
            "tools"
            "timer";
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .tcg-center-panel .tcg-history {
        display: none;
    }
}

@media (max-width: 700px) and (orientation: landscape) {
    .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(120px, .66fr) minmax(0, 1fr);
        height: calc(var(--tcg-vh, 100dvh) - 42px);
    }
}

@media (max-width: 520px) and (orientation: portrait) {
    .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(112px, .62fr) minmax(0, 1fr);
    }

    .tcg-counter-select {
        display: none;
    }
}

.product-variant-item {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    padding: 10px;
}

.category-admin-list {
    display: grid;
    gap: 8px;
}

.category-tree-node {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 17, 17, .06);
    overflow: hidden;
}

.category-tree-node .category-tree-node {
    border: 0;
    border-left: 2px solid var(--amazon-gold);
    border-radius: 0;
    box-shadow: none;
    margin-left: 18px;
}

.category-tree-details {
    padding: 0;
}

.category-tree-summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 18px minmax(0, 1fr) auto auto;
    list-style: none;
    padding: 12px;
}

.category-tree-summary::-webkit-details-marker {
    display: none;
}

.category-tree-toggle::before {
    color: #565959;
    content: "▸";
    display: inline-block;
    transition: transform .15s ease;
}

.category-tree-details[open] > .category-tree-summary .category-tree-toggle::before {
    transform: rotate(90deg);
}

.category-tree-title {
    display: grid;
    gap: 2px;
}

.category-tree-children {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px 18px;
}

.category-picker {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    max-height: 320px;
    overflow: auto;
    padding: 10px;
}

.category-picker-path {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 6px;
    color: #565959;
    font-size: .875rem;
    margin-bottom: 8px;
    padding: 6px 8px;
}

.category-picker-root,
.category-picker-children {
    display: grid;
    gap: 4px;
}

.category-picker-children {
    border-left: 2px solid #ffd814;
    margin-left: 14px;
    padding-left: 10px;
}

.category-picker-summary {
    align-items: center;
    display: flex;
    gap: 6px;
    list-style: none;
}

.category-picker-summary::-webkit-details-marker {
    display: none;
}

.category-picker-toggle {
    flex: 0 0 12px;
}

.category-picker-toggle::before {
    color: #565959;
    content: "▸";
    display: inline-block;
    transition: transform .15s ease;
}

.category-picker-node[open] > .category-picker-summary .category-picker-toggle::before {
    transform: rotate(90deg);
}

.category-picker-option {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text-main);
    display: block;
    padding: 6px 8px;
    text-align: left;
    width: 100%;
}

.category-picker-option:hover,
.category-picker-option.is-selected {
    background: #fff8e1;
    color: #0f1111;
    font-weight: 700;
}

.is-category-locked .category-picker {
    background: #f7fafa;
}

.is-category-locked .category-picker-option {
    cursor: not-allowed;
    opacity: .72;
}

.category-picker-lock-message {
    border-top: 1px solid var(--amazon-border);
    color: #565959;
    font-size: .8125rem;
    margin-top: 8px;
    padding-top: 8px;
}

.update-log-list .list-group-item {
    border-color: var(--amazon-border);
}

.update-log-list .list-group-item.active {
    background: #232f3e;
    border-color: #232f3e;
}

.update-release-notes {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    color: #0f1111;
    font-family: inherit;
    font-size: .94rem;
    line-height: 1.65;
    margin: 0;
    max-height: 320px;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
}

.storefront-shell {
    margin: 0 auto;
    max-width: 1760px;
    padding: 0 40px;
}

.storefront-hero {
    background:
        linear-gradient(90deg, rgba(255, 153, 0, .12), transparent 34%),
        linear-gradient(180deg, #f7fafa 0%, #ffffff 100%);
    color: var(--text-main);
    overflow: hidden;
    padding: 0 0 52px;
}

.storefront-floating-notice {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-left: 5px solid var(--amazon-orange);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(15, 17, 17, .18);
    color: #37475a;
    display: flex;
    gap: 8px;
    font-size: .84rem;
    font-weight: 800;
    left: 32px;
    max-width: min(460px, calc(100vw - 64px));
    padding: 11px 14px;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1100;
}

.storefront-floating-notice svg {
    color: var(--amazon-orange-dark);
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.storefront-nav {
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(15, 17, 17, .08);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 14px 36px rgba(15, 17, 17, .18);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 0 -12px 44px;
    min-height: 74px;
    padding: 0 18px;
    position: relative;
    z-index: 30;
}

.storefront-logo,
.storefront-cart,
.storefront-nav nav {
    align-items: center;
    display: flex;
}

.storefront-logo {
    color: var(--amazon-navy);
    gap: 10px;
    text-decoration: none;
}

.storefront-logo span {
    align-items: center;
    background: var(--amazon-orange);
    border-radius: 8px;
    color: var(--amazon-navy);
    display: inline-flex;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.storefront-logo img {
    border-radius: 6px;
    height: 38px;
    object-fit: contain;
    width: auto;
    max-width: 150px;
}

.storefront-logo .brand-logo-rotator {
    align-items: center;
    background: transparent;
    border-radius: 0;
    color: inherit;
    display: inline-grid;
    font-weight: inherit;
    height: 38px;
    justify-content: stretch;
    min-width: min(230px, 54vw);
    position: relative;
    width: auto;
}

.storefront-logo .brand-logo-slide {
    align-items: center;
    background: transparent;
    border-radius: 0;
    color: inherit;
    display: flex;
    font-weight: inherit;
    gap: 10px;
    grid-area: 1 / 1;
    height: 38px;
    justify-content: flex-start;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
    width: auto;
}

.storefront-logo .brand-logo-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.storefront-logo .brand-logo-slide img {
    flex: 0 0 auto;
}

.storefront-logo .brand-logo-letter {
    align-items: center;
    background: var(--amazon-orange);
    border-radius: 8px;
    color: var(--amazon-navy);
    display: inline-flex;
    flex: 0 0 38px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.storefront-logo .brand-logo-slide strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storefront-category-page {
    background: #eaeded;
    min-height: 100vh;
    padding: 18px 0 64px;
}

.category-page-nav {
    margin-bottom: 22px;
}

.category-page-header {
    background: #fff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 22px;
}

.category-page-header h1 {
    color: var(--amazon-navy);
    font-weight: 800;
    margin: 0 0 8px;
}

.category-page-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: 280px minmax(0, 1fr);
}

.category-tree-sidebar {
    background: #fff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    padding: 16px;
    position: sticky;
    top: 18px;
}

.category-tree-sidebar h2 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.category-tree-sidebar ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.category-tree-sidebar ul ul {
    border-left: 1px solid #e3e6e6;
    margin-left: 10px;
    padding-left: 12px;
}

.category-tree-sidebar a {
    border-radius: 6px;
    color: #0f1111;
    display: block;
    padding: 7px 8px;
    text-decoration: none;
}

.category-tree-sidebar a:hover,
.category-tree-sidebar a.active {
    background: #fff3cd;
    color: var(--amazon-navy);
    font-weight: 800;
}

@media (max-width: 900px) {
    .category-page-layout {
        grid-template-columns: 1fr;
    }

    .category-tree-sidebar {
        position: static;
    }
}

.storefront-logo strong {
    font-size: 1.22rem;
    letter-spacing: .01em;
}

.storefront-nav nav {
    align-self: stretch;
    background: transparent;
    border: 0;
    border-radius: 0;
    gap: 2px;
    justify-content: center;
    min-width: 0;
    padding: 0;
}

.storefront-nav-categories {
    flex: 1 1 auto;
}

.storefront-nav-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.storefront-nav-group {
    align-items: stretch;
    display: flex;
    position: relative;
}

.storefront-nav-menu {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 22px 48px rgba(15, 17, 17, .22);
    display: none;
    gap: 22px;
    grid-template-columns: 240px minmax(360px, 1fr);
    left: 50%;
    min-width: min(760px, calc(100vw - 64px));
    padding: 22px;
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
    z-index: 20;
}

.storefront-nav-menu::before {
    background: var(--amazon-orange);
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.storefront-nav-group:hover .storefront-nav-menu,
.storefront-nav-group:focus-within .storefront-nav-menu {
    display: grid;
}

.storefront-nav-menu h3 {
    color: var(--amazon-navy);
    font-size: 1.45rem;
    font-weight: 950;
    margin: 0 0 8px;
}

.storefront-nav-menu p {
    color: #565959;
    margin: 0;
}

.storefront-nav-menu-links {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.storefront-nav-menu-links a {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px !important;
    color: var(--text-main) !important;
    display: flex;
    gap: 10px;
    min-height: 72px;
    padding: 12px !important;
    text-align: left;
}

.storefront-nav-menu-links a:hover {
    background: #fff7e6;
    border-color: #ffd28a;
}

.storefront-nav-menu-links svg {
    color: var(--amazon-orange-dark);
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.storefront-nav-menu-links span,
.storefront-nav-menu-links strong,
.storefront-nav-menu-links small {
    display: block;
}

.storefront-nav-menu-links strong {
    color: var(--amazon-navy);
    font-weight: 900;
}

.storefront-nav-menu-links small {
    color: #565959;
    font-size: .78rem;
    font-weight: 700;
    margin-top: 2px;
}

.storefront-nav nav a,
.storefront-cart {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: #37475a;
    font-weight: 800;
    padding: 24px 13px;
    text-decoration: none;
}

.storefront-nav nav a:hover,
.storefront-cart:hover {
    background: #f7fafa;
    color: var(--amazon-navy);
}

.storefront-nav nav a.storefront-account-link {
    align-items: center;
    color: var(--amazon-navy);
    display: inline-flex;
    gap: 7px;
    font-weight: 900;
    position: relative;
    z-index: 35;
}

.storefront-user-actions {
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    display: inline-flex;
    gap: 4px;
    padding: 3px;
}

.storefront-user-actions .storefront-account-link {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storefront-nav nav a.storefront-logout-link {
    align-items: center;
    background: #fff7e6;
    border: 1px solid rgba(255, 153, 0, .34);
    border-radius: 999px;
    color: #8a4b00;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 900;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    text-decoration: none;
    white-space: nowrap;
}

.storefront-nav nav a.storefront-logout-link:hover,
.storefront-nav nav a.storefront-logout-link:focus {
    background: var(--amazon-orange);
    color: #111827;
}

.storefront-account-link svg {
    height: 17px;
    width: 17px;
}

.storefront-account-avatar,
.tcg-auth-avatar {
    align-items: center;
    background: linear-gradient(180deg, #ffcf75, #ff9900);
    border: 1px solid rgba(17, 24, 39, .12);
    border-radius: 50%;
    color: #111827;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .8rem;
    font-weight: 950;
    height: 26px;
    justify-content: center;
    line-height: 1;
    width: 26px;
}

.storefront-account-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.storefront-logout-link svg {
    height: 15px;
    width: 15px;
}

.storefront-cart {
    align-self: stretch;
    border-left: 1px solid var(--amazon-border);
    cursor: pointer;
    gap: 7px;
    white-space: nowrap;
}

.storefront-cart span {
    background: var(--amazon-orange);
    border-radius: 999px;
    color: var(--amazon-navy);
    font-size: .78rem;
    font-weight: 900;
    min-width: 22px;
    padding: 1px 7px;
    text-align: center;
}

.storefront-cart svg {
    height: 18px;
    width: 18px;
}

.storefront-hero-grid {
    align-items: center;
    display: grid;
    gap: 54px;
    grid-template-columns: minmax(560px, 1.08fr) minmax(0, .92fr);
    min-height: 520px;
}

.storefront-kicker {
    color: var(--amazon-gold);
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .08em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.storefront-hero h1 {
    color: var(--amazon-navy);
    font-size: clamp(3.2rem, 6vw, 6.1rem);
    font-weight: 950;
    letter-spacing: 0;
    line-height: .94;
    margin-bottom: 18px;
}

.storefront-hero-copy p:not(.storefront-kicker) {
    color: #565959;
    font-size: 1.08rem;
    max-width: 650px;
}

.storefront-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.storefront-actions .btn {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.storefront-mat-preview {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(15, 17, 17, .14);
    padding: 22px;
}

.mat-art {
    aspect-ratio: 12 / 7;
    background:
        linear-gradient(135deg, rgba(255, 153, 0, .88), rgba(255, 62, 132, .78) 35%, rgba(0, 113, 133, .84)),
        #111820;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.mat-sun,
.mat-grid,
.mat-card {
    position: absolute;
}

.mat-sun {
    background: radial-gradient(circle, #ffffff 0, #ffd28a 42%, transparent 68%);
    border-radius: 999px;
    height: 170px;
    right: 12%;
    top: 11%;
    width: 170px;
}

.mat-grid {
    background:
        linear-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px);
    background-size: 34px 34px;
    inset: 0;
    mask-image: linear-gradient(transparent, #000 34%, #000);
}

.mat-card {
    background: rgba(255, 255, 255, .82);
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15, 17, 17, .3);
    height: 118px;
    width: 84px;
}

.mat-card-one {
    bottom: 17%;
    left: 15%;
    transform: rotate(-10deg);
}

.mat-card-two {
    bottom: 24%;
    left: 30%;
    transform: rotate(8deg);
}

.mat-toolbar {
    color: #37475a;
    display: flex;
    flex-wrap: wrap;
    font-size: .82rem;
    font-weight: 800;
    gap: 9px;
    margin-top: 14px;
    text-transform: uppercase;
}

.mat-toolbar span {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    padding: 7px 10px;
}

.storefront-band {
    background: #ffffff;
    padding: 76px 0;
}

.featured-carousel-band {
    background:
        linear-gradient(180deg, #ffffff 0, #fff7e6 100%);
    padding-top: 54px;
}

.featured-carousel {
    --featured-visible-count: 4;
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
}

.featured-carousel-window {
    overflow: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.featured-carousel-track {
    display: grid;
    gap: 18px;
    grid-auto-columns: calc((100% - 54px) / 4);
    grid-auto-flow: column;
}

.featured-carousel[data-visible-count="1"] .featured-carousel-track {
    grid-auto-columns: 100%;
}

.featured-carousel[data-visible-count="2"] .featured-carousel-track {
    grid-auto-columns: calc((100% - 18px) / 2);
}

.featured-carousel[data-visible-count="3"] .featured-carousel-track {
    grid-auto-columns: calc((100% - 36px) / 3);
}

.featured-carousel[data-visible-count="4"] .featured-carousel-track {
    grid-auto-columns: calc((100% - 54px) / 4);
}

.featured-carousel[data-visible-count="5"] .featured-carousel-track {
    grid-auto-columns: calc((100% - 72px) / 5);
}

.featured-carousel[data-visible-count="6"] .featured-carousel-track {
    grid-auto-columns: calc((100% - 90px) / 6);
}

.featured-carousel-control {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(15, 17, 17, .12);
    color: var(--amazon-navy);
    cursor: pointer;
    display: inline-flex;
    height: 46px;
    justify-content: center;
    padding: 0;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
    width: 46px;
}

.featured-carousel-control:hover {
    background: #fff7e6;
    border-color: #ffd28a;
    transform: translateY(-1px);
}

.featured-carousel-control svg {
    height: 22px;
    width: 22px;
}

.featured-product-card {
    min-width: 0;
    position: relative;
    scroll-snap-align: start;
}

.featured-hot-badge {
    align-items: center;
    background: linear-gradient(180deg, #ff9900 0%, #f08804 100%);
    border: 1px solid rgba(127, 74, 0, .22);
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(240, 136, 4, .24);
    color: #111827 !important;
    display: inline-flex;
    font-size: .72rem !important;
    font-weight: 950 !important;
    gap: 4px;
    left: 12px;
    letter-spacing: 0;
    line-height: 1;
    padding: 7px 9px;
    position: absolute;
    text-transform: none !important;
    top: 12px;
    z-index: 5;
}

.featured-hot-badge svg {
    height: 14px;
    width: 14px;
}

.featured-product-card .product-card-body h3 {
    display: -webkit-box;
    min-height: 40px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-feature-band {
    padding-top: 42px;
}

.home-feature-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-feature-grid article {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 17, 17, .08);
    overflow: hidden;
}

.home-feature-art {
    aspect-ratio: 16 / 9;
    background: #f7fafa;
}

.home-feature-art.is-custom {
    background:
        radial-gradient(circle at 28% 32%, rgba(255, 255, 255, .95), transparent 16%),
        linear-gradient(135deg, #ff9900, #007185 62%, #232f3e);
}

.home-feature-art.is-vibrant {
    background:
        linear-gradient(120deg, rgba(255,255,255,.32) 0 12%, transparent 12% 24%, rgba(255,255,255,.26) 24% 36%, transparent 36%),
        linear-gradient(135deg, #f08804, #d946ef 48%, #007185);
}

.home-feature-art.is-artist {
    background:
        radial-gradient(circle at 72% 24%, #febd69, transparent 20%),
        linear-gradient(135deg, #131921, #37475a 55%, #ff9900);
}

.home-feature-grid h2 {
    color: var(--amazon-navy);
    font-size: 1.45rem;
    font-weight: 950;
    margin: 18px 18px 8px;
}

.home-feature-grid p {
    color: #565959;
    margin: 0 18px 20px;
}

.category-showcase-band {
    background: #f7fafa;
    padding-top: 34px;
}

.storefront-band.is-light {
    background: #f7fafa;
}

.storefront-section-heading {
    margin-bottom: 24px;
    max-width: 720px;
}

.storefront-section-heading h2,
.artist-program h2 {
    color: var(--amazon-navy);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 950;
    line-height: 1;
}

.storefront-section-heading p:not(.storefront-kicker),
.artist-program p {
    color: #565959;
    font-size: 1.02rem;
}

.customizer-panel {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 10px;
    box-shadow: 0 18px 42px rgba(15, 17, 17, .1);
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    padding: 18px;
}

.customizer-canvas {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(35, 47, 62, .96), rgba(15, 17, 17, .88)),
        #232f3e;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 330px;
    padding: 20px;
}

.upload-drop {
    align-items: center;
    border: 2px dashed rgba(255, 255, 255, .34);
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    height: auto;
    justify-content: center;
    aspect-ratio: 62 / 37;
    max-width: 980px;
    min-height: 0;
    overflow: hidden;
    position: relative;
    text-align: center;
    width: 100%;
}

.upload-drop input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.upload-drop img {
    display: none;
    height: auto;
    left: 50%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center center;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center;
    width: auto;
}

.upload-drop.has-preview {
    border-color: var(--amazon-gold);
    cursor: grab;
    touch-action: none;
}

.upload-drop.has-preview img {
    display: block;
}

.upload-drop.has-preview.is-dragging {
    cursor: grabbing;
}

.upload-drop-empty {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-drop.has-preview .upload-drop-empty {
    display: none;
}

.upload-drop.has-preview .upload-drop-empty svg {
    display: none;
}

.upload-drop.has-preview .upload-drop-empty strong {
    font-size: .9rem;
}

.custom-bleed-guide {
    border: 2px dashed rgba(255, 255, 255, .9);
    bottom: 2.703%;
    box-shadow: 0 0 0 999px rgba(255, 153, 0, .08);
    left: 1.613%;
    pointer-events: none;
    position: absolute;
    right: 1.613%;
    top: 2.703%;
    z-index: 3;
}

.custom-bleed-guide::after {
    background: rgba(15, 17, 17, .68);
    border-radius: 999px;
    bottom: 8px;
    color: #ffffff;
    content: "Bleed guide";
    font-size: .72rem;
    font-weight: 800;
    padding: 4px 8px;
    position: absolute;
    right: 8px;
}

.custom-playzone-preview {
    display: none !important;
    bottom: auto !important;
    object-fit: contain !important;
    pointer-events: none;
    position: absolute;
    transform: none !important;
    height: 91.892% !important;
    left: 2.419% !important;
    max-height: none !important;
    max-width: none !important;
    top: 4.054% !important;
    width: 95.162% !important;
    z-index: 2;
}

.custom-playzone-preview.is-visible {
    display: block !important;
}

.upload-drop svg {
    color: var(--amazon-gold);
    height: 48px;
    margin-bottom: 12px;
    width: 48px;
}

.upload-drop strong {
    font-size: 1.5rem;
}

.upload-drop span {
    color: rgba(255, 255, 255, .68);
}

.custom-upload-button {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
}

.custom-upload-button input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.customizer-controls {
    display: grid;
    gap: 14px;
}

.customizer-controls label,
.customizer-upgrades span,
.customizer-file-notes strong {
    color: #37475a;
    font-weight: 800;
}

.customizer-controls .form-select,
.customizer-controls .form-control {
    margin-top: 7px;
}

.customizer-upgrades,
.customizer-file-notes {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 12px;
}

.customizer-upgrades label {
    align-items: center;
    color: #0f1111;
    display: flex;
    font-weight: 700;
    gap: 8px;
}

.customizer-file-notes span {
    color: #565959;
    font-size: .9rem;
}

.storefront-product-grid,
.category-grid,
.learn-grid {
    display: grid;
    gap: 18px;
}

.storefront-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.storefront-category-block {
    margin-top: 28px;
}

.storefront-category-block > h3 {
    color: var(--amazon-navy);
    font-size: 1.35rem;
    font-weight: 950;
    margin-bottom: 14px;
}

.storefront-subcategory-heading {
    align-items: center;
    display: flex;
    margin: 16px 0 10px;
}

.storefront-subcategory-heading span {
    background: #fff7e6;
    border: 1px solid #ffd28a;
    border-radius: 999px;
    color: #7a4b00;
    font-size: .85rem;
    font-weight: 900;
    padding: 6px 11px;
}

.storefront-product-card,
.category-tile,
.learn-grid article {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 17, 17, .08);
    overflow: hidden;
}

.product-art {
    aspect-ratio: 1 / 1;
    background: #f7fafa;
}

.product-art-image {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.product-art-link {
    background: #f7fafa;
    display: block;
    text-decoration: none;
}

.product-art.is-solar {
    background: radial-gradient(circle at 70% 25%, #fff7e6, transparent 22%), linear-gradient(135deg, #ff9900, #8f2f00);
}

.product-art.is-arcade {
    background: linear-gradient(135deg, #007185, #232f3e 58%, #ff3e84);
}

.product-art.is-moon {
    background: radial-gradient(circle at 70% 25%, #f7fafa, transparent 18%), linear-gradient(135deg, #111820, #52616f);
}

.product-art.is-obsidian {
    background: linear-gradient(135deg, #0f1111, #37475a 60%, #f08804);
}

.product-card-body {
    padding: 14px;
}

.product-card-body span {
    color: #565959;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.product-card-body h3 {
    color: var(--amazon-navy);
    font-size: 1rem;
    font-weight: 900;
    margin: 7px 0 12px;
}

.product-card-body h3 a {
    color: inherit;
    text-decoration: none;
}

.product-card-body h3 a:hover {
    color: var(--amazon-link);
    text-decoration: underline;
}

.product-card-body p {
    color: #565959;
    display: -webkit-box;
    font-size: .9rem;
    line-height: 1.35;
    margin: 0 0 12px;
    min-height: 38px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card-body div {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.storefront-price {
    align-items: baseline;
    color: #b12704;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 900;
}

.storefront-price del {
    color: #565959;
    font-size: .86rem;
    font-weight: 700;
}

.storefront-price strong {
    color: #b12704;
}

.storefront-card-actions {
    display: inline-flex;
    gap: 6px;
}

.storefront-product-modal-body {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1fr);
}

.storefront-modal-image {
    aspect-ratio: 4 / 3;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    object-fit: cover;
    width: 100%;
}

.storefront-modal-image.is-empty {
    background: linear-gradient(135deg, #007185, #232f3e 58%, #ff3e84);
}

.storefront-cart-backdrop {
    background: rgba(15, 17, 17, .48);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .18s ease;
    z-index: 1040;
}

.storefront-cart-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.storefront-cart-drawer {
    background: #ffffff;
    bottom: 0;
    box-shadow: -18px 0 44px rgba(15, 17, 17, .26);
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    max-width: min(430px, 100vw);
    padding: 22px;
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(105%);
    transition: transform .22s ease;
    width: 430px;
    z-index: 1050;
}

.storefront-cart-drawer.is-open {
    transform: translateX(0);
}

.cart-drawer-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--amazon-border);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding-bottom: 16px;
}

.cart-drawer-header h2 {
    color: var(--amazon-navy);
    font-size: 1.45rem;
    font-weight: 950;
    margin: 0;
}

.cart-shipping-meter {
    border-bottom: 1px solid var(--amazon-border);
    color: #565959;
    display: grid;
    font-size: .92rem;
    gap: 10px;
    padding: 16px 0;
}

.cart-shipping-meter div {
    background: #eaeded;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.cart-shipping-meter div span {
    background: var(--amazon-orange);
    display: block;
    height: 100%;
    width: 38%;
}

.cart-drawer-items {
    display: grid;
    gap: 12px;
    overflow-y: auto;
    padding: 16px 0;
}

.cart-empty {
    align-content: center;
    background: #f7fafa;
    border: 1px dashed var(--amazon-border);
    border-radius: 8px;
    color: #565959;
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 210px;
    padding: 24px;
    text-align: center;
}

.cart-empty svg {
    color: var(--amazon-orange-dark);
    height: 34px;
    width: 34px;
}

.cart-empty strong {
    color: var(--amazon-navy);
}

.cart-line {
    align-items: center;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    padding: 10px;
}

.cart-line img,
.cart-line-art {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #007185, #232f3e 58%, #ff9900);
    border-radius: 6px;
    object-fit: cover;
    width: 64px;
}

.cart-line strong,
.cart-line span {
    display: block;
}

.cart-line strong {
    color: var(--amazon-navy);
    font-size: .95rem;
    font-weight: 900;
}

.cart-line span {
    color: #565959;
    font-size: .82rem;
    margin-top: 2px;
}

.cart-line button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #565959;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.cart-line button:hover {
    color: #b12704;
}

.cart-line button svg {
    height: 17px;
    width: 17px;
}

.cart-drawer-footer {
    border-top: 1px solid var(--amazon-border);
    display: grid;
    gap: 10px;
    padding-top: 16px;
}

.cart-total-lines {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 10px 12px;
}

.cart-total-lines div {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.cart-total-lines div:last-child {
    border-top: 1px solid var(--amazon-border);
    color: var(--amazon-red);
    font-size: 1.02rem;
    margin-top: 2px;
    padding-top: 8px;
}

.guide-hero .card-body {
    align-items: center;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
}

.guide-hero h2 {
    font-size: 1.8rem;
    font-weight: 900;
}

.guide-flow {
    align-items: center;
    background: linear-gradient(135deg, #fff8e1, #f7fafa);
    border: 1px solid var(--amazon-border);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 22px;
}

.guide-flow span {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 17, 17, .08);
    font-weight: 800;
    padding: 8px 12px;
}

.guide-layout {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: 260px minmax(0, 1fr);
}

.guide-toc {
    position: sticky;
    top: 88px;
}

.guide-toc a {
    border-radius: 8px;
    color: var(--amazon-link);
    display: block;
    font-weight: 700;
    padding: 8px 10px;
    text-decoration: none;
}

.guide-toc a:hover {
    background: #f7fafa;
}

.guide-content {
    display: grid;
    gap: 22px;
}

.guide-section h2 {
    color: var(--amazon-navy);
    font-weight: 900;
}

.guide-section h3 {
    font-size: 1rem;
    font-weight: 900;
}

.guide-section ol {
    margin-bottom: 0;
}

.guide-section li {
    margin-bottom: 8px;
}

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

.guide-step-grid article {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 10px;
    padding: 14px;
}

.guide-step-grid p {
    color: #565959;
    margin-bottom: 0;
}

.guide-screenshot {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 12px;
    box-shadow: inset 0 0 0 8px #f7fafa;
    margin-top: 18px;
    overflow: hidden;
    padding: 18px;
}

.guide-shot-top {
    background: var(--amazon-navy);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 900;
    margin-bottom: 14px;
    padding: 10px 12px;
}

.guide-shot-grid,
.guide-shot-form,
.guide-storefront-shot {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-shot-grid span,
.guide-shot-form span,
.guide-storefront-shot span {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-left: 4px solid var(--amazon-orange-dark);
    border-radius: 8px;
    font-weight: 800;
    min-height: 56px;
    padding: 12px;
}

.guide-shot-chart {
    background: repeating-linear-gradient(90deg, #ffd814 0 18px, #ffa41c 18px 34px, #f7fafa 34px 46px);
    border-radius: 8px;
    height: 72px;
    margin-top: 14px;
    opacity: .9;
}

.guide-media-row {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-top: 14px;
}

.guide-media-row svg {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 10px;
    color: var(--amazon-orange-dark);
    height: 58px;
    padding: 14px;
    width: 58px;
}

.guide-order-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 14px;
}

@media (max-width: 1100px) {
    .guide-hero .card-body,
    .guide-layout {
        grid-template-columns: 1fr;
    }

    .guide-toc {
        position: static;
    }
}

@media (max-width: 760px) {
    .guide-step-grid,
    .guide-shot-grid,
    .guide-shot-form,
    .guide-storefront-shot {
        grid-template-columns: 1fr;
    }

    .admin-language-switch span {
        display: none;
    }
}

.cart-terms {
    align-items: center;
    color: #565959;
    display: flex;
    font-size: .88rem;
    gap: 8px;
}

.product-detail-page {
    background: #ffffff;
    min-height: 100vh;
    padding: 24px 0 80px;
}

.product-breadcrumb {
    align-items: center;
    color: #565959;
    display: flex;
    flex-wrap: wrap;
    font-size: .9rem;
    gap: 8px;
    margin-bottom: 22px;
}

.product-breadcrumb a {
    color: var(--amazon-link);
    text-decoration: none;
}

.product-breadcrumb a:hover {
    text-decoration: underline;
}

.product-breadcrumb strong {
    color: var(--text-main);
}

.product-detail-layout {
    align-items: start;
    display: grid;
    gap: 36px;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
}

.product-gallery {
    display: grid;
    gap: 16px;
    grid-template-columns: 86px minmax(0, 1fr);
    position: sticky;
    top: 24px;
}

.product-thumbs {
    display: grid;
    gap: 10px;
    align-content: start;
}

.product-thumbs button {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    padding: 6px;
}

.product-thumbs button:hover,
.product-thumbs button:focus {
    border-color: var(--amazon-orange);
    outline: 2px solid rgba(255, 153, 0, .22);
}

.product-thumbs img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.product-video-thumb {
    align-items: center;
    background: #111827;
    border-radius: 6px;
    color: #fff;
    display: flex;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.product-video-thumb svg {
    height: 24px;
    width: 24px;
}

.product-thumbs .is-empty svg {
    color: #8b96a3;
    height: 24px;
    width: 24px;
}

.product-main-image {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    padding: 22px;
}

.product-main-image img,
.product-main-image video {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.product-main-image-empty {
    align-items: center;
    background: linear-gradient(135deg, #007185, #232f3e 58%, #ff9900);
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.product-main-image-empty svg {
    height: 58px;
    width: 58px;
}

.product-purchase-panel {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 17, 17, .12);
    display: grid;
    gap: 16px;
    padding: 24px;
    position: sticky;
    top: 24px;
}

.product-purchase-panel h1 {
    color: var(--amazon-navy);
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1;
    margin: 0;
}

.product-brand-link {
    color: var(--amazon-link);
    font-weight: 800;
    text-decoration: none;
}

.product-brand-link:hover {
    text-decoration: underline;
}

.product-price {
    align-items: baseline;
    color: #b12704;
    display: flex;
    flex-wrap: wrap;
    font-size: 1.8rem;
    font-weight: 900;
    gap: 10px;
}

.product-price del {
    color: #565959;
    font-size: 1.1rem;
}

.product-price strong {
    color: #b12704;
}

.product-option-group {
    display: grid;
    gap: 8px;
}

.product-option-group > span,
.product-quantity {
    color: #37475a;
    font-weight: 900;
}

.product-option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-option-buttons button,
.product-variant-list a {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    color: var(--text-main);
    font-weight: 800;
    padding: 10px 12px;
}

.product-option-buttons button.is-selected {
    border-color: var(--amazon-orange);
    box-shadow: 0 0 0 2px rgba(255, 153, 0, .22);
}

.product-variant-list {
    display: grid;
    gap: 8px;
}

.product-variant-list a {
    display: block;
    text-decoration: none;
}

.product-variant-list strong,
.product-variant-list small {
    display: block;
}

.product-variant-list small {
    color: #565959;
    margin-top: 2px;
}

.product-quantity {
    display: grid;
    gap: 7px;
}

.product-detail-content {
    display: grid;
    gap: 22px;
    margin-top: 56px;
    max-width: 980px;
}

.product-detail-content article {
    border-top: 1px solid var(--amazon-border);
    padding-top: 24px;
}

.product-detail-content h2 {
    color: var(--amazon-navy);
    font-size: 1.65rem;
    font-weight: 950;
    margin-bottom: 12px;
}

.product-detail-content h3 {
    color: var(--amazon-navy);
    font-size: 1.2rem;
    font-weight: 900;
    margin-top: 20px;
}

.product-detail-content p,
.product-detail-content li {
    color: #37475a;
    font-size: 1rem;
    line-height: 1.7;
}

.admin-soft-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f7fafa 100%);
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .74);
    padding: 16px;
}

.featured-product-manager {
    display: grid;
    gap: 12px;
}

.featured-product-current-list {
    display: grid;
    gap: 10px;
}

.featured-product-admin-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 12px;
}

.featured-product-drag {
    align-items: center;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    color: #565959;
    cursor: default;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 42px;
}

.featured-product-row-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.featured-product-meta {
    color: #565959;
    font-size: .82rem;
    font-weight: 700;
}

.featured-product-row-actions,
.featured-product-add-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.featured-product-add-row {
    background: #fff7e6;
    border: 1px dashed #f0b44c;
    border-radius: 8px;
    padding: 12px;
}

.featured-product-add-row .form-select {
    flex: 1 1 280px;
}

.featured-product-add-row [data-featured-add-search] {
    flex: 1 1 240px;
    min-width: min(100%, 220px);
}

.featured-product-empty {
    background: #ffffff;
    border: 1px dashed var(--amazon-border);
    border-radius: 8px;
    color: #565959;
    font-weight: 700;
    padding: 14px;
    text-align: center;
}

.custom-playzone-admin-preview {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 12px;
}

.custom-playzone-admin-list {
    display: grid;
    gap: 10px;
}

.custom-order-thumb {
    aspect-ratio: 12 / 7;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 6px;
    object-fit: contain;
    width: 150px;
}

.admin-nav-section {
    margin: 14px 12px 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.amazon-stars {
    color: #ffa41c;
    letter-spacing: 1px;
    white-space: nowrap;
}

.product-reviews-panel {
    margin-top: 36px;
    padding: 30px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    background: #fff;
}

.product-review-summary {
    display: grid;
    grid-template-columns: minmax(240px, 0.75fr) minmax(280px, 1fr);
    gap: 32px;
    align-items: start;
}

.product-rating-line {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 10px 0;
}

.product-review-form {
    display: grid;
    gap: 12px;
}

.product-review-form label,
.account-lookup label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.product-review-list {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.product-review-card {
    padding-top: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.product-review-card h3 {
    margin: 6px 0;
    font-size: 1rem;
}

.storefront-account-page {
    padding: 34px 0 60px;
}

.account-header {
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
}

.account-header h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin: 0;
}

.account-lookup {
    display: grid;
    grid-template-columns: minmax(260px, 420px) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 28px;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1fr);
    gap: 18px;
}

.account-panel {
    padding: 22px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.account-panel h2 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.account-list {
    display: grid;
    gap: 12px;
}

.account-line {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    background: #f8fafc;
}

.account-line img {
    width: 84px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}

.account-line div {
    display: grid;
    gap: 3px;
}

@media (max-width: 900px) {
    .product-review-summary,
    .account-lookup,
    .account-grid {
        grid-template-columns: 1fr;
    }
}

.custom-playzone-admin-preview img {
    background: repeating-conic-gradient(#e7e7e7 0 25%, #ffffff 0 50%) 50% / 18px 18px;
    border: 1px solid var(--amazon-border);
    border-radius: 6px;
    height: 72px;
    object-fit: contain;
    width: 124px;
}

.category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-tile {
    color: var(--text-main);
    padding: 20px;
    text-decoration: none;
}

.category-tile:hover {
    border-color: var(--amazon-gold);
    color: var(--text-main);
}

.email-preview {
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 6px;
    color: #37475a;
    margin: 8px 0 0;
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    white-space: pre-wrap;
}

.admin-mail-tabs {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
}

.admin-mail-tabs a {
    align-items: center;
    border-radius: 6px;
    color: #37475a;
    display: inline-flex;
    font-weight: 800;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    text-decoration: none;
}

.admin-mail-tabs a.active {
    background: var(--amazon-orange);
    color: var(--amazon-navy);
}

.email-search-box {
    position: relative;
}

.email-recipient-composer {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 46px;
    padding: 6px;
    position: relative;
}

.email-recipient-composer:focus-within {
    border-color: var(--amazon-orange);
    box-shadow: 0 0 0 .2rem rgba(255, 153, 0, .2);
}

.email-recipient-composer > input {
    border: 0;
    flex: 1 1 240px;
    min-height: 32px;
    outline: 0;
}

.email-recipient-pills {
    display: contents;
}

.email-recipient-pill {
    align-items: center;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    color: #37475a;
    display: inline-flex;
    font-size: .9rem;
    font-weight: 700;
    gap: 6px;
    min-height: 32px;
    padding: 4px 8px 4px 11px;
}

.email-recipient-pill button {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 999px;
    color: #565959;
    display: inline-flex;
    font-weight: 900;
    height: 20px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 20px;
}

.email-search-results {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 17, 17, .16);
    left: 0;
    max-height: 280px;
    overflow: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1060;
}

.email-search-results button {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e7e7e7;
    display: block;
    padding: 11px 12px;
    text-align: left;
    width: 100%;
}

.email-search-results button:hover,
.email-search-results button:focus {
    background: #fffaf2;
}

.email-search-results strong,
.email-search-results span {
    display: block;
}

.email-search-results span,
.email-search-empty {
    color: #565959;
    font-size: .88rem;
}

.email-search-empty {
    padding: 12px;
}

.email-rich-editor {
    background: #ffffff;
    min-height: 260px;
}

.email-rich-editor .ql-editor {
    min-height: 260px;
}

.email-rich-editor .ql-editor img {
    border-radius: 6px;
    display: block;
    margin: 10px 0;
    max-width: 100%;
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
    border-color: var(--amazon-border) !important;
}

.ql-toolbar.ql-snow {
    border-radius: 7px 7px 0 0;
}

.ql-container.ql-snow {
    border-radius: 0 0 7px 7px;
}

.email-contact-picker {
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    display: grid;
    max-height: 430px;
    overflow: auto;
}

.email-contact-option {
    align-items: flex-start;
    background: #ffffff;
    border-bottom: 1px solid #e7e7e7;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    cursor: pointer;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 12px;
    text-align: left;
    width: 100%;
}

.email-contact-picker.is-compact {
    max-height: 250px;
}

.email-contact-option:last-child {
    border-bottom: 0;
}

.email-contact-option:hover {
    background: #fffaf2;
}

.email-contact-option input {
    margin-top: 4px;
}

.email-contact-option span,
.email-contact-option small,
.email-contact-option em {
    display: block;
}

.email-contact-option strong {
    color: var(--amazon-navy);
}

.email-contact-option small {
    color: #565959;
}

.email-contact-option em {
    color: var(--amazon-link);
    font-size: .8rem;
    font-style: normal;
    margin-top: 3px;
}

.email-detail-toolbar {
    align-items: center;
    background: #f7fafa;
    border-bottom: 1px solid var(--amazon-border);
    display: flex;
    justify-content: space-between;
    min-height: 56px;
    padding: 12px 16px;
}

.email-detail-frame {
    background: #ffffff;
    border: 0;
    display: block;
    min-height: 620px;
    width: 100%;
}

.checkout-address-list,
.account-address-list,
.account-order-list,
.admin-order-list {
    display: grid;
    gap: 12px;
}

.checkout-address-card,
.account-address-card,
.account-order-card,
.admin-order-card {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    padding: 14px;
}

.checkout-address-card {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: 10px;
}

.checkout-address-card input {
    margin-top: 4px;
}

.checkout-address-card span,
.checkout-address-card small,
.account-address-card span,
.account-address-card small {
    display: block;
}

.checkout-address-card em {
    background: #fff3cd;
    border-radius: 999px;
    color: #7a4b00;
    font-size: .75rem;
    font-style: normal;
    font-weight: 800;
    margin-left: 6px;
    padding: 2px 7px;
}

.account-orders-panel {
    grid-column: 1 / -1;
}

.account-order-head,
.checkout-line-item {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.admin-page-heading {
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #f7fafa);
    border: 1px solid var(--amazon-border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 18px 20px;
}

.admin-page-kicker {
    color: var(--amazon-orange-dark);
    display: block;
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .04em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.admin-count-pill,
.admin-date-badge {
    background: #e7f4f5;
    border: 1px solid #b9dfe4;
    border-radius: 999px;
    color: #0f4c5c;
    font-size: .86rem;
    font-weight: 800;
    padding: 7px 12px;
    white-space: nowrap;
}

.admin-filter-panel {
    background: #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
    margin-bottom: 16px;
    padding: 14px;
}

.admin-filter-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.admin-order-card {
    box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
    overflow: hidden;
    padding: 0;
}

.admin-order-head {
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #f8fbfb);
    border-bottom: 1px solid var(--amazon-border);
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px 18px;
}

.admin-order-title strong {
    color: #111827;
    display: block;
    font-size: 1.02rem;
    font-weight: 900;
}

.admin-order-title span {
    color: #565959;
    display: block;
    margin-top: 3px;
}

.admin-order-total-box {
    background: #ffffff;
    border: 1px solid #d5e7ea;
    border-radius: 10px;
    min-width: 190px;
    padding: 10px 12px;
    text-align: right;
}

.admin-order-total-box strong {
    color: #111827;
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    margin-top: 4px;
}

.admin-order-total-box small {
    color: #565959;
    display: block;
    margin-top: 2px;
}

.admin-order-head span,
.account-order-head small,
.admin-order-meta small,
.admin-order-item small,
.account-order-item small,
.checkout-line-item small {
    color: #565959;
    display: block;
}

.admin-order-meta {
    background: #f7fafa;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 14px 18px;
}

.admin-order-fact {
    background: #ffffff;
    border: 1px solid #e2e8ea;
    border-radius: 8px;
    min-width: 0;
    padding: 12px;
}

.admin-order-fact > span {
    color: #6b7280;
    display: block;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.admin-order-fact strong {
    color: #111827;
    display: block;
    font-weight: 900;
}

.account-order-items,
.admin-order-items {
    display: grid;
    gap: 12px;
    padding: 14px 18px 4px;
}

.account-order-item,
.checkout-line-item {
    border-top: 1px solid #e7e7e7;
    padding-top: 10px;
}

.admin-order-item {
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) 220px;
    padding: 14px;
}

.account-order-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.account-order-item img,
.admin-order-item img,
.checkout-line-item img,
.custom-order-thumb {
    aspect-ratio: 1;
    background: #f7fafa;
    border: 1px solid var(--amazon-border);
    border-radius: 6px;
    object-fit: contain;
    width: 76px;
}

.custom-order-thumb.is-empty {
    display: inline-block;
}

.account-order-item > div:nth-child(2),
.checkout-line-item > div:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-order-product-main {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 84px minmax(0, 1fr);
    min-width: 0;
}

.admin-order-product-media {
    align-items: center;
    display: flex;
    justify-content: center;
}

.admin-order-product-copy {
    min-width: 0;
}

.admin-order-product-copy strong {
    color: #111827;
    display: block;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.35;
}

.admin-order-product-copy small {
    color: #565959;
    display: block;
    margin-top: 4px;
}

.account-order-item-meta,
.checkout-line-item-meta {
    flex: 0 0 auto;
    text-align: right;
}

.admin-order-price {
    align-self: stretch;
    background: #fffaf0;
    border: 1px solid #f0c36d;
    border-radius: 10px;
    box-shadow: inset 4px 0 0 var(--amazon-orange);
    display: grid !important;
    gap: 0;
    min-width: 0;
    padding: 10px 12px;
    text-align: left !important;
}

.admin-order-price-row {
    align-items: center;
    color: #565959;
    display: grid !important;
    font-size: .86rem;
    gap: 14px;
    grid-template-columns: minmax(86px, 1fr) auto;
    line-height: 1.45;
    min-height: 28px;
}

.admin-order-price-row + .admin-order-price-row {
    border-top: 1px solid rgba(210, 161, 65, .28);
    margin-top: 4px;
    padding-top: 4px;
}

.admin-order-price-row strong {
    color: #111827;
    font-weight: 800;
}

.admin-order-price-total {
    color: #111827;
    font-size: .95rem;
}

.admin-order-price-total strong {
    color: var(--amazon-orange-dark);
}

.admin-fulfillment-form {
    align-items: end;
    background: #ffffff;
    border-top: 1px solid var(--amazon-border);
    display: grid;
    gap: 10px;
    grid-template-columns: 1.1fr 1.1fr 1.1fr 1.7fr 1.1fr 120px;
    padding: 14px 18px;
}

.admin-fulfillment-form .btn {
    min-height: 38px;
}

.admin-sync-form {
    padding: 0 18px 16px;
}

@media (max-width: 768px) {
    .admin-page-heading,
    .admin-filter-row,
    .admin-order-head,
    .admin-order-meta,
    .admin-order-item,
    .admin-fulfillment-form {
        grid-template-columns: 1fr;
    }

    .admin-order-total-box,
    .admin-order-price {
        text-align: left;
        width: 100%;
    }

    .admin-order-product-main {
        grid-template-columns: 70px minmax(0, 1fr);
    }
}

.account-order-address {
    color: #565959;
    font-size: .9rem;
    margin: 8px 0 12px;
}

.category-tile svg,
.learn-grid svg {
    color: var(--amazon-orange-dark);
    height: 28px;
    margin-bottom: 14px;
    width: 28px;
}

.category-tile strong,
.category-tile span {
    display: block;
}

.category-tile strong,
.learn-grid h3 {
    color: var(--amazon-navy);
    font-size: 1.12rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.category-tile span,
.learn-grid p {
    color: #565959;
}

.artist-program {
    background:
        linear-gradient(135deg, rgba(255, 153, 0, .12), transparent 55%),
        #ffffff;
    padding: 70px 0;
}

.storefront-newsletter {
    background: #f7fafa;
    padding: 70px 0;
}

.newsletter-panel {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(255, 153, 0, .16), transparent 42%),
        #ffffff;
    border: 1px solid var(--amazon-border);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 17, 17, .1);
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .78fr);
    padding: 34px;
}

.newsletter-panel h2 {
    color: var(--amazon-navy);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 950;
    line-height: 1;
    margin: 0 0 10px;
}

.newsletter-panel p:not(.storefront-kicker) {
    color: #565959;
    margin: 0;
}

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

.artist-grid {
    align-items: center;
    display: grid;
    gap: 40px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
}

.artist-stack {
    height: 360px;
    position: relative;
}

.artist-stack span {
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(15, 17, 17, .18);
    height: 250px;
    position: absolute;
    width: 190px;
}

.artist-stack span:nth-child(1) {
    background: linear-gradient(135deg, #ff9900, #7a4b00);
    left: 8%;
    top: 40px;
    transform: rotate(-12deg);
}

.artist-stack span:nth-child(2) {
    background: linear-gradient(135deg, #007185, #131921);
    left: 32%;
    top: 0;
    transform: rotate(7deg);
}

.artist-stack span:nth-child(3) {
    background: linear-gradient(135deg, #febd69, #ff3e84);
    left: 52%;
    top: 74px;
    transform: rotate(14deg);
}

.learn-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.learn-grid article {
    padding: 22px;
}

footer {
    background: #ffffff;
}

@media (max-width: 991.98px) {
    .admin-content {
        margin-left: 76px;
        padding: 18px 14px 28px;
    }

    .dashboard-hero {
        flex-direction: column;
    }

    .dashboard-hero-total {
        flex-basis: auto;
    }

    .admin-sidebar {
        bottom: 10px;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 10px 12px;
        right: auto;
        top: 10px;
        width: 64px;
        transition: width .22s ease, box-shadow .22s ease;
    }

    .admin-sidebar:hover,
    .admin-sidebar:focus-within {
        box-shadow: 12px 0 34px rgba(15, 17, 17, .28);
        width: 248px;
    }

    .admin-sidebar-brand {
        margin: 0 0 14px;
        min-height: 44px;
        padding: 5px 0 14px;
    }

    .admin-sidebar-brand span:last-child,
    .admin-sidebar-nav a span,
    .admin-logout span,
    .admin-nav-badge {
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        white-space: nowrap;
        width: 0;
    }

    .admin-sidebar:hover .admin-sidebar-brand span:last-child,
    .admin-sidebar:focus-within .admin-sidebar-brand span:last-child,
    .admin-sidebar:hover .admin-sidebar-nav a span,
    .admin-sidebar:focus-within .admin-sidebar-nav a span,
    .admin-sidebar:hover .admin-logout span,
    .admin-sidebar:focus-within .admin-logout span,
    .admin-sidebar:hover .admin-nav-badge,
    .admin-sidebar:focus-within .admin-nav-badge {
        opacity: 1;
        pointer-events: auto;
        width: auto;
    }

    .admin-sidebar-nav {
        display: grid;
        gap: 6px;
    }

    .admin-sidebar-nav a,
    .admin-logout {
        min-height: 42px;
        white-space: nowrap;
    }

    .admin-logout {
        margin-left: 0;
        margin-top: auto;
    }

    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .storefront-nav {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 34px;
        padding: 14px;
    }

    .storefront-nav nav {
        background: #f7fafa;
        border-radius: 8px;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        width: 100%;
    }

    .storefront-nav-group {
        flex: 1 1 calc(50% - 8px);
        min-width: 160px;
    }

    .storefront-nav nav a,
    .storefront-cart {
        border: 1px solid var(--amazon-border);
        border-radius: 8px;
        justify-content: center;
        padding: 12px 10px;
    }

    .storefront-cart {
        align-self: stretch;
        border-left: 1px solid var(--amazon-border);
    }

    .storefront-nav-menu {
        left: auto;
        min-width: 100%;
        position: static;
        transform: none;
        width: 100%;
    }

    .storefront-nav-menu-links {
        grid-template-columns: 1fr;
    }

    .storefront-hero-grid,
    .customizer-panel,
    .artist-grid,
    .home-feature-grid,
    .newsletter-panel,
    .product-detail-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .storefront-hero-grid {
        gap: 28px;
    }

    .storefront-hero-copy {
        order: -1;
    }

    .product-gallery,
    .product-purchase-panel {
        position: static;
    }

    .storefront-mat-preview {
        transform: none;
    }

    .storefront-product-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .newsletter-form {
        grid-template-columns: 1fr;
    }

    .media-sort-card {
        grid-template-columns: 34px 92px minmax(0, 1fr);
    }

    .media-delete-check,
    .media-delete-button {
        grid-column: 2 / -1;
        justify-self: start;
    }
}

@media (max-width: 575.98px) {
    .public-main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .experience-hero,
    .experience-card,
    .product-panel {
        padding: 20px;
    }

    .experience-card-header,
    .product-detail-row {
        align-items: stretch;
        flex-direction: column;
    }

    .product-detail-row strong {
        text-align: left;
    }

    .star-rating {
        gap: .3rem;
    }

    .star-option {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

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

    .product-form-body {
        padding: 12px;
    }

    .product-form-body .row,
    .product-form-section {
        padding: 12px;
    }

    .product-form-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .media-sort-card {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .media-preview-frame {
        grid-column: 1 / -1;
        order: -1;
    }

    .media-sort-content,
    .media-delete-check,
    .media-delete-button {
        grid-column: 1 / -1;
    }

    .media-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .media-footer-actions {
        width: 100%;
    }

    .media-footer-actions .btn {
        flex: 1 1 0;
    }

    .country-list-actions {
        justify-content: stretch;
        width: 100%;
    }

    .country-list-actions .btn {
        flex: 1 1 0;
    }

    .country-save-bar .btn {
        width: 100%;
    }

    .featured-product-admin-row {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .featured-product-row-actions {
        grid-column: 1 / -1;
    }

    .featured-product-row-actions .btn,
    .featured-product-add-row .btn {
        flex: 1 1 0;
    }

    .dashboard-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-time-pill {
        align-items: flex-start;
        border-radius: 8px;
        flex-direction: column;
        white-space: normal;
    }

    .dashboard-time-separator {
        display: none;
    }

    .dashboard-hero-total strong {
        font-size: 2.5rem;
    }

    .dashboard-metric-card,
    .dashboard-today-card {
        min-height: 132px;
    }

    .storefront-shell {
        padding: 0 14px;
    }

    .storefront-floating-notice {
        font-size: .78rem;
        justify-content: center;
        left: 14px;
        max-width: calc(100vw - 28px);
        padding: 9px 12px;
        text-align: center;
        top: 50%;
        width: max-content;
    }

    .storefront-hero {
        padding-bottom: 46px;
    }

    .storefront-hero h1 {
        font-size: 2.55rem;
        line-height: 1;
    }

    .storefront-hero-copy p:not(.storefront-kicker) {
        font-size: 1rem;
    }

    .storefront-nav {
        border-radius: 0 0 8px 8px;
        gap: 12px;
        margin-bottom: 28px;
    }

    .storefront-logo {
        width: 100%;
    }

    .storefront-logo strong {
        font-size: 1.05rem;
        overflow-wrap: anywhere;
    }

    .storefront-nav nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .storefront-nav-group {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .storefront-nav nav a {
        align-items: center;
        display: flex;
        min-height: 44px;
        width: 100%;
    }

    .storefront-actions .btn,
    .storefront-cart {
        justify-content: center;
        width: 100%;
    }

    .storefront-cart {
        min-height: 48px;
    }

    .featured-carousel {
        gap: 8px;
        grid-template-columns: 34px minmax(0, 1fr) 34px;
    }

    .featured-carousel-control {
        height: 34px;
        width: 34px;
    }

    .featured-carousel[data-visible-count] .featured-carousel-track {
        grid-auto-columns: 100%;
    }

    .featured-carousel-band {
        padding-top: 34px;
    }

    .featured-carousel-band .storefront-section-heading h2 {
        font-size: 2rem;
    }

    .featured-carousel-band .storefront-section-heading p:not(.storefront-kicker) {
        font-size: .92rem;
        margin-bottom: 0;
    }

    .featured-product-card .product-card-body {
        padding: 12px;
    }

    .featured-product-card .product-card-body h3 {
        font-size: .98rem;
        line-height: 1.24;
        margin-bottom: 8px;
        min-height: 38px;
    }

    .featured-product-card .product-card-body p {
        font-size: .84rem;
        margin-bottom: 10px;
        min-height: 0;
    }

    .featured-product-card .storefront-card-actions {
        flex-wrap: nowrap;
    }

    .storefront-mat-preview {
        padding: 12px;
    }

    .mat-toolbar {
        gap: 6px;
    }

    .mat-toolbar span {
        font-size: .72rem;
        padding: 6px 8px;
    }

    .home-feature-grid,
    .category-grid {
        gap: 12px;
    }

    .storefront-band {
        padding: 46px 0;
    }

    .storefront-section-heading {
        margin-bottom: 18px;
    }

    .storefront-product-modal-body {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        grid-template-columns: 1fr;
    }

    .product-thumbs {
        display: flex;
        overflow-x: auto;
        order: 2;
    }

    .product-thumbs button {
        flex: 0 0 74px;
    }

    .storefront-product-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .customizer-panel {
        padding: 12px;
    }

    .customizer-canvas {
        min-height: 240px;
    }

    .upload-drop {
        min-height: 210px;
    }

    .artist-stack {
        height: 260px;
    }

    .artist-stack span {
        height: 190px;
        width: 145px;
    }
}

/* Final TCG behavior override: mobile horizontal board, no inversion; desktop log fills center. */
.tcg-player-bottom {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.tcg-center-panel {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

.tcg-player-top {
    grid-column: 3 !important;
    grid-row: 1 !important;
}

.tcg-center-panel {
    display: grid !important;
    grid-template-areas:
        "round"
        "tools"
        "timer"
        "history" !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto minmax(0, 1fr) !important;
    min-height: 0 !important;
}

.tcg-center-panel .tcg-round-card { grid-area: round !important; }
.tcg-center-panel .tcg-tool-grid { grid-area: tools !important; }
.tcg-center-panel .tcg-timer { grid-area: timer !important; }

.tcg-center-panel .tcg-history {
    display: grid !important;
    grid-area: history !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    min-height: 0 !important;
}

.tcg-history ol {
    flex: 1 1 auto !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

@media (max-width: 980px) {
    .tcg-counter-topbar {
        display: none !important;
        gap: 6px !important;
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    .tcg-counter-controls {
        display: none !important;
        flex: 0 0 0 !important;
        gap: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 0 !important;
    }

    .tcg-counter-select {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .tcg-counter-select .form-select {
        font-size: .72rem !important;
        min-height: 28px !important;
        min-width: 0 !important;
        padding: 2px 24px 2px 8px !important;
        width: min(190px, 42vw) !important;
    }

    .tcg-counter-brand img,
    .tcg-counter-brand span {
        height: 28px !important;
        width: 28px !important;
    }

    .tcg-counter-board {
        gap: 5px !important;
        grid-template-columns: minmax(0, 1fr) minmax(96px, .68fr) minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: var(--tcg-vh, 100dvh) !important;
        max-width: none !important;
        min-height: 0 !important;
    }

    .tcg-fullscreen-btn {
        display: none !important;
        flex: 0 0 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        width: 0 !important;
    }

    .tcg-player-top,
    .tcg-center-panel,
    .tcg-player-bottom {
        order: 0 !important;
    }

    .tcg-player-top .tcg-player-inner {
        transform: none !important;
    }

    .tcg-player-inner {
        gap: 6px !important;
        justify-content: space-between !important;
        padding: 5px !important;
    }

    .tcg-player-name {
        font-size: clamp(.58rem, 2.2vw, .78rem) !important;
        max-width: 58% !important;
        min-height: 22px !important;
        padding: 3px 5px !important;
    }

    .tcg-lp-badge {
        font-size: .56rem !important;
        padding: 3px 5px !important;
    }

    .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        flex: 1 1 auto !important;
        font-size: clamp(1.72rem, min(7.2vw, 14vh), 3.8rem) !important;
        justify-content: center !important;
        line-height: .88 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-quick-row {
        gap: 5px !important;
        grid-template-columns: repeat(3, minmax(34px, 1fr)) !important;
    }

    .tcg-quick-row button,
    .tcg-calc button,
    .tcg-timer-actions button,
    .tcg-reset {
        border-radius: 9px !important;
        font-size: clamp(.64rem, 2.1vw, .86rem) !important;
        min-height: 32px !important;
        padding: 0 5px !important;
    }

    .tcg-calc {
        cursor: pointer !important;
        gap: 5px !important;
        grid-template-columns: minmax(76px, 1fr) 36px 36px 36px !important;
        touch-action: manipulation !important;
    }

    .tcg-calc-input {
        font-size: clamp(.66rem, 2.1vw, .88rem) !important;
        min-height: 36px !important;
        padding: 0 9px !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }

    .tcg-calc button {
        min-height: 36px !important;
    }

    .tcg-center-panel {
        gap: 4px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-rows: auto 42px auto minmax(42px, 1fr) !important;
        padding: 5px !important;
    }

    .tcg-center-panel .tcg-history {
        border-radius: 9px !important;
        display: grid !important;
        grid-area: history !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        min-height: 0 !important;
        padding: 4px 5px !important;
    }

    .tcg-history summary {
        font-size: clamp(.58rem, 1.9vw, .74rem) !important;
    }

    .tcg-history-actions {
        gap: 4px !important;
    }

    .tcg-history summary button {
        font-size: clamp(.54rem, 1.7vw, .68rem) !important;
        padding: 0 !important;
    }

    .tcg-history ol {
        gap: 3px !important;
        margin-top: 4px !important;
        min-height: 0 !important;
        overflow-y: hidden !important;
    }

    .tcg-history li {
        border-radius: 7px !important;
        gap: 1px !important;
        padding: 3px 5px !important;
    }

    .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-history li span {
        font-size: clamp(.48rem, 1.5vw, .58rem) !important;
    }

    .tcg-history li strong {
        font-size: clamp(.52rem, 1.6vw, .66rem) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-round-card,
    .tcg-timer {
        border-radius: 9px !important;
        padding: 4px 5px !important;
    }

    .tcg-round-card p,
    .tcg-timer span {
        display: none !important;
    }

    .tcg-round-card strong,
    .tcg-timer strong {
        font-size: clamp(.78rem, 2.4vw, 1rem) !important;
    }

    .tcg-tool-grid {
        gap: 4px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        min-height: 0 !important;
    }

    .tcg-tool {
        border-radius: 9px !important;
        gap: 2px !important;
        grid-template-columns: 24px minmax(0, 1fr) !important;
        justify-items: start !important;
        min-height: 40px !important;
        padding: 3px 5px !important;
    }

    .tcg-tool svg {
        display: none !important;
    }

    .tcg-tool > span:not(.tcg-dice-stage):not(.tcg-coin-stage) {
        display: none !important;
    }

    .tcg-tool strong {
        align-self: center !important;
        font-size: clamp(.72rem, 2.1vw, .9rem) !important;
        justify-self: end !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-dice-stage,
    .tcg-coin-stage {
        align-self: center !important;
        height: 24px !important;
        justify-self: start !important;
        width: 24px !important;
    }

    .tcg-dice-cube {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-dice-face {
        border-radius: 6px !important;
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-dice-face-1 { transform: rotateY(0deg) translateZ(11px) !important; }
    .tcg-dice-face-2 { transform: rotateY(90deg) translateZ(11px) !important; }
    .tcg-dice-face-3 { transform: rotateX(90deg) translateZ(11px) !important; }
    .tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(11px) !important; }
    .tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(11px) !important; }
    .tcg-dice-face-6 { transform: rotateX(180deg) translateZ(11px) !important; }

    .tcg-dice-face-1::before,
    .tcg-dice-face-2::before,
    .tcg-dice-face-3::before,
    .tcg-dice-face-4::before,
    .tcg-dice-face-5::before,
    .tcg-dice-face-6::before {
        height: 3px !important;
        width: 3px !important;
    }

    .tcg-dice-face-2::before {
        box-shadow: 10px 10px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-3::before {
        box-shadow: 5px 5px 0 #0f172a, 10px 10px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-4::before {
        box-shadow: 10px 0 0 #0f172a, 0 10px 0 #0f172a, 10px 10px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-5::before {
        box-shadow: 10px 0 0 #0f172a, 5px 5px 0 #0f172a, 0 10px 0 #0f172a, 10px 10px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-6::before {
        box-shadow: 0 5px 0 #0f172a, 0 10px 0 #0f172a, 10px 0 0 #0f172a, 10px 5px 0 #0f172a, 10px 10px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-coin-disc,
    .tcg-coin-face {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-coin-disc::before {
        height: 22px !important;
        left: 9px !important;
        width: 4px !important;
    }

    .tcg-coin-face {
        border-width: 2px !important;
        font-size: .72rem !important;
    }

    .tcg-counter-brand strong,
    .tcg-counter-select > span {
        display: none !important;
    }

    .tcg-mobile-keypad {
        align-items: center !important;
        padding: 8px !important;
    }

    .tcg-mobile-keypad-card {
        max-height: calc(var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) - 18px) !important;
        max-width: min(620px, 94vw) !important;
        padding: 10px !important;
    }

    .tcg-mobile-keypad-grid {
        gap: 6px !important;
    }

    .tcg-mobile-keypad-grid button {
        border-radius: 9px !important;
        min-height: clamp(30px, 8vh, 42px) !important;
    }

    .tcg-log-overlay {
        padding: 8px !important;
    }

    .tcg-log-card {
        max-height: calc(var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) - 18px) !important;
        max-width: min(680px, 94vw) !important;
        padding: 12px !important;
    }
}

@media (max-width: 520px) {
    .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(82px, .62fr) minmax(0, 1fr) !important;
    }

    .tcg-counter-brand {
        display: none !important;
    }
}

@media (max-width: 980px) {
    body:has(.tcg-counter-page.is-forced-landscape) {
        height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
    }

    .tcg-counter-page {
        height: var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) !important;
        min-height: var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) !important;
        width: var(--tcg-layout-vw, var(--tcg-vw, 100vw)) !important;
    }

    .tcg-counter-board {
        height: calc(var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) - 44px) !important;
    }

    .tcg-counter-page.is-forced-landscape {
        max-height: none !important;
        max-width: none !important;
        overflow: hidden !important;
        padding: 6px !important;
        left: 0 !important;
        position: fixed !important;
        top: 0 !important;
        transform: rotate(90deg) translateY(-100%) !important;
        transform-origin: top left !important;
        z-index: 1050 !important;
    }
}

@media (max-width: 980px) and (orientation: portrait) {
    .tcg-counter-page.is-forced-landscape .tcg-counter-topbar {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-forced-landscape .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(120px, .68fr) minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: var(--tcg-layout-vh, 100vw) !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-forced-landscape .tcg-player-top .tcg-player-inner {
        transform: none !important;
    }
}

/* TCG Counter player color, undo, and 3D coin polish. */
.tcg-player {
    --tcg-player-color: #38bdf8;
    --tcg-player-color-ring: rgba(56, 189, 248, .48);
    --tcg-player-color-soft: rgba(56, 189, 248, .18);
    background:
        linear-gradient(160deg, rgba(15, 23, 42, .94), rgba(30, 41, 59, .78)),
        radial-gradient(circle at 50% 18%, var(--tcg-player-color-soft), transparent 18rem) !important;
    border-color: var(--tcg-player-color-ring) !important;
}

.tcg-player-bottom {
    --tcg-player-color: #f59e0b;
    --tcg-player-color-ring: rgba(245, 158, 11, .48);
    --tcg-player-color-soft: rgba(245, 158, 11, .18);
}

.tcg-player .tcg-lp-display {
    text-shadow: 0 0 32px var(--tcg-player-color-soft), 0 0 12px rgba(255, 255, 255, .08);
}

.tcg-player .tcg-player-head {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--tcg-player-color) 84%, #020617), color-mix(in srgb, var(--tcg-player-color) 52%, #020617)),
        radial-gradient(circle at 12% 50%, rgba(255, 255, 255, .22), transparent 12rem);
    border: 1px solid color-mix(in srgb, var(--tcg-player-color) 72%, #ffffff);
    border-radius: 18px;
    box-shadow:
        0 14px 34px color-mix(in srgb, var(--tcg-player-color) 30%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .28);
    padding: 10px 12px;
}

.tcg-player .tcg-player-name {
    background: rgba(2, 6, 23, .34) !important;
    border-color: rgba(255, 255, 255, .38) !important;
    box-shadow: inset 0 0 18px rgba(2, 6, 23, .18) !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.tcg-player .tcg-lp-badge {
    background: rgba(255, 255, 255, .22) !important;
    border-color: rgba(255, 255, 255, .45) !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .32);
}

.tcg-player .tcg-color-picker {
    background: rgba(2, 6, 23, .28);
    border-color: rgba(255, 255, 255, .36);
}

.tcg-player .tcg-color-picker span {
    color: rgba(255, 255, 255, .92);
}

.tcg-player-actions {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    min-width: 0;
}

.tcg-color-picker {
    align-items: center;
    background: rgba(2, 6, 23, .42);
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    padding: 5px 7px;
}

.tcg-color-picker span {
    color: #cbd5e1;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tcg-color-picker input {
    background: transparent;
    border: 0;
    cursor: pointer;
    height: 24px;
    padding: 0;
    width: 24px;
}

.tcg-round-card {
    gap: 8px;
}

.tcg-undo:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.tcg-history li {
    border: 1px solid color-mix(in srgb, var(--tcg-entry-color, #94a3b8) 38%, transparent);
    border-left: 5px solid var(--tcg-entry-color, #94a3b8);
    box-shadow: inset 0 0 22px color-mix(in srgb, var(--tcg-entry-color, #94a3b8) 10%, transparent);
}

.tcg-history li strong {
    color: color-mix(in srgb, var(--tcg-entry-color, #f8fafc) 42%, #f8fafc);
}

.tcg-coin-stage {
    display: grid;
    height: 68px;
    perspective: 720px;
    place-items: center;
    width: 68px;
}

.tcg-coin-disc {
    display: block;
    height: 50px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .42s cubic-bezier(.2, .8, .2, 1);
    width: 50px;
}

.tcg-coin-disc::before {
    background: linear-gradient(90deg, #7c4a03, #fbbf24, #7c4a03);
    border-radius: 999px;
    content: "";
    height: 50px;
    left: 21px;
    position: absolute;
    top: 0;
    transform: rotateY(90deg);
    transform-origin: center;
    width: 8px;
}

.tcg-coin-disc.is-flipping {
    animation: tcgCoinFlip3d .82s cubic-bezier(.15, .72, .28, 1.08);
}

.tcg-coin-face {
    align-items: center;
    backface-visibility: hidden;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .72), transparent 18%),
        radial-gradient(circle at 50% 54%, rgba(255, 243, 191, .72), transparent 42%),
        linear-gradient(145deg, #fef3c7, #f59e0b 58%, #92400e);
    border: 3px solid #fde68a;
    border-radius: 999px;
    box-shadow:
        inset 0 -8px 12px rgba(120, 53, 15, .28),
        0 10px 24px rgba(251, 191, 36, .28);
    color: #451a03 !important;
    display: flex !important;
    font-size: 1.25rem;
    font-weight: 950;
    height: 50px;
    justify-content: center;
    left: 0;
    line-height: 1;
    position: absolute;
    top: 0;
    width: 50px;
}

.tcg-coin-tails {
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .62), transparent 18%),
        linear-gradient(145deg, #e0f2fe, #38bdf8 58%, #075985);
    border-color: #bae6fd;
    color: #082f49 !important;
    transform: rotateY(180deg);
}

@keyframes tcgCoinFlip3d {
    0% { transform: rotateY(0deg) rotateX(0deg) translateY(0) scale(1); }
    35% { transform: rotateY(900deg) rotateX(28deg) translateY(-8px) scale(1.22); }
    70% { transform: rotateY(1620deg) rotateX(-18deg) translateY(2px) scale(1.06); }
    100% { transform: rotateY(2160deg) rotateX(0deg) translateY(0) scale(1); }
}

@media (max-width: 980px) {
    .tcg-player-actions {
        gap: 4px !important;
    }

    .tcg-color-picker {
        padding: 2px 4px !important;
    }

    .tcg-color-picker span {
        display: none !important;
    }

    .tcg-color-picker input {
        height: 18px !important;
        width: 18px !important;
    }

    .tcg-coin-stage {
        display: grid !important;
        height: 26px !important;
        width: 26px !important;
    }

    .tcg-tool.tcg-tool > span.tcg-coin-stage {
        display: grid !important;
    }

    .tcg-coin-disc,
    .tcg-coin-face {
        height: 24px !important;
        width: 24px !important;
    }

    .tcg-coin-disc::before {
        height: 24px !important;
        left: 10px !important;
        width: 4px !important;
    }

    .tcg-coin-face {
        border-width: 2px !important;
        font-size: .64rem !important;
    }
}

/* TCG Counter full-screen event effects. */
.tcg-counter-page {
    position: relative;
}

.tcg-timer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.tcg-event-overlay {
    align-items: center;
    background:
        radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .1), transparent 18rem),
        linear-gradient(135deg, rgba(2, 6, 23, .82), rgba(15, 23, 42, .92));
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 22px;
    pointer-events: none;
    position: absolute;
    transform: scale(1.02);
    transition: opacity .18s ease, transform .18s ease;
    z-index: 1300;
}

.tcg-event-overlay.is-showing {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.tcg-event-card {
    align-items: center;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .82), rgba(2, 6, 23, .94)),
        radial-gradient(circle at 50% 0%, rgba(255, 153, 0, .18), transparent 16rem);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 28px;
    box-shadow: 0 34px 100px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1);
    color: #fff;
    display: grid;
    gap: 10px;
    justify-items: center;
    max-width: min(620px, 92vw);
    min-width: min(420px, 90vw);
    overflow: hidden;
    padding: clamp(24px, 5vw, 52px);
    position: relative;
    text-align: center;
}

.tcg-event-card::before,
.tcg-event-card::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
    content: "";
    height: 1px;
    left: 8%;
    position: absolute;
    right: 8%;
}

.tcg-event-card::before { top: 14px; }
.tcg-event-card::after { bottom: 14px; }

.tcg-event-card.is-entering {
    animation: tcgEventCardEnter .48s cubic-bezier(.16, .84, .31, 1.22);
}

.tcg-event-visual {
    display: grid;
    min-height: clamp(92px, 18vw, 160px);
    perspective: 900px;
    place-items: center;
}

.tcg-event-card p {
    color: #ffcc80;
    font-size: clamp(.78rem, 1.5vw, 1rem);
    font-weight: 950;
    letter-spacing: .16em;
    margin: 0;
    text-transform: uppercase;
}

.tcg-event-card strong {
    color: #fff;
    font-size: clamp(3rem, 10vw, 7.5rem);
    font-weight: 950;
    letter-spacing: 0;
    line-height: .9;
    text-shadow: 0 0 36px rgba(255, 153, 0, .34);
}

.tcg-event-card > span {
    color: #cbd5e1;
    font-size: clamp(.98rem, 2vw, 1.35rem);
    font-weight: 800;
}

.tcg-event-close {
    background: linear-gradient(180deg, #ffb84d, #f59e0b);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 16px 34px rgba(245, 158, 11, .32);
    color: #111827;
    display: none;
    font-weight: 950;
    margin-top: 12px;
    min-height: 42px;
    padding: 0 24px;
}

.tcg-event-overlay.is-persistent .tcg-event-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tcg-confirm-overlay {
    align-items: center;
    background:
        radial-gradient(circle at 50% 36%, rgba(255, 153, 0, .18), transparent 18rem),
        rgba(2, 6, 23, .72);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 20px;
    pointer-events: none;
    position: absolute;
    transform: scale(1.01);
    transition: opacity .16s ease, transform .16s ease;
    z-index: 1500;
}

.tcg-confirm-overlay.is-showing {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.tcg-confirm-card {
    align-items: center;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(2, 6, 23, .98)),
        radial-gradient(circle at 18% 0%, rgba(255, 153, 0, .16), transparent 15rem);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 22px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
    color: #fff;
    display: grid;
    gap: 16px;
    grid-template-columns: auto minmax(0, 1fr);
    max-width: min(520px, 92vw);
    padding: 22px;
}

.tcg-confirm-icon {
    align-items: center;
    background: rgba(245, 158, 11, .16);
    border: 1px solid rgba(245, 158, 11, .44);
    border-radius: 18px;
    color: #ffcc80;
    display: flex;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.tcg-confirm-overlay.is-danger .tcg-confirm-icon {
    background: rgba(239, 68, 68, .14);
    border-color: rgba(248, 113, 113, .5);
    color: #fca5a5;
}

.tcg-confirm-icon svg {
    height: 26px;
    width: 26px;
}

.tcg-confirm-card p {
    color: #ffcc80;
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .14em;
    margin: 0 0 5px;
    text-transform: uppercase;
}

.tcg-confirm-card strong {
    color: #fff;
    display: block;
    font-size: clamp(1.28rem, 3vw, 1.75rem);
    line-height: 1.1;
    margin-bottom: 7px;
}

.tcg-confirm-card span {
    color: #cbd5e1;
    display: block;
    font-weight: 750;
    line-height: 1.45;
}

.tcg-confirm-actions {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.tcg-confirm-actions button {
    border-radius: 999px;
    font-weight: 950;
    min-height: 42px;
    padding: 0 20px;
}

.tcg-confirm-secondary {
    background: rgba(148, 163, 184, .12);
    border: 1px solid rgba(148, 163, 184, .32);
    color: #e2e8f0;
}

.tcg-confirm-primary {
    background: linear-gradient(180deg, #ffb84d, #f59e0b);
    border: 0;
    box-shadow: 0 12px 26px rgba(245, 158, 11, .28);
    color: #111827;
}

.tcg-confirm-overlay.is-danger .tcg-confirm-primary {
    background: linear-gradient(180deg, #fb7185, #ef4444);
    box-shadow: 0 12px 26px rgba(239, 68, 68, .26);
    color: #fff;
}

.tcg-event-overlay.is-dice {
    background:
        radial-gradient(circle at 50% 40%, rgba(56, 189, 248, .26), transparent 20rem),
        linear-gradient(135deg, rgba(2, 6, 23, .88), rgba(8, 47, 73, .92));
}

.tcg-event-dice {
    align-items: center;
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .96), transparent 18%),
        linear-gradient(145deg, #fff, #dbeafe);
    border: clamp(4px, .8vw, 8px) solid rgba(125, 211, 252, .86);
    border-radius: clamp(22px, 4vw, 36px);
    box-shadow: inset 0 -20px 34px rgba(15, 23, 42, .14), 0 0 54px rgba(56, 189, 248, .45);
    color: #0f172a;
    display: flex;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 950;
    height: clamp(104px, 20vw, 180px);
    justify-content: center;
    line-height: 1;
    transform-style: preserve-3d;
    width: clamp(104px, 20vw, 180px);
}

.tcg-event-dice.is-rolling {
    animation: tcgEventDiceRoll 1.02s cubic-bezier(.2, .8, .2, 1);
}

.tcg-event-overlay.is-coin {
    background:
        radial-gradient(circle at 50% 40%, rgba(251, 191, 36, .3), transparent 20rem),
        linear-gradient(135deg, rgba(2, 6, 23, .88), rgba(69, 26, 3, .9));
}

.tcg-event-coin {
    display: block;
    height: clamp(112px, 22vw, 190px);
    position: relative;
    transform-style: preserve-3d;
    width: clamp(112px, 22vw, 190px);
}

.tcg-event-coin::before {
    background: linear-gradient(90deg, #78350f, #fbbf24, #78350f);
    border-radius: 999px;
    content: "";
    height: 100%;
    left: calc(50% - 8px);
    position: absolute;
    top: 0;
    transform: rotateY(90deg);
    width: 16px;
}

.tcg-event-coin span {
    align-items: center;
    backface-visibility: hidden;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .74), transparent 18%),
        linear-gradient(145deg, #fef3c7, #f59e0b 58%, #92400e);
    border: clamp(5px, .9vw, 9px) solid #fde68a;
    border-radius: 999px;
    box-shadow: inset 0 -24px 32px rgba(120, 53, 15, .3), 0 22px 60px rgba(251, 191, 36, .38);
    color: #451a03;
    display: flex;
    font-size: clamp(3.4rem, 10vw, 7rem);
    font-weight: 950;
    height: 100%;
    justify-content: center;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.tcg-event-coin span + span {
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .62), transparent 18%),
        linear-gradient(145deg, #e0f2fe, #38bdf8 58%, #075985);
    border-color: #bae6fd;
    color: #082f49;
    transform: rotateY(180deg);
}

.tcg-event-coin.is-flipping {
    animation: tcgEventCoinFlip 1.04s cubic-bezier(.15, .72, .28, 1.08);
}

.tcg-event-coin.is-tails {
    transform: rotateY(180deg);
}

.tcg-event-overlay.is-pause {
    background:
        radial-gradient(circle at 50% 42%, rgba(148, 163, 184, .25), transparent 19rem),
        linear-gradient(135deg, rgba(2, 6, 23, .86), rgba(30, 41, 59, .92));
}

.tcg-event-pause {
    align-items: center;
    display: inline-flex;
    gap: clamp(16px, 3vw, 28px);
}

.tcg-event-pause i {
    background: linear-gradient(180deg, #f8fafc, #94a3b8);
    border-radius: 999px;
    box-shadow: 0 0 42px rgba(248, 250, 252, .3);
    display: block;
    height: clamp(88px, 15vw, 150px);
    width: clamp(24px, 4vw, 42px);
}

.tcg-event-overlay.is-finish {
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 213, 97, .4), transparent 16rem),
        conic-gradient(from 22deg at 50% 50%, rgba(255, 255, 255, .05), rgba(255, 184, 77, .28), rgba(56, 189, 248, .16), rgba(255, 184, 77, .32), rgba(255, 255, 255, .05)),
        linear-gradient(135deg, rgba(2, 6, 23, .92), rgba(69, 26, 3, .94));
}

.tcg-event-overlay.is-finish::before,
.tcg-event-overlay.is-finish::after {
    content: "";
    inset: -20%;
    pointer-events: none;
    position: absolute;
}

.tcg-event-overlay.is-finish::before {
    animation: tcgVictoryRays 8s linear infinite;
    background:
        repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 224, 138, .2) 0deg 7deg, transparent 7deg 18deg);
    mix-blend-mode: screen;
    opacity: .55;
}

.tcg-event-overlay.is-finish::after {
    background:
        radial-gradient(circle at 18% 28%, rgba(255, 255, 255, .5) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 20%, rgba(255, 224, 138, .7) 0 2px, transparent 3px),
        radial-gradient(circle at 68% 76%, rgba(125, 211, 252, .55) 0 2px, transparent 3px),
        radial-gradient(circle at 34% 70%, rgba(255, 255, 255, .48) 0 2px, transparent 3px);
    opacity: .82;
}

.tcg-event-overlay.is-finish .tcg-event-card {
    background:
        linear-gradient(180deg, rgba(22, 13, 2, .76), rgba(2, 6, 23, .94)),
        radial-gradient(circle at 50% 0%, rgba(255, 184, 77, .28), transparent 19rem);
    border-color: rgba(255, 224, 138, .46);
    box-shadow:
        0 38px 120px rgba(0, 0, 0, .62),
        0 0 80px rgba(255, 184, 77, .22),
        inset 0 1px 0 rgba(255, 255, 255, .14);
    max-width: min(980px, 96vw);
    min-width: min(720px, 94vw);
    overflow: visible;
    padding: clamp(28px, 4.2vw, 54px) clamp(34px, 6vw, 76px);
}

.tcg-event-overlay.is-finish .tcg-event-visual {
    min-height: clamp(124px, 18vw, 214px);
    overflow: visible;
}

.tcg-event-overlay.is-finish .tcg-event-card strong {
    animation: tcgVictoryTitle .92s cubic-bezier(.16, .84, .31, 1.22);
    background: linear-gradient(180deg, #ffffff 0%, #ffe8a3 28%, #ffb84d 58%, #7c2d12 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: block;
    font-size: clamp(3.2rem, 9vw, 7.8rem);
    letter-spacing: .06em;
    line-height: 1;
    max-width: 100%;
    padding: .08em .04em .14em;
    position: relative;
    text-shadow: none;
    transform: skewX(-7deg);
    white-space: nowrap;
}

.tcg-event-overlay.is-finish .tcg-event-card > span {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.tcg-event-overlay.is-finish .tcg-event-card strong::after {
    animation: tcgVictoryScan 1.7s ease-in-out infinite;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
    content: "";
    height: .12em;
    left: 0;
    position: absolute;
    right: 0;
    top: 48%;
}

.tcg-victory-burst,
.tcg-victory-ring,
.tcg-victory-emblem {
    grid-area: 1 / 1;
}

.tcg-victory-burst {
    display: grid;
    height: clamp(132px, 22vw, 220px);
    place-items: center;
    position: relative;
    width: clamp(132px, 22vw, 220px);
}

.tcg-victory-burst i {
    animation: tcgVictoryBlade 1.35s ease-in-out infinite;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95), #ffb84d, transparent);
    border-radius: 999px;
    box-shadow: 0 0 28px rgba(255, 184, 77, .55);
    height: clamp(8px, 1.1vw, 14px);
    position: absolute;
    width: 112%;
}

.tcg-victory-burst i:nth-child(1) { transform: rotate(0deg); }
.tcg-victory-burst i:nth-child(2) { animation-delay: .08s; transform: rotate(30deg); }
.tcg-victory-burst i:nth-child(3) { animation-delay: .16s; transform: rotate(60deg); }
.tcg-victory-burst i:nth-child(4) { animation-delay: .24s; transform: rotate(90deg); }
.tcg-victory-burst i:nth-child(5) { animation-delay: .32s; transform: rotate(120deg); }
.tcg-victory-burst i:nth-child(6) { animation-delay: .4s; transform: rotate(150deg); }

.tcg-victory-burst b {
    animation: tcgVictoryShard 1.2s ease-in-out infinite;
    background: linear-gradient(135deg, #fff7ed, #f59e0b);
    clip-path: polygon(50% 0, 100% 100%, 0 78%);
    display: block;
    height: clamp(18px, 3vw, 34px);
    position: absolute;
    width: clamp(14px, 2.4vw, 28px);
}

.tcg-victory-burst b:nth-of-type(1) { left: 2%; top: 16%; }
.tcg-victory-burst b:nth-of-type(2) { animation-delay: .15s; right: 6%; top: 18%; transform: rotate(58deg); }
.tcg-victory-burst b:nth-of-type(3) { animation-delay: .3s; bottom: 10%; left: 14%; transform: rotate(-35deg); }
.tcg-victory-burst b:nth-of-type(4) { animation-delay: .45s; bottom: 13%; right: 10%; transform: rotate(118deg); }

.tcg-victory-ring {
    animation: tcgVictoryRing 1.8s ease-in-out infinite;
    border: clamp(5px, .8vw, 9px) solid rgba(255, 224, 138, .78);
    border-left-color: rgba(56, 189, 248, .44);
    border-radius: 999px;
    box-shadow: 0 0 46px rgba(255, 184, 77, .45), inset 0 0 30px rgba(255, 224, 138, .24);
    height: clamp(112px, 18vw, 190px);
    width: clamp(112px, 18vw, 190px);
}

.tcg-victory-emblem {
    align-items: center;
    animation: tcgVictoryEmblem .7s cubic-bezier(.16, .84, .31, 1.22);
    background:
        radial-gradient(circle at 32% 22%, rgba(255, 255, 255, .7), transparent 20%),
        linear-gradient(145deg, #fff7ed, #f59e0b 58%, #7c2d12);
    border: clamp(4px, .7vw, 8px) solid #fde68a;
    border-radius: 20px;
    box-shadow: 0 18px 54px rgba(245, 158, 11, .42), inset 0 -16px 22px rgba(124, 45, 18, .24);
    color: #451a03;
    display: flex;
    font-size: clamp(3rem, 9vw, 6.8rem);
    font-weight: 950;
    height: clamp(84px, 14vw, 148px);
    justify-content: center;
    line-height: 1;
    transform: rotate(-8deg);
    width: clamp(84px, 14vw, 148px);
}

@keyframes tcgEventCardEnter {
    0% { opacity: 0; transform: translateY(18px) scale(.9); }
    60% { opacity: 1; transform: translateY(-4px) scale(1.035); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tcgEventDiceRoll {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(.86); }
    40% { transform: rotateX(520deg) rotateY(340deg) rotateZ(220deg) scale(1.18); }
    78% { transform: rotateX(860deg) rotateY(620deg) rotateZ(360deg) scale(.98); }
    100% { transform: rotateX(1080deg) rotateY(720deg) rotateZ(360deg) scale(1); }
}

@keyframes tcgEventCoinFlip {
    0% { transform: rotateY(0deg) rotateX(0deg) translateY(0) scale(.9); }
    35% { transform: rotateY(1080deg) rotateX(28deg) translateY(-22px) scale(1.18); }
    72% { transform: rotateY(1980deg) rotateX(-14deg) translateY(2px) scale(1.04); }
    100% { transform: rotateY(2520deg) rotateX(0deg) translateY(0) scale(1); }
}

@keyframes tcgVictoryRays {
    to { transform: rotate(360deg); }
}

@keyframes tcgVictoryTitle {
    0% { filter: blur(8px); opacity: 0; transform: translateY(18px) scale(.78) skewX(-7deg); }
    58% { filter: blur(0); opacity: 1; transform: translateY(-4px) scale(1.08) skewX(-7deg); }
    100% { transform: translateY(0) scale(1) skewX(-7deg); }
}

@keyframes tcgVictoryScan {
    0%, 100% { opacity: 0; transform: translateX(-110%); }
    35%, 62% { opacity: 1; }
    80% { opacity: 0; transform: translateX(110%); }
}

@keyframes tcgVictoryBlade {
    0%, 100% { opacity: .52; filter: brightness(1); transform-origin: 50% 50%; }
    50% { opacity: 1; filter: brightness(1.35); }
}

@keyframes tcgVictoryShard {
    0%, 100% { filter: brightness(1); opacity: .65; translate: 0 0; }
    50% { filter: brightness(1.35); opacity: 1; translate: 0 -10px; }
}

@keyframes tcgVictoryRing {
    0%, 100% { opacity: .82; transform: rotate(0deg) scale(.94); }
    50% { opacity: 1; transform: rotate(180deg) scale(1.05); }
}

@keyframes tcgVictoryEmblem {
    0% { opacity: 0; transform: rotate(-24deg) scale(.58); }
    68% { opacity: 1; transform: rotate(-6deg) scale(1.12); }
    100% { transform: rotate(-8deg) scale(1); }
}

@media (max-width: 980px) {
    .tcg-event-overlay {
        padding: 10px !important;
    }

    .tcg-event-card {
        border-radius: 18px !important;
        gap: 5px !important;
        min-width: min(340px, 88vw) !important;
        padding: 16px 18px !important;
    }

    .tcg-event-visual {
        min-height: 70px !important;
    }

    .tcg-event-card strong {
        font-size: clamp(2.2rem, 8vw, 4.6rem) !important;
    }

    .tcg-event-overlay.is-finish .tcg-event-card {
        gap: 4px !important;
        max-width: 94vw !important;
        min-width: min(540px, 92vw) !important;
        padding: 14px 22px !important;
    }

    .tcg-event-overlay.is-finish .tcg-event-visual {
        min-height: clamp(70px, 20vh, 118px) !important;
    }

    .tcg-event-overlay.is-finish .tcg-event-card strong {
        font-size: clamp(2.2rem, 10vw, 4rem) !important;
        letter-spacing: .04em !important;
        line-height: 1 !important;
        padding: .05em .02em .08em !important;
    }

    .tcg-event-overlay.is-finish .tcg-victory-burst {
        height: clamp(72px, 22vh, 120px) !important;
        width: clamp(72px, 22vh, 120px) !important;
    }

    .tcg-event-overlay.is-finish .tcg-victory-ring {
        height: clamp(64px, 18vh, 104px) !important;
        width: clamp(64px, 18vh, 104px) !important;
    }

    .tcg-event-overlay.is-finish .tcg-victory-emblem {
        border-radius: 14px !important;
        font-size: clamp(2rem, 7vw, 3.6rem) !important;
        height: clamp(48px, 14vh, 82px) !important;
        width: clamp(48px, 14vh, 82px) !important;
    }

    .tcg-event-close {
        min-height: 34px !important;
        padding: 0 18px !important;
    }

    .tcg-confirm-overlay {
        padding: 10px !important;
    }

    .tcg-confirm-card {
        border-radius: 16px !important;
        gap: 10px !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        max-width: min(420px, 92vw) !important;
        padding: 14px !important;
    }

    .tcg-confirm-icon {
        border-radius: 13px !important;
        height: 42px !important;
        width: 42px !important;
    }

    .tcg-confirm-card strong {
        font-size: 1.15rem !important;
    }

    .tcg-confirm-card span {
        font-size: .85rem !important;
    }

    .tcg-confirm-actions button {
        min-height: 34px !important;
        padding: 0 14px !important;
    }
}

/* Final mobile TCG layout authority: larger controls, stable center panel. */
@media (max-width: 980px) {
    .tcg-counter-page {
        padding: 6px !important;
    }

    .tcg-counter-topbar,
    .tcg-counter-controls {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 0 !important;
    }

    .tcg-counter-board {
        gap: 6px !important;
        grid-template-columns: minmax(0, 1.05fr) minmax(0, .82fr) minmax(0, 1.05fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: calc(var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) - 12px) !important;
        width: 100% !important;
    }

    .tcg-player-inner {
        display: grid !important;
        gap: 6px !important;
        grid-template-rows: minmax(28px, .14fr) minmax(0, 1fr) minmax(68px, .42fr) minmax(42px, .26fr) !important;
        justify-content: stretch !important;
        padding: 6px !important;
    }

    .tcg-player-head {
        min-height: 30px !important;
        padding: 5px 7px !important;
    }

    .tcg-player-name {
        font-size: clamp(.68rem, 2.1vw, .9rem) !important;
        min-height: 26px !important;
        padding: 3px 7px !important;
    }

    .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(1.9rem, min(7.8vw, 13vh), 4.1rem) !important;
        justify-content: center !important;
        line-height: .9 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-quick-row {
        align-self: stretch !important;
        gap: 6px !important;
        grid-template-columns: repeat(3, minmax(38px, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-quick-row button,
    .tcg-calc button {
        border-radius: 10px !important;
        font-size: clamp(.72rem, 2.2vw, .94rem) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 6px !important;
    }

    .tcg-calc {
        align-self: stretch !important;
        gap: 6px !important;
        grid-template-columns: minmax(88px, 1fr) 42px 42px !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-calc-input {
        font-size: clamp(.74rem, 2.2vw, .98rem) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 10px !important;
    }

    .tcg-calc button[data-calc-action="clear"] {
        display: none !important;
    }

    .tcg-center-panel {
        gap: 5px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-rows: minmax(34px, .15fr) minmax(34px, .15fr) minmax(58px, .26fr) minmax(0, .44fr) !important;
        min-height: 0 !important;
        padding: 6px !important;
    }

    .tcg-round-card,
    .tcg-timer,
    .tcg-center-panel .tcg-history {
        border-radius: 10px !important;
        min-height: 0 !important;
        padding: 5px 6px !important;
    }

    .tcg-round-card {
        gap: 5px !important;
    }

    .tcg-reset,
    .tcg-timer-actions button {
        border-radius: 9px !important;
        font-size: clamp(.62rem, 1.9vw, .82rem) !important;
        min-height: 32px !important;
        padding: 0 6px !important;
    }

    .tcg-tool-grid {
        gap: 5px !important;
        min-height: 0 !important;
    }

    .tcg-tool {
        align-items: center !important;
        border-radius: 10px !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: 26px minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 4px 6px !important;
    }

    .tcg-tool strong {
        font-size: clamp(.76rem, 2vw, .92rem) !important;
    }

    .tcg-center-panel .tcg-history {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
    }
}

@media (max-width: 980px) and (orientation: portrait) {
    .tcg-counter-page.is-forced-landscape .tcg-counter-board {
        height: calc(var(--tcg-layout-vh, 100vw) - 12px) !important;
    }
}

/* Final mobile center controls: keep middle buttons visible and proportional. */
@media (max-width: 980px) {
    .tcg-center-panel {
        overflow: hidden !important;
        grid-template-rows: minmax(0, .18fr) minmax(0, .18fr) minmax(0, .34fr) minmax(0, .30fr) !important;
    }

    .tcg-round-card {
        align-items: stretch !important;
        display: grid !important;
        gap: 5px !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, .86fr) minmax(0, .86fr) !important;
        overflow: hidden !important;
    }

    .tcg-round-card > div {
        display: grid !important;
        min-width: 0 !important;
        place-content: center start !important;
    }

    .tcg-round-card strong,
    .tcg-timer strong {
        font-size: clamp(.78rem, 2.1vw, 1rem) !important;
        line-height: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-reset {
        align-items: center !important;
        display: inline-flex !important;
        gap: 3px !important;
        justify-content: center !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    .tcg-reset svg {
        flex: 0 0 auto !important;
        height: 13px !important;
        width: 13px !important;
    }

    .tcg-tool-grid {
        align-items: stretch !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-timer {
        display: grid !important;
        gap: 5px !important;
        grid-template-rows: minmax(0, .42fr) minmax(0, .58fr) !important;
        overflow: hidden !important;
    }

    .tcg-timer > div:first-child {
        display: grid !important;
        min-height: 0 !important;
        place-items: center !important;
    }

    .tcg-timer-actions {
        display: grid !important;
        gap: 5px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-timer-actions button {
        align-items: center !important;
        display: inline-flex !important;
        font-size: clamp(.58rem, 1.8vw, .78rem) !important;
        height: 100% !important;
        justify-content: center !important;
        line-height: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 4px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-center-panel .tcg-history {
        overflow: hidden !important;
    }
}

/* Final TCG mobile fit pass: unclutter the center header and compact tool effects. */
@media (max-width: 980px) {
    .tcg-center-panel {
        grid-template-rows: minmax(0, .22fr) minmax(0, .12fr) minmax(0, .33fr) minmax(0, .33fr) !important;
    }

    .tcg-round-card {
        align-content: stretch !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: minmax(0, .42fr) minmax(0, .58fr) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-round-card > div {
        grid-column: 1 / -1 !important;
        min-height: 0 !important;
        place-content: center !important;
        text-align: center !important;
    }

    .tcg-round-card [data-turn-label] {
        font-size: clamp(.72rem, 2vw, .92rem) !important;
        line-height: 1 !important;
    }

    .tcg-round-card .tcg-reset {
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 4px !important;
    }

    .tcg-tool-grid {
        gap: 4px !important;
    }

    .tcg-tool {
        grid-template-columns: minmax(18px, 22px) minmax(0, 1fr) !important;
        min-height: 0 !important;
        padding: 2px 5px !important;
    }

    .tcg-tool strong {
        font-size: clamp(.66rem, 1.85vw, .82rem) !important;
    }

    .tcg-dice-stage,
    .tcg-coin-stage {
        height: 20px !important;
        width: 20px !important;
    }

    .tcg-dice-cube,
    .tcg-dice-face,
    .tcg-coin-disc,
    .tcg-coin-face {
        height: 18px !important;
        width: 18px !important;
    }

    .tcg-dice-face {
        border-radius: 5px !important;
    }

    .tcg-dice-face-1 { transform: rotateY(0deg) translateZ(9px) !important; }
    .tcg-dice-face-2 { transform: rotateY(90deg) translateZ(9px) !important; }
    .tcg-dice-face-3 { transform: rotateX(90deg) translateZ(9px) !important; }
    .tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(9px) !important; }
    .tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(9px) !important; }
    .tcg-dice-face-6 { transform: rotateX(180deg) translateZ(9px) !important; }

    .tcg-dice-face-1::before,
    .tcg-dice-face-2::before,
    .tcg-dice-face-3::before,
    .tcg-dice-face-4::before,
    .tcg-dice-face-5::before,
    .tcg-dice-face-6::before {
        height: 2px !important;
        width: 2px !important;
    }

    .tcg-dice-face-2::before {
        box-shadow: 8px 8px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-3::before {
        box-shadow: 4px 4px 0 #0f172a, 8px 8px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-4::before {
        box-shadow: 8px 0 0 #0f172a, 0 8px 0 #0f172a, 8px 8px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-5::before {
        box-shadow: 8px 0 0 #0f172a, 4px 4px 0 #0f172a, 0 8px 0 #0f172a, 8px 8px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-dice-face-6::before {
        box-shadow: 0 4px 0 #0f172a, 0 8px 0 #0f172a, 8px 0 0 #0f172a, 8px 4px 0 #0f172a, 8px 8px 0 #0f172a !important;
        left: 4px !important;
        top: 4px !important;
    }

    .tcg-coin-disc::before {
        height: 18px !important;
        left: 7px !important;
        width: 4px !important;
    }

    .tcg-coin-face {
        border-width: 1px !important;
        font-size: .58rem !important;
    }
}

/* Keep desktop event dice and coin animations visually centered. */
.tcg-event-visual {
    align-items: center !important;
    display: grid !important;
    justify-items: center !important;
    width: 100% !important;
}

.tcg-event-dice,
.tcg-event-coin {
    align-self: center !important;
    justify-self: center !important;
    margin: 0 auto !important;
    transform-origin: 50% 50% !important;
}

.tcg-event-coin {
    display: block !important;
    flex: 0 0 auto !important;
    position: relative !important;
}

.tcg-event-coin::before {
    bottom: 0 !important;
    left: calc(50% - 8px) !important;
    top: 0 !important;
}

.tcg-event-coin span {
    box-sizing: border-box !important;
    inset: 0 !important;
    margin: 0 !important;
    transform-origin: 50% 50% !important;
}

/* Mobile dice pips: draw dots as face backgrounds so they stay inside small dice. */
@media (max-width: 980px) {
    .tcg-dice-face {
        --tcg-dice-pip: #0f172a;
        background:
            radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), transparent 20%),
            linear-gradient(145deg, #ffffff, #dbeafe) !important;
        overflow: hidden !important;
    }

    .tcg-dice-face::before,
    .tcg-dice-face::after {
        display: none !important;
    }

    .tcg-dice-face-1 {
        background:
            radial-gradient(circle at 50% 50%, var(--tcg-dice-pip) 0 1.9px, transparent 2px),
            radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), transparent 20%),
            linear-gradient(145deg, #ffffff, #dbeafe) !important;
    }

    .tcg-dice-face-2 {
        background:
            radial-gradient(circle at 32% 32%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 68% 68%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), transparent 20%),
            linear-gradient(145deg, #ffffff, #dbeafe) !important;
    }

    .tcg-dice-face-3 {
        background:
            radial-gradient(circle at 32% 32%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 50% 50%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 68% 68%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), transparent 20%),
            linear-gradient(145deg, #ffffff, #dbeafe) !important;
    }

    .tcg-dice-face-4 {
        background:
            radial-gradient(circle at 32% 32%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 68% 32%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 32% 68%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 68% 68%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), transparent 20%),
            linear-gradient(145deg, #ffffff, #dbeafe) !important;
    }

    .tcg-dice-face-5 {
        background:
            radial-gradient(circle at 32% 32%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 68% 32%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 50% 50%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 32% 68%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 68% 68%, var(--tcg-dice-pip) 0 1.8px, transparent 2px),
            radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), transparent 20%),
            linear-gradient(145deg, #ffffff, #dbeafe) !important;
    }

    .tcg-dice-face-6 {
        background:
            radial-gradient(circle at 32% 28%, var(--tcg-dice-pip) 0 1.7px, transparent 2px),
            radial-gradient(circle at 32% 50%, var(--tcg-dice-pip) 0 1.7px, transparent 2px),
            radial-gradient(circle at 32% 72%, var(--tcg-dice-pip) 0 1.7px, transparent 2px),
            radial-gradient(circle at 68% 28%, var(--tcg-dice-pip) 0 1.7px, transparent 2px),
            radial-gradient(circle at 68% 50%, var(--tcg-dice-pip) 0 1.7px, transparent 2px),
            radial-gradient(circle at 68% 72%, var(--tcg-dice-pip) 0 1.7px, transparent 2px),
            radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), transparent 20%),
            linear-gradient(145deg, #ffffff, #dbeafe) !important;
    }
}

/* Mobile TCG center console redesign. */
@media (max-width: 980px) {
    .tcg-counter-board {
        gap: 6px !important;
        grid-template-columns: minmax(0, 1fr) clamp(142px, 25vw, 190px) minmax(0, 1fr) !important;
    }

    .tcg-center-panel {
        background:
            radial-gradient(circle at 50% 0%, rgba(56, 189, 248, .18), transparent 42%),
            linear-gradient(180deg, rgba(9, 20, 36, .98), rgba(3, 8, 18, .97)) !important;
        border-color: rgba(125, 211, 252, .42) !important;
        border-radius: 14px !important;
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, .05),
            inset 0 0 26px rgba(14, 165, 233, .1),
            0 0 24px rgba(2, 132, 199, .12) !important;
        display: grid !important;
        gap: 6px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-rows: minmax(44px, .18fr) minmax(42px, .16fr) minmax(86px, .36fr) minmax(62px, .30fr) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 6px !important;
    }

    .tcg-center-panel .tcg-round-card,
    .tcg-center-panel .tcg-tool-grid,
    .tcg-center-panel .tcg-timer,
    .tcg-center-panel .tcg-history {
        background:
            linear-gradient(180deg, rgba(15, 32, 55, .88), rgba(4, 12, 24, .92)) !important;
        border: 1px solid rgba(125, 211, 252, .24) !important;
        border-radius: 12px !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .07),
            inset 0 -12px 24px rgba(2, 6, 23, .22) !important;
        min-height: 0 !important;
    }

    .tcg-round-card {
        align-items: stretch !important;
        display: grid !important;
        gap: 5px !important;
        grid-area: round !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, .46fr) minmax(0, .54fr) !important;
        padding: 5px !important;
    }

    .tcg-round-card > div {
        align-items: center !important;
        background: linear-gradient(180deg, rgba(255, 153, 0, .22), rgba(146, 64, 14, .16)) !important;
        border: 1px solid rgba(255, 184, 77, .28) !important;
        border-radius: 9px !important;
        display: flex !important;
        grid-column: 1 / -1 !important;
        justify-content: center !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 6px !important;
        text-align: center !important;
    }

    .tcg-round-card p {
        display: none !important;
    }

    .tcg-round-card [data-turn-label] {
        color: #ffce8a !important;
        font-size: clamp(.82rem, 2.25vw, 1.04rem) !important;
        font-weight: 950 !important;
        line-height: 1 !important;
        text-shadow: 0 0 14px rgba(255, 153, 0, .3) !important;
    }

    .tcg-round-card .tcg-reset {
        align-items: center !important;
        background:
            linear-gradient(180deg, rgba(22, 44, 72, .96), rgba(8, 20, 38, .98)) !important;
        border: 1px solid rgba(125, 211, 252, .26) !important;
        border-radius: 9px !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06) !important;
        color: #eaf6ff !important;
        display: inline-flex !important;
        font-size: clamp(.58rem, 1.75vw, .76rem) !important;
        font-weight: 900 !important;
        gap: 4px !important;
        height: 100% !important;
        justify-content: center !important;
        letter-spacing: 0 !important;
        line-height: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 5px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-round-card .tcg-reset svg {
        height: 13px !important;
        width: 13px !important;
    }

    .tcg-tool-grid {
        display: grid !important;
        gap: 5px !important;
        grid-area: tools !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        padding: 0 !important;
    }

    .tcg-tool {
        align-items: center !important;
        background:
            radial-gradient(circle at 50% 0%, rgba(56, 189, 248, .18), transparent 72%),
            linear-gradient(180deg, rgba(15, 38, 68, .92), rgba(6, 18, 36, .96)) !important;
        border: 1px solid rgba(125, 211, 252, .28) !important;
        border-radius: 12px !important;
        display: grid !important;
        gap: 3px !important;
        grid-template-columns: 22px minmax(0, 1fr) !important;
        height: 100% !important;
        justify-items: start !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 4px 6px !important;
    }

    .tcg-tool svg,
    .tcg-tool > span:not(.tcg-dice-stage):not(.tcg-coin-stage) {
        display: none !important;
    }

    .tcg-tool strong {
        align-self: center !important;
        color: #ffd18a !important;
        font-size: clamp(.72rem, 2vw, .9rem) !important;
        font-weight: 950 !important;
        justify-self: end !important;
        line-height: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-dice-stage,
    .tcg-coin-stage {
        height: 22px !important;
        justify-self: start !important;
        width: 22px !important;
    }

    .tcg-dice-cube,
    .tcg-dice-face,
    .tcg-coin-disc,
    .tcg-coin-face {
        height: 20px !important;
        width: 20px !important;
    }

    .tcg-dice-face {
        border-radius: 6px !important;
        border-width: 1px !important;
    }

    .tcg-dice-face-1 { transform: rotateY(0deg) translateZ(10px) !important; }
    .tcg-dice-face-2 { transform: rotateY(90deg) translateZ(10px) !important; }
    .tcg-dice-face-3 { transform: rotateX(90deg) translateZ(10px) !important; }
    .tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(10px) !important; }
    .tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(10px) !important; }
    .tcg-dice-face-6 { transform: rotateX(180deg) translateZ(10px) !important; }

    .tcg-coin-disc::before {
        height: 20px !important;
        left: 8px !important;
        width: 4px !important;
    }

    .tcg-coin-face {
        border-width: 2px !important;
        font-size: .62rem !important;
    }

    .tcg-timer {
        display: grid !important;
        gap: 5px !important;
        grid-area: timer !important;
        grid-template-rows: minmax(28px, .30fr) minmax(0, .70fr) !important;
        overflow: hidden !important;
        padding: 5px !important;
    }

    .tcg-timer > div:first-child {
        align-items: center !important;
        background: linear-gradient(180deg, rgba(2, 6, 23, .58), rgba(15, 23, 42, .48)) !important;
        border: 1px solid rgba(125, 211, 252, .16) !important;
        border-radius: 9px !important;
        display: flex !important;
        justify-content: center !important;
        min-height: 0 !important;
        padding: 0 6px !important;
    }

    .tcg-timer span {
        display: none !important;
    }

    .tcg-timer strong {
        color: #f8fbff !important;
        font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif !important;
        font-size: clamp(1.05rem, 3.2vw, 1.55rem) !important;
        font-weight: 950 !important;
        letter-spacing: 0 !important;
        line-height: 1 !important;
        text-shadow: 0 0 18px rgba(56, 189, 248, .36) !important;
    }

    .tcg-timer-actions {
        display: grid !important;
        gap: 5px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-timer-actions button {
        background:
            linear-gradient(180deg, rgba(27, 54, 87, .96), rgba(8, 22, 40, .98)) !important;
        border: 1px solid rgba(125, 211, 252, .26) !important;
        border-radius: 9px !important;
        color: #eaf6ff !important;
        font-size: clamp(.62rem, 1.85vw, .82rem) !important;
        font-weight: 900 !important;
        height: 100% !important;
        line-height: 1.05 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 4px !important;
        text-align: center !important;
        white-space: normal !important;
    }

    .tcg-center-panel .tcg-history {
        display: grid !important;
        gap: 4px !important;
        grid-area: history !important;
        grid-template-rows: minmax(20px, auto) minmax(0, 1fr) !important;
        overflow: hidden !important;
        padding: 5px !important;
    }

    .tcg-history summary {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        min-height: 0 !important;
    }

    .tcg-history summary > span:first-child {
        color: #c7e8ff !important;
        font-size: clamp(.58rem, 1.65vw, .74rem) !important;
        font-weight: 950 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-history-actions {
        display: inline-flex !important;
        gap: 3px !important;
        min-width: 0 !important;
    }

    .tcg-history summary button {
        background: rgba(15, 23, 42, .74) !important;
        border: 1px solid rgba(125, 211, 252, .18) !important;
        border-radius: 7px !important;
        color: #dff4ff !important;
        font-size: clamp(.48rem, 1.42vw, .62rem) !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        min-height: 18px !important;
        padding: 0 4px !important;
    }

    .tcg-history ol {
        background: rgba(2, 6, 23, .36) !important;
        border: 1px solid rgba(125, 211, 252, .12) !important;
        border-radius: 9px !important;
        display: grid !important;
        gap: 3px !important;
        margin: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 4px !important;
    }

    .tcg-history li {
        background: rgba(15, 23, 42, .66) !important;
        border-radius: 7px !important;
        gap: 2px !important;
        min-height: 0 !important;
        padding: 3px 5px !important;
    }

    .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-history li span {
        font-size: clamp(.46rem, 1.3vw, .56rem) !important;
        line-height: 1 !important;
    }

    .tcg-history li strong {
        font-size: clamp(.52rem, 1.55vw, .66rem) !important;
        line-height: 1.05 !important;
    }
}

@media (max-width: 980px) and (max-height: 360px) {
    .tcg-center-panel {
        gap: 4px !important;
        grid-template-rows: minmax(38px, .17fr) minmax(34px, .13fr) minmax(72px, .35fr) minmax(48px, .35fr) !important;
        padding: 4px !important;
    }

    .tcg-center-panel .tcg-round-card,
    .tcg-center-panel .tcg-tool-grid,
    .tcg-center-panel .tcg-timer,
    .tcg-center-panel .tcg-history {
        border-radius: 10px !important;
    }

    .tcg-round-card,
    .tcg-timer,
    .tcg-center-panel .tcg-history {
        padding: 4px !important;
    }
}

/* Mobile TCG adaptive stage: one fixed design canvas, scaled to every device. */
@media (max-width: 980px) {
    html:has(.tcg-counter-page.is-mobile-fit),
    body:has(.tcg-counter-page.is-mobile-fit) {
        height: var(--tcg-vh, 100dvh) !important;
        max-height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    .tcg-counter-page.is-mobile-fit {
        background:
            radial-gradient(circle at 16% 18%, rgba(14, 165, 233, .18), transparent 18rem),
            radial-gradient(circle at 86% 76%, rgba(255, 153, 0, .2), transparent 18rem),
            linear-gradient(135deg, #030712 0%, #0b1220 52%, #020617 100%) !important;
        height: var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) !important;
        inset: 0 auto auto 0 !important;
        max-height: none !important;
        max-width: none !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        position: fixed !important;
        touch-action: manipulation !important;
        width: var(--tcg-layout-vw, var(--tcg-vw, 100vw)) !important;
        z-index: 1050 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-forced-landscape {
        height: var(--tcg-layout-vh, var(--tcg-vw, 100vw)) !important;
        left: 0 !important;
        top: 0 !important;
        transform: rotate(90deg) translateY(-100%) !important;
        transform-origin: top left !important;
        width: var(--tcg-layout-vw, var(--tcg-vh, 100dvh)) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-topbar,
    .tcg-counter-page.is-mobile-fit .tcg-counter-controls,
    .tcg-counter-page.is-mobile-fit .tcg-fullscreen-btn {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice {
        display: flex !important;
        flex-direction: column !important;
        height: var(--tcg-vh, 100dvh) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 12px !important;
        position: fixed !important;
        transform: none !important;
        width: var(--tcg-vw, 100vw) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-panel {
        align-items: center !important;
        display: flex !important;
        flex: 1 1 100% !important;
        justify-content: center !important;
        min-height: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-card {
        max-height: calc(var(--tcg-vh, 100dvh) - 24px) !important;
        overflow: auto !important;
        padding: 22px !important;
        text-align: center !important;
        width: min(100%, 520px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-actions {
        display: grid !important;
        gap: 12px !important;
        grid-template-columns: 1fr !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-actions button {
        justify-items: center !important;
        min-height: 96px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-board {
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: minmax(0, 1fr) 178px minmax(0, 1fr) !important;
        grid-template-rows: 1fr !important;
        height: var(--tcg-stage-h, 390px) !important;
        left: 50% !important;
        margin: 0 !important;
        max-height: none !important;
        max-width: none !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 8px !important;
        position: absolute !important;
        top: 50% !important;
        transform: translate(-50%, -50%) scale(var(--tcg-stage-scale, 1)) !important;
        transform-origin: center center !important;
        width: var(--tcg-stage-w, 844px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player,
    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        border-radius: 18px !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-inner {
        display: grid !important;
        gap: 8px !important;
        grid-template-rows: 38px minmax(0, 1fr) 86px 48px !important;
        height: 100% !important;
        justify-content: stretch !important;
        padding: 10px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-head {
        min-height: 0 !important;
        padding: 6px 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-name {
        font-size: 15px !important;
        min-height: 28px !important;
        padding: 3px 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-color-picker input {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-lp-badge {
        font-size: 12px !important;
        min-height: 28px !important;
        padding: 4px 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: 72px !important;
        justify-content: center !important;
        line-height: .88 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-quick-row {
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-quick-row button,
    .tcg-counter-page.is-mobile-fit .tcg-calc button {
        border-radius: 12px !important;
        font-size: 16px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-calc {
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: minmax(0, 1fr) 54px 54px !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-calc-input {
        border-radius: 12px !important;
        font-size: 16px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 12px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-calc button[data-calc-action="clear"] {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        display: grid !important;
        gap: 7px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 72px 48px 124px minmax(0, 1fr) !important;
        padding: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card {
        display: grid !important;
        gap: 6px !important;
        grid-area: round !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: 28px minmax(0, 1fr) !important;
        padding: 6px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card > div {
        grid-column: 1 / -1 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card [data-turn-label] {
        font-size: 16px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset {
        border-radius: 10px !important;
        font-size: 12px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset svg {
        height: 14px !important;
        width: 14px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool-grid {
        display: grid !important;
        gap: 7px !important;
        grid-area: tools !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool {
        border-radius: 12px !important;
        display: grid !important;
        gap: 5px !important;
        grid-template-columns: 28px minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 5px 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool strong {
        font-size: 14px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-stage,
    .tcg-counter-page.is-mobile-fit .tcg-coin-stage {
        height: 26px !important;
        width: 26px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-cube,
    .tcg-counter-page.is-mobile-fit .tcg-dice-face,
    .tcg-counter-page.is-mobile-fit .tcg-coin-disc,
    .tcg-counter-page.is-mobile-fit .tcg-coin-face {
        height: 24px !important;
        width: 24px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-face {
        border-radius: 7px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-face-1 { transform: rotateY(0deg) translateZ(12px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-2 { transform: rotateY(90deg) translateZ(12px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-3 { transform: rotateX(90deg) translateZ(12px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(12px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(12px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-6 { transform: rotateX(180deg) translateZ(12px) !important; }

    .tcg-counter-page.is-mobile-fit .tcg-coin-disc::before {
        height: 24px !important;
        left: 10px !important;
        width: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-coin-face {
        font-size: 12px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer {
        display: grid !important;
        gap: 7px !important;
        grid-area: timer !important;
        grid-template-rows: 36px minmax(0, 1fr) !important;
        padding: 7px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer strong {
        font-size: 25px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions {
        display: grid !important;
        gap: 7px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions button {
        border-radius: 10px !important;
        font-size: 13px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history {
        display: grid !important;
        gap: 5px !important;
        grid-area: history !important;
        grid-template-rows: 22px minmax(0, 1fr) !important;
        padding: 6px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary > span:first-child {
        font-size: 11px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary button {
        font-size: 10px !important;
        min-height: 18px !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history ol {
        gap: 4px !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li {
        padding: 4px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li span {
        font-size: 9px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li strong {
        font-size: 11px !important;
    }
}

@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit.is-stage-compact .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) 168px minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-stage-compact .tcg-lp-display {
        font-size: 68px !important;
    }
}

/* Mobile TCG final adaptive layout: fill screen, no transformed canvas. */
@media (max-width: 980px) {
    html:has(.tcg-counter-page.is-mobile-fit),
    body:has(.tcg-counter-page.is-mobile-fit) {
        height: var(--tcg-vh, 100dvh) !important;
        margin: 0 !important;
        max-height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: var(--tcg-vw, 100vw) !important;
    }

    .tcg-counter-page.is-mobile-fit {
        box-sizing: border-box !important;
        height: var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
        width: var(--tcg-layout-vw, var(--tcg-vw, 100vw)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-forced-landscape {
        height: var(--tcg-layout-vh, var(--tcg-vw, 100vw)) !important;
        left: 0 !important;
        position: fixed !important;
        top: 0 !important;
        transform: rotate(90deg) translateY(-100%) !important;
        transform-origin: top left !important;
        width: var(--tcg-layout-vw, var(--tcg-vh, 100dvh)) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-board {
        box-sizing: border-box !important;
        display: grid !important;
        gap: max(4px, calc(8px * var(--tcg-scale, 1))) !important;
        grid-template-columns: minmax(0, 1fr) clamp(132px, 22%, 188px) minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: 100% !important;
        left: auto !important;
        margin: 0 !important;
        max-height: none !important;
        max-width: none !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        position: relative !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player,
    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        box-sizing: border-box !important;
        height: 100% !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-inner {
        box-sizing: border-box !important;
        display: grid !important;
        gap: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
        grid-template-rows: minmax(24px, .13fr) minmax(0, 1fr) minmax(54px, .34fr) minmax(36px, .22fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: max(5px, calc(9px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-head {
        gap: max(3px, calc(6px * var(--tcg-scale, 1))) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: max(3px, calc(5px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-name {
        border-radius: max(7px, calc(10px * var(--tcg-scale, 1))) !important;
        font-size: max(11px, calc(14px * var(--tcg-scale, 1))) !important;
        height: 100% !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 max(5px, calc(8px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-actions {
        gap: max(3px, calc(5px * var(--tcg-scale, 1))) !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-color-picker {
        min-height: 0 !important;
        padding: max(2px, calc(3px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-color-picker input {
        height: max(18px, calc(22px * var(--tcg-scale, 1))) !important;
        width: max(18px, calc(22px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-lp-badge {
        align-items: center !important;
        display: inline-flex !important;
        font-size: max(10px, calc(12px * var(--tcg-scale, 1))) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 max(5px, calc(8px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-lp-display {
        font-size: clamp(40px, 14vh, 76px) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-quick-row {
        gap: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-quick-row button,
    .tcg-counter-page.is-mobile-fit .tcg-calc button {
        border-radius: max(8px, calc(11px * var(--tcg-scale, 1))) !important;
        font-size: max(12px, calc(15px * var(--tcg-scale, 1))) !important;
        height: 100% !important;
        line-height: 1 !important;
        min-height: 0 !important;
        padding: 0 max(4px, calc(7px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-calc {
        gap: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
        grid-template-columns: minmax(0, 1fr) max(42px, calc(54px * var(--tcg-scale, 1))) max(42px, calc(54px * var(--tcg-scale, 1))) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-calc-input {
        border-radius: max(8px, calc(11px * var(--tcg-scale, 1))) !important;
        font-size: max(12px, calc(15px * var(--tcg-scale, 1))) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 max(7px, calc(10px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        display: grid !important;
        gap: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(54px, .22fr) minmax(38px, .16fr) minmax(88px, .36fr) minmax(0, .26fr) !important;
        min-height: 0 !important;
        padding: max(5px, calc(8px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card,
    .tcg-counter-page.is-mobile-fit .tcg-tool-grid,
    .tcg-counter-page.is-mobile-fit .tcg-timer,
    .tcg-counter-page.is-mobile-fit .tcg-history {
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card {
        gap: max(3px, calc(5px * var(--tcg-scale, 1))) !important;
        grid-template-rows: minmax(20px, .42fr) minmax(0, .58fr) !important;
        padding: max(4px, calc(6px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card [data-turn-label] {
        font-size: max(12px, calc(16px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset {
        border-radius: max(7px, calc(10px * var(--tcg-scale, 1))) !important;
        font-size: max(9px, calc(12px * var(--tcg-scale, 1))) !important;
        min-height: 0 !important;
        padding: 0 3px !important;
        white-space: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool-grid {
        gap: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool {
        gap: max(3px, calc(5px * var(--tcg-scale, 1))) !important;
        grid-template-columns: max(22px, calc(28px * var(--tcg-scale, 1))) minmax(0, 1fr) !important;
        min-height: 0 !important;
        padding: max(3px, calc(5px * var(--tcg-scale, 1))) max(5px, calc(8px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool strong {
        font-size: max(11px, calc(14px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-stage,
    .tcg-counter-page.is-mobile-fit .tcg-coin-stage {
        height: max(22px, calc(26px * var(--tcg-scale, 1))) !important;
        width: max(22px, calc(26px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-cube,
    .tcg-counter-page.is-mobile-fit .tcg-dice-face,
    .tcg-counter-page.is-mobile-fit .tcg-coin-disc,
    .tcg-counter-page.is-mobile-fit .tcg-coin-face {
        height: max(20px, calc(24px * var(--tcg-scale, 1))) !important;
        width: max(20px, calc(24px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer {
        gap: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
        grid-template-rows: minmax(28px, .34fr) minmax(0, .66fr) !important;
        padding: max(5px, calc(7px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer strong {
        font-size: max(18px, calc(25px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions {
        gap: max(4px, calc(7px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions button {
        font-size: max(10px, calc(13px * var(--tcg-scale, 1))) !important;
        line-height: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 3px !important;
        white-space: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history {
        gap: max(3px, calc(5px * var(--tcg-scale, 1))) !important;
        grid-template-rows: minmax(18px, auto) minmax(0, 1fr) !important;
        padding: max(4px, calc(6px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary {
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary > span:first-child {
        font-size: max(9px, calc(11px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary button {
        font-size: max(8px, calc(10px * var(--tcg-scale, 1))) !important;
        min-height: 0 !important;
        padding: 2px 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li span {
        font-size: max(8px, calc(9px * var(--tcg-scale, 1))) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li strong {
        font-size: max(9px, calc(11px * var(--tcg-scale, 1))) !important;
    }
}

@media (max-width: 980px) and (max-height: 340px) {
    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        grid-template-rows: minmax(46px, .20fr) minmax(34px, .14fr) minmax(76px, .34fr) minmax(0, .32fr) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-inner {
        grid-template-rows: minmax(22px, .12fr) minmax(0, 1fr) minmax(48px, .30fr) minmax(34px, .20fr) !important;
    }
}

@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit.is-stage-compact .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) clamp(126px, 21%, 168px) minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-stage-compact .tcg-round-card .tcg-reset svg {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-stage-compact .tcg-lp-display {
        font-size: clamp(36px, 13vh, 64px) !important;
    }
}

/* Mobile TCG variable-driven authority: full screen and stable controls. */
@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit {
        height: var(--tcg-layout-vh, var(--tcg-vh, 100dvh)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: var(--tcg-m-page-pad, 6px) !important;
        width: var(--tcg-layout-vw, var(--tcg-vw, 100vw)) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-board {
        display: grid !important;
        gap: var(--tcg-m-gap, 6px) !important;
        grid-template-columns: minmax(0, 1fr) clamp(126px, 21.5%, 184px) minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        height: 100% !important;
        left: auto !important;
        margin: 0 !important;
        max-height: none !important;
        max-width: none !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        position: relative !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-inner {
        display: grid !important;
        gap: var(--tcg-m-gap, 6px) !important;
        grid-template-rows: minmax(24px, .13fr) minmax(0, 1fr) minmax(52px, .33fr) minmax(36px, .21fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: var(--tcg-m-inner-pad, 8px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-head {
        gap: 4px !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-player-name {
        font-size: var(--tcg-m-name-font, 13px) !important;
        height: 100% !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 6px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-lp-display {
        font-size: var(--tcg-m-lp-font, 58px) !important;
        line-height: .86 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-quick-row {
        gap: var(--tcg-m-gap, 6px) !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-quick-row button,
    .tcg-counter-page.is-mobile-fit .tcg-calc button {
        border-radius: var(--tcg-m-radius, 10px) !important;
        font-size: var(--tcg-m-button-font, 14px) !important;
        height: 100% !important;
        line-height: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-calc {
        gap: var(--tcg-m-gap, 6px) !important;
        grid-template-columns: minmax(0, 1fr) var(--tcg-m-calc-button, 48px) var(--tcg-m-calc-button, 48px) !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-calc-input {
        font-size: var(--tcg-m-button-font, 14px) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        display: grid !important;
        gap: var(--tcg-m-gap, 6px) !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(52px, .21fr) minmax(38px, .15fr) minmax(84px, .36fr) minmax(0, .28fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: var(--tcg-m-card-pad, 6px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card,
    .tcg-counter-page.is-mobile-fit .tcg-timer,
    .tcg-counter-page.is-mobile-fit .tcg-history {
        padding: var(--tcg-m-card-pad, 6px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card {
        gap: 4px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: minmax(18px, .40fr) minmax(0, .60fr) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card [data-turn-label] {
        font-size: var(--tcg-m-turn-font, 14px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset {
        font-size: var(--tcg-m-small-font, 10px) !important;
        height: 100% !important;
        line-height: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 3px !important;
        white-space: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset svg {
        flex: 0 0 auto !important;
        height: 12px !important;
        width: 12px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool-grid {
        gap: var(--tcg-m-gap, 6px) !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool {
        grid-template-columns: var(--tcg-m-icon, 24px) minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 4px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool strong {
        font-size: var(--tcg-m-action-font, 12px) !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-stage,
    .tcg-counter-page.is-mobile-fit .tcg-coin-stage {
        height: var(--tcg-m-icon, 24px) !important;
        width: var(--tcg-m-icon, 24px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-cube,
    .tcg-counter-page.is-mobile-fit .tcg-dice-face,
    .tcg-counter-page.is-mobile-fit .tcg-coin-disc,
    .tcg-counter-page.is-mobile-fit .tcg-coin-face {
        height: var(--tcg-m-dice, 22px) !important;
        width: var(--tcg-m-dice, 22px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer {
        gap: var(--tcg-m-gap, 6px) !important;
        grid-template-rows: minmax(26px, .32fr) minmax(0, .68fr) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer strong {
        font-size: var(--tcg-m-timer-font, 22px) !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions {
        gap: var(--tcg-m-gap, 6px) !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions button {
        font-size: var(--tcg-m-action-font, 12px) !important;
        line-height: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 3px !important;
        white-space: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history {
        gap: 3px !important;
        grid-template-rows: minmax(16px, auto) minmax(0, 1fr) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary > span:first-child,
    .tcg-counter-page.is-mobile-fit .tcg-history li strong {
        font-size: var(--tcg-m-small-font, 10px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary button,
    .tcg-counter-page.is-mobile-fit .tcg-history li span {
        font-size: 9px !important;
    }
}

/* Mobile TCG navigation and true fullscreen trigger. */
@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit {
        --tcg-mobile-nav-h: 36px;
        display: grid !important;
        gap: var(--tcg-m-page-pad, 6px) !important;
        grid-template-rows: var(--tcg-mobile-nav-h) minmax(0, 1fr) !important;
        padding:
            var(--tcg-m-page-pad, 6px)
            var(--tcg-m-page-pad, 6px)
            max(var(--tcg-m-page-pad, 6px), env(safe-area-inset-bottom))
            var(--tcg-m-page-pad, 6px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-topbar {
        align-items: center !important;
        background:
            linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .9)) !important;
        border: 1px solid rgba(125, 211, 252, .24) !important;
        border-radius: 12px !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06) !important;
        box-sizing: border-box !important;
        display: grid !important;
        gap: 6px !important;
        grid-template-columns: minmax(30px, auto) minmax(0, 1fr) !important;
        height: var(--tcg-mobile-nav-h) !important;
        margin: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 4px 6px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-brand {
        align-items: center !important;
        display: inline-flex !important;
        gap: 5px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-brand img,
    .tcg-counter-page.is-mobile-fit .tcg-counter-brand span {
        border-radius: 8px !important;
        flex: 0 0 auto !important;
        height: 24px !important;
        padding: 2px !important;
        width: 24px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-brand strong {
        color: #f8fafc !important;
        display: inline-block !important;
        font-size: 12px !important;
        font-weight: 950 !important;
        line-height: 1 !important;
        max-width: 76px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-controls {
        align-items: center !important;
        display: grid !important;
        gap: 5px !important;
        grid-template-columns: minmax(0, 1fr) 34px !important;
        height: 100% !important;
        justify-self: stretch !important;
        margin: 0 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-select {
        display: block !important;
        height: 100% !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-select > span {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-select .form-select {
        background-color: rgba(2, 6, 23, .86) !important;
        border-color: rgba(125, 211, 252, .28) !important;
        border-radius: 9px !important;
        color: #f8fafc !important;
        font-size: 11px !important;
        height: 100% !important;
        line-height: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 22px 0 8px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-fullscreen-btn {
        align-items: center !important;
        background: linear-gradient(180deg, rgba(255, 184, 77, .26), rgba(146, 64, 14, .18)) !important;
        border: 1px solid rgba(255, 184, 77, .38) !important;
        border-radius: 9px !important;
        color: #ffe6b7 !important;
        display: inline-flex !important;
        height: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 34px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-fullscreen-btn span {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-fullscreen-btn svg {
        height: 17px !important;
        width: 17px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-board {
        grid-row: 2 !important;
        height: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-fullscreen {
        --tcg-mobile-nav-h: 34px;
        gap: 4px !important;
        padding: 4px !important;
    }
}

/* Mobile TCG compact tools pass: give more readable space to the duel log. */
@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        gap: 4px !important;
        grid-template-rows: minmax(46px, .20fr) minmax(26px, .10fr) minmax(74px, .30fr) minmax(0, .40fr) !important;
        padding: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool-grid {
        gap: 4px !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool {
        border-radius: 8px !important;
        gap: 3px !important;
        grid-template-columns: 18px minmax(0, 1fr) !important;
        min-height: 0 !important;
        padding: 2px 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool strong {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-stage,
    .tcg-counter-page.is-mobile-fit .tcg-coin-stage {
        height: 18px !important;
        width: 18px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-cube,
    .tcg-counter-page.is-mobile-fit .tcg-dice-face,
    .tcg-counter-page.is-mobile-fit .tcg-coin-disc,
    .tcg-counter-page.is-mobile-fit .tcg-coin-face {
        height: 16px !important;
        width: 16px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-face {
        border-radius: 5px !important;
        border-width: 1px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-dice-face-1 { transform: rotateY(0deg) translateZ(8px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-2 { transform: rotateY(90deg) translateZ(8px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-3 { transform: rotateX(90deg) translateZ(8px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-4 { transform: rotateX(-90deg) translateZ(8px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-5 { transform: rotateY(-90deg) translateZ(8px) !important; }
    .tcg-counter-page.is-mobile-fit .tcg-dice-face-6 { transform: rotateX(180deg) translateZ(8px) !important; }

    .tcg-counter-page.is-mobile-fit .tcg-coin-disc::before {
        height: 16px !important;
        left: 6px !important;
        width: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-coin-face {
        border-width: 1px !important;
        font-size: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history {
        gap: 4px !important;
        grid-template-rows: minmax(20px, auto) minmax(0, 1fr) !important;
        padding: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary > span:first-child {
        font-size: 12px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary button {
        font-size: 10px !important;
        min-height: 18px !important;
        padding: 0 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history ol {
        gap: 4px !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li {
        display: grid !important;
        gap: 2px !important;
        padding: 4px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li:nth-child(n + 3) {
        display: grid !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li:nth-child(n + 4) {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li span {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li strong {
        font-size: 12px !important;
        line-height: 1.14 !important;
    }
}

@media (max-width: 980px) and (max-height: 340px) {
    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        grid-template-rows: minmax(42px, .19fr) minmax(24px, .09fr) minmax(68px, .29fr) minmax(0, .43fr) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }
}

/* Final mobile TCG feedback button override. */
@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit .tcg-counter-controls {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 34px 34px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-feedback-link {
        align-items: center !important;
        display: inline-flex !important;
        height: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-feedback-link span {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-feedback-link svg {
        height: 17px !important;
        width: 17px !important;
    }
}

/* Mobile TCG log readability fix: smaller text, complete rows. */
@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit .tcg-history {
        gap: 3px !important;
        grid-template-rows: 18px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary {
        gap: 3px !important;
        min-height: 18px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary > span:first-child {
        font-size: 10px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history summary button {
        font-size: 8px !important;
        line-height: 1 !important;
        min-height: 16px !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history ol {
        align-content: start !important;
        gap: 3px !important;
        grid-auto-rows: minmax(0, max-content) !important;
        overflow: hidden !important;
        padding: 3px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li {
        display: grid !important;
        gap: 1px !important;
        grid-template-rows: auto auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li span {
        font-size: 8px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li strong {
        display: block !important;
        font-size: 10px !important;
        line-height: 1.05 !important;
        max-height: 2.1em !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Mobile TCG adaptive text authority: every control fits its own box. */
@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(168px, var(--tcg-m-center-share, 30%)) minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-stage-compact .tcg-counter-board,
    .tcg-counter-page.is-mobile-fit.is-forced-landscape .tcg-counter-board,
    .tcg-counter-page.is-mobile-fit.is-ultra-tight .tcg-counter-board {
        grid-template-columns: minmax(0, 1fr) minmax(168px, var(--tcg-m-center-share, 30%)) minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        display: grid !important;
        grid-template-rows:
            minmax(34px, var(--tcg-m-round-row, 44px))
            minmax(22px, var(--tcg-m-tool-row, 30px))
            minmax(90px, var(--tcg-m-timer-row, 112px))
            minmax(0, 1fr) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card,
    .tcg-counter-page.is-mobile-fit .tcg-tool-grid,
    .tcg-counter-page.is-mobile-fit .tcg-timer,
    .tcg-counter-page.is-mobile-fit .tcg-history {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card {
        align-items: stretch !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(0, .55fr) repeat(2, minmax(0, .9fr)) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card > div {
        align-content: center !important;
        display: grid !important;
        gap: 1px !important;
        grid-column: auto !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card p {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card [data-turn-label] {
        align-items: center !important;
        background: rgba(255, 184, 77, .13) !important;
        border: 1px solid rgba(255, 184, 77, .24) !important;
        border-radius: 8px !important;
        color: #ffe6b7 !important;
        display: flex !important;
        font-size: var(--tcg-fit-font, clamp(10px, calc(var(--tcg-m-round-row, 44px) * .30), 14px)) !important;
        justify-content: center !important;
        line-height: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 4px !important;
        text-align: center !important;
        white-space: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset {
        align-items: center !important;
        border-radius: 8px !important;
        display: grid !important;
        gap: 2px !important;
        grid-template-columns: minmax(0, 1fr) !important;
        height: 100% !important;
        justify-items: center !important;
        line-height: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow-wrap: normal !important;
        overflow: hidden !important;
        padding: 1px 4px !important;
        text-align: center !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        word-break: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset svg {
        display: none !important;
        height: clamp(12px, calc(var(--tcg-m-round-row, 44px) * .34), 17px) !important;
        width: clamp(12px, calc(var(--tcg-m-round-row, 44px) * .34), 17px) !important;
    }

    .tcg-counter-page.is-mobile-fit button,
    .tcg-counter-page.is-mobile-fit .tcg-tool strong,
    .tcg-counter-page.is-mobile-fit .tcg-counter-select .form-select {
        box-sizing: border-box !important;
        max-height: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-reset,
    .tcg-counter-page.is-mobile-fit .tcg-tool,
    .tcg-counter-page.is-mobile-fit .tcg-counter-select .form-select,
    .tcg-counter-page.is-mobile-fit .tcg-timer-actions button,
    .tcg-counter-page.is-mobile-fit .tcg-quick-row button,
    .tcg-counter-page.is-mobile-fit .tcg-calc button,
    .tcg-counter-page.is-mobile-fit .tcg-history summary button {
        align-items: center !important;
        display: inline-flex !important;
        font-size: var(--tcg-fit-font, var(--tcg-m-action-font, 11px)) !important;
        justify-content: center !important;
        line-height: 1 !important;
        overflow-wrap: anywhere !important;
        text-align: center !important;
        white-space: normal !important;
        word-break: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool {
        grid-template-columns: minmax(14px, .18fr) minmax(0, .50fr) minmax(16px, .18fr) minmax(0, .26fr) !important;
        height: 100% !important;
        padding: 1px 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-quick-row button,
    .tcg-counter-page.is-mobile-fit .tcg-calc button {
        font-size: var(--tcg-fit-font, var(--tcg-m-button-font, 13px)) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-tool strong {
        display: block !important;
        font-size: var(--tcg-fit-font, var(--tcg-m-action-font, 11px)) !important;
        line-height: 1 !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions {
        align-items: stretch !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions button {
        height: 100% !important;
        padding: 1px 3px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer {
        align-items: stretch !important;
        display: grid !important;
        gap: 5px !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(22px, .30fr) minmax(0, .70fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer > div:first-child {
        align-items: center !important;
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) !important;
        justify-items: center !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer span {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer strong {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(18px, calc(var(--tcg-m-timer-row, 112px) * .20), 26px) !important;
        justify-content: center !important;
        line-height: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        writing-mode: horizontal-tb !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions {
        gap: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-timer-actions button {
        border-radius: 8px !important;
        font-size: var(--tcg-fit-font, clamp(10px, calc(var(--tcg-m-timer-row, 112px) * .105), 13px)) !important;
        min-height: 0 !important;
        min-width: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-history li:nth-child(n + 2) {
        display: var(--tcg-second-log-display, grid) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-tight-height .tcg-history li:nth-child(n + 2),
    .tcg-counter-page.is-mobile-fit .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }
}

/* Mobile TCG round controls: turn gets its own row, reset/undo sit below it. */
@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit .tcg-center-panel {
        grid-template-rows:
            minmax(32px, var(--tcg-m-round-row, 40px))
            minmax(22px, var(--tcg-m-tool-row, 30px))
            minmax(90px, var(--tcg-m-timer-row, 112px))
            minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card {
        align-items: stretch !important;
        display: grid !important;
        gap: 3px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: minmax(13px, .42fr) minmax(0, .58fr) !important;
        padding: 3px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card > div {
        align-content: stretch !important;
        display: grid !important;
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card p {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card [data-turn-label] {
        align-items: center !important;
        border-radius: 7px !important;
        display: flex !important;
        font-size: clamp(11px, calc(var(--tcg-m-round-row, 40px) * .30), 14px) !important;
        height: 100% !important;
        justify-content: center !important;
        line-height: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0 6px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset {
        align-items: center !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        font-size: var(--tcg-fit-font, clamp(9px, calc(var(--tcg-m-round-row, 40px) * .25), 12px)) !important;
        grid-row: 2 !important;
        height: 100% !important;
        justify-content: center !important;
        line-height: 1 !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        overflow-wrap: normal !important;
        padding: 0 4px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        word-break: normal !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-round-card .tcg-reset svg {
        display: none !important;
    }
}

/* Unified mobile public navigation. */
.public-mobile-nav-toggle,
.public-mobile-nav-backdrop,
.public-mobile-sidebar {
    display: none;
}

@media (max-width: 980px) {
    .public-mobile-nav-toggle {
        align-items: center;
        background: linear-gradient(180deg, #232f3e 0%, #131921 100%);
        border: 1px solid rgba(255, 153, 0, .58);
        border-radius: 0 18px 18px 0;
        box-shadow: 0 14px 34px rgba(15, 23, 42, .28);
        color: #fff;
        display: inline-flex;
        font-weight: 800;
        gap: 0;
        left: 0;
        min-height: 46px;
        padding: 0 12px 0 11px;
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        z-index: 3200;
    }

    .public-mobile-nav-toggle svg {
        height: 20px;
        width: 20px;
    }

    .public-mobile-nav-toggle span {
        display: none;
    }

    .public-mobile-nav-backdrop {
        background: rgba(15, 23, 42, .46);
        bottom: 0;
        display: block;
        left: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transition: opacity .22s ease;
        z-index: 3190;
    }

    .public-mobile-sidebar {
        background:
            linear-gradient(180deg, rgba(255, 153, 0, .08), transparent 160px),
            #fff;
        border-right: 1px solid rgba(15, 23, 42, .14);
        bottom: 0;
        box-shadow: 18px 0 44px rgba(15, 23, 42, .30);
        display: flex;
        flex-direction: column;
        left: 0;
        max-width: 340px;
        opacity: .96;
        padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
        pointer-events: none;
        position: fixed;
        top: 0;
        transform: translateX(-106%);
        transition: transform .24s ease, opacity .24s ease;
        width: min(84vw, 340px);
        z-index: 3210;
    }

    .public-mobile-sidebar-head {
        align-items: center;
        background:
            linear-gradient(135deg, rgba(255, 153, 0, .18), transparent 46%),
            linear-gradient(180deg, #232f3e 0%, #131921 100%);
        border: 1px solid rgba(255, 153, 0, .28);
        border-radius: 16px;
        box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
        display: flex;
        gap: 12px;
        justify-content: space-between;
        margin-bottom: 12px;
        padding: 10px;
    }

    .public-mobile-sidebar-brand {
        align-items: center;
        color: #ffffff;
        display: inline-flex;
        gap: 10px;
        min-width: 0;
        text-decoration: none;
    }

    .public-mobile-sidebar-brand img,
    .public-mobile-sidebar-brand > span:first-child {
        align-items: center;
        background: #ffffff;
        border: 1px solid rgba(255, 255, 255, .42);
        border-radius: 10px;
        color: #111827;
        display: inline-flex;
        flex: 0 0 40px;
        font-weight: 900;
        height: 40px;
        justify-content: center;
        object-fit: contain;
        padding: 5px;
        width: 40px;
    }

    .public-mobile-sidebar-brand strong {
        display: block;
        font-size: 16px;
        font-weight: 950;
        line-height: 1.12;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .public-mobile-nav-close {
        align-items: center;
        background: rgba(255, 255, 255, .12);
        border: 1px solid rgba(255, 255, 255, .26);
        border-radius: 999px;
        color: #ffffff;
        display: inline-flex;
        flex: 0 0 38px;
        height: 38px;
        justify-content: center;
        padding: 0;
        width: 38px;
    }

    .public-mobile-nav-close svg {
        height: 19px;
        width: 19px;
    }

    .public-mobile-nav-links {
        display: grid;
        gap: 8px;
        overflow: auto;
        padding: 4px 2px 12px;
    }

    .public-mobile-nav-links a,
    .public-mobile-nav-links button {
        align-items: center;
        background: #f8fafc;
        border: 1px solid rgba(15, 23, 42, .10);
        border-radius: 12px;
        color: #111827;
        display: flex;
        font-weight: 800;
        gap: 10px;
        justify-content: flex-start;
        min-height: 44px;
        padding: 10px 12px;
        text-decoration: none;
        width: 100%;
    }

    .public-mobile-nav-links a:hover,
    .public-mobile-nav-links a:focus,
    .public-mobile-nav-links button:hover,
    .public-mobile-nav-links button:focus {
        background: #fff7e6;
        border-color: rgba(255, 153, 0, .42);
        color: #111827;
    }

    .public-mobile-nav-links svg {
        color: #ff9900;
        flex: 0 0 18px;
        height: 18px;
        width: 18px;
    }

    .public-mobile-nav-label {
        color: #64748b;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: .08em;
        margin: 10px 4px 0;
        text-transform: uppercase;
    }

    .public-mobile-nav-section {
        display: grid;
        gap: 7px;
    }

    .public-mobile-nav-section .public-mobile-nav-parent {
        background: #232f3e;
        border-color: #232f3e;
        color: #fff;
    }

    .public-mobile-nav-section .public-mobile-nav-child {
        margin-left: 13px;
        min-height: 42px;
    }

    .public-mobile-nav-section .public-mobile-nav-child small {
        color: #64748b;
        display: block;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.2;
        margin-top: 2px;
    }

    body.public-mobile-nav-open {
        overflow: hidden;
    }

    body.public-mobile-nav-open .public-mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.public-mobile-nav-open .public-mobile-sidebar {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    body.public-mobile-nav-open .public-mobile-nav-toggle {
        opacity: 0;
        pointer-events: none;
    }

    .storefront-nav {
        padding-left: 58px;
    }

    .storefront-nav > nav {
        display: none !important;
    }

    .featured-carousel {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
    }

    .featured-carousel-control {
        height: 38px;
        width: 38px;
    }

    .featured-carousel[data-visible-count] .featured-carousel-track {
        grid-auto-columns: 100%;
    }

    .public-header .public-navbar .container {
        padding-left: 64px;
    }

    .tcg-counter-page .tcg-counter-topbar,
    .storefront-category-page .category-page-nav {
        padding-left: 58px;
    }
}

@media (max-width: 480px) {
    .public-mobile-nav-toggle {
        min-height: 44px;
        padding-right: 12px;
    }

    .storefront-nav {
        gap: 10px;
        padding-left: 52px;
    }
}

/* TCG Counter mobile uses a rotated landscape stage, so its public nav follows that axis. */
@media (max-width: 980px) {
    .public-tcg-counter-body .public-mobile-nav-toggle {
        border-radius: 0 0 14px 0;
        box-shadow: 0 10px 26px rgba(0, 0, 0, .34);
        left: 0 !important;
        min-height: 40px;
        padding: 0 11px;
        top: 0 !important;
        z-index: 3400;
    }

    .public-tcg-counter-body .public-mobile-sidebar {
        border-bottom: 1px solid rgba(255, 153, 0, .34);
        border-right: 0;
        bottom: auto;
        box-shadow: 0 18px 44px rgba(0, 0, 0, .36);
        height: min(72vh, 320px);
        left: 0;
        max-width: none;
        opacity: 0;
        right: 0;
        top: 0;
        transform: translateY(-106%);
        width: 100vw;
        visibility: hidden;
    }

    .public-tcg-counter-body.public-mobile-nav-open .public-mobile-sidebar {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }

    .public-tcg-counter-body .public-mobile-nav-links {
        align-content: start;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-tcg-counter-body .public-mobile-nav-section {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-tcg-counter-body .public-mobile-nav-section .public-mobile-nav-parent {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) and (orientation: portrait) {
    .public-tcg-counter-body .public-mobile-nav-toggle {
        transform: rotate(90deg) translateY(-100%);
        transform-origin: top left;
    }

    .public-tcg-counter-body .public-mobile-sidebar {
        height: min(var(--tcg-layout-vh, 100vw), 340px);
        max-height: calc(var(--tcg-layout-vh, 100vw) - 10px);
        transform: rotate(90deg) translateY(-100%) translateY(-106%);
        transform-origin: top left;
        width: var(--tcg-layout-vw, 100vh);
    }

    .public-tcg-counter-body.public-mobile-nav-open .public-mobile-sidebar {
        transform: rotate(90deg) translateY(-100%);
    }
}

/* Online TCG counter room mode. */
.tcg-online-toggle,
.tcg-feedback-link {
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 184, 77, .18), rgba(245, 158, 11, .1));
    border: 1px solid rgba(245, 158, 11, .36);
    border-radius: 999px;
    color: #ffcc80;
    display: inline-flex;
    font-weight: 900;
    gap: 8px;
    min-height: 42px;
    padding: 0 15px;
    text-decoration: none;
}

.tcg-online-toggle svg,
.tcg-feedback-link svg {
    height: 18px;
    width: 18px;
}

.tcg-online-toggle:hover,
.tcg-feedback-link:hover {
    background: linear-gradient(180deg, rgba(255, 184, 77, .26), rgba(245, 158, 11, .16));
    color: #fff3d6;
}

.tcg-auth-login,
.tcg-auth-chip {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    color: #f8fafc;
    display: inline-flex;
    font-size: .88rem;
    font-weight: 900;
    gap: 7px;
    min-height: 38px;
    padding: 0 10px;
    text-decoration: none;
}

.tcg-user-actions.tcg-auth-chip {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .16);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
    color: #f8fafc;
    gap: 4px;
    padding: 3px;
}

.tcg-user-actions .tcg-auth-account-link {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 7px;
    justify-content: center;
    min-height: 30px;
    padding: 0 8px 0 2px;
}

.tcg-user-actions .tcg-auth-logout {
    border-left: 1px solid rgba(255, 255, 255, .18);
    color: inherit;
    min-height: 30px;
    padding: 0 8px;
}

.tcg-user-actions .tcg-auth-logout:hover,
.tcg-user-actions .tcg-auth-account-link:hover {
    color: #fff3d6;
}

.tcg-auth-login {
    cursor: pointer;
}

.tcg-auth-login:hover,
.tcg-auth-login:focus,
.tcg-auth-chip:hover {
    background: rgba(255, 153, 0, .18);
    border-color: rgba(255, 153, 0, .44);
    color: #fff3d6;
}

.tcg-auth-chip a,
.tcg-mode-account a {
    color: inherit;
    text-decoration: none;
}

.tcg-auth-name {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    max-width: 140px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storefront-auth-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    justify-content: space-between;
    margin-top: 14px;
}

.storefront-auth-links a,
.storefront-auth-links button {
    background: transparent;
    border: 0;
    color: #2563eb;
    font-size: .92rem;
    font-weight: 800;
    padding: 0;
    text-decoration: none;
}

.storefront-auth-links a:hover,
.storefront-auth-links button:hover {
    color: #c45500;
    text-decoration: underline;
}

.tcg-auth-logout {
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, .18);
    display: inline-flex;
    justify-content: center;
    margin-left: 2px;
    padding-left: 8px;
}

.tcg-auth-logout svg,
.tcg-auth-login svg {
    height: 16px;
    width: 16px;
}

.tcg-mode-account {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 0 auto 16px;
}

.tcg-mode-account-link,
.tcg-mode-signin,
.tcg-mode-signout {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    color: #f8fafc;
    display: inline-flex;
    font-weight: 900;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
}

.tcg-mode-signin,
.tcg-mode-signout {
    cursor: pointer;
}

.tcg-mode-signin:hover,
.tcg-mode-signout:hover,
.tcg-mode-account-link:hover {
    background: rgba(255, 153, 0, .18);
    color: #fff3d6;
}

.tcg-mode-account-inline {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.public-tcg-counter-body .storefront-auth-modal {
    z-index: 20000;
}

.public-tcg-counter-body .modal-backdrop {
    z-index: 19990;
}

.storefront-auth-modal [data-auth-error]:not(.d-none),
.storefront-auth-modal [data-auth-success]:not(.d-none) {
    display: block !important;
    font-weight: 800;
    margin: 12px 0;
}

.tcg-online-panel {
    display: none;
    margin: 0 auto 18px;
    max-width: min(1180px, calc(100vw - 28px));
    width: 100%;
}

.tcg-online-panel.is-showing,
.tcg-online-panel[aria-hidden="false"] {
    display: block;
}

.tcg-online-card {
    align-items: center;
    background:
        radial-gradient(circle at 92% 0%, rgba(56, 189, 248, .16), transparent 18rem),
        linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(2, 6, 23, .96));
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .08);
    color: #e5edf7;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 20px;
}

.tcg-online-card p {
    color: #ffcc80;
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .16em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.tcg-online-card h2 {
    color: #fff;
    font-size: clamp(1.25rem, 2vw, 1.9rem);
    font-weight: 950;
    letter-spacing: 0;
    margin: 0 0 5px;
}

.tcg-online-card span {
    color: #b6c6da;
    font-weight: 750;
}

.tcg-online-actions {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(150px, 190px) auto;
}

.tcg-online-primary,
.tcg-online-secondary,
.tcg-online-room button {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 950;
    gap: 8px;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
}

.tcg-online-primary {
    background: linear-gradient(180deg, #ffb84d, #f59e0b);
    border: 0;
    color: #111827;
}

.tcg-online-secondary,
.tcg-online-room button {
    background: rgba(148, 163, 184, .12);
    border: 1px solid rgba(148, 163, 184, .28);
    color: #e5edf7;
}

.tcg-online-join {
    display: grid;
    gap: 5px;
}

.tcg-online-join span {
    color: #ffcc80;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tcg-online-join .form-control {
    background: rgba(2, 6, 23, .72);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    color: #fff;
    font-weight: 950;
    letter-spacing: .08em;
    min-height: 42px;
}

.tcg-online-room {
    align-items: center;
    display: flex;
    gap: 14px;
}

.tcg-online-room > div {
    align-items: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 18px;
    display: grid;
    gap: 4px;
    min-width: 130px;
    padding: 12px;
}

.tcg-online-room strong {
    color: #fff;
    font-size: 1.55rem;
    font-weight: 950;
    letter-spacing: .12em;
}

.tcg-online-room img {
    background: #fff;
    border-radius: 16px;
    height: 112px;
    padding: 8px;
    width: 112px;
}

.tcg-counter-page.is-online-mode {
    min-height: 100dvh;
    overflow: auto;
}

.tcg-counter-page.is-online-mode .tcg-counter-topbar,
.tcg-counter-page.is-online-mode .tcg-online-panel,
.tcg-counter-page.is-online-mode .tcg-counter-board {
    max-width: 720px;
}

.tcg-counter-page.is-online-mode .tcg-counter-topbar {
    margin-bottom: 12px;
}

.tcg-counter-page.is-online-mode .tcg-online-card {
    grid-template-columns: 1fr;
}

.tcg-counter-page.is-online-mode .tcg-online-actions {
    grid-template-columns: 1fr;
}

.tcg-counter-page.is-online-mode .tcg-online-room {
    justify-content: space-between;
}

.tcg-counter-page.is-online-mode .tcg-counter-board {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, auto) auto minmax(250px, auto);
    height: auto;
    margin: 0 auto;
    min-height: 0;
}

.tcg-counter-page.is-online-mode .tcg-player-top {
    order: 1;
}

.tcg-counter-page.is-online-mode .tcg-center-panel {
    order: 2;
}

.tcg-counter-page.is-online-mode .tcg-player-bottom {
    order: 3;
}

.tcg-counter-page.is-online-mode .tcg-player-inner {
    grid-template-rows: auto minmax(100px, auto) auto auto;
}

.tcg-counter-page.is-online-mode .tcg-lp-display {
    font-size: clamp(4.4rem, 18vw, 8rem);
}

.tcg-counter-page.is-online-mode .tcg-center-panel {
    grid-template-columns: 1fr;
}

.tcg-counter-page.is-online-mode .tcg-fullscreen-btn {
    display: none;
}

@media (max-width: 980px) {
    html:has(.tcg-counter-page.is-online-mode),
    body:has(.tcg-counter-page.is-online-mode) {
        height: auto !important;
        max-height: none !important;
        overflow: auto !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode {
        height: auto !important;
        min-height: 100dvh !important;
        overflow: auto !important;
        padding: 10px !important;
        position: relative !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-topbar,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-controls,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-online-toggle,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-feedback-link {
        display: flex !important;
        height: auto !important;
        min-height: 40px !important;
        overflow: visible !important;
        width: auto !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-topbar {
        align-items: center !important;
        gap: 8px !important;
        margin: 0 auto 10px !important;
        padding: 8px !important;
        position: static !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-brand {
        display: flex !important;
        min-width: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-brand strong {
        display: block !important;
        font-size: 13px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-controls {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        margin-left: auto !important;
        max-width: min(100%, 420px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-select {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-auth-chip,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-auth-login {
        min-height: 34px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-auth-name {
        max-width: 92px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-online-panel {
        display: none !important;
        margin-bottom: 10px !important;
        max-width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-online-panel.is-showing,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-online-panel[aria-hidden="false"] {
        display: block !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-online-card {
        border-radius: 16px !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-online-room img {
        height: 86px !important;
        width: 86px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-board {
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(178px, auto) auto minmax(220px, auto) !important;
        height: auto !important;
        left: auto !important;
        margin: 0 auto !important;
        max-width: 680px !important;
        padding: 0 !important;
        position: static !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-player,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-center-panel {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-player-inner {
        gap: 8px !important;
        grid-template-rows: auto minmax(72px, auto) auto auto !important;
        padding: 9px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-lp-display {
        font-size: clamp(3.6rem, 19vw, 6.4rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-center-panel {
        display: grid !important;
        gap: 8px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto minmax(82px, auto) !important;
        padding: 9px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-round-card,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-tool-grid,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-timer,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-history {
        height: auto !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-timer {
        grid-template-rows: auto auto !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-history li:nth-child(n + 4) {
        display: none !important;
    }

    body.public-tcg-counter-body:has(.tcg-counter-page.is-online-mode) .public-mobile-nav-toggle {
        transform: none !important;
    }

    body.public-tcg-counter-body:has(.tcg-counter-page.is-online-mode) .public-mobile-sidebar {
        bottom: 0 !important;
        height: 100dvh !important;
        left: 0 !important;
        max-height: none !important;
        right: auto !important;
        top: 0 !important;
        transform: translateX(-106%) !important;
        width: min(84vw, 340px) !important;
    }

body.public-tcg-counter-body.public-mobile-nav-open:has(.tcg-counter-page.is-online-mode) .public-mobile-sidebar {
        transform: translateX(0) !important;
    }
}

/* Storefront navigation and mobile carousel polish. */
.storefront-hero,
.storefront-shell {
    overflow: visible;
}

.storefront-nav {
    border-radius: 0 0 6px 6px;
    gap: 10px;
    margin-bottom: 28px;
    min-height: 58px;
    padding: 0 14px;
    z-index: 1600;
}

.storefront-logo img,
.storefront-logo span,
.storefront-logo .brand-logo-letter {
    height: 34px;
    width: 34px;
}

.storefront-logo img {
    max-width: 132px;
    width: auto;
}

.storefront-logo .brand-logo-rotator,
.storefront-logo .brand-logo-slide {
    height: 34px;
}

.storefront-logo .brand-logo-rotator {
    min-width: min(210px, 38vw);
}

.storefront-logo strong,
.storefront-logo .brand-logo-slide strong {
    font-size: 1rem;
}

.storefront-nav nav a,
.storefront-cart {
    align-items: center;
    display: inline-flex;
    min-height: 58px;
    padding: 0 10px;
}

.storefront-nav-menu {
    left: auto;
    min-width: min(720px, calc(100vw - 36px));
    right: 50%;
    top: calc(100% + 6px);
    transform: translateX(50%);
    z-index: 4200;
}

.storefront-nav-menu::after {
    content: "";
    height: 10px;
    left: 0;
    position: absolute;
    right: 0;
    top: -10px;
}

.storefront-nav-group:first-child .storefront-nav-menu {
    left: 0;
    right: auto;
    transform: none;
}

.storefront-nav-group:last-child .storefront-nav-menu {
    left: auto;
    right: 0;
    transform: none;
}

@media (max-width: 980px) {
    html,
    body.public-body {
        overflow-x: hidden;
    }

    .public-mobile-nav-toggle {
        background:
            linear-gradient(135deg, rgba(255, 153, 0, .18), transparent 46%),
            linear-gradient(180deg, #232f3e 0%, #131921 100%) !important;
        border-color: rgba(255, 153, 0, .34) !important;
        border-radius: 0 18px 18px 0 !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, .24) !important;
        gap: 9px !important;
        max-width: min(78vw, 330px);
        min-height: 50px !important;
        padding: 6px 12px 6px 10px !important;
    }

    .public-mobile-nav-toggle > svg {
        color: #ffb84d;
        flex: 0 0 20px;
        height: 20px;
        width: 20px;
    }

    .public-mobile-toggle-brand {
        align-items: center;
        display: inline-flex !important;
        gap: 8px;
        min-width: 0;
    }

    .public-mobile-toggle-brand img,
    .public-mobile-toggle-brand > span {
        align-items: center;
        background: #ffffff;
        border-radius: 9px;
        color: #111827;
        display: inline-flex;
        flex: 0 0 32px;
        font-size: .9rem;
        font-weight: 950;
        height: 32px;
        justify-content: center;
        object-fit: contain;
        padding: 4px;
        width: 32px;
    }

    .public-mobile-toggle-brand strong {
        color: #ffffff;
        display: block;
        font-size: 13px;
        font-weight: 950;
        line-height: 1.05;
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .storefront-nav {
        background: transparent;
        border: 0;
        box-shadow: none;
        height: 0;
        justify-content: flex-end;
        margin: 0;
        min-height: 0;
        overflow: visible;
        padding: 0;
    }

    .storefront-logo {
        display: none;
    }

    .featured-carousel {
        gap: 8px;
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        margin-inline: -2px;
    }

    .featured-carousel-control {
        height: 34px;
        width: 34px;
    }

    .featured-carousel-window {
        overflow: hidden;
        width: 100%;
    }

    .featured-carousel[data-visible-count] .featured-carousel-track,
    .featured-carousel-track {
        display: flex;
        gap: 0;
        grid-auto-columns: unset;
    }

    .featured-carousel .featured-product-card {
        flex: 0 0 100%;
        max-width: 100%;
        min-width: 100%;
        width: 100%;
    }

    .featured-product-card .product-art-link {
        display: block;
    }

    .featured-product-card .product-card-body h3 {
        min-height: 0;
    }

    .featured-product-card .product-card-body h3 a {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .featured-carousel-band {
        padding-top: 34px;
    }
}

@media (max-width: 480px) {
    .public-mobile-nav-toggle {
        max-width: min(82vw, 300px);
    }

    .public-mobile-toggle-brand strong {
        max-width: 158px;
    }

    .storefront-nav {
        min-height: 0;
        padding-left: 0;
    }
}

/* TCG Counter online lobby/game split. */
.tcg-counter-page.is-mode-choice .tcg-counter-board,
.tcg-counter-page.is-mode-choice .tcg-online-panel {
    display: none !important;
}

.tcg-mode-panel {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: min(620px, calc(100dvh - 96px));
    padding: 20px;
}

.tcg-mode-card {
    background:
        radial-gradient(circle at 15% 20%, rgba(245, 158, 11, .2), transparent 34%),
        linear-gradient(145deg, rgba(15, 23, 42, .96), rgba(2, 6, 23, .98));
    border: 1px solid rgba(251, 191, 36, .28);
    border-radius: 26px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
    color: #fff;
    max-width: 760px;
    padding: clamp(24px, 5vw, 48px);
    text-align: center;
    width: 100%;
}

.tcg-mode-card p {
    color: #ffcc80;
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .14em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.tcg-mode-card h1 {
    font-size: clamp(2rem, 6vw, 4.4rem);
    font-weight: 950;
    margin: 0;
}

.tcg-mode-card > span {
    color: #cbd5e1;
    display: block;
    font-weight: 700;
    margin: 10px auto 26px;
    max-width: 520px;
}

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

.tcg-mode-actions button {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 160px;
    padding: 22px;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.tcg-mode-actions button:hover {
    background: rgba(255, 153, 0, .16);
    border-color: rgba(255, 153, 0, .55);
    transform: translateY(-2px);
}

.tcg-mode-actions svg {
    color: #ff9900;
    height: 36px;
    width: 36px;
}

.tcg-mode-actions strong {
    font-size: 1.25rem;
    font-weight: 950;
}

.tcg-mode-actions small {
    color: #b6c6da;
    font-weight: 800;
}

.tcg-online-profile {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(190px, 1fr) minmax(170px, .85fr) 72px minmax(150px, .7fr);
}

.tcg-online-profile label {
    display: grid;
    gap: 5px;
}

.tcg-online-profile span {
    color: #ffcc80;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tcg-online-profile .form-select,
.tcg-online-profile .form-control {
    background: rgba(2, 6, 23, .72);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    min-height: 42px;
}

.tcg-online-profile input[type="color"] {
    background: rgba(2, 6, 23, .72);
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    height: 42px;
    padding: 5px;
    width: 100%;
}

.tcg-counter-page.is-online-room-page .tcg-online-actions,
.tcg-counter-page.is-online-room-page .tcg-online-lobby-list {
    display: none;
}

.tcg-counter-page.is-online-game .tcg-online-profile {
    display: none;
}

.tcg-online-lobby-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tcg-online-empty,
.tcg-online-room-tile {
    background: linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(30, 41, 59, .82));
    border: 1px solid rgba(255, 204, 128, .22);
    border-radius: 18px;
    color: #e5edf8;
    min-height: 92px;
    padding: 14px;
    text-align: left;
}

.tcg-online-empty {
    align-items: center;
    display: flex;
    font-weight: 850;
    justify-content: center;
}

.tcg-online-room-tile {
    display: grid;
    gap: 7px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.tcg-online-room-tile:hover {
    border-color: rgba(245, 158, 11, .7);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .28);
    transform: translateY(-2px);
}

.tcg-online-room-tile span {
    align-items: center;
    color: #fff;
    display: flex;
    gap: 8px;
    font-size: 1rem;
    font-weight: 950;
}

.tcg-online-room-tile svg {
    color: #f59e0b;
    height: 16px;
    width: 16px;
}

.tcg-online-room-tile small {
    color: #b6c6da;
    font-weight: 800;
}

.tcg-online-room-tile em {
    color: #ffcc80;
    font-style: normal;
    font-weight: 900;
}

.tcg-online-room-page {
    display: grid;
    gap: 12px;
}

.tcg-online-back {
    align-items: center;
    background: rgba(15, 23, 42, .74);
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 999px;
    color: #e5edf8;
    display: inline-flex;
    font-weight: 950;
    gap: 8px;
    justify-self: start;
    min-height: 38px;
    padding: 0 14px;
}

.tcg-online-players {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tcg-online-player {
    align-items: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    display: grid;
    gap: 2px 9px;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    padding: 11px 12px;
}

.tcg-online-player-dot {
    background: var(--tcg-entry-color, #94a3b8);
    border-radius: 999px;
    box-shadow: 0 0 18px var(--tcg-entry-color, #94a3b8);
    grid-row: span 2;
    height: 12px;
    width: 12px;
}

.tcg-online-player.is-away {
    opacity: .72;
}

.tcg-online-player.is-away .tcg-online-player-dot {
    animation: none;
    background: #f97316;
}

.tcg-online-player strong {
    color: #fff;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tcg-online-player small {
    color: #b6c6da;
    font-weight: 800;
}

.tcg-online-player button {
    align-self: center;
    background: rgba(239, 68, 68, .18);
    border: 1px solid rgba(248, 113, 113, .44);
    border-radius: 999px;
    color: #fecaca;
    font-size: .72rem;
    font-weight: 950;
    grid-row: span 2;
    min-height: 30px;
    padding: 0 12px;
}

.tcg-online-room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tcg-online-room-actions button {
    flex: 1 1 160px;
}

[data-online-copy].is-copied {
    background: rgba(34, 197, 94, .22) !important;
    border-color: rgba(34, 197, 94, .5) !important;
    color: #bbf7d0 !important;
}

[data-online-copy].is-copy-failed {
    background: rgba(239, 68, 68, .22) !important;
    border-color: rgba(248, 113, 113, .5) !important;
    color: #fecaca !important;
}

.tcg-counter-page.is-online-hall .tcg-counter-board,
.tcg-counter-page.is-online-room-page .tcg-counter-board {
    display: none;
}

.tcg-counter-page.is-online-game .tcg-online-panel {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-counter-board {
    display: grid;
}

.tcg-counter-page.is-online-mode .tcg-counter-select {
    opacity: .58;
    pointer-events: none;
}

.tcg-counter-page.is-online-mode [data-return-lobby] {
    display: inline-flex;
}

.tcg-counter-page:not(.is-online-game) [data-return-lobby] {
    display: none;
}

.tcg-counter-page .tcg-timer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.tcg-counter-page.is-online-game .tcg-timer-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (min-width: 981px) {
    .tcg-counter-page .tcg-counter-topbar {
        max-width: min(1180px, calc(100vw - 48px));
        padding: 10px 12px;
    }

    .tcg-counter-page .tcg-counter-controls {
        gap: 8px;
    }

    .tcg-counter-page .tcg-counter-select .form-select,
    .tcg-counter-page .tcg-fullscreen-btn,
    .tcg-counter-page .tcg-online-toggle,
    .tcg-counter-page .tcg-feedback-link {
        min-height: 38px;
    }
}

@media (max-width: 980px) {
    .tcg-online-profile,
    .tcg-online-actions,
    .tcg-online-players {
        grid-template-columns: 1fr;
    }

    .tcg-mode-actions {
        grid-template-columns: 1fr;
    }

    .tcg-mode-actions button {
        min-height: 118px;
    }

    .tcg-mode-account {
        flex-wrap: wrap;
        margin-bottom: 12px;
    }

    .tcg-mode-account-link {
        max-width: 100%;
    }

    .tcg-online-room {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .tcg-counter-page.is-mobile-fit.is-online-hall,
    .tcg-counter-page.is-mobile-fit.is-online-room-page {
        height: var(--tcg-vh, 100dvh) !important;
        min-height: var(--tcg-vh, 100dvh) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 10px !important;
        position: relative !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-hall .tcg-counter-topbar,
    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-counter-topbar {
        display: flex !important;
        height: auto !important;
        margin: 0 auto 10px !important;
        min-height: 40px !important;
        padding: 8px !important;
        position: static !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-hall .tcg-online-panel,
    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-panel {
        margin: 0 auto;
        max-width: 680px;
        width: 100%;
    }

    .tcg-counter-page.is-mobile-fit.is-online-hall .tcg-online-card,
    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-card {
        grid-template-columns: 1fr;
        min-height: calc(var(--tcg-vh, 100dvh) - 70px) !important;
    }
}

/* Online counter layout repair: lobby and active game are separate, stable screens. */
.tcg-online-player em {
    align-self: center;
    background: rgba(255, 153, 0, .16);
    border: 1px solid rgba(255, 153, 0, .32);
    border-radius: 999px;
    color: #ffcc80;
    font-size: .76rem;
    font-style: normal;
    font-weight: 950;
    grid-column: 2 / 3;
    padding: 3px 8px;
    width: max-content;
}

.tcg-online-primary:disabled,
.tcg-online-primary.is-disabled {
    cursor: not-allowed;
    filter: grayscale(.35);
    opacity: .55;
}

.tcg-counter-page.is-online-game {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow: auto;
    padding: 12px;
}

.tcg-counter-page.is-online-game .tcg-counter-topbar,
.tcg-counter-page.is-online-game .tcg-counter-board {
    max-width: min(980px, calc(100vw - 24px)) !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-counter-board {
    align-items: stretch;
    display: grid !important;
    flex: 1 1 auto;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(185px, .92fr) minmax(250px, auto) minmax(210px, 1fr) !important;
    height: auto !important;
    margin: 0 auto !important;
    min-height: 720px;
    overflow: visible !important;
    padding: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-player-top {
    order: 1;
}

.tcg-counter-page.is-online-game .tcg-center-panel {
    order: 2;
}

.tcg-counter-page.is-online-game .tcg-player-bottom {
    order: 3;
}

.tcg-counter-page.is-online-game .tcg-player,
.tcg-counter-page.is-online-game .tcg-center-panel {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

.tcg-counter-page.is-online-game .tcg-player-inner {
    gap: clamp(8px, 1.4vw, 12px) !important;
    grid-template-rows: auto minmax(86px, 1fr) auto auto !important;
    min-height: 0 !important;
    padding: clamp(10px, 1.6vw, 14px) !important;
}

.tcg-counter-page.is-online-game .tcg-lp-display {
    align-self: center;
    font-size: clamp(4.2rem, 14vw, 8.2rem) !important;
    line-height: .88 !important;
    min-height: 0 !important;
}

.tcg-counter-page.is-online-game .tcg-center-panel {
    display: grid !important;
    gap: 10px !important;
    grid-template-areas:
        "round tools"
        "timer tools"
        "history history" !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(180px, .8fr) !important;
    grid-template-rows: auto auto minmax(88px, 1fr) !important;
    padding: 12px !important;
}

.tcg-counter-page.is-online-game .tcg-round-card {
    grid-area: round;
}

.tcg-counter-page.is-online-game .tcg-tool-grid {
    grid-area: tools;
}

.tcg-counter-page.is-online-game .tcg-timer {
    grid-area: timer;
}

.tcg-counter-page.is-online-game .tcg-history {
    grid-area: history;
    min-height: 86px !important;
}

.tcg-counter-page.is-online-game .tcg-timer-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit.is-online-game {
        height: auto !important;
        min-height: 100dvh !important;
        overflow: auto !important;
        padding: 8px !important;
        position: relative !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-topbar {
        display: flex !important;
        margin: 0 auto 8px !important;
        max-width: 100% !important;
        min-height: 40px !important;
        padding: 7px !important;
        position: static !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-board {
        gap: 8px !important;
        grid-template-rows: minmax(150px, auto) minmax(190px, auto) minmax(170px, auto) !important;
        min-height: 0 !important;
        max-width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-inner {
        gap: 7px !important;
        grid-template-rows: auto minmax(64px, auto) auto auto !important;
        padding: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-lp-display {
        font-size: clamp(3.25rem, 18vw, 5.8rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        gap: 7px !important;
        grid-template-areas:
            "round"
            "timer"
            "tools"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto minmax(58px, auto) !important;
        padding: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool {
        min-height: 58px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        min-height: 58px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }
}

/* Final mobile stabilization for TCG Counter. Keep controls centered and prevent old rotated rules from leaking in. */
@media (max-width: 980px) {
    html:has(.tcg-counter-page.is-mobile-fit),
    body:has(.tcg-counter-page.is-mobile-fit) {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        max-height: none !important;
        min-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body.public-tcg-counter-body .public-main {
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
        max-width: none !important;
        min-height: 100dvh !important;
        padding: 0 !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-mobile-fit {
        align-items: center !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        justify-content: flex-start !important;
        left: auto !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        max-width: 100vw !important;
        min-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding: 8px !important;
        position: relative !important;
        top: auto !important;
        transform: none !important;
        width: min(100vw, 680px) !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-topbar {
        align-items: center !important;
        align-self: center !important;
        display: flex !important;
        gap: 8px !important;
        justify-content: space-between !important;
        margin: 0 auto 8px !important;
        max-width: 680px !important;
        min-height: 42px !important;
        padding: 7px !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-brand {
        min-width: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-brand strong {
        display: block !important;
        max-width: 118px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-controls {
        align-items: center !important;
        display: flex !important;
        flex: 0 1 auto !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        justify-content: flex-end !important;
        margin-left: auto !important;
        min-width: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-counter-select,
    .tcg-counter-page.is-mobile-fit .tcg-fullscreen-btn {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-auth-chip,
    .tcg-counter-page.is-mobile-fit .tcg-auth-login,
    .tcg-counter-page.is-mobile-fit .tcg-feedback-link {
        flex: 0 0 auto !important;
        min-height: 34px !important;
        padding: 0 9px !important;
        transform: none !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-user-actions.tcg-auth-chip {
        max-width: 136px !important;
        min-height: 34px !important;
    }

    .tcg-counter-page.is-mobile-fit .tcg-auth-name {
        max-width: 88px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-panel {
        align-items: center !important;
        display: flex !important;
        flex: 1 1 auto !important;
        justify-content: center !important;
        margin: 0 auto !important;
        max-width: 680px !important;
        min-height: calc(100dvh - 66px) !important;
        padding: 10px 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-card {
        border-radius: 20px !important;
        margin: 0 auto !important;
        max-width: 460px !important;
        padding: 18px !important;
        text-align: center !important;
        width: min(100%, 460px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-actions {
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-mode-choice .tcg-mode-actions button {
        min-height: 96px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-solo-mode .tcg-counter-board,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-board {
        align-self: center !important;
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto !important;
        height: auto !important;
        left: auto !important;
        margin: 0 auto !important;
        max-width: 680px !important;
        min-height: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        position: static !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-solo-mode .tcg-player,
    .tcg-counter-page.is-mobile-fit.is-solo-mode .tcg-center-panel,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-solo-mode .tcg-player-inner,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-inner {
        gap: 7px !important;
        grid-template-rows: auto minmax(66px, auto) auto auto !important;
        padding: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-solo-mode .tcg-lp-display,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-lp-display {
        font-size: clamp(3.2rem, 18vw, 5.6rem) !important;
        line-height: .9 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-solo-mode .tcg-center-panel,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 7px !important;
        grid-template-areas:
            "round"
            "timer"
            "tools"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto minmax(58px, auto) !important;
        padding: 8px !important;
    }
}

/* Mobile solo mode must stay inside the visible viewport after leaving mode choice. */
@media (max-width: 980px) {
    body.public-tcg-counter-body:has(.tcg-counter-page.is-solo-mode.is-mobile-fit) {
        height: 100dvh !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    body.public-tcg-counter-body:has(.tcg-counter-page.is-solo-mode.is-mobile-fit) .public-main {
        height: 100dvh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-solo-mode.is-mobile-fit,
    .tcg-counter-page.is-solo-mode.is-mobile-fit.is-forced-landscape {
        height: 100dvh !important;
        left: 0 !important;
        margin: 0 !important;
        max-height: 100dvh !important;
        max-width: 100vw !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
        padding: 6px !important;
        position: fixed !important;
        top: 0 !important;
        transform: none !important;
        transform-origin: center center !important;
        width: 100vw !important;
        z-index: 1050 !important;
    }

    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-counter-topbar,
    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-counter-controls {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 0 !important;
    }

    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-counter-board {
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr) !important;
        height: calc(100dvh - 12px) !important;
        left: auto !important;
        margin: 0 auto !important;
        max-width: min(680px, calc(100vw - 12px)) !important;
        min-height: 0 !important;
        overflow: visible !important;
        position: static !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-player,
    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-center-panel {
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-player-top {
        grid-column: 1 !important;
        grid-row: 1 !important;
        order: 1 !important;
    }

    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-center-panel {
        grid-column: 1 !important;
        grid-row: 2 !important;
        order: 2 !important;
    }

    .tcg-counter-page.is-solo-mode.is-mobile-fit .tcg-player-bottom {
        grid-column: 1 !important;
        grid-row: 3 !important;
        order: 3 !important;
    }
}

/* Online counter desktop navigation needs room for account chips and room controls. */
@media (min-width: 981px) {
    .tcg-counter-page.is-online-mode .tcg-counter-topbar {
        height: auto !important;
        max-width: min(1180px, calc(100vw - 48px)) !important;
        min-height: 58px !important;
        overflow: visible !important;
        padding: 10px 14px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-mode .tcg-counter-controls {
        align-items: center !important;
        display: flex !important;
        flex: 1 1 auto !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: flex-end !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    .tcg-counter-page.is-online-mode .tcg-counter-brand {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 280px !important;
    }

    .tcg-counter-page.is-online-mode .tcg-counter-brand strong {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-online-mode .tcg-user-actions.tcg-auth-chip,
    .tcg-counter-page.is-online-mode .tcg-auth-login {
        flex: 0 0 auto !important;
        max-width: min(260px, 100%) !important;
    }

    .tcg-counter-page.is-online-mode .tcg-auth-name {
        max-width: 170px !important;
    }

    .tcg-counter-page.is-online-mode .tcg-counter-select {
        flex: 0 1 360px !important;
        min-width: 260px !important;
    }

    .tcg-counter-page.is-online-mode .tcg-counter-select .form-select {
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* Final mobile online room flow: mode choice, lobby, room page, and game must not share cramped rules. */
@media (max-width: 980px) {
    body.public-tcg-counter-body:has(.tcg-counter-page.is-mobile-fit.is-online-mode) {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body.public-tcg-counter-body:has(.tcg-counter-page.is-mobile-fit.is-online-mode) .public-main {
        align-items: stretch !important;
        display: flex !important;
        justify-content: center !important;
        min-height: 100dvh !important;
        overflow: visible !important;
        padding: 0 !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode {
        align-items: stretch !important;
        background:
            radial-gradient(circle at 12% 0%, rgba(245, 158, 11, .18), transparent 32%),
            radial-gradient(circle at 100% 18%, rgba(56, 189, 248, .15), transparent 34%),
            #07111f !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        height: auto !important;
        min-height: 100dvh !important;
        overflow: visible !important;
        padding: 10px !important;
        position: relative !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-topbar {
        align-items: center !important;
        background: rgba(8, 15, 28, .92) !important;
        border: 1px solid rgba(255, 204, 128, .2) !important;
        border-radius: 18px !important;
        box-shadow: 0 14px 38px rgba(0, 0, 0, .22) !important;
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        margin: 0 !important;
        max-width: none !important;
        min-height: 48px !important;
        padding: 8px 10px !important;
        position: static !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-brand {
        display: flex !important;
        gap: 8px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-brand strong {
        color: #fff !important;
        font-size: 13px !important;
        max-width: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-controls {
        display: flex !important;
        flex: 0 0 auto !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        justify-content: flex-end !important;
        margin: 0 !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-counter-select,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-fullscreen-btn {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-feedback-link,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-auth-login,
    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-user-actions.tcg-auth-chip {
        border-radius: 999px !important;
        min-height: 36px !important;
        padding: 0 9px !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode .tcg-auth-name {
        max-width: 78px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-panel {
        display: block !important;
        flex: 1 1 auto !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-card {
        background: linear-gradient(180deg, rgba(15, 23, 42, .98), rgba(6, 13, 25, .98)) !important;
        border: 1px solid rgba(255, 204, 128, .22) !important;
        border-radius: 22px !important;
        box-shadow: 0 18px 48px rgba(0, 0, 0, .28) !important;
        display: grid !important;
        gap: 13px !important;
        grid-template-columns: 1fr !important;
        min-height: calc(var(--tcg-vh, 100dvh) - 78px) !important;
        padding: 14px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-intro {
        display: grid !important;
        gap: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-intro p {
        color: #ffcc80 !important;
        font-size: 12px !important;
        margin: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-intro h2 {
        color: #fff !important;
        font-size: clamp(1.35rem, 6vw, 1.85rem) !important;
        line-height: 1.08 !important;
        margin: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-intro span {
        color: #cbd5e1 !important;
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-profile {
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 1fr !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-profile label {
        min-width: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-profile .form-select,
    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-profile .form-control,
    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-profile input[type="color"] {
        border-radius: 14px !important;
        font-size: 15px !important;
        min-height: 46px !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-actions {
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-actions [data-online-create] {
        grid-column: 1 / -1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-join {
        min-width: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-primary,
    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-secondary,
    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-room button,
    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-back {
        min-height: 46px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-online-lobby-list {
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 1fr !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-actions,
    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-lobby-list {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-room-page {
        display: grid !important;
        gap: 12px !important;
        min-height: 0 !important;
        padding-bottom: 16px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-room {
        align-items: center !important;
        background: rgba(255, 255, 255, .06) !important;
        border: 1px solid rgba(255, 204, 128, .22) !important;
        border-radius: 18px !important;
        display: grid !important;
        gap: 12px !important;
        grid-template-columns: 1fr !important;
        justify-items: center !important;
        padding: 14px !important;
        text-align: center !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-room > div {
        align-items: center !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-room strong {
        font-size: clamp(2rem, 12vw, 3.2rem) !important;
        letter-spacing: .08em !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-room img {
        height: min(38vw, 132px) !important;
        max-height: 132px !important;
        max-width: 132px !important;
        width: min(38vw, 132px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-players {
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 1fr !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-player {
        border-radius: 16px !important;
        grid-template-columns: 14px minmax(0, 1fr) auto !important;
        padding: 12px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-room-page .tcg-online-room-actions {
        display: grid !important;
        gap: 10px !important;
        grid-template-columns: 1fr !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-mode:not(.is-online-game) .tcg-counter-board {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-panel {
        display: none !important;
    }
}

/* Final online page separation. Hall, room, and active game are mutually exclusive screens. */
.tcg-counter-page.is-online-hall .tcg-counter-board,
.tcg-counter-page.is-online-room-page .tcg-counter-board,
.tcg-counter-page.is-online-game .tcg-online-panel {
    display: none !important;
}

.tcg-counter-page.is-online-hall .tcg-online-panel,
.tcg-counter-page.is-online-room-page .tcg-online-panel {
    display: block !important;
}

.tcg-online-hall {
    display: grid;
    gap: 14px;
}

.tcg-counter-page.is-online-hall .tcg-online-hall {
    display: grid !important;
}

.tcg-counter-page.is-online-room-page .tcg-online-hall,
.tcg-counter-page.is-online-game .tcg-online-hall {
    display: none !important;
}

.tcg-counter-page.is-online-hall .tcg-online-room-page,
.tcg-counter-page.is-online-hall .tcg-counter-board,
.tcg-counter-page.is-online-room-page .tcg-online-lobby-list,
.tcg-counter-page.is-online-room-page .tcg-online-actions {
    display: none !important;
}

.tcg-counter-page.is-online-room-page .tcg-online-room-page {
    display: grid !important;
}

.tcg-online-profile .form-control.is-attention {
    border-color: rgba(245, 158, 11, .95) !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .18), 0 0 24px rgba(245, 158, 11, .24) !important;
}

.tcg-pixi-stage {
    inset: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    transition: opacity .18s ease;
    z-index: 1080;
}

.tcg-pixi-stage canvas {
    display: block;
    height: 100% !important;
    width: 100% !important;
}

.tcg-counter-page.is-solo-mode .tcg-pixi-stage,
.tcg-counter-page.is-online-game .tcg-pixi-stage {
    opacity: 1;
}

.tcg-online-game-head {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(3, 7, 18, .92)),
        radial-gradient(circle at 10% 0%, rgba(255, 153, 0, .22), transparent 24rem);
    border: 1px solid rgba(255, 153, 0, .28);
    border-radius: 18px;
    box-shadow: 0 20px 54px rgba(0, 0, 0, .28);
    display: none;
    gap: 16px;
    grid-column: 1 / -1;
    justify-content: space-between;
    min-height: 72px;
    padding: 12px 14px;
}

.tcg-online-game-head div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.tcg-online-game-head span {
    color: #ffcc80;
    font-size: .74rem;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tcg-online-game-head strong {
    color: #fff;
    font-size: clamp(1.05rem, 2vw, 1.42rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tcg-online-game-head small {
    color: #cbd5e1;
    font-size: .84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tcg-online-exit-game {
    align-items: center;
    background: linear-gradient(180deg, #ffb84d, #f59e0b);
    border: 1px solid #d97706;
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(245, 158, 11, .26);
    color: #111827;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 950;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
}

.tcg-online-exit-game svg {
    height: 18px;
    width: 18px;
}

.tcg-counter-page.is-online-game {
    align-items: stretch !important;
    background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, .14), transparent 34%), #07111f !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-height: 100dvh !important;
    overflow: auto !important;
    padding: 12px !important;
}

.tcg-counter-page.is-online-game .tcg-counter-board {
    align-items: stretch !important;
    display: grid !important;
    flex: 1 1 auto !important;
    gap: 12px !important;
    grid-template-columns: minmax(240px, 1fr) minmax(300px, .85fr) minmax(240px, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    height: auto !important;
    margin: 0 auto !important;
    max-width: min(1320px, calc(100vw - 24px)) !important;
    min-height: min(760px, calc(100dvh - 92px)) !important;
    padding: 0 !important;
    width: 100% !important;
}

.tcg-counter-page.is-online-game .tcg-online-game-head {
    display: flex !important;
    margin: 0 auto;
    max-width: min(1320px, calc(100vw - 24px));
    width: 100%;
}

.tcg-counter-page:not(.is-online-game) .tcg-online-game-head {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-counter-topbar {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-player-top {
    grid-column: 1 !important;
    grid-row: 1 !important;
    order: 1 !important;
}

.tcg-counter-page.is-online-game .tcg-center-panel {
    grid-column: 2 !important;
    grid-row: 1 !important;
    order: 2 !important;
}

.tcg-counter-page.is-online-game .tcg-player-bottom {
    grid-column: 3 !important;
    grid-row: 1 !important;
    order: 3 !important;
}

.tcg-counter-page.is-online-game .tcg-player,
.tcg-counter-page.is-online-game .tcg-center-panel {
    min-height: 0 !important;
    overflow: hidden !important;
}

.tcg-counter-page.is-online-game .tcg-player-inner {
    grid-template-rows: auto minmax(160px, 1fr) auto auto !important;
}

.tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
    align-content: center !important;
    display: grid !important;
    gap: 18px !important;
    grid-template-rows: auto minmax(180px, 1fr) !important;
}

.tcg-counter-page.is-online-game .tcg-player-top .tcg-player-actions,
.tcg-counter-page.is-online-game .tcg-player-top .tcg-quick-row,
.tcg-counter-page.is-online-game .tcg-player-top .tcg-calc {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name {
    max-width: 100% !important;
    pointer-events: none !important;
    text-align: center !important;
}

.tcg-counter-page.is-online-game .tcg-player-top::after {
    background: rgba(148, 163, 184, .12);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    bottom: 16px;
    color: #cbd5e1;
    content: "Opponent";
    font-size: .78rem;
    font-weight: 950;
    left: 50%;
    letter-spacing: .08em;
    padding: 5px 12px;
    position: absolute;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.tcg-counter-page.is-online-game .tcg-player-bottom::after {
    background: rgba(255, 153, 0, .16);
    border: 1px solid rgba(255, 153, 0, .32);
    border-radius: 999px;
    bottom: 16px;
    color: #ffcc80;
    content: "You";
    font-size: .78rem;
    font-weight: 950;
    left: 50%;
    letter-spacing: .08em;
    padding: 5px 12px;
    position: absolute;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.tcg-counter-page.is-online-game .tcg-lp-display {
    font-size: clamp(4.8rem, 9vw, 8.6rem) !important;
}

.tcg-counter-page.is-online-game .tcg-timer-actions [data-return-lobby] {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-center-panel {
    display: grid !important;
    gap: 10px !important;
    grid-template-areas:
        "round"
        "timer"
        "tools"
        "history" !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto minmax(120px, 1fr) !important;
}

/* Desktop online duel uses a dedicated battle layout instead of the solo three-column board. */
@media (min-width: 981px) {
    .tcg-counter-page.is-online-game {
        overflow: auto !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        grid-template-areas:
            "opponent opponent"
            "you tools" !important;
        grid-template-columns: minmax(420px, 1.05fr) minmax(430px, .95fr) !important;
        grid-template-rows: minmax(190px, .38fr) minmax(480px, 1fr) !important;
        min-height: min(820px, calc(100dvh - 104px)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 190px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 480px !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        grid-area: tools !important;
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 480px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        align-items: center !important;
        gap: 8px !important;
        grid-template-columns: minmax(220px, .34fr) minmax(360px, 1fr) minmax(120px, .2fr) !important;
        grid-template-rows: 1fr !important;
        justify-items: center !important;
        min-height: 100% !important;
        padding: 18px 28px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-head {
        justify-content: center !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name {
        background: rgba(255, 255, 255, .07) !important;
        border: 1px solid rgba(148, 163, 184, .18) !important;
        border-radius: 16px !important;
        color: #e5e7eb !important;
        font-size: clamp(1.08rem, 2vw, 1.55rem) !important;
        font-weight: 950 !important;
        min-height: 58px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(5.4rem, 11vw, 9.4rem) !important;
        justify-content: center !important;
        line-height: .86 !important;
        min-height: 150px !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top::after {
        bottom: 50% !important;
        left: auto !important;
        right: 28px !important;
        transform: translateY(50%) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        gap: 14px !important;
        grid-template-rows: auto minmax(150px, 1fr) auto auto !important;
        padding: 18px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-name,
    .tcg-counter-page.is-online-game [data-player-color] {
        pointer-events: none !important;
    }

    .tcg-counter-page.is-online-game .tcg-color-picker {
        filter: grayscale(.35) !important;
        opacity: .52 !important;
    }

    .tcg-counter-page.is-online-game .tcg-color-picker::after {
        color: #94a3b8;
        content: "Locked";
        font-size: .64rem;
        font-weight: 900;
        margin-left: 4px;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(4.8rem, 8vw, 7.6rem) !important;
        min-height: 140px !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-rows: auto auto auto minmax(170px, 1fr) !important;
        padding: 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history ol {
        max-height: none !important;
    }
}

@media (max-width: 980px) {
    .tcg-counter-page.is-mobile-fit.is-online-game {
        gap: 7px !important;
        height: auto !important;
        min-height: var(--tcg-vh, 100dvh) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 6px !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head {
        background: rgba(15, 23, 42, .96) !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 26px rgba(0, 0, 0, .22) !important;
        gap: 6px !important;
        min-height: 42px !important;
        padding: 5px 7px !important;
        width: calc(100vw - 12px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head span,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head strong {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head small {
        color: #ffcc80 !important;
        font-size: clamp(.62rem, 2.8vw, .78rem) !important;
        font-weight: 900 !important;
        max-width: 58vw !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-exit-game {
        border-radius: 10px !important;
        font-size: clamp(.7rem, 2.8vw, .86rem) !important;
        min-height: 32px !important;
        padding: 0 9px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-exit-game svg {
        height: 15px !important;
        width: 15px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-board {
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(96px, auto) minmax(238px, auto) minmax(310px, auto) !important;
        max-width: calc(100vw - 12px) !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        overflow: visible !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-inner {
        gap: 5px !important;
        grid-template-rows: auto minmax(54px, 1fr) !important;
        min-height: 96px !important;
        padding: 7px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-lp-display {
        font-size: clamp(2.25rem, 13vw, 4.2rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top::after,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom::after {
        bottom: 6px !important;
        font-size: .56rem !important;
        padding: 2px 7px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-inner {
        gap: 8px !important;
        min-height: 310px !important;
        padding: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(3.25rem, 18vw, 5.4rem) !important;
        min-height: 78px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row {
        gap: 7px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row button {
        font-size: clamp(.82rem, 3.4vw, 1rem) !important;
        min-height: 44px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc {
        gap: 7px !important;
        grid-template-columns: minmax(112px, 1fr) repeat(3, 48px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc button {
        font-size: clamp(.9rem, 3.6vw, 1.08rem) !important;
        min-height: 48px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        gap: 7px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-rows: 44px 58px 56px minmax(66px, auto) !important;
        min-height: 238px !important;
        padding: 7px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        border-radius: 10px !important;
        padding: 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card {
        gap: 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card .tcg-reset {
        font-size: clamp(.62rem, 2.6vw, .78rem) !important;
        min-height: 32px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid {
        gap: 7px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool {
        min-height: 46px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool strong {
        font-size: clamp(.78rem, 3vw, .94rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer {
        align-items: center !important;
        gap: 6px !important;
        grid-template-columns: minmax(58px, .34fr) minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions button {
        font-size: clamp(.58rem, 2.5vw, .74rem) !important;
        min-height: 34px !important;
        padding: 0 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history summary,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li strong {
        font-size: clamp(.5rem, 2vw, .66rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history ol {
        max-height: 72px !important;
        overflow-y: auto !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li:nth-child(n + 3),
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li:nth-child(n + 4) {
        display: grid !important;
    }
}

/* Final online duel battle UI: independent desktop/mobile layouts. */
.tcg-counter-page.is-online-game .tcg-online-panel {
    display: none !important;
}

body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-main {
    margin: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    width: 100% !important;
}

body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-toggle {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-counter-topbar {
    display: none !important;
}

@media (min-width: 981px) {
    .tcg-counter-page.is-online-game {
        gap: 10px !important;
        height: 100dvh !important;
        min-height: 720px !important;
        overflow: hidden !important;
        padding: 12px 20px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        border-radius: 14px !important;
        min-height: 58px !important;
        padding: 8px 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head span {
        font-size: .68rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head strong {
        font-size: 1.22rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head small {
        font-size: .78rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game {
        min-height: 38px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        display: grid !important;
        flex: 1 1 auto !important;
        gap: 12px !important;
        grid-template-areas:
            "opponent tools"
            "you tools" !important;
        grid-template-columns: minmax(560px, 1.16fr) minmax(430px, .84fr) !important;
        grid-template-rows: minmax(210px, .34fr) minmax(390px, .66fr) !important;
        height: calc(100dvh - 92px) !important;
        margin: 0 auto !important;
        max-width: min(1440px, calc(100vw - 40px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        grid-area: tools !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        align-items: center !important;
        display: grid !important;
        gap: 18px !important;
        grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) 110px !important;
        grid-template-rows: 1fr !important;
        height: 100% !important;
        justify-items: center !important;
        min-height: 0 !important;
        padding: 18px 24px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-head {
        justify-content: center !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name {
        font-size: clamp(1.05rem, 1.6vw, 1.45rem) !important;
        min-height: 56px !important;
        text-align: center !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(5.6rem, 10vw, 9.2rem) !important;
        height: 100% !important;
        justify-content: center !important;
        line-height: .84 !important;
        min-height: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top::after {
        bottom: auto !important;
        left: auto !important;
        right: 24px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        gap: 12px !important;
        grid-template-rows: auto minmax(120px, 1fr) auto auto !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 16px 18px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(4.4rem, 8vw, 7.4rem) !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row {
        gap: 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row button {
        min-height: 44px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button {
        min-height: 44px !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 10px !important;
        grid-template-areas:
            "round"
            "timer"
            "tools"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 86px 112px 158px minmax(0, 1fr) !important;
        overflow: hidden !important;
        padding: 12px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card,
    .tcg-counter-page.is-online-game .tcg-timer,
    .tcg-counter-page.is-online-game .tcg-tool-grid,
    .tcg-counter-page.is-online-game .tcg-history {
        min-height: 0 !important;
        padding: 12px 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card {
        gap: 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool-grid {
        gap: 10px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool {
        min-height: 134px !important;
        padding: 10px !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool strong {
        font-size: 1.2rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer {
        align-items: center !important;
        grid-template-columns: minmax(88px, .25fr) minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions {
        gap: 8px !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions button {
        min-height: 42px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history {
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-history ol {
        max-height: none !important;
        overflow-y: auto !important;
    }
}

@media (max-width: 980px) {
    html:has(.tcg-counter-page.is-online-game),
    body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) {
        height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game {
        background: #07111f !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 32px minmax(0, 1fr) !important;
        height: var(--tcg-vh, 100dvh) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 4px !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head {
        border-radius: 10px !important;
        box-shadow: none !important;
        min-height: 32px !important;
        padding: 3px 6px !important;
        width: calc(100vw - 8px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head span,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head strong {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head small {
        color: #ffcc80 !important;
        font-size: clamp(.58rem, 2.45vw, .72rem) !important;
        font-weight: 950 !important;
        max-width: calc(100vw - 108px) !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-exit-game {
        border-radius: 9px !important;
        font-size: clamp(.62rem, 2.5vw, .76rem) !important;
        gap: 4px !important;
        min-height: 26px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-exit-game svg {
        height: 13px !important;
        width: 13px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "opponent"
            "tools"
            "you" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 17% 38% minmax(0, 45%) !important;
        height: 100% !important;
        max-width: calc(100vw - 8px) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: calc(100vw - 8px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top {
        grid-area: opponent !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        grid-area: tools !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom {
        grid-area: you !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-inner {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(88px, .34fr) minmax(0, 1fr) 54px !important;
        grid-template-rows: 1fr !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 5px 7px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-head {
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-name {
        border-radius: 10px !important;
        font-size: clamp(.72rem, 3vw, .94rem) !important;
        min-height: 30px !important;
        padding: 0 6px !important;
        text-align: center !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(2.7rem, 14vw, 4.4rem) !important;
        justify-content: center !important;
        line-height: .84 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top::after {
        bottom: auto !important;
        left: auto !important;
        right: 7px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "round"
            "timer"
            "tools"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 31px 46px 47px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        border-radius: 9px !important;
        min-height: 0 !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card {
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(48px, .32fr) repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card > div {
        align-items: center !important;
        display: flex !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card p {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card strong {
        font-size: clamp(.74rem, 3vw, .9rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card .tcg-reset {
        font-size: clamp(.56rem, 2.3vw, .68rem) !important;
        min-height: 24px !important;
        padding: 0 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card .tcg-reset svg {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(58px, .25fr) minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer strong {
        font-size: clamp(1.05rem, 5.8vw, 1.55rem) !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions {
        gap: 4px !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions button {
        font-size: clamp(.52rem, 2.25vw, .66rem) !important;
        min-height: 30px !important;
        padding: 0 3px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid {
        gap: 4px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool {
        min-height: 39px !important;
        padding: 3px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool strong {
        font-size: clamp(.62rem, 2.8vw, .78rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-stage,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-stage,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-cube,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-face,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-disc,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-face {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        display: grid !important;
        grid-template-rows: 22px minmax(0, 1fr) !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history summary {
        font-size: clamp(.56rem, 2.35vw, .7rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history summary button {
        font-size: clamp(.52rem, 2.2vw, .64rem) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history ol {
        gap: 3px !important;
        margin-top: 3px !important;
        max-height: none !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li {
        padding: 3px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li span {
        font-size: .52rem !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li strong {
        font-size: .6rem !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 5px !important;
        grid-template-rows: 32px minmax(52px, 1fr) 80px 34px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-head {
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-name {
        font-size: clamp(.72rem, 3vw, .9rem) !important;
        min-height: 28px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(2.8rem, 16vw, 4.8rem) !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row {
        gap: 4px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row button {
        font-size: clamp(.62rem, 2.75vw, .82rem) !important;
        min-height: 37px !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc {
        gap: 4px !important;
        grid-template-columns: minmax(78px, 1fr) repeat(3, 34px) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc button {
        font-size: clamp(.62rem, 2.75vw, .82rem) !important;
        min-height: 32px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom::after {
        display: none !important;
    }
}

/* Online duel final override. Keep this at EOF so older counter rules cannot win. */
.tcg-counter-page.is-online-game .tcg-online-panel {
    display: none !important;
    visibility: hidden !important;
}

.tcg-counter-page.is-online-game .tcg-player::after,
.tcg-counter-page.is-online-game .tcg-player-actions,
.tcg-counter-page.is-online-game .tcg-counter-topbar {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-player-name {
    pointer-events: none !important;
}

body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-toggle,
body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-mobile-sidebar,
body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-mobile-nav-backdrop {
    display: none !important;
}

body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) .public-main {
    padding: 0 !important;
}

@media (min-width: 981px) {
    body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) {
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game {
        gap: 12px !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        padding: 12px 20px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        align-items: center !important;
        display: flex !important;
        flex: 0 0 auto !important;
        justify-content: space-between !important;
        margin: 0 auto !important;
        max-width: min(1460px, calc(100vw - 40px)) !important;
        min-height: 58px !important;
        padding: 8px 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head span {
        font-size: .66rem !important;
        letter-spacing: .08em !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head strong {
        font-size: 1.25rem !important;
        line-height: 1.1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head small {
        font-size: .78rem !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-exit-game {
        min-height: 38px !important;
        padding: 0 16px !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 12px !important;
        grid-template-areas:
            "opponent tools"
            "you tools" !important;
        grid-template-columns: minmax(560px, 1.18fr) minmax(430px, .82fr) !important;
        grid-template-rows: minmax(170px, .32fr) minmax(380px, .68fr) !important;
        height: calc(100dvh - 96px) !important;
        margin: 0 auto !important;
        max-width: min(1460px, calc(100vw - 40px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top {
        grid-area: opponent !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom {
        grid-area: you !important;
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 10px !important;
        grid-area: tools !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 64px 132px 96px minmax(0, 1fr) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 14px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-inner {
        align-items: center !important;
        display: grid !important;
        gap: 20px !important;
        grid-template-columns: minmax(190px, .34fr) minmax(0, 1fr) 96px !important;
        grid-template-rows: 1fr !important;
        min-height: 0 !important;
        padding: 18px 24px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        justify-content: center !important;
        line-height: .86 !important;
        min-height: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-lp-display {
        font-size: clamp(5rem, 9vw, 8.1rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-lp-display {
        font-size: clamp(4.4rem, 7vw, 7rem) !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-top .tcg-player-name,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-name {
        background: linear-gradient(135deg, var(--tcg-player-color-soft), rgba(15, 23, 42, .86)) !important;
        border-color: var(--tcg-player-color-ring) !important;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 14px 36px var(--tcg-player-color-soft) !important;
        color: #fff !important;
        opacity: 1 !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 12px !important;
        grid-template-rows: 52px minmax(110px, 1fr) auto auto !important;
        min-height: 0 !important;
        padding: 16px 18px !important;
    }

    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-quick-row button,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-online-game .tcg-player-bottom .tcg-calc button {
        min-height: 42px !important;
    }

    .tcg-counter-page.is-online-game .tcg-round-card,
    .tcg-counter-page.is-online-game .tcg-tool-grid,
    .tcg-counter-page.is-online-game .tcg-timer,
    .tcg-counter-page.is-online-game .tcg-history {
        min-height: 0 !important;
    }

    .tcg-counter-page.is-online-game .tcg-tool {
        min-height: 116px !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        grid-template-columns: 118px minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions {
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-online-game .tcg-timer-actions button {
        min-height: 34px !important;
    }

    .tcg-counter-page.is-online-game .tcg-history {
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game .tcg-history ol {
        max-height: none !important;
        overflow: auto !important;
    }
}

@media (max-width: 980px) {
    html:has(.tcg-counter-page.is-online-game),
    body.public-tcg-counter-body:has(.tcg-counter-page.is-online-game) {
        height: 100% !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game {
        gap: 4px !important;
        height: var(--tcg-vh, 100dvh) !important;
        max-height: var(--tcg-vh, 100dvh) !important;
        min-height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head {
        border-radius: 12px !important;
        display: flex !important;
        flex: 0 0 34px !important;
        margin: 0 !important;
        min-height: 34px !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head span,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head strong {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-game-head small {
        display: block !important;
        font-size: 10px !important;
        max-width: 58vw !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-online-exit-game {
        border-radius: 10px !important;
        font-size: 11px !important;
        min-height: 28px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-counter-board {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "opponent"
            "tools"
            "you" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 17% 40% 43% !important;
        height: calc(var(--tcg-vh, 100dvh) - 42px - env(safe-area-inset-bottom, 0px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top {
        grid-area: opponent !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        grid-area: tools !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom {
        grid-area: you !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-inner {
        display: grid !important;
        gap: 3px !important;
        grid-template-rows: 23px minmax(0, 1fr) !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-player-name {
        font-size: 11px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
        text-align: center !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-top .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(2rem, 13vw, 3.35rem) !important;
        justify-content: center !important;
        line-height: .84 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-center-panel {
        display: grid !important;
        gap: 4px !important;
        grid-template-areas:
            "round"
            "tools"
            "timer"
            "history" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 30px 44px 45px minmax(0, 1fr) !important;
        padding: 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        border-radius: 10px !important;
        min-height: 0 !important;
        padding: 3px 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(48px, .34fr) repeat(2, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card p {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card strong {
        font-size: 14px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-round-card .tcg-reset {
        font-size: 10px !important;
        min-height: 24px !important;
        padding: 0 4px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool-grid {
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        height: 44px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool {
        align-items: center !important;
        display: grid !important;
        grid-template-columns: 24px minmax(0, 1fr) !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 3px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-tool strong {
        font-size: 12px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-stage,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-stage,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-cube,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-dice-face,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-disc,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-coin-face {
        height: 22px !important;
        width: 22px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer {
        align-items: center !important;
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: 70px minmax(0, 1fr) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer strong {
        font-size: 20px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions {
        display: grid !important;
        gap: 3px !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-timer-actions button {
        font-size: 10px !important;
        min-height: 28px !important;
        padding: 0 2px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history {
        display: grid !important;
        grid-template-rows: 20px minmax(0, 1fr) !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history summary {
        font-size: 11px !important;
        line-height: 1 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history summary button {
        font-size: 10px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history ol {
        gap: 3px !important;
        margin-top: 3px !important;
        max-height: none !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li {
        padding: 3px 6px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li:nth-child(n + 3) {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li span {
        font-size: 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-history li strong {
        font-size: 10px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-inner {
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 24px minmax(0, 1fr) 76px 34px !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 5px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-player-name {
        font-size: 11px !important;
        min-height: 22px !important;
        padding: 0 8px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-lp-display {
        align-items: center !important;
        display: flex !important;
        font-size: clamp(2.7rem, 15vw, 4.1rem) !important;
        justify-content: center !important;
        line-height: .85 !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row {
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-quick-row button {
        font-size: 12px !important;
        min-height: 35px !important;
        padding: 0 3px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc {
        display: grid !important;
        gap: 4px !important;
        grid-template-columns: minmax(0, 1fr) 38px 38px !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc button[data-calc-action="clear"] {
        display: none !important;
    }

    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc-input,
    .tcg-counter-page.is-mobile-fit.is-online-game .tcg-player-bottom .tcg-calc button {
        font-size: 12px !important;
        min-height: 32px !important;
        padding: 0 4px !important;
    }
}

/* EOF sanity marker for active online duel layout. */
.tcg-counter-page.is-online-game .tcg-counter-topbar,
.tcg-counter-page.is-online-game .tcg-mode-panel,
.tcg-counter-page.is-online-game .tcg-online-panel {
    display: none !important;
}

.tcg-counter-page.is-online-game .tcg-online-game-head {
    order: 0 !important;
    position: static !important;
    transform: none !important;
}

.tcg-counter-page.is-online-game .tcg-counter-board {
    align-self: stretch !important;
    height: auto !important;
    min-height: 0 !important;
    order: 1 !important;
}

@media (max-width: 980px) {
    body:has(.tcg-counter-page.is-online-game),
    body:has(.tcg-counter-page.is-online-game) .public-main {
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }

    .tcg-counter-page.is-online-game {
        display: grid !important;
        gap: 4px !important;
        grid-template-rows: 32px minmax(0, 1fr) !important;
        height: var(--tcg-vh, 100dvh) !important;
        max-height: var(--tcg-vh, 100dvh) !important;
        min-height: var(--tcg-vh, 100dvh) !important;
        overflow: hidden !important;
        padding: 4px !important;
        width: 100vw !important;
    }

    .tcg-counter-page.is-online-game .tcg-online-game-head {
        grid-row: 1 !important;
        height: 32px !important;
        margin: 0 !important;
        min-height: 0 !important;
        width: 100% !important;
    }

    .tcg-counter-page.is-online-game .tcg-counter-board {
        grid-row: 2 !important;
        align-self: stretch !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
}
