:root {
    color-scheme: dark;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    color: #fff8e7;
    background: #07040f;
    --cast-accent: #79dfff;
    --gold-light: #fff3b8;
    --gold-mid: #f3c458;
    --gold-deep: #9e6b18;
    --pink: #ff4fa8;
    --felt: #0d5a3f;
    --card-w: min(17.6vw, 78px);
    -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 60, 166, 0.18), transparent 55%),
        radial-gradient(ellipse at 50% 100%, rgba(243, 196, 88, 0.12), transparent 60%),
        #07040f;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
[hidden] { display: none !important; }

.pk-shell {
    max-width: 450px;
    margin: 0 auto;
    padding: 4px 6px max(10px, env(safe-area-inset-bottom));
}

.pk-table {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 10%, rgba(255, 212, 102, 0.14), transparent 50%),
        linear-gradient(180deg, #1a0b30 0%, #120a22 40%, #0a1d18 100%);
    box-shadow: 0 0 0 1px rgba(243, 196, 88, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.3s;
}

.pk-table.is-bonus {
    box-shadow: 0 0 0 2px rgba(255, 79, 168, 0.75), 0 0 22px rgba(255, 79, 168, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.pk-table.is-flash-win::after,
.pk-table.is-flash-jackpot::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    border-radius: inherit;
    animation: pk-flash 0.9s ease-out forwards;
}

.pk-table.is-flash-win::after { background: radial-gradient(circle at 50% 62%, rgba(255, 233, 150, 0.35), transparent 60%); }
.pk-table.is-flash-jackpot::after {
    background: radial-gradient(circle at 50% 55%, rgba(255, 240, 170, 0.55), rgba(255, 79, 168, 0.18) 45%, transparent 75%);
    animation-duration: 1.4s;
}

@keyframes pk-flash {
    0% { opacity: 0; }
    18% { opacity: 1; }
    100% { opacity: 0; }
}

/* HUD */
.pk-hud {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 6px 0 10px;
    background: linear-gradient(90deg, rgba(16, 8, 32, 0.94), rgba(40, 18, 60, 0.9), rgba(16, 8, 32, 0.94));
}

.pk-gauge {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}

.pk-gauge-heart {
    color: var(--pink);
    font-size: 17px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(255, 79, 168, 0.7));
}

.pk-gauge-track {
    position: relative;
    flex: 1;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 220, 140, 0.3);
}

.pk-gauge-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff7cc8, var(--pink) 55%, #ffd36e);
    box-shadow: 0 0 8px rgba(255, 79, 168, 0.8);
    transition: width 0.5s cubic-bezier(.2, .8, .2, 1);
}

.pk-gauge.is-near .pk-gauge-heart { animation: pk-beat 0.8s ease-in-out infinite; }

@keyframes pk-beat {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.25); }
}

.pk-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.07);
    color: #ffeaa7;
}

.pk-chip-bonus {
    background: linear-gradient(135deg, #8a1253, #ff4fa8);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 79, 168, 0.6);
    animation: pk-glow 1.4s ease-in-out infinite;
}

@keyframes pk-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 79, 168, 0.45); }
    50% { box-shadow: 0 0 16px rgba(255, 79, 168, 0.9); }
}

.pk-help {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffe89e;
    font-size: 13px;
    font-weight: 900;
}

/* Dealer */
.pk-dealer {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px 8px;
    background:
        radial-gradient(circle at 18% 50%, rgba(255, 215, 110, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(36, 14, 58, 0.9), rgba(18, 10, 34, 0.8));
}

.pk-portrait-wrap {
    position: relative;
    width: 104px;
    height: 104px;
    padding: 3px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fff5c0, #e6ad39 45%, #8c590b 80%, #ffdf85);
    box-shadow: 0 0 0 2px rgba(15, 8, 28, 0.85), 0 0 18px rgba(243, 196, 88, 0.4), 0 0 14px var(--cast-accent);
}

.pk-table[data-mood="big"] .pk-portrait-wrap,
.pk-table[data-mood="jackpot"] .pk-portrait-wrap {
    background: linear-gradient(135deg, #ffffff, #ffe680 35%, #ff2e9d 72%, #ffe680);
    box-shadow: 0 0 0 2px #fff6c2, 0 0 26px rgba(255, 214, 70, 0.85), 0 0 20px rgba(255, 46, 157, 0.75);
}

.pk-portrait {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 19px;
    background: radial-gradient(circle at 50% 34%, #fffdf2, #f6dfb0 56%, #9c6d3e 100%);
}

.pk-table:not(.has-special-dealer) .pk-portrait { object-fit: contain; }

.pk-portrait-wrap.is-reacting { animation: pk-pop 0.42s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes pk-pop {
    0% { transform: scale(0.94); }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pk-reaction-badge {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #2a1600;
    background: linear-gradient(135deg, #fff6c8, #f3c458 55%, #d89a26);
    box-shadow: 0 0 0 1px rgba(60, 30, 0, 0.6), 0 0 10px rgba(255, 210, 76, 0.7);
}

.pk-dealer-info { min-width: 0; }

.pk-dealer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.pk-dealer-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: #fff;
}

.pk-cast-toggle {
    flex-shrink: 0;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    color: #f5e6c4;
    font-size: 11px;
    font-weight: 700;
}

.pk-speech {
    position: relative;
    margin: 6px 0 0;
    min-height: 44px;
    padding: 7px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #2a2328;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.pk-speech::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 16px;
    border: 6px solid transparent;
    border-left: 0;
    border-right-color: rgba(255, 255, 255, 0.95);
}

#cast-picker.pk-cast-picker {
    margin: 0;
    padding: 6px 10px 8px;
    background: rgba(18, 10, 34, 0.85);
}

/* Paytable / collection */
.pk-paytable {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 10px;
    margin: 0;
    padding: 6px 10px;
    list-style: none;
    background: linear-gradient(180deg, rgba(10, 6, 20, 0.92), rgba(16, 10, 30, 0.88));
    border-top: 1px solid rgba(243, 196, 88, 0.22);
    border-bottom: 1px solid rgba(243, 196, 88, 0.22);
}

.pk-pay-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 18px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.2;
    color: rgba(255, 244, 220, 0.62);
}

.pk-pay-row::before {
    content: '';
    flex: 0 0 auto;
    width: 10px;
    font-size: 9px;
    color: #ffd36e;
}

.pk-pay-row.is-owned { color: rgba(255, 244, 220, 0.9); }
.pk-pay-row.is-owned::before { content: '✓'; }

.pk-pay-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pk-pay-value {
    font-variant-numeric: tabular-nums;
    color: #ffd36e;
}

.pk-pay-row.tier-jackpot .pk-pay-value { color: #ff9fd2; }
.pk-paytable.is-bonus .pk-pay-value { color: #ff7cc8; text-shadow: 0 0 6px rgba(255, 79, 168, 0.7); }

.pk-pay-row.is-hit {
    color: #2a1600;
    background: linear-gradient(90deg, #fff4c2, #f3c458);
    box-shadow: 0 0 10px rgba(255, 210, 76, 0.65);
}

.pk-pay-row.is-hit .pk-pay-value,
.pk-pay-row.is-hit::before { color: #6b3d00; text-shadow: none; }

/* Felt */
.pk-felt {
    position: relative;
    padding: 6px 6px 10px;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(40, 150, 100, 0.55), transparent 70%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 5px),
        var(--felt);
    box-shadow: inset 0 0 0 3px rgba(180, 120, 30, 0.45), inset 0 0 26px rgba(0, 0, 0, 0.45);
}

.pk-table.is-bonus .pk-felt {
    background:
        radial-gradient(ellipse at 50% 40%, rgba(255, 79, 168, 0.32), transparent 70%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 5px),
        #3a0f3a;
}

.pk-felt-head {
    display: grid;
    place-items: center;
    min-height: 44px;
}

.pk-felt-head > * { grid-area: 1 / 1; }

.pk-felt-label {
    margin: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 245, 210, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.pk-cards {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding-top: 12px;
    min-height: calc(var(--card-w) * 1.4 + 16px);
}

.pk-card {
    position: relative;
    flex: 0 0 var(--card-w);
    width: var(--card-w);
    height: calc(var(--card-w) * 1.4);
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(160deg, #ffffff, #f4efe4);
    color: #17151c;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.pk-card.is-red { color: #d3173f; }

.pk-card-corner {
    position: absolute;
    top: 4px;
    left: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.pk-card-corner b { font-size: calc(var(--card-w) * 0.24); font-weight: 900; letter-spacing: -0.04em; }
.pk-card-corner i { font-style: normal; font-size: calc(var(--card-w) * 0.2); }

.pk-card-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding-top: 10%;
    font-size: calc(var(--card-w) * 0.52);
    line-height: 1;
}

.pk-card-center.is-face {
    font-size: calc(var(--card-w) * 0.46);
    font-weight: 900;
    font-family: Georgia, "Times New Roman", serif;
    text-shadow: 0 1px 0 rgba(255, 220, 120, 0.9);
}

.pk-card-center.is-face i {
    position: absolute;
    bottom: 12%;
    right: 14%;
    font-style: normal;
    font-size: calc(var(--card-w) * 0.22);
}

.pk-card-center.is-face::before {
    content: '';
    position: absolute;
    inset: 22% 14% 10%;
    z-index: -1;
    border-radius: 6px;
    background: linear-gradient(160deg, rgba(255, 223, 133, 0.55), rgba(255, 255, 255, 0));
}

.pk-card.is-joker {
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.9), transparent 45%),
        conic-gradient(from 20deg, #ff4fa8, #ffd36e, #66e3ff, #9c7bff, #ff4fa8);
    color: #2a0b3a;
}

.pk-card-joker-star {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding-bottom: 14%;
    font-size: calc(var(--card-w) * 0.6);
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 200, 80, 0.95), 0 2px 0 #b8326f;
}

.pk-card-joker-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8%;
    text-align: center;
    font-size: calc(var(--card-w) * 0.17);
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #2a0b3a;
}

.pk-card.is-back {
    background:
        repeating-linear-gradient(45deg, rgba(243, 196, 88, 0.28) 0 2px, transparent 2px 9px),
        repeating-linear-gradient(-45deg, rgba(243, 196, 88, 0.28) 0 2px, transparent 2px 9px),
        linear-gradient(160deg, #1d1650, #0d0a2c);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 3px #0d0a2c, inset 0 0 0 4px rgba(243, 196, 88, 0.7);
}

.pk-card.is-back::after {
    content: '♠';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: calc(var(--card-w) * 0.38);
    color: #f3c458;
    text-shadow: 0 0 8px rgba(243, 196, 88, 0.7);
}

button.pk-card:active { transform: translateY(-2px) scale(0.97); }

.pk-card.is-held {
    transform: translateY(-10px);
    box-shadow: 0 0 0 2px #ffd36e, 0 0 14px rgba(255, 210, 76, 0.8), 0 8px 12px rgba(0, 0, 0, 0.45);
}

.pk-card-tag {
    position: absolute;
    left: 50%;
    top: -11px;
    transform: translateX(-50%);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
    color: #2a1600;
    background: linear-gradient(135deg, #fff6c8, #f3c458);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.pk-card.is-win {
    box-shadow: 0 0 0 2px #fff2a8, 0 0 18px rgba(255, 210, 76, 0.95), 0 4px 10px rgba(0, 0, 0, 0.45);
    animation: pk-shine 1.6s ease-in-out infinite;
}

@keyframes pk-shine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.12); }
}

.pk-card.is-dim { opacity: 0.45; filter: saturate(0.6); }

.pk-card.is-entering { animation: pk-deal 0.38s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 70ms); }

@keyframes pk-deal {
    0% { transform: translateY(-36px) rotateY(90deg) scale(0.86); opacity: 0; }
    100% { transform: none; opacity: 1; }
}

.pk-card.is-held.is-entering { animation: none; }

/* Double up */
.pk-cards.is-double { gap: 4px; }
.pk-cards.is-double .is-dealer-card { margin-right: 8px; box-shadow: 0 0 0 2px var(--cast-accent), 0 0 14px var(--cast-accent); }
.pk-cards.is-double .is-dealer-card .pk-card-tag { top: auto; bottom: -9px; background: linear-gradient(135deg, #ffd0ea, #ff7cc8); color: #3a0021; }
.pk-cards.is-double button.pk-card.is-back { animation: pk-tease 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * 0.2s); }
.pk-cards.is-double button.pk-card.is-back.is-entering { animation: pk-deal 0.38s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 70ms); }

@keyframes pk-tease {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.pk-card.is-picked.is-lose { box-shadow: 0 0 0 2px #ff6b8b, 0 0 14px rgba(255, 70, 110, 0.7); }
.pk-card.is-picked.is-lose .pk-card-tag { background: #ff6b8b; color: #fff; }

/* Outcome */
.pk-outcome {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    max-width: calc(100% - 16px);
    padding: 4px 16px 5px;
    border-radius: 12px;
    background: rgba(10, 6, 20, 0.86);
    box-shadow: 0 0 0 1px rgba(243, 196, 88, 0.55), 0 6px 16px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    animation: pk-banner 0.45s cubic-bezier(.3, 1.6, .5, 1) both;
}

@keyframes pk-banner {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.pk-outcome-title {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
    background: linear-gradient(180deg, #fffbe0, #f3c458 60%, #c98a1c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.pk-outcome.is-long .pk-outcome-title { font-size: 16px; }

.pk-outcome-sub {
    font-size: 12px;
    font-weight: 800;
    color: #ffe9a8;
    white-space: nowrap;
}

.pk-outcome[data-tone="jackpot"],
.pk-outcome[data-tone="high"] {
    background: linear-gradient(135deg, rgba(90, 10, 60, 0.92), rgba(30, 8, 40, 0.92));
    box-shadow: 0 0 0 2px #ffd36e, 0 0 24px rgba(255, 79, 168, 0.7);
}

.pk-outcome[data-tone="lose"] .pk-outcome-title { background: none; color: #cfc6d8; }
.pk-outcome[data-tone="lose"] { box-shadow: 0 0 0 1px rgba(200, 190, 220, 0.35); }
.pk-outcome[data-tone="neutral"] .pk-outcome-title { background: none; color: #e5f3ff; }

.pk-coin-layer {
    position: absolute;
    left: 50%;
    top: 55%;
    z-index: 4;
    pointer-events: none;
}

.pk-coin {
    position: absolute;
    width: 14px;
    height: 14px;
    margin: -7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fffbe0, #f3c458 50%, #a86c12);
    box-shadow: 0 0 6px rgba(255, 210, 76, 0.8);
    animation: pk-coin 1s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes pk-coin {
    0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1); opacity: 0; }
}

/* Controls */
.pk-controls {
    display: grid;
    gap: 6px;
    padding: 8px 10px 10px;
    background: linear-gradient(180deg, rgba(12, 8, 24, 0.95), rgba(8, 4, 16, 0.98));
}

.pk-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 4px 10px;
    border: 0;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.2;
}

.pk-btn b { font-size: 13px; font-variant-numeric: tabular-nums; }

.pk-btn-gold {
    color: #2a1600;
    background: linear-gradient(180deg, #fff6c8 0%, #f3c458 48%, #c98a1c 100%);
    box-shadow: 0 0 0 1px rgba(90, 50, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 14px rgba(243, 196, 88, 0.35);
}

.pk-btn-gold.is-draw {
    background: linear-gradient(180deg, #ffd0ea 0%, #ff4fa8 55%, #b51869 100%);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(90, 0, 40, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 14px rgba(255, 79, 168, 0.4);
}

.pk-btn:active { transform: translateY(1px); }

.pk-result-row {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 8px;
}

.pk-result-row:has(#double-btn[hidden]) { grid-template-columns: 1fr; }

.pk-btn-dark {
    color: #ffe9a8;
    background: linear-gradient(180deg, #2c2140, #1a1228);
    box-shadow: 0 0 0 1px rgba(243, 196, 88, 0.55);
}

.pk-btn-pink {
    color: #fff;
    background: linear-gradient(180deg, #ff8ccc 0%, #ff4fa8 50%, #b51869 100%);
    box-shadow: 0 0 0 1px rgba(255, 220, 240, 0.6), 0 0 16px rgba(255, 79, 168, 0.55);
    animation: pk-glow 1.4s ease-in-out infinite;
}

.pk-ranking-slot:empty { display: none; }
.pk-ranking-slot { display: flex; justify-content: center; }

/* Rules */
.pk-dialog {
    width: min(92vw, 400px);
    max-height: 86vh;
    padding: 16px 16px 14px;
    border: 0;
    border-radius: 16px;
    color: #fff8e7;
    background: linear-gradient(180deg, #23123a, #120a22);
    box-shadow: 0 0 0 1px rgba(243, 196, 88, 0.5), 0 12px 32px rgba(0, 0, 0, 0.6);
}

.pk-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.pk-dialog h2 { margin: 0 0 8px; font-size: 17px; color: #ffe08a; }

.pk-rules {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.6;
}

.pk-rules li + li { margin-top: 4px; }
.pk-rules strong { color: #ffd36e; }

.pk-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-bottom: 10px;
    font-size: 13px;
}

.pk-toggle input { width: 20px; height: 20px; accent-color: #f3c458; }
.pk-close { min-height: 46px; font-size: 15px; }

@media (min-height: 760px) {
    :root { --card-w: min(17.8vw, 80px); }
    .pk-dealer { grid-template-columns: 128px minmax(0, 1fr); }
    .pk-portrait-wrap { width: 128px; height: 128px; border-radius: 26px; }
    .pk-portrait { border-radius: 23px; }
    .pk-pay-row { min-height: 20px; font-size: 12px; }
    .pk-felt { padding-top: 10px; padding-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .pk-card, .pk-card.is-win, .pk-btn-pink, .pk-chip-bonus, .pk-gauge.is-near .pk-gauge-heart,
    .pk-cards.is-double button.pk-card.is-back, .pk-outcome, .pk-portrait-wrap.is-reacting {
        animation: none !important;
        transition: none;
    }
}

/* Table scenes use the same felt and card components as the classic table. */
.pk-scene {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 0 10px 7px;
    background: linear-gradient(115deg, #151020, var(--felt));
    border-block: 1px solid color-mix(in srgb, var(--scene-glow, #f3c458) 45%, transparent);
}
.pk-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .45;
    pointer-events: none;
}
.pk-scene-motif {
    position: absolute;
    right: 10px;
    bottom: 9px;
    font-size: 25px;
    letter-spacing: 4px;
    opacity: .65;
    pointer-events: none;
}
.pk-scene-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
}
.pk-scene-choice select {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 4px 6px;
    border: 0;
    border-radius: 0;
    color: #fff8e7;
    background: transparent;
    font: inherit;
    font-size: 13px;
    touch-action: manipulation;
}
.pk-scene-choice option { background: #21182b; color: #fff8e7; }
.pk-scene-choice select:disabled { opacity: .75; }
.pk-scene-choice select:focus-visible { outline: 2px solid var(--scene-glow); outline-offset: -2px; }
.pk-scene-goal, .pk-scene-hint {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(8, 5, 18, .83);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.pk-scene-goal { font-size: 12px; font-weight: 800; color: var(--scene-glow, #ffeaa7); }
.pk-scene-hint { margin-top: 2px; font-size: 10px; color: #fff4df; }
.pk-scene-goal[data-complete="true"] { color: #fff; box-shadow: 0 0 9px var(--scene-glow); }
.pk-table:not([data-scene="classic"]) .pk-card.is-back {
    background:
        repeating-linear-gradient(45deg, transparent 0 7px, color-mix(in srgb, var(--scene-glow) 30%, transparent) 7px 9px),
        linear-gradient(160deg, var(--scene-back), #100d22);
}
.pk-table:not([data-scene="classic"]) .pk-card.is-back::after { color: var(--scene-glow); }
.pk-table[data-scene="christmas-market"] .pk-scene::before {
    background: repeating-linear-gradient(135deg, #ab273a 0 12px, #ffeab1 12px 16px, transparent 16px 44px);
}
.pk-table[data-scene="christmas-market"] .pk-card.is-back::after { content: '🎁'; }
.pk-table[data-scene="christmas-candle"] .pk-scene::before {
    background: radial-gradient(ellipse at 15% 90%, #fff4a7, #e78d2d 8%, transparent 35%), radial-gradient(ellipse at 85% 90%, #fff4a7, #e78d2d 8%, transparent 35%);
}
.pk-table[data-scene="christmas-candle"] .pk-card.is-back::after { content: '🔔'; }
.pk-table[data-scene="christmas-snow"] .pk-scene::before {
    background: radial-gradient(circle, #e3fcff 1px, transparent 2px) 0 0 / 19px 23px, repeating-conic-gradient(from 30deg at 90% 80%, #80dcff 0deg 8deg, transparent 8deg 60deg);
}
.pk-table[data-scene="christmas-snow"] .pk-card.is-back::after { content: '❄'; }
.pk-table[data-scene="sakura"] .pk-scene::before {
    background: radial-gradient(ellipse, #ffc3de 0 17%, transparent 22%) 0 0 / 37px 27px;
    transform: rotate(-8deg) scale(1.2);
}
.pk-table[data-scene="sakura"] .pk-card.is-back::after { content: '🌸'; }
.pk-table[data-scene="ocean"] .pk-scene::before {
    background: radial-gradient(ellipse at 50% 0%, #6ee9ef 0 18%, transparent 23%) 0 0 / 85px 27px, linear-gradient(180deg, #00758d, #001e3f);
}
.pk-table[data-scene="ocean"] .pk-card.is-back::after { content: '🐚'; }
.pk-table[data-scene="observatory"] .pk-scene::before {
    background: radial-gradient(circle, #fdf4c5 1px, transparent 2px) 0 0 / 29px 31px, radial-gradient(ellipse at 80% 90%, #9974d9, transparent 65%);
}
.pk-table[data-scene="observatory"] .pk-card.is-back::after { content: '✦'; }
.pk-table[data-scene="sunset-express"] .pk-scene::before {
    background: repeating-linear-gradient(90deg, #412b25 0 9px, transparent 9px 85px), linear-gradient(0deg, #3a2328 15%, #fa8a44 16%, #ffd691 48%, #a9778c);
}
.pk-table[data-scene="sunset-express"] .pk-card.is-back::after { content: '🚂'; }
.pk-table[data-scene="neon"] .pk-scene::before {
    background: repeating-linear-gradient(90deg, transparent 0 28px, #e553ed 28px 30px), repeating-linear-gradient(0deg, #142340 0 9px, #728dec 9px 10px, #142340 10px 21px);
    transform: perspective(130px) rotateX(20deg) scale(1.2);
}
.pk-table[data-scene="neon"] .pk-card.is-back::after { content: '⚡'; }
