@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Rajdhani:wght@500;600;700&display=swap');

:root { 
    --bg-color: #111115; 
    --panel-bg: #1e1e24; 
    --border: #333; 
    --text-main: #e0e0e0; 
    --blood: #b91c1c; 
    --mind: #0369a1; 
    --void: #6d28d9; 
    --ash: #52525b; 
    --spark: #d97706; 
    --highlight: #22c55e; 
    --error: #ef4444; 
    --player: #facc15; 
    --pts: #eab308; 
    --eldritch: #dc2626; 
}

* { box-sizing: border-box; }
html, body { max-width: 100vw; overflow-x: hidden; }
body { margin: 0; padding: 10px 15px; background-color: var(--bg-color); color: var(--text-main); font-family: 'Inter', sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
h1, h2, h3 { font-family: 'Rajdhani', sans-serif; margin: 0; text-transform: uppercase; letter-spacing: 1px; }

#ability-controls { display: none; }
#ability-controls.active { display: flex !important; }
#ability-controls:not(.active) { display: none !important; }

.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px; }
.overlay-box { background: var(--panel-bg); padding: 30px 20px; border: 2px solid var(--border); border-radius: 8px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.8); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.edge-fog, #edge-fog { display: none !important; width: 0 !important; height: 0 !important; opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

.header { 
    width: 100%; 
    max-width: 1750px; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: stretch; 
    background: rgba(30, 30, 36, 0.85); 
    padding: 14px 4% 20px 4%; 
    margin-bottom: 24px; 
    gap: 12px; 
    position: relative; 
    z-index: 10; 
    clip-path: polygon(0 0, 100% 0, 97% 100%, 3% 100%); 
}
.header-top-bar {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-left { 
    flex: 1 1 auto; 
    display: flex; 
    flex-direction: row; 
    justify-content: flex-start; 
    align-items: center; 
    gap: 10px; 
    min-width: 0; 
}

#score-counter {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.player-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.player-score-badge:hover {
    transform: scale(1.04);
}
.header-center { 
    width: 100%; 
    display: flex; 
    flex-direction: row; 
    flex-wrap: wrap;
    align-items: center; 
    gap: 14px 18px; 
    justify-content: flex-start; 
}
.header-center-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.header-right { 
    flex: 0 0 auto; 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    gap: 16px; 
    justify-content: flex-end; 
    margin-left: auto; 
}

.rounds { font-size: 1.5rem; color: white; font-weight: bold; font-family: 'Rajdhani', sans-serif; } 
.action-text { color: #38bdf8; font-weight: bold; font-size: 1.5rem; font-family: 'Rajdhani', sans-serif; }

#bot-thinking { display: none; position: fixed; bottom: 25px; right: 25px; z-index: 9999; background: #111115; border: 2px solid #a855f7; border-radius: 8px; padding: 18px 30px; color: #d8b4fe; font-family: 'Rajdhani', sans-serif; font-weight: bold; box-shadow: 0 0 30px rgba(168, 85, 247, 0.5); font-size: 1.35rem; align-items: center; text-transform: uppercase; letter-spacing: 1px; }
#action-notification-popup { display: none; position: fixed; bottom: 25px; right: 25px; z-index: 10000; background: #111115; border: 2px solid #a855f7; border-radius: 8px; padding: 14px 22px; color: #f3e8ff; font-family: 'Rajdhani', sans-serif; font-weight: bold; box-shadow: 0 0 35px rgba(168, 85, 247, 0.6), inset 0 0 15px rgba(168, 85, 247, 0.15); font-size: 1.25rem; align-items: center; letter-spacing: 0.5px; max-width: 440px; width: calc(100vw - 50px); box-sizing: border-box; cursor: pointer; transition: bottom 0.25s ease, opacity 0.3s ease, transform 0.2s ease; animation: action-popup-slide 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
#action-notification-popup:hover { border-color: #c084fc; box-shadow: 0 0 45px rgba(192, 132, 252, 0.8), inset 0 0 20px rgba(168, 85, 247, 0.25); }
@keyframes action-popup-slide { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 600px) { #action-notification-popup { right: 15px; left: 15px; bottom: 20px; width: auto; max-width: calc(100vw - 30px); padding: 12px 16px; } }

.btn-pcount-selector { transition: all 0.2s ease; cursor: pointer; }
.btn-pcount-selector.active { background: #6d28d9 !important; border-color: #a855f7 !important; color: white !important; box-shadow: 0 0 15px rgba(168, 85, 247, 0.4); }

.btn-deck-selector { transition: all 0.2s ease; cursor: pointer; }
.btn-deck-selector.active { background: #0284c7 !important; border-color: #38bdf8 !important; color: white !important; box-shadow: 0 0 15px rgba(56, 189, 248, 0.4); }

.btn-shadow-selector { transition: all 0.2s ease; cursor: pointer; }
.btn-shadow-selector.active-on { background: #6d28d9 !important; border-color: #a855f7 !important; color: white !important; box-shadow: 0 0 15px rgba(168, 85, 247, 0.4); }
.btn-shadow-selector.active-off { background: #3f3f46 !important; border-color: #71717a !important; color: white !important; box-shadow: 0 0 10px rgba(113, 113, 122, 0.3); }

.battlefield-tab-btn { background: #18181b; border: 1px solid #3f3f46; color: #a1a1aa; padding: 6px 14px; border-radius: 6px; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 0.95rem; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.2s ease; }
.battlefield-tab-btn:hover { border-color: #8b5cf6; color: #fff; }
.battlefield-tab-btn.active { background: #4c1d95; border-color: #a855f7; color: #fff; box-shadow: 0 0 15px rgba(168, 85, 247, 0.4); }
.hourglass { display: inline-block; animation: spin-glass 2s infinite ease-in-out; margin-right: 12px; font-size: 1.75rem; }
@keyframes spin-glass { 0% { transform: rotate(0deg); } 50% { transform: rotate(180deg); } 100% { transform: rotate(180deg); } }

.game-board { width: 100%; max-width: 1750px; display: flex; flex-direction: column; align-items: center; gap: 18px; z-index: 10; position: relative; }

.top-zones { display: flex; flex-wrap: nowrap; gap: 20px; width: 100%; max-width: 100%; margin: 0 auto; justify-content: center; align-items: center; margin-bottom: 12px; }
.deck-zone, .market-zone, .discard-zone { width: 100%; max-width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.card-row { 
    display: flex; 
    gap: 12px; 
    justify-content: flex-start; 
    align-items: center; 
    padding: 25px 18px 38px 18px; 
    background: rgba(0,0,0,0.2); 
    border-radius: 10px; 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    overflow-x: auto; 
    overflow-y: hidden; 
    flex-wrap: nowrap; 
    -webkit-overflow-scrolling: touch; 
    width: max-content; 
    max-width: 100%;
    min-height: 290px;
    margin: 0 auto; 
    scrollbar-width: thin; 
    scrollbar-color: #555 rgba(0,0,0,0.3);
    box-sizing: border-box;
}
.card-row::-webkit-scrollbar { height: 8px; display: block !important; } 
.card-row::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 5px; } 
.card-row::-webkit-scrollbar-thumb { background: #555; border-radius: 5px; }
.card-row::-webkit-scrollbar-thumb:hover { background: #38bdf8; }

#market-row { background: linear-gradient(rgba(10, 15, 20, 0.8), rgba(5, 10, 15, 0.95)), repeating-linear-gradient(45deg, transparent, transparent 18px, rgba(255,255,255,0.02) 20px); box-shadow: inset 0 0 30px rgba(0,0,0,1); border: 1px solid rgba(56, 189, 248, 0.15); }
#active-battlefield-row, #opponent-battlefield-row { background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.15) 0%, rgba(17, 17, 21, 0.9) 80%); box-shadow: inset 0 0 50px rgba(0,0,0,0.95); border: 1px solid rgba(168, 85, 247, 0.25); }
#opponent-battlefield-row { background: radial-gradient(ellipse at center, rgba(244, 63, 94, 0.12) 0%, rgba(17, 17, 21, 0.92) 80%); border-color: rgba(244, 63, 94, 0.25); }

/* Header Tiny Deck and Discard Piles in Trapezoid Bar */
.header-piles-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 0;
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
}

.tiny-pile-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tiny-pile-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tiny-pile-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #e4e4e7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.tiny-pile-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.1;
}

.tiny-pile-divider {
    width: 1px;
    height: 38px;
    background: rgba(255, 255, 255, 0.12);
}

#visual-deck {
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 68px !important;
    min-width: 46px !important;
    min-height: 68px !important;
    max-width: 46px !important;
    max-height: 68px !important;
    padding: 0 !important;
    border-radius: 5px !important;
    border: 2px solid #555 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)), url('assets/card_back.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    cursor: help !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
    position: relative !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

#visual-deck:hover {
    transform: scale(1.08) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.5) !important;
}

#visual-deck #deck-counter {
    color: #fff !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 8px rgba(0,0,0,1), 0 0 10px rgba(56, 189, 248, 0.8) !important;
    position: relative !important;
    z-index: 10 !important;
    line-height: 1 !important;
}

#discard-row {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#discard-row .card {
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 68px !important;
    min-width: 46px !important;
    min-height: 68px !important;
    max-width: 46px !important;
    max-height: 68px !important;
    padding: 2px !important;
    border-radius: 5px !important;
    border-width: 2px !important;
    box-sizing: border-box !important;
    position: relative !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

#discard-row .card:hover,
#exhaust-row .card:hover,
#opp-exhaust-row .card:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.5) !important;
}

#discard-row .card .card-rule,
#exhaust-row .card .card-rule,
#opp-exhaust-row .card .card-rule,
#exhaust-row .card .card-renowned-name,
#opp-exhaust-row .card .card-renowned-name,
#discard-row .card .card-renowned-name {
    display: none !important;
}

#discard-row .card .card-aptitude-badge,
#exhaust-row .card .card-aptitude-badge,
#opp-exhaust-row .card .card-aptitude-badge {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    font-size: 0.42rem !important;
    padding: 1px 3px !important;
    border-radius: 3px !important;
    line-height: 1 !important;
    max-width: 34px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#discard-row .card .card-pts-badge {
    position: absolute !important;
    bottom: 2px !important;
    right: 2px !important;
    top: auto !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-shadow: 0 1px 4px #000 !important;
}

#discard-row .card.empty-slot {
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    color: #71717a !important;
}

#discard-row .card.empty-slot > div {
    font-size: 0.62rem !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

#action-discard-row {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#action-discard-row .card {
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 68px !important;
    min-width: 46px !important;
    min-height: 68px !important;
    max-width: 46px !important;
    max-height: 68px !important;
    padding: 2px !important;
    border-radius: 5px !important;
    border-width: 2px !important;
    box-sizing: border-box !important;
    position: relative !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

#action-discard-row .card:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.6) !important;
}

#action-discard-row .card .shadow-text,
#action-discard-row .card .btn-play-shadow {
    display: none !important;
}

#action-discard-row .card .shadow-cost {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 0 4px !important;
    border-radius: 3px !important;
    line-height: 1.1 !important;
    background: rgba(139, 92, 246, 0.85) !important;
    color: white !important;
}

#action-discard-row .card .shadow-title-box {
    position: absolute !important;
    bottom: 2px !important;
    left: 2px !important;
    right: 2px !important;
    background: rgba(0,0,0,0.75) !important;
    padding: 1px 2px !important;
    border-radius: 2px !important;
}

#action-discard-row .card .shadow-title {
    font-size: 0.45rem !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    color: #e2e8f0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.1 !important;
    text-align: center !important;
}

#action-discard-row .card.empty-slot {
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    color: #71717a !important;
}

#action-discard-row .card.empty-slot > div {
    font-size: 0.62rem !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.btn-options {
    background: rgba(0, 0, 0, 0.6);
    color: #e4e4e7;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.btn-options:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
    transform: scale(1.05);
}

.options-toggle-switch input:checked + .options-slider {
    background-color: #38bdf8;
}

.options-toggle-switch input:checked + .options-slider:before {
    transform: translateX(20px);
}

.options-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #3f3f46;
    transition: .3s;
    border-radius: 24px;
}

.options-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.card { flex: 0 0 150px; width: 150px; height: 244px; background: var(--panel-bg); border: 3px solid var(--border); border-radius: 8px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; position: relative; user-select: none; -webkit-user-select: none; touch-action: manipulation; background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; background-color: #1e1e24 !important; }
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.5) 120%); border-radius: 2px; z-index: 1; pointer-events: none; }
.card > * { position: relative; z-index: 2; }
.card:hover { transform: translateY(-4px); border-color: #aaa; } 

.card.selected,
.card.empty-slot.selected,
#active-battlefield-row .card.selected,
#opponent-battlefield-row .card.selected,
#market-row .card.selected,
.battlefield-slot .card.selected,
.battlefield-slot .card.empty-slot.selected {
    transform: scale(1.04) translateY(-4px) !important;
    border-color: #facc15 !important;
    border-width: 3px !important;
    border-style: solid !important;
    box-shadow: 0 0 25px 6px rgba(250, 204, 21, 0.85), inset 0 0 18px rgba(250, 204, 21, 0.4) !important;
    z-index: 50 !important;
    animation: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.card.selected:hover,
.card.empty-slot.selected:hover,
#active-battlefield-row .card.selected:hover,
#opponent-battlefield-row .card.selected:hover,
#market-row .card.selected:hover,
.battlefield-slot .card.selected:hover,
.battlefield-slot .card.empty-slot.selected:hover {
    transform: scale(1.04) translateY(-4px) !important;
    border-color: #facc15 !important;
    box-shadow: 0 0 28px 8px rgba(250, 204, 21, 0.9), inset 0 0 18px rgba(250, 204, 21, 0.45) !important;
}
.battlefield-slot:has(.selected) {
    z-index: 50 !important;
    position: relative !important;
}
.battlefield-slot:has(.selected) .battlefield-location-above {
    border-color: rgba(250, 204, 21, 0.75) !important;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.4) !important;
}

.card.target-selected { border-color: #0ea5e9; box-shadow: 0 0 15px rgba(14, 165, 233, 0.8); transform: scale(1.02); } 
.card.target-selected:hover, .card.empty-slot.target-selected:hover { transform: scale(1.02) !important; } 
.card.status-pass:not(.selected) { z-index: 10; } 
.card.status-fail:not(.selected) { box-shadow: inset 0 0 38px rgba(0,0,0,0.8); } 

/* Card borders match their bar colour (Colourblind-friendly: Cobalt Blue #2563eb, Crimson Red #e11d48, Bright Mint-Green #4ade80, Canary Yellow #fde047) */
.card[data-aptitude]:not([data-opp-cond="1"]):not([data-green-bar="1"]):not([data-renowned="1"]):not(.renowned):not(.empty-slot):not(.card-hidden):not(.selected):not(.target-selected):not(.targetable-blood):not(.targetable-frost) {
    border-color: #2563eb !important;
}
.card[data-opp-cond="1"]:not(.empty-slot):not(.card-hidden):not(.selected):not(.target-selected):not(.targetable-blood):not(.targetable-frost) {
    border-color: #e11d48 !important;
}
.card[data-green-bar="1"]:not(.empty-slot):not(.card-hidden):not(.selected):not(.target-selected):not(.targetable-blood):not(.targetable-frost) {
    border-color: #4ade80 !important;
}
.card.renowned:not(.empty-slot):not(.card-hidden):not(.selected):not(.target-selected):not(.targetable-blood):not(.targetable-frost),
.card[data-renowned="1"]:not(.empty-slot):not(.card-hidden):not(.selected):not(.target-selected):not(.targetable-blood):not(.targetable-frost) {
    border-color: #fde047 !important;
    box-shadow: 0 0 10px rgba(253, 224, 71, 0.35);
}

.card.empty-slot::before { display: none; }
.card.empty-slot { border-color: #222; background: rgba(0,0,0,0.4) !important; cursor: pointer; justify-content: center; align-items: center; box-shadow: inset 0 0 18px rgba(0,0,0,0.8) !important; } 
.card.empty-slot:hover { border-color: #555; }
.card.empty-slot.target-selected { border-color: #0ea5e9; box-shadow: 0 0 15px rgba(14, 165, 233, 0.8) !important; }

#visual-deck { cursor: help; pointer-events: auto !important; } #visual-deck:hover { transform: none !important; border-color: #555 !important; }
.targetable-blood { border-color: #ef4444 !important; cursor: crosshair !important; animation: eldritch-pulse 1.5s infinite; }
.targetable-frost { border-color: #38bdf8 !important; cursor: crosshair !important; box-shadow: 0 0 18px rgba(56, 189, 248, 0.5) !important; }

.card-pts-badge { position: absolute; top: 5px; right: 5px; font-size: 1.35rem; color: #fff !important; font-weight: 700; font-family: 'Rajdhani', sans-serif; background: transparent; padding: 5px 10px; border-radius: 5px; text-shadow: 1px 1px 4px rgba(0,0,0,0.9) !important; z-index: 10; }
.card-renowned-name { position: absolute; top: 5px; left: 5px; right: 28px; z-index: 10; font-family: 'Rajdhani', sans-serif; font-weight: 800; font-size: 0.78rem; line-height: 1.05; color: #ffffff !important; letter-spacing: 0.3px; text-shadow: 1px 1px 4px rgba(0,0,0,0.95), 0 0 6px rgba(0,0,0,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.card-aptitude-badge { position: absolute; top: 22px; left: 5px; font-size: 0.65rem; color: #fff; font-weight: 700; font-family: 'Rajdhani', sans-serif; background: rgba(0,0,0,0.85); padding: 3px 6px; border-radius: 5px; text-transform: uppercase; text-shadow: 1px 1px 4px rgba(0,0,0,0.9); z-index: 10; letter-spacing: 0px; border: 1px solid #444; display: inline-flex; align-items: center; line-height: 1; }
.card-aptitude-badge .color-pip { align-self: center !important; vertical-align: middle !important; flex-shrink: 0 !important; position: relative; top: 0.03em; }
.card-id-num { display: none !important; }
.card-pts-badge.feat-cost { color: #f87171 !important; }
.card.feat:not(.selected) { border-color: #94a3b8; box-shadow: 0 0 10px rgba(148, 163, 184, 0.3); }
.card-player-dot { width: 5px; height: 5px; border-radius: 50%; background: #facc15; box-shadow: 0 0 4px rgba(250, 204, 21, 0.8); display: inline-block; flex-shrink: 0; }

.card-rule { 
    margin-top: auto; 
    font-family: 'Inter', sans-serif; 
    font-size: 0.72rem; 
    text-align: left; 
    flex-grow: 0; 
    height: auto; 
    max-height: 55%; 
    min-height: 40px; 
    display: flex; 
    align-items: center; 
    line-height: 1.25; 
    overflow-y: auto; 
    scrollbar-width: none;
    -ms-overflow-style: none;
    color: #fff !important; 
    font-weight: 600; 
    background: rgba(17, 17, 21, 0.75);
    padding: 5px 6px; 
    border-radius: 4px; 
    margin-bottom: 2px; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9) !important; 
    border-left: 2px solid #2563eb; 
}
.card-rule.opp-cond, .card[data-opp-cond="1"] .card-rule {
    border-left-color: #e11d48 !important;
}
.card-rule.green-bar, .card[data-green-bar="1"] .card-rule {
    border-left-color: #4ade80 !important;
}
.card-rule.renowned-rule, .card.renowned .card-rule, .card[data-renowned="1"] .card-rule {
    border-left-color: #fde047 !important;
}
.card-rule::-webkit-scrollbar { display: none; }
.card.long-text .card-rule { font-size: 0.65rem; line-height: 1.15; }

.card.empty-slot:not(.location-slot) div { color: #666 !important; font-family: 'Rajdhani', sans-serif; font-weight: 600; letter-spacing: 2px; text-shadow: none !important; text-transform: uppercase; }

.card.empty-slot.location-slot {
    border-color: rgba(56, 189, 248, 0.45) !important;
    padding: 8px 6px !important;
    background-color: #111116 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    flex: 0 0 150px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    height: 244px !important;
    min-height: 244px !important;
    max-height: 244px !important;
}
.card.empty-slot.location-slot:hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4) !important;
}

/* Psifront Battlefield Slot & Location Above Card */
.battlefield-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 150px;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    gap: 4px;
    position: relative;
}

.battlefield-slot .card {
    flex: 0 0 150px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    height: 244px !important;
    min-height: 244px !important;
    max-height: 244px !important;
}

.battlefield-location-above {
    width: 100%;
    min-height: 30px;
    max-height: 38px;
    background: rgba(10, 14, 22, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    border-radius: 6px;
    padding: 2px 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.battlefield-location-above:not(.placeholder-empty):hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.battlefield-location-above.placeholder-empty {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.battlefield-location-above .loc-above-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #38bdf8;
    letter-spacing: 0.3px;
    line-height: 1.12;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    text-align: center;
}

.card.empty-slot.location-slot .location-card-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    text-align: center;
}
.card.empty-slot.location-slot .location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.card.empty-slot.location-slot .location-tag {
    color: #38bdf8 !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    background: rgba(0, 0, 0, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.45);
}
.card.empty-slot.location-slot .location-id {
    color: #94a3b8 !important;
    font-size: 0.65rem;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700;
    text-shadow: 0 1px 3px #000;
}
.card.empty-slot.location-slot .location-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: auto 0;
    padding: 2px 0;
    width: 100%;
}
.card.empty-slot.location-slot .location-name-text {
    color: #ffffff !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 800 !important;
    font-size: 0.8rem;
    letter-spacing: 0.5px !important;
    line-height: 1.2;
    text-transform: uppercase !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.95) !important;
}
.card.empty-slot.location-slot .location-rule-box {
    color: #e2e8f0 !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    font-size: 0.72rem; /* Matches morphon .card-rule on desktop */
    line-height: 1.25;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.95) !important;
    background: rgba(17, 17, 21, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 4px;
    padding: 5px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    width: 100%;
    box-sizing: border-box;
}

/* Shadow Cards */
#shadow-modal .overlay-box {
    max-width: 980px !important;
    width: min(980px, 95vw) !important;
}
#shadow-hand-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 10px 6px 18px 6px !important;
}
.card.shadow-card {
    border-color: #3f3f46 !important;
    background: linear-gradient(135deg, rgba(20, 20, 26, 0.95), rgba(12, 12, 16, 0.95)) !important;
    padding: 8px;
    height: 250px;
    flex: 0 0 150px;
    width: 150px;
    min-width: 150px;
    flex-shrink: 0 !important;
    justify-content: flex-end;
    position: relative;
}
.card.shadow-card:hover {
    border-color: #71717a !important;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.12);
}
.shadow-type {
    display: none !important;
}
.shadow-cost {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 1.15rem;
    color: #facc15;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    background: rgba(0,0,0,0.85);
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px solid #eab308;
    z-index: 10;
    line-height: 1;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}
.shadow-title-box {
    margin-top: auto;
    background: rgba(12, 12, 18, 0.92);
    border-radius: 6px;
    padding: 7px;
    border-left: 2px solid #38bdf8;
    margin-bottom: 8px;
    text-align: left;
}
.shadow-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.92rem;
    font-weight: bold;
    color: #f1f5f9;
    margin-bottom: 3px;
    line-height: 1.15;
}
.shadow-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    color: #cbd5e1;
    line-height: 1.25;
}
.btn-play-shadow {
    background: #18181b;
    border: 1px solid #52525b;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}
.btn-play-shadow:hover:not([disabled]) {
    background: #27272a;
    border-color: #38bdf8;
}
.btn-play-shadow[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    background: #27272a;
    border-color: #3f3f46;
}

/* Objective Action Card & Art Placeholder Styling */
.shadow-art-placeholder {
    display: none !important;
}

.shadow-objective-pill {
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    text-align: center;
    line-height: 1.2;
}

.shadow-objective-pill.ready {
    background: rgba(34, 197, 94, 0.25);
    border: 1px solid #22c55e;
    color: #4ade80;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.shadow-objective-pill.progress {
    display: none !important;
}

.card.shadow-card.objective-card-type {
    border-color: #3f3f46 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

/* Objective Battlefield Intel Tracker */
.objective-intel-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(25, 12, 45, 0.92), rgba(12, 8, 22, 0.95));
    border: 1.5px solid #a855f7;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.35);
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
}

.objective-intel-box.opponent-threat {
    border-color: #f97316;
    background: linear-gradient(135deg, rgba(45, 16, 10, 0.92), rgba(20, 8, 8, 0.95));
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.35);
}

.objective-beacon-badge {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -6px;
    background: #7e22ce;
    border: 2px solid #facc15;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.85);
    z-index: 25;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

/* Magic Arena Style Turn Timer */
.turn-timer-container {
    width: 100%;
    max-width: 680px;
    margin: 4px auto 6px auto;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 18;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.turn-timer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-family: 'Rajdhani', sans-serif;
    line-height: 1;
}

.turn-timer-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #94a3b8;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.turn-timer-seconds {
    font-size: 1.05rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.turn-timer-track {
    width: 100%;
    height: 7px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.turn-timer-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    border-radius: 4px;
    transition: width 0.15s linear, background 0.3s ease;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

/* Magic Arena "Rope" Burning State (< 15s) */
.turn-timer-container.rope-burning {
    border-color: rgba(239, 68, 68, 0.75);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4), inset 0 0 12px rgba(239, 68, 68, 0.2);
    animation: ropeContainerPulse 1s ease-in-out infinite alternate;
}

.turn-timer-container.rope-burning .turn-timer-seconds {
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    animation: ropeTextFlash 0.5s infinite alternate;
}

.turn-timer-container.rope-burning .turn-timer-progress {
    background: linear-gradient(90deg, #dc2626, #f97316, #eab308);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.95);
}

/* Timer reset flash on performing action */
.turn-timer-container.timer-reset-flash {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.8) !important;
}

@keyframes ropeContainerPulse {
    0% { border-color: rgba(239, 68, 68, 0.5); }
    100% { border-color: rgba(249, 115, 22, 0.9); }
}

@keyframes ropeTextFlash {
    0% { opacity: 0.8; }
    100% { opacity: 1; transform: scale(1.05); }
}

button { font-family: 'Inter', sans-serif; font-weight: 600; padding: 8px 15px; font-size: 1rem; color: white; background: #27272a; border: 1px solid #52525b; border-radius: 4px; cursor: pointer; transition: all 0.2s; width: auto; min-height: unset; white-space: nowrap; touch-action: manipulation; }
button:hover:not([disabled]) { background: #3f3f46; border-color: white; } 
button[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-end { background: #991b1b; border-color: #f97316; font-size: 1.05rem; padding: 8px 18px; } 
.btn-end:hover:not([disabled]) { background: #c2410c; border-color: white; }
.highlight-end { box-shadow: 0 0 18px #f97316; animation: pulse 1.5s infinite; }

.btn-solid { background: #3f3f46 !important; border-color: #555 !important; }
.btn-solid:hover:not([disabled]) { background: #52525b !important; border-color: #fff !important; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7); } 70% { box-shadow: 0 0 0 18px rgba(249, 115, 22, 0); } 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); } }
@keyframes eldritch-pulse { 0% { box-shadow: 0 0 12px rgba(185, 28, 28, 0.6), inset 0 0 18px rgba(185, 28, 28, 0.2); border-color: #b91c1c; } 50% { box-shadow: 0 0 30px rgba(239, 68, 68, 1), inset 0 0 38px rgba(239, 68, 68, 0.6); border-color: #f87171; } 100% { box-shadow: 0 0 12px rgba(185, 28, 28, 0.6), inset 0 0 18px rgba(185, 28, 28, 0.2); border-color: #b91c1c; } }

.discard-item { padding: 12px; border-bottom: 1px solid #333; transition: background 0.2s; }
.discard-item:hover { background: rgba(255, 255, 255, 0.05); }
.leaderboard-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 1.15rem; }
.leaderboard-table th, .leaderboard-table td { padding: 10px 15px; text-align: center; border-bottom: 1px solid #333; }
.leaderboard-table th { background: #27272a; color: #a1a1aa; font-family: 'Rajdhani', sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.leaderboard-table tr:first-child td { color: #facc15; font-weight: bold; }

.card.aptitude-Neuralbleed.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Pre-Cog.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Data-Purge.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Overclock.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Surge.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Zero-State.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Grid-Shift.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Deep-Dive.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Uplink.status-pass:not(.selected):not(.target-selected),
.card.aptitude-Firewall.status-pass:not(.selected):not(.target-selected) { box-shadow: 0 0 25px rgba(241, 245, 249, 0.8) !important; }

#setup-screen { background: #111115; }
.priv-overlay-bury { position: absolute; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; color: #ef4444; font-weight: bold; font-family: 'Rajdhani', sans-serif; font-size: 1.85rem; z-index: 30; border-radius: 5px; pointer-events: none; } 
.priv-overlay-top { position: absolute; inset: 0; background: rgba(168, 85, 247, 0.5); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-family: 'Rajdhani', sans-serif; font-size: 1.85rem; z-index: 30; border-radius: 5px; pointer-events: none; border: 2px solid #a855f7; } 
.priv-overlay-second { position: absolute; inset: 0; background: rgba(59, 130, 246, 0.5); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-family: 'Rajdhani', sans-serif; font-size: 1.6rem; z-index: 30; border-radius: 5px; pointer-events: none; border: 2px solid #3b82f6; } 
.priv-overlay-discard { position: absolute; inset: 0; background: rgba(220, 38, 38, 0.6); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-family: 'Rajdhani', sans-serif; font-size: 1.85rem; z-index: 30; border-radius: 5px; pointer-events: none; border: 2px solid #ef4444; } 

#global-tooltip { display: none; position: fixed; background: rgba(17, 17, 21, 0.98); color: #ccc; padding: 12px 15px; border: 1px solid #777; border-radius: 8px; font-size: 1rem; font-family: 'Inter', sans-serif; width: max-content; max-width: 350px; z-index: 2147483647; pointer-events: none; white-space: normal; line-height: 1.4; box-shadow: 0 12px 38px rgba(0,0,0,0.9); transform: translateZ(0); }
#faction-portrait, #opp-faction-portrait { width: 75px; height: 75px; border-radius: 8px; border: 2px solid var(--eldritch); background-size: cover; background-position: center; background-color: #111; flex-shrink: 0; transition: box-shadow 0.3s, border-color 0.3s; position: relative; cursor: help; z-index: 10; } 
#opp-faction-portrait { border-color: #fb7185; }
#faction-portrait:hover { box-shadow: 0 0 18px rgba(220, 38, 38, 0.6); } 
#opp-faction-portrait:hover { box-shadow: 0 0 18px rgba(251, 113, 133, 0.6); } 

/* Looping art videos (morphon / faction). The static jpg stays as the background fallback underneath. */
.art-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; border-radius: inherit; background: transparent; }
.card.has-art-video { isolation: isolate; }
.card.has-art-video > .art-video { z-index: -1; border-radius: 5px; }
#global-faction-tooltip { overflow: hidden; }
#global-faction-tooltip { display: none; position: fixed; width: 312px; height: 437px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); border: 3px solid var(--eldritch); border-radius: 8px; box-shadow: 0 12px 50px rgba(0,0,0,0.95); z-index: 2147483647; pointer-events: auto; cursor: pointer; background-color: #111; background-size: cover; background-position: center; box-sizing: border-box; } 
#global-action-tooltip { display: none !important; }

.side-panel { 
    display: none; 
    position: fixed; 
    top: 0; 
    right: 0; 
    width: 100%; 
    max-width: 440px; 
    height: 100%; 
    background: #16161a; 
    border-left: 2px solid #555; 
    z-index: 1000; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
    padding: 16px 18px 28px 18px; 
    box-shadow: -12px 0 38px rgba(0,0,0,0.9); 
    color: #ccc; 
}
.side-panel.open { 
    display: block !important; 
    pointer-events: auto !important; 
}
.side-panel:not(.open) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    box-shadow: none !important;
    width: 0 !important;
    height: 0 !important;
    border: none !important;
    opacity: 0 !important;
}
.side-panel h2 { color: #facc15; margin-bottom: 12px; font-family: 'Rajdhani', sans-serif; font-size: 1.35rem; text-shadow: 0 0 12px rgba(250, 204, 21, 0.3); }
.side-panel h3 { color: #38bdf8; margin-top: 14px; margin-bottom: 6px; font-family: 'Rajdhani', sans-serif; font-size: 1.02rem; border-bottom: 1px solid #333; padding-bottom: 3px; }
.side-panel p, .side-panel li { font-size: 0.84rem; line-height: 1.35; margin-bottom: 5px; }
.side-panel ul { padding-left: 18px; margin: 4px 0 8px 0; }
.side-panel ul.rules-compact-list { list-style-type: none; padding-left: 0; }
.side-panel ul.rules-compact-list li { margin-bottom: 3px; }
.close-panel { position: absolute; top: 12px; right: 14px; background: #27272a; border: 1px solid #555; border-radius: 5px; color: #fff; font-size: 1.3rem; cursor: pointer; padding: 2px 10px; min-height: 34px; min-width: 34px; transition: all 0.2s; z-index: 100002 !important; pointer-events: auto !important; touch-action: manipulation; }
.close-panel:hover { background: #ef4444; border-color: #ef4444; }

.coinflip-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 17, 21, 0.95);
    border: 2px solid #facc15;
    border-radius: 8px;
    padding: 12px 25px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.4);
    z-index: 99999;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-align: center;
}

@media(min-width: 768px) { 
    .header { padding: 18px 60px 30px 60px; clip-path: polygon(0 0, 100% 0, 97% 100%, 3% 100%); } 
    .card { width: 150px; height: 244px; padding: 10px; }
    .card-rule { font-size: 0.75rem; line-height: 1.3; min-height: 48px; } 
    .card.long-text .card-rule { font-size: 0.65rem; line-height: 1.2; } 
    .card-pts-badge { font-size: 1.5rem; top: 5px; right: 5px; } 
    .card-renowned-name { top: 5px; left: 5px; right: 28px; font-size: 0.8rem; }
    .card-aptitude-badge { font-size: 0.7rem; top: 23px; left: 5px; padding: 4px 6px; }
        .card-player-dot { width: 5.5px; height: 5.5px; }
    button { font-size: 1rem; padding: 10px 18px; }
}

@media(max-width: 850px) {
    .edge-fog, #edge-fog { 
        display: none !important; 
        opacity: 0 !important; 
        visibility: hidden !important; 
        pointer-events: none !important; 
        animation: none !important; 
        box-shadow: none !important; 
        background: none !important; 
    }
    body { padding: 4px 6px 20px 6px; }
    .header { flex-direction: column; align-items: stretch; clip-path: none; padding: 8px 10px; margin-bottom: 8px; gap: 8px; }
    .header-top-bar { width: 100%; display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 6px; }
    .header-left { flex: 1 1 auto; width: auto; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding-left: 0; font-size: 0.95rem; min-width: 0; border-bottom: none !important; padding-bottom: 0 !important; }
    #score-counter {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
        width: 100% !important;
    }
    .player-score-badge {
        display: inline-flex !important;
        width: auto !important;
        justify-content: flex-start !important;
        box-sizing: border-box !important;
    }
    #round-credit-status-bar { margin: 0 !important; padding: 0 !important; gap: 8px !important; font-size: 0.85rem !important; border: none !important; display: inline-flex !important; align-items: center !important; }
    #round-credit-status-bar span.rounds, #round-credit-status-bar span.action-text { font-size: 1.05rem !important; }
    .full-sc-label { display: none !important; }
    .short-sc-label { display: inline !important; }
    .header-center { flex: none; width: 100%; justify-content: flex-start; gap: 10px; align-items: center; }
    #faction-portrait, #opp-faction-portrait { width: 48px; height: 48px; flex-shrink: 0; }
    #faction-name-display, #opp-faction-name-display { font-size: 1.05rem; }
    #faction-rule-display, #opp-faction-rule-display { font-size: 0.78rem; line-height: 1.25; }
    .header-right { flex: 0 0 auto; width: auto; flex-direction: row; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 8px; padding-right: 0; margin-left: auto; border-top: none !important; padding-top: 0 !important; }
    .btn-options { width: 34px !important; height: 34px !important; font-size: 1.25rem !important; flex-shrink: 0 !important; }
    
    #action-bar { 
        display: flex !important; 
        flex-wrap: wrap !important; 
        flex-direction: row !important; 
        width: 100% !important; 
        gap: 6px !important; 
        margin-top: 6px !important; 
        padding-top: 6px !important; 
        justify-content: center !important;
    }
    
    #standard-controls { 
        order: -1 !important; 
        flex: 1 1 100% !important; 
        width: 100% !important; 
        max-width: 100% !important; 
        display: flex; 
        gap: 4px !important; 
        justify-content: center !important; 
        align-items: stretch !important; 
        flex-wrap: wrap !important; 
        padding: 0 !important; 
        margin: 0 0 6px 0 !important; 
    }
    #standard-controls[style*="display: none"],
    #standard-controls[style*="display:none"] {
        display: none !important;
    }
    
    #ability-controls { 
        order: -1 !important; 
        flex: 1 1 100% !important; 
        width: 100% !important; 
        max-width: 100% !important; 
        margin: 0 0 6px 0 !important; 
        padding: 4px 8px !important;
        font-size: 0.8rem !important;
    }
    #ability-controls:not(.active) { 
        display: none !important; 
    }
    #ability-controls.active { 
        display: flex !important; 
    }
    #ability-controls button {
        min-height: 30px !important;
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }

    #standard-controls > div,
    #standard-controls > button { 
        flex: 1 1 calc(16.6% - 4px) !important; 
        min-width: 48px !important; 
        display: flex; 
    }
    #standard-controls > div[style*="display: none"],
    #standard-controls > div[style*="display:none"],
    #standard-controls > button[style*="display: none"],
    #standard-controls > button[style*="display:none"],
    #btn-shadow[style*="display: none"],
    #btn-shadow[style*="display:none"] {
        display: none !important;
    }
    #standard-controls button { 
        width: 100% !important; 
        min-width: 0 !important; 
        min-height: 32px !important; 
        font-size: 0.72rem !important; 
        font-weight: 700 !important; 
        padding: 4px 1px !important; 
        letter-spacing: 0.1px !important; 
        white-space: nowrap !important; 
        text-overflow: ellipsis !important; 
        overflow: hidden !important; 
        margin: 0 !important; 
        display: flex !important; 
        align-items: center !important; 
        justify-content: center !important; 
        text-align: center !important; 
    }
    #btn-shadow { 
        flex: 1 1 calc(16.6% - 4px) !important; 
        min-width: 48px !important; 
        padding: 4px 1px !important; 
        font-size: 0.72rem !important; 
        margin: 0 !important; 
    }
    #btn-end-turn { 
        flex: 1 1 calc(16.6% - 4px) !important; 
        min-width: 60px !important; 
        min-height: 32px !important; 
        font-size: 0.75rem !important; 
        padding: 4px 4px !important; 
        margin: 0 !important; 
    }
    
    .game-board { gap: 10px; }
    .card-row { 
        min-height: 185px; 
        padding: 8px 6px 16px 6px; 
        gap: 8px; 
        border-radius: 8px; 
        overflow-x: auto !important; 
        overflow-y: hidden !important; 
        scrollbar-width: thin !important; 
        -webkit-overflow-scrolling: touch !important; 
        max-width: 100% !important; 
    }
    .card-row::-webkit-scrollbar { 
        height: 8px !important; 
        display: block !important; 
    }
    .card-row::-webkit-scrollbar-track { 
        background: rgba(0,0,0,0.3) !important; 
        border-radius: 4px !important; 
    }
    .card-row::-webkit-scrollbar-thumb { 
        background: #555 !important; 
        border-radius: 4px !important; 
    }
    #market-row, #discard-row, #active-battlefield-row, #opponent-battlefield-row { box-shadow: none !important; }
    .card { flex: 0 0 106px; width: 106px; height: 172px; padding: 6px 5px; border-width: 2px; }
    .card-pts-badge { font-size: 1.05rem; top: 2px; right: 2px; padding: 2px 4px; }
    .card-renowned-name { top: 2px; left: 2px; right: 20px; font-size: 0.58rem; }
    .card-aptitude-badge { font-size: 0.52rem; top: 15px; left: 2px; padding: 2px 3px; }
        .card-player-dot { width: 3.5px; height: 3.5px; }
    
    .card-rule { font-size: 0.56rem; line-height: 1.15; min-height: 28px; padding: 3px; margin-bottom: 2px; }
    .card.long-text .card-rule { font-size: 0.49rem; line-height: 1.08; }

    /* Location slot mobile font size matches morphon text */
    .card.empty-slot.location-slot {
        flex: 0 0 106px !important;
        width: 106px !important;
        min-width: 106px !important;
        max-width: 106px !important;
        height: 172px !important;
        min-height: 172px !important;
        max-height: 172px !important;
        padding: 4px 3px !important;
    }
    .card.empty-slot.location-slot .location-tag {
        font-size: 0.52rem !important; /* matches .card-aptitude-badge on mobile */
        padding: 1.5px 4px !important;
    }
    .card.empty-slot.location-slot .location-id {
        font-size: 0.52rem !important;
    }
    .card.empty-slot.location-slot .location-body {
        gap: 3px !important;
    }
    .card.empty-slot.location-slot .location-name-text {
        font-size: 0.58rem !important;
        line-height: 1.12 !important;
    }
    .card.empty-slot.location-slot .location-rule-box {
        font-size: 0.56rem !important; /* Exactly the same font size as .card-rule on morphons on mobile */
        line-height: 1.15 !important;
        padding: 3px !important;
        border-radius: 3px !important;
    }

    .battlefield-slot {
        flex: 0 0 106px !important;
        width: 106px !important;
        min-width: 106px !important;
        max-width: 106px !important;
        gap: 3px !important;
    }
    .battlefield-slot .card {
        flex: 0 0 106px !important;
        width: 106px !important;
        min-width: 106px !important;
        max-width: 106px !important;
        height: 172px !important;
        min-height: 172px !important;
        max-height: 172px !important;
    }
    .battlefield-location-above {
        min-height: 24px !important;
        max-height: 32px !important;
        padding: 1px 3px !important;
    }
    .battlefield-location-above .loc-above-name {
        font-size: 0.62rem !important;
        line-height: 1.08 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        white-space: normal !important;
    }
    
    .top-zones { gap: 8px; margin-bottom: 6px; padding-bottom: 4px; justify-content: center; }
    #visual-deck #deck-counter { font-size: 1.5rem !important; }
    
    .controls { gap: 8px; margin-top: 8px; }
    .controls > div { flex: 1 1 calc(50% - 6px); min-width: 130px; }
    .controls button { min-height: 44px; font-size: 0.88rem; padding: 8px 6px; }
    
    .side-panel { max-width: 100vw; width: 100vw; padding: 20px 14px 40px 14px; }
    .side-panel:not(.open) { display: none !important; box-shadow: none !important; width: 0 !important; height: 0 !important; visibility: hidden !important; }
    .side-panel.open { display: block !important; }
    .overlay-box { padding: 18px 14px; width: 94%; max-height: 90vh; }
    #join-code { font-size: 20px !important; } 

    #shadow-modal .overlay-box {
        overflow-x: hidden !important;
        padding: 14px 8px 18px 8px !important;
        width: 96% !important;
        max-height: 94vh !important;
    }
    #shadow-hand-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
        justify-content: flex-start !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px calc(50% - min(156px, 42vw)) 20px calc(50% - min(156px, 42vw)) !important;
        scrollbar-width: thin !important;
        box-sizing: border-box !important;
    }
    .card.shadow-card {
        flex: 0 0 min(312px, 84vw) !important;
        width: min(312px, 84vw) !important;
        min-width: min(312px, 84vw) !important;
        height: min(437px, 60vh) !important;
        max-height: 440px !important;
        scroll-snap-align: center !important;
        scroll-snap-stop: always !important;
        flex-shrink: 0 !important;
        padding: 12px !important;
        border-width: 3px !important;
        border-color: #3f3f46 !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.85) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        position: relative !important;
    }
    .shadow-cost {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        font-size: 1.35rem !important;
        font-weight: 800 !important;
        padding: 3px 10px !important;
        border-radius: 6px !important;
        border: 2px solid #eab308 !important;
        background: rgba(0,0,0,0.9) !important;
        color: #facc15 !important;
        box-shadow: 0 0 10px rgba(250, 204, 21, 0.4) !important;
        z-index: 10 !important;
    }
    .shadow-art-placeholder {
        display: none !important;
    }
    .shadow-title-box {
        padding: 10px 12px !important;
        margin-bottom: 10px !important;
        border-radius: 8px !important;
        border-left: 3px solid #38bdf8 !important;
        background: rgba(12, 12, 18, 0.94) !important;
    }
    .shadow-title {
        font-family: 'Rajdhani', sans-serif !important;
        font-size: 1.15rem !important;
        line-height: 1.2 !important;
        margin-bottom: 4px !important;
        font-weight: 700 !important;
        color: #f1f5f9 !important;
    }
    .shadow-text {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.85rem !important;
        line-height: 1.35 !important;
        color: #cbd5e1 !important;
        max-height: 110px !important;
        overflow-y: auto !important;
    }
    .btn-play-shadow {
        font-family: 'Rajdhani', sans-serif !important;
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        padding: 10px 14px !important;
        min-height: 42px !important;
        border-radius: 6px !important;
        letter-spacing: 1px !important;
        text-transform: uppercase !important;
        background: #18181b !important;
        border-color: #52525b !important;
        color: white !important;
    }

    #global-action-tooltip {
        display: none !important;
    }
    #global-faction-tooltip { 
        width: min(280px, 84vw) !important; 
        height: min(392px, 76vh) !important; 
        max-width: calc(100vw - 16px) !important; 
        max-height: calc(100vh - 16px) !important; 
        border-radius: 8px !important;
        box-shadow: 0 8px 30px rgba(0,0,0,0.95) !important;
    }

    #private-modal .overlay-box,
    #ability-choice-modal .overlay-box,
    #ability-modal .overlay-box {
        width: 96% !important;
        padding: 14px 8px 16px 8px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
    #private-cards,
    #ability-choice-cards,
    #ability-modal .choice-win-cards {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px 4px 14px 4px !important;
        min-height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        max-height: 58vh !important;
        box-sizing: border-box !important;
    }
    #private-cards .card,
    #ability-choice-cards .card,
    #ability-modal .choice-win-cards .card {
        flex: 0 0 96px !important;
        width: 96px !important;
        min-width: 96px !important;
        max-width: 96px !important;
        height: 156px !important;
        margin: 2px !important;
    }
}

.shadow-art-placeholder {
    position: absolute;
    top: 36%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(216, 180, 254, 0.45);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px dashed rgba(216, 180, 254, 0.35);
    padding: 6px 14px;
    border-radius: 4px;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.objective-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 5px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Rajdhani', sans-serif;
}

.objective-badge.met {
    background: rgba(34, 197, 94, 0.25);
    border: 1px solid #22c55e;
    color: #4ade80;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.objective-badge.in-progress {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fbbf24;
}

@media (max-width: 850px) {
    .turn-timer-container {
        max-width: 96%;
        padding: 4px 8px;
        margin: 2px auto 4px auto;
    }
    .turn-timer-label { font-size: 0.72rem; }
    .turn-timer-seconds { font-size: 0.88rem; }
    .turn-timer-track { height: 5px; }
    .objective-beacon-badge {
        font-size: 0.58rem !important;
        padding: 1.5px 4px !important;
        right: -4px !important;
    }
}

/* Digital Scorepad Styles */
#digital-scorepad-modal .overlay-box {
    max-width: 1180px;
    width: min(1180px, 96vw);
    max-height: 94vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px 20px;
    background: #090d16;
    border: 2px solid #10b981;
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.35);
}

.scorepad-player-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.scorepad-player-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.scorepad-stat-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.scorepad-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 4px;
}

.scorepad-stat-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scorepad-stat-sub {
    font-size: 0.7rem;
    color: #64748b;
    font-family: 'Inter', sans-serif;
}

.scorepad-stat-val {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.scorepad-btn-group {
    display: flex;
    gap: 4px;
    width: 100%;
}

.scorepad-btn {
    flex: 1;
    padding: 6px 0;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #1e293b;
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.scorepad-btn:hover {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

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

/* Faction Selector in Setup Screen */
.btn-faction-selector {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-faction-selector.active {
    background: #92400e !important;
    border-color: #f59e0b !important;
    color: #fff !important;
}

/* Corporate Faction Draft */
.faction-draft-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 8px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: hover) {
    .faction-draft-card:not(.drafted):hover {
        border-color: #f59e0b;
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
        transform: translateY(-2px);
    }
}
.faction-draft-card.drafted {
    opacity: 0.42;
    border-color: #3f3f46;
    background: rgba(10, 10, 14, 0.65);
}
.faction-chip-draft {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 850px) {
    #faction-draft-modal .overlay-box {
        width: 96% !important;
        padding: 16px 12px !important;
        max-height: 94vh !important;
    }
    #faction-draft-cards-grid {
        grid-template-columns: 1fr !important;
    }
    #digital-scorepad-modal .overlay-box {
        width: 96% !important;
        padding: 14px 10px !important;
        max-height: 92vh !important;
    }
    #scorepad-players-grid {
        grid-template-columns: 1fr !important;
    }
}



/* Combat Tier Badge & Fight Modal Styles */
.card-combat-tier-badge {
    position: absolute;
    top: 34px;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    box-sizing: border-box;
    font-size: 0.95rem;
    font-weight: 900;
    font-family: "Rajdhani", sans-serif;
    color: #ef4444;
    background: rgba(0, 0, 0, 0.9);
    border: 1.5px solid #ef4444;
    border-radius: 4px;
    z-index: 10;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 8px rgba(239, 68, 68, 0.4);
    user-select: none;
    pointer-events: none;
}

@media (max-width: 850px) {
    .card-combat-tier-badge {
        top: 20px;
        right: 2px;
        font-size: 0.75rem;
        min-width: 17px;
        height: 17px;
        padding: 0 2px;
        border-radius: 3px;
        border-width: 1px;
    }
}

#btn-fight {
    background: #881337 !important;
    border-color: #f43f5e !important;
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
}

#btn-fight:not(:disabled):hover {
    background: #9f1239 !important;
    border-color: #fb7185 !important;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.5);
    transform: translateY(-1px);
}

#btn-fight:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #71717a !important;
}

.fight-champion-card {
    background: linear-gradient(135deg, rgba(30, 10, 20, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(244, 63, 94, 0.6);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.2);
}

.fight-targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    width: 100%;
}

.fight-target-item {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.2s ease;
}

.fight-target-item:hover {
    border-color: #f43f5e;
    background: rgba(26, 15, 28, 0.95);
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.3);
    transform: translateY(-1px);
}

.fight-target-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-fight-action {
    background: linear-gradient(135deg, #be123c, #881337);
    color: #fff;
    border: 1px solid #f43f5e;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: "Rajdhani", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.btn-fight-action:hover {
    background: linear-gradient(135deg, #e11d48, #9f1239);
    border-color: #fb7185;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.5);
}


/* Centered Points & Combat Tier Column */
.card-pts-column {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    z-index: 10 !important;
    pointer-events: none !important;
    user-select: none !important;
    min-width: 24px !important;
}

.card-pts-column .card-pts-badge {
    position: static !important;
    inset: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 1.35rem !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-family: "Rajdhani", sans-serif !important;
    background: transparent !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9) !important;
    line-height: 1 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

.card-pts-column .card-combat-tier-badge {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    min-width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    font-family: "Rajdhani", sans-serif !important;
    color: #ef4444 !important;
    background: rgba(0, 0, 0, 0.92) !important;
    border: 1.5px solid #ef4444 !important;
    border-radius: 4px !important;
    line-height: 1 !important;
    text-align: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 8px rgba(239, 68, 68, 0.4) !important;
}

.card-pts-column .card-agile-badge,
.card-pts-column .card-agile-badge b,
.card-pts-column .card-agile-badge i {
    font-style: italic !important;
    font-weight: 900 !important;
    font-size: 1.5rem !important;
    font-family: "Rajdhani", sans-serif !important;
    color: #ffffff !important;
    line-height: 1 !important;
    text-align: center !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 10px rgba(255, 255, 255, 0.65) !important;
}

.card-pts-column .card-agile-badge {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 2px !important;
    box-sizing: border-box !important;
}

.card-pts-column .card-color-letter,
.card-pts-column .card-color-letter b {
    font-weight: 900 !important;
    font-size: 1.35rem !important;
    font-family: "Rajdhani", sans-serif !important;
    line-height: 1 !important;
    text-align: center !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.85) !important;
}

.card-pts-column .card-color-letter {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 2px !important;
    box-sizing: border-box !important;
}

/* Hide combat tier / agile / color letter badge on tiny discard card */
#discard-row .card-combat-tier-badge,
#discard-row .card-pts-column .card-combat-tier-badge,
#visual-discard .card-combat-tier-badge,
#visual-discard .card-pts-column .card-combat-tier-badge,
#discard-row .card-agile-badge,
#discard-row .card-pts-column .card-agile-badge,
#visual-discard .card-agile-badge,
#visual-discard .card-pts-column .card-agile-badge,
#discard-row .card-color-letter,
#discard-row .card-pts-column .card-color-letter,
#visual-discard .card-color-letter,
#visual-discard .card-pts-column .card-color-letter {
    display: none !important;
}

#discard-row .card-pts-column,
#visual-discard .card-pts-column {
    top: auto !important;
    bottom: 2px !important;
    right: 2px !important;
    gap: 0 !important;
    min-width: 0 !important;
}

#discard-row .card-pts-column .card-pts-badge,
#visual-discard .card-pts-column .card-pts-badge {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-shadow: 0 1px 4px #000 !important;
}

@media (max-width: 850px) {
    .card-pts-column {
        top: 2px !important;
        right: 2px !important;
        gap: 3px !important;
        min-width: 18px !important;
    }
    .card-pts-column .card-pts-badge {
        font-size: 1.05rem !important;
        padding: 0 !important;
    }
    .card-pts-column .card-combat-tier-badge {
        font-size: 0.75rem !important;
        width: 17px !important;
        min-width: 17px !important;
        height: 17px !important;
        padding: 0 !important;
        border-radius: 3px !important;
        border-width: 1px !important;
    }
    .card-pts-column .card-agile-badge,
    .card-pts-column .card-agile-badge b,
    .card-pts-column .card-agile-badge i,
    .card-pts-column .card-color-letter,
    .card-pts-column .card-color-letter b {
        font-size: 1.15rem !important;
    }
}

/* ===== Mobile usability refinements ===== */
/* Taps respond instantly (no double-tap-zoom delay) and no grey tap flash */
button, .card, .btn-options, .faction-draft-card, #action-bar * { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

@media (max-width: 850px) {
    /* Keep content out of notches / home indicator */
    body { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); }

    /* Compact turn toast so it does not cover the header */
    .coinflip-toast { top: max(8px, env(safe-area-inset-top)); width: calc(100vw - 32px); max-width: 420px; padding: 8px 14px; font-size: 0.95rem; line-height: 1.25; }

    /* Score badges side by side instead of stacked: saves vertical space */
    body #score-counter { flex-direction: row !important; flex-wrap: wrap !important; gap: 4px 6px !important; }

    /* Finger-sized action buttons */
    body #standard-controls button, body #btn-end-turn, body #btn-shadow { min-height: 44px !important; }
    body #ability-controls button { min-height: 44px !important; font-size: 0.8rem !important; }
    body .btn-options { width: 44px !important; height: 44px !important; }
    body .close-panel { top: max(12px, env(safe-area-inset-top)); right: 12px; }

    /* Scrolling card rows: snap so cards line up after a swipe */
    .card-row { scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
    .card-row > .card, .card-row > .battlefield-slot { scroll-snap-align: start; }

    /* Modals scroll inside themselves rather than the page behind */
    .overlay-box { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}

/* Narrow phones: action buttons wrap into 3 columns so labels (e.g. Fight (2 SC)) are not clipped */
@media (max-width: 430px) {
    body #standard-controls > div, body #standard-controls > button, body #btn-shadow, body #btn-end-turn { flex: 1 1 calc(33.333% - 4px) !important; min-width: 84px !important; }
    body #standard-controls button { font-size: 0.82rem !important; padding: 4px 4px !important; }
}

/* Network connection banner */
#network-banner {
    display: none;
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100001;
    max-width: min(560px, calc(100vw - 24px));
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
    background: rgba(30, 41, 59, 0.97);
    border: 2px solid #38bdf8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}
#network-banner.net-warn { border-color: #facc15; }
#network-banner.net-error { border-color: #ef4444; background: rgba(60, 20, 20, 0.97); }

/* Face-down Morphon whose identity the host has not revealed yet (hidden-information netplay) */
.card.card-hidden { background: url("assets/card_back.jpg") center/cover no-repeat !important; border-color: #3f3f46; cursor: default; box-shadow: inset 0 0 18px rgba(0,0,0,0.6); }

/* Location hand tray (hidden hand: lands are placed into a slot when a Morphon is first summoned there) */
.land-chip {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #38bdf8;
    background: rgba(12, 74, 110, 0.55);
    color: #e0f2fe;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.land-chip:hover { transform: translateY(-1px); box-shadow: 0 0 10px rgba(56, 189, 248, 0.5); }
.land-chip.selected { background: #0369a1; border-color: #facc15; box-shadow: 0 0 12px rgba(250, 204, 21, 0.6); color: #fff; }
.land-pick-btn:hover { border-color: #facc15 !important; }

/* ---- compact Fight window (rules live in the rules panel) ---- */
.fight-champ { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.55); border: 1px solid rgba(244,63,94,0.55); border-radius: 8px; padding: 8px 12px; }
.fight-champ-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fight-champ-label { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.fight-champ-name { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.2rem; color: #f1f5f9; }
.fight-tier { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border: 2px solid #ef4444; border-radius: 6px; background: rgba(0,0,0,0.85); color: #ef4444; font-family: 'Rajdhani', sans-serif; font-weight: 900; font-size: 1.2rem; }
.fight-tier-sm { min-width: 22px; height: 22px; font-size: 0.95rem; border-width: 1.5px; border-radius: 4px; }
.fight-pts { font-family: 'Rajdhani', sans-serif; font-weight: 800; font-size: 1.15rem; color: #38bdf8; white-space: nowrap; }
.fight-bolt { color: #facc15; }
.fight-chip { font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; border: 1px solid; background: rgba(0,0,0,0.5); vertical-align: middle; }
.fight-target-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fight-target-name { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.05rem; color: #f1f5f9; }
.fight-target-score { display: inline-flex; align-items: center; gap: 8px; }
.fight-empty { padding: 22px 14px; text-align: center; color: #94a3b8; border: 1px dashed rgba(244,63,94,0.35); border-radius: 8px; }
#priv-return { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 310; align-items: center; justify-content: center; padding: 12px 26px; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.15rem; letter-spacing: 0.5px; color: #fff; background: linear-gradient(135deg, #7e22ce, #581c87); border: 2px solid #c084fc; border-radius: 10px; cursor: pointer; box-shadow: 0 6px 28px rgba(168,85,247,0.55); }
#priv-return:hover { background: linear-gradient(135deg, #9333ea, #6b21a8); }

/* Deep-Dive slot chooser */
.priv-slot { padding: 7px 12px; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 0.95rem; color: #e4e4e7; background: #27272a; border: 1px solid #52525b; border-radius: 6px; cursor: pointer; }
.priv-slot:hover:not(:disabled) { border-color: #c084fc; background: #3b2a55; }
.priv-slot.sel { border-color: #c084fc; background: #6b21a8; color: #fff; }
.priv-slot:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================================
   2D MAGIC ARENA ONE-SCREEN UI REDESIGN
   - Fits on 100vh with zero vertical scrolling
   - Tiny cards on board, hand, and piles are pure art (text hidden via CSS)
   - Hand fanned out in a curved arc at the bottom of the screen
   - Hovering any tiny card shows a bigger full-face card (#arena-hover-card)
   - Clicking any card shows it on the left upsized to window size (#arena-left-card-showcase)
   - Hovering that upsized card shows extra breakdown info on the right (#arena-right-breakdown-panel)
   ============================================================================ */

html, body {
    height: 100vh !important;
    max-height: 100vh !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

/* Compact Top Arena HUD Bar: Avatars + Full Screen Button + Deck/Discard/Exhaust Piles Only */
html body .header {
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 3px 12px !important;
    border-radius: 0 !important;
    clip-path: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.25) !important;
    background: linear-gradient(180deg, rgba(10, 14, 24, 0.96), rgba(14, 18, 30, 0.92)) !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    min-height: 46px !important;
    max-height: 52px !important;
    box-sizing: border-box !important;
    z-index: 50 !important;
    cursor: pointer !important;
}

html body .header-top-bar,
html body .header-left,
html body #score-counter,
html body .player-score-badge,
html body #round-credit-status-bar,
html body .header-center-text,
html body #faction-name-display,
html body #faction-rule-display,
html body #opp-faction-name-display,
html body #opp-faction-rule-display,
html body .arena-header-divider,
html body .tiny-pile-meta,
html body .tiny-pile-label,
html body .tiny-pile-sub,
html body .tiny-pile-divider,
html body .header-legacy-btns,
html body .header #btn-sound-toggle,
html body .header #btn-options {
    display: none !important;
}

html body .header-center {
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

html body .arena-faction-badge {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    flex-shrink: 0 !important;
}

html body #faction-portrait,
html body #opp-faction-portrait {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}

html body #global-faction-tooltip {
    pointer-events: none !important;
}

html body .header-fullscreen-btn {
    flex: 1 1 auto !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 6px !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    background: rgba(15, 23, 42, 0.65) !important;
    color: #bae6fd !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

html body .header-fullscreen-btn:hover {
    background: rgba(14, 116, 144, 0.35) !important;
    border-color: #38bdf8 !important;
    color: #fff !important;
}

html body .header-right {
    width: auto !important;
    margin-left: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    flex: 0 0 auto !important;
}

html body .header-piles-bar {
    padding: 2px 6px !important;
    gap: 6px !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
}

html body .tiny-pile-item {
    gap: 0 !important;
}

html body #visual-deck,
html body #discard-row .card,
html body #exhaust-row .card,
html body #opp-exhaust-row .card {
    flex: 0 0 32px !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
}

html body #visual-deck #deck-counter {
    font-size: 0.92rem !important;
}

/* Main 1-Screen Arena Table */
.game-board {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: calc(100vh - 52px) !important;
    max-height: calc(100vh - 52px) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 4px 16px 0 16px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 2px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    position: relative !important;
    background: radial-gradient(ellipse at 50% 46%, rgba(30, 41, 68, 0.48) 0%, rgba(11, 14, 23, 0.88) 72%, rgba(5, 7, 12, 0.98) 100%) !important;
}

#arena-battlefield-lanes {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0 18px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-end !important;
    gap: 6px !important;
}

#opponent-battlefield-section,
#self-battlefield-section {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    flex: 0 1 auto !important;
}

#opponent-board-header,
#self-board-header {
    display: none !important;
}

.arena-lane-row {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 18px !important;
    box-sizing: border-box !important;
}

.arena-mid-stats {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
}

.arena-side-stat {
    min-width: 78px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 6px 14px !important;
    background: rgba(10, 14, 24, 0.72) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 0 18px rgba(0, 0, 0, 0.5) !important;
    user-select: none !important;
}

.arena-side-sc-box {
    border-bottom: 3px solid rgba(192, 132, 252, 0.72) !important;
}

.arena-side-pts-box {
    border-bottom: 3px solid rgba(255, 255, 255, 0.72) !important;
}

#opp-side-pts.arena-side-pts-box {
    border-bottom-color: rgba(255, 255, 255, 0.72) !important;
}

.arena-side-val {
    font-family: 'Cinzel', serif !important;
    font-size: clamp(1.85rem, 3.6vh, 2.75rem) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
}

.arena-val-sc {
    color: #c084fc !important;
    text-shadow: 0 0 16px rgba(192, 132, 252, 0.45) !important;
}

.arena-val-self-pts {
    color: #ffffff !important;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.38) !important;
}

.arena-val-opp-pts {
    color: #ffffff !important;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.38) !important;
}

/* Arena Battlefield Card Rows */
#opponent-battlefield-row,
#active-battlefield-row {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    padding: 6px 14px !important;
    gap: 12px !important;
    background: rgba(12, 16, 28, 0.62) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    border-radius: 10px !important;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65) !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: visible !important;
    width: max-content !important;
    min-width: 0 !important;
}

#opponent-battlefield-row {
    border-top: 1.5px solid rgba(251, 113, 133, 0.32) !important;
}

#active-battlefield-row {
    border-bottom: 1.5px solid rgba(74, 222, 128, 0.32) !important;
}

/* Compact Tiny Battlefield Cards & Slots */
:root {
    --tiny-card-w: clamp(50px, min(10.2vh, 13.5vw), 104px);
    --tiny-card-h: clamp(76px, min(15.6vh, 20.5vw), 158px);
}

html body #opponent-battlefield-row .card,
html body #active-battlefield-row .card,
html body #opponent-battlefield-row .card.empty-slot.location-slot,
html body #active-battlefield-row .card.empty-slot.location-slot,
html body .battlefield-slot .card {
    flex: 0 0 var(--tiny-card-w) !important;
    width: var(--tiny-card-w) !important;
    min-width: var(--tiny-card-w) !important;
    max-width: var(--tiny-card-w) !important;
    height: var(--tiny-card-h) !important;
    min-height: var(--tiny-card-h) !important;
    max-height: var(--tiny-card-h) !important;
    padding: 0 !important;
    border-radius: 7px !important;
    border-width: 2px !important;
    overflow: hidden !important;
    background-size: cover !important;
    background-position: center !important;
    transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease, border-color 0.16s ease !important;
}

html body .battlefield-slot {
    flex: 0 0 var(--tiny-card-w) !important;
    width: var(--tiny-card-w) !important;
    min-width: var(--tiny-card-w) !important;
    max-width: var(--tiny-card-w) !important;
    gap: 2px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

/* Location Strip Above Occupied Battlefield Slot: Pure Art Peek */
.battlefield-location-above {
    width: 100% !important;
    height: clamp(16px, 2.2vh, 22px) !important;
    min-height: clamp(16px, 2.2vh, 22px) !important;
    max-height: clamp(16px, 2.2vh, 22px) !important;
    padding: 0 !important;
    border-radius: 5px 5px 2px 2px !important;
    border: 1.5px solid rgba(56, 189, 248, 0.65) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75) !important;
    cursor: pointer !important;
    overflow: hidden !important;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease !important;
}

.battlefield-location-above:hover {
    transform: translateY(-2px) scale(1.04) !important;
    border-color: #facc15 !important;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.7) !important;
    z-index: 30 !important;
}

/* ============================================================================
   TINY CARDS ARE JUST ART:
   Hide all text/number badges on tiny cards on the board, in hand, and in header
   piles, while keeping inner DOM elements intact for unit tests and showing
   them inside #arena-hover-card and #arena-left-card-showcase!
   ============================================================================ */
.game-board .card > :not(video.art-video):not(.psifuge-counter-pip):not(.tiny-hand-sc-tl):not(.tiny-card-pts-tr),
#discard-row .card:not(.empty-slot) > :not(video.art-video),
#exhaust-row .card:not(.empty-slot) > :not(video.art-video),
#opp-exhaust-row .card:not(.empty-slot) > :not(video.art-video),
.battlefield-location-above > * {
    display: none !important;
}

.tiny-hand-sc-tl,
.tiny-card-pts-tr {
    display: none;
}

.game-board .card > .psifuge-counter-pip {
    display: block !important;
    top: 5px !important;
    left: 5px !important;
    width: 16px !important;
    height: 16px !important;
    z-index: 30 !important;
    pointer-events: none !important;
}

#market-row .card > .tiny-hand-sc-tl {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border-radius: 5px !important;
    background: rgba(2, 6, 23, 0.88) !important;
    border: 1.5px solid #c084fc !important;
    color: #c084fc !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 800 !important;
    font-size: 0.84rem !important;
    line-height: 1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.88) !important;
    z-index: 28 !important;
    pointer-events: none !important;
}

#market-row .card > .tiny-card-pts-tr,
#active-battlefield-row .card > .tiny-card-pts-tr,
#opponent-battlefield-row .card > .tiny-card-pts-tr {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border-radius: 5px !important;
    background: rgba(2, 6, 23, 0.88) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.38) !important;
    color: #ffffff !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 800 !important;
    font-size: 0.86rem !important;
    line-height: 1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.88) !important;
    z-index: 28 !important;
    pointer-events: none !important;
}

#active-battlefield-row .card.status-pass:not([data-green-bar="1"]) > .tiny-card-pts-tr,
#opponent-battlefield-row .card.status-pass:not([data-green-bar="1"]) > .tiny-card-pts-tr {
    color: #facc15 !important;
    border-color: rgba(250, 204, 21, 0.75) !important;
}

/* Subtle empty slot styling when no Location is present yet */
.game-board .card.empty-slot:not(.location-slot) {
    background: rgba(9, 12, 20, 0.48) !important;
    border: 1.5px dashed rgba(148, 163, 184, 0.22) !important;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5) !important;
}

/* Visual state glows on pure-art tiny cards (border color matches bar color) */
.game-board .card.status-pass {
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.48) !important;
}

.game-board .card[data-psifuge-count="1"],
.game-board .card[data-psifuge-count="2"] {
    box-shadow: 0 0 0 2px #38bdf8, 0 0 16px rgba(56, 189, 248, 0.9) !important;
}

.game-board .card.selected {
    border-color: #facc15 !important;
    box-shadow: 0 0 0 2px #facc15, 0 0 20px rgba(250, 204, 21, 0.85) !important;
}

.game-board .card.target-selected {
    border-color: #2dd4bf !important;
    box-shadow: 0 0 0 2px #2dd4bf, 0 0 18px rgba(45, 212, 191, 0.85) !important;
}

.game-board .card.targetable-blood {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px #ef4444, 0 0 18px rgba(239, 68, 68, 0.85) !important;
}

.game-board .card.targetable-frost {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px #38bdf8, 0 0 18px rgba(56, 189, 248, 0.85) !important;
}

#opponent-battlefield-row .card:hover,
#active-battlefield-row .card:hover {
    transform: translateY(-4px) scale(1.06) !important;
    z-index: 35 !important;
}

/* Central Arena Action Bar (between Opponent and Self Psifronts, right-aligned) */
html body #action-bar {
    margin: 0 !important;
    padding: 0 18px !important;
    background: transparent !important;
    border: none !important;
    flex: 0 0 auto !important;
    min-height: 2px !important;
    height: 2px !important;
    justify-content: flex-end !important;
}

html body #shift-container,
html body #swap-container,
html body #cycle-container,
html body #btn-shift,
html body #btn-swap,
html body #btn-cycle,
html body #action-bar #ability-controls,
html body #ability-controls,
html body #ability-controls.active {
    display: none !important;
}

html body #standard-controls #btn-end-turn,
html body #btn-end-turn {
    position: fixed !important;
    right: 16px !important;
    bottom: 16px !important;
    left: auto !important;
    width: auto !important;
    min-width: 96px !important;
    max-width: max-content !important;
    flex: 0 0 auto !important;
    z-index: 80 !important;
    min-height: 42px !important;
    padding: 8px 20px !important;
    font-size: 0.95rem !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75) !important;
}

/* Show choice windows on the right-hand side of the screen */
#private-modal,
#ability-choice-modal,
#psifuge-warning-modal,
#sc-warning-modal,
#fight-modal,
#discard-viewer,
#exhaust-viewer,
#deck-viewer,
#options-modal,
#gameover-modal,
#ability-modal {
    justify-content: flex-end !important;
    padding-right: 28px !important;
    box-sizing: border-box !important;
}

.choice-window-box {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.97), rgba(9, 12, 24, 0.98)) !important;
    border: 2px solid #a855f7 !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.92), 0 0 36px rgba(168, 85, 247, 0.32) !important;
    padding: 20px 22px !important;
    max-width: min(1060px, 95vw) !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
}

#private-cards {
    justify-content: flex-start !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

#private-cards > .card:first-child {
    margin-left: auto !important;
}

#private-cards > .card:last-child {
    margin-right: auto !important;
}

#ability-choice-cards .card,
#ability-modal .choice-win-cards .card {
    cursor: pointer !important;
    transition: transform 0.14s ease, box-shadow 0.14s ease !important;
}

#ability-choice-cards .card:hover,
#ability-modal .choice-win-cards .card:hover {
    transform: translateY(-4px) scale(1.04) !important;
}

.choice-card-zone-pill {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.65);
    color: #e0f2fe;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 25;
    pointer-events: none;
    letter-spacing: 0.4px;
}

#psytrance-water-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.92;
}

/* ============================================================================
   MAGIC ARENA DRAG-AND-DROP GHOST, FLOATING CURSOR SC COST, & DROP HIGHLIGHTS
   ============================================================================ */
.card.is-being-dragged {
    opacity: 0.28 !important;
    filter: saturate(0.4) !important;
    pointer-events: none !important;
}

#arena-drag-card-ghost {
    position: fixed !important;
    z-index: 9800 !important;
    width: 84px !important;
    height: 124px !important;
    pointer-events: none !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.9)) !important;
    transform: rotate(-4deg) scale(1.04) !important;
    transition: transform 0.1s ease, filter 0.1s ease !important;
}

#arena-drag-card-ghost .card {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    border-width: 2px !important;
    background-size: cover !important;
    background-position: center !important;
}

#arena-drag-card-ghost .card > :not(video.art-video) {
    display: none !important;
}

#arena-drag-card-ghost.drag-ghost-valid .card {
    border-color: #4ade80 !important;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.9) !important;
}

#arena-drag-card-ghost.drag-ghost-invalid .card {
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.9) !important;
}

#arena-drag-cost-cursor {
    position: fixed !important;
    z-index: 9900 !important;
    transform: translate(-50%, -100%) !important;
    pointer-events: none !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: rgba(10, 14, 24, 0.94) !important;
    border: 2px solid #c084fc !important;
    color: #c084fc !important;
    font-family: 'Cinzel', serif !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85), 0 0 14px rgba(192, 132, 252, 0.45) !important;
}

#arena-drag-cost-cursor.cost-valid {
    border-color: #4ade80 !important;
    color: #4ade80 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85), 0 0 16px rgba(74, 222, 128, 0.65) !important;
}

#arena-drag-cost-cursor.cost-invalid {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85), 0 0 16px rgba(239, 68, 68, 0.65) !important;
}

.arena-drop-target-valid {
    outline: 2.5px solid #4ade80 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 22px rgba(74, 222, 128, 0.75) !important;
    border-radius: 10px !important;
}

.arena-drop-target-invalid {
    outline: 2.5px solid #ef4444 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.75) !important;
    border-radius: 10px !important;
}

/* ============================================================================
   FANNED-OUT HAND AT THE BOTTOM-RIGHT OF THE SCREEN (SHIFTED LEFT FOR END TURN)
   ============================================================================ */
#hand-zone-container {
    width: 100% !important;
    flex: 0 0 auto !important;
    height: clamp(112px, 16.8vh, 152px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    position: relative !important;
    z-index: 45 !important;
    pointer-events: none !important;
    padding-bottom: 2px !important;
    padding-right: 175px !important;
    box-sizing: border-box !important;
}

.arena-hand-header {
    position: absolute !important;
    right: 16px !important;
    bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    pointer-events: auto !important;
    z-index: 60 !important;
}

#hand-label {
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    color: #94a3b8 !important;
}

#btn-toggle-hand {
    padding: 3px 10px !important;
    font-size: 0.72rem !important;
    min-height: 24px !important;
    background: rgba(24, 24, 27, 0.85) !important;
    border: 1px solid #52525b !important;
    color: #cbd5e1 !important;
    border-radius: 5px !important;
    margin: 0 !important;
}

#market-row {
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 24px 2px 24px !important;
    margin: 0 !important;
    gap: 0 !important;
    overflow: visible !important;
}

#market-row .card {
    flex: 0 0 clamp(76px, 10vh, 102px) !important;
    width: clamp(76px, 10vh, 102px) !important;
    min-width: clamp(76px, 10vh, 102px) !important;
    max-width: clamp(76px, 10vh, 102px) !important;
    height: clamp(112px, 15.2vh, 154px) !important;
    min-height: clamp(112px, 15.2vh, 154px) !important;
    max-height: clamp(112px, 15.2vh, 154px) !important;
    padding: 0 !important;
    margin: 0 -9px !important;
    border-radius: 8px !important;
    border-width: 2px !important;
    overflow: hidden !important;
    background-size: cover !important;
    background-position: center !important;
    transform-origin: 50% 90% !important;
    transform: translateY(var(--fan-y, 0px)) rotate(var(--fan-rot, 0deg)) !important;
    z-index: var(--fan-z, 1) !important;
    box-shadow: -3px 4px 14px rgba(0, 0, 0, 0.85) !important;
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, border-color 0.18s ease !important;
}

#market-row .card:hover,
#market-row .card.selected,
#market-row .card.selected:hover {
    transform: translateY(var(--fan-y, 0px)) rotate(var(--fan-rot, 0deg)) scale(1.18) !important;
    z-index: 90 !important;
}

/* ============================================================================
   STAGE 1: HOVERING ANY TINY CARD SHOWS A BIGGER VERSION (#arena-hover-card)
   ============================================================================ */
#arena-hover-card {
    position: fixed !important;
    z-index: 9400 !important;
    width: 224px !important;
    height: 364px !important;
    pointer-events: none !important;
    filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.92)) !important;
}

#arena-hover-card .card {
    width: 224px !important;
    height: 364px !important;
    min-width: 224px !important;
    max-width: 224px !important;
    min-height: 364px !important;
    max-height: 364px !important;
    padding: 10px 8px !important;
    border-radius: 10px !important;
    border-width: 2.5px !important;
    margin: 0 !important;
    transform: none !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Restore full card details inside #arena-hover-card and #arena-left-card-showcase */
#arena-hover-card .card .card-renowned-name,
#arena-left-card-showcase .card .card-renowned-name {
    display: block !important;
}

#arena-hover-card .card .card-aptitude-badge,
#arena-left-card-showcase .card .card-aptitude-badge {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

#arena-hover-card .card .card-pts-column,
#arena-left-card-showcase .card .card-pts-column {
    display: flex !important;
}

#arena-hover-card .card .card-rule,
#arena-left-card-showcase .card .card-rule {
    display: flex !important;
}

#arena-hover-card .card .location-card-content,
#arena-left-card-showcase .card .location-card-content {
    display: flex !important;
}

#arena-hover-card .card .card-renowned-name {
    top: 8px !important;
    left: 8px !important;
    right: 38px !important;
    font-size: 0.94rem !important;
    line-height: 1.08 !important;
}

#arena-hover-card .card .card-aptitude-badge {
    font-size: 0.82rem !important;
    padding: 3px 7px !important;
    top: 29px !important;
    left: 8px !important;
}

#arena-hover-card .card .card-pts-column {
    top: 8px !important;
    right: 8px !important;
}

#arena-hover-card .card .card-pts-column .card-pts-badge {
    font-size: 1.65rem !important;
}

#arena-hover-card .card .card-pts-column .card-color-letter,
#arena-hover-card .card .card-pts-column .card-color-letter b {
    font-size: 1.45rem !important;
}

#arena-hover-card .card .card-rule {
    font-size: 0.88rem !important;
    line-height: 1.28 !important;
    padding: 8px 9px !important;
    min-height: 54px !important;
}

#arena-hover-card .card.empty-slot.location-slot .location-tag {
    font-size: 0.8rem !important;
    padding: 3px 7px !important;
}

#arena-hover-card .card.empty-slot.location-slot .location-name-text {
    font-size: 1rem !important;
}

#arena-hover-card .card.empty-slot.location-slot .location-rule-box {
    font-size: 0.85rem !important;
    line-height: 1.28 !important;
    padding: 7px 8px !important;
}

/* ============================================================================
   STAGE 2: CLICKING ANY CARD SHOWS IT ON THE LEFT OF THE SCREEN UPSIZED TO THE
   WINDOW SIZE (#arena-left-card-showcase)
   ============================================================================ */
#arena-left-card-showcase {
    position: fixed !important;
    left: 12px !important;
    top: 56px !important;
    height: calc(100vh - 68px) !important;
    max-height: calc(100vh - 68px) !important;
    aspect-ratio: 150 / 244 !important;
    width: auto !important;
    max-width: min(44vw, calc((100vh - 68px) * 150 / 244)) !important;
    z-index: 9600 !important;
    display: none;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.96)) !important;
    transition: opacity 0.18s ease !important;
    animation: arenaShowcaseIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#arena-left-card-showcase.choice-window-open {
    opacity: 0.16 !important;
    pointer-events: none !important;
}

@keyframes arenaShowcaseIn {
    from { opacity: 0; transform: translateX(-18px) scale(0.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

#arena-left-card-showcase .card.arena-window-card {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
    padding: clamp(14px, 2.2vh, 24px) clamp(12px, 1.8vh, 20px) !important;
    border-radius: 14px !important;
    border-width: 3px !important;
    transform: none !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

#arena-left-card-showcase .card.arena-window-card .card-renowned-name {
    top: clamp(12px, 2vh, 22px) !important;
    left: clamp(12px, 2vh, 22px) !important;
    right: clamp(54px, 8vh, 84px) !important;
    font-size: clamp(1.1rem, 2.4vh, 1.6rem) !important;
    padding: 0 !important;
}

#arena-left-card-showcase .card.arena-window-card .card-aptitude-badge {
    top: clamp(42px, 6.2vh, 64px) !important;
    left: clamp(12px, 2vh, 22px) !important;
    font-size: clamp(0.95rem, 2vh, 1.38rem) !important;
    padding: clamp(4px, 0.7vh, 8px) clamp(8px, 1.3vh, 14px) !important;
    border-radius: 7px !important;
}

#arena-left-card-showcase .card.arena-window-card .card-pts-column {
    top: clamp(12px, 2vh, 22px) !important;
    right: clamp(12px, 2vh, 22px) !important;
    gap: 6px !important;
}

#arena-left-card-showcase .card.arena-window-card .card-pts-column .card-pts-badge {
    font-size: clamp(2rem, 4.4vh, 3.1rem) !important;
}

#arena-left-card-showcase .card.arena-window-card .card-pts-column .card-agile-badge,
#arena-left-card-showcase .card.arena-window-card .card-pts-column .card-agile-badge b,
#arena-left-card-showcase .card.arena-window-card .card-pts-column .card-agile-badge i,
#arena-left-card-showcase .card.arena-window-card .card-pts-column .card-color-letter,
#arena-left-card-showcase .card.arena-window-card .card-pts-column .card-color-letter b {
    font-size: clamp(1.6rem, 3.4vh, 2.4rem) !important;
}

#arena-left-card-showcase .card.arena-window-card .card-feat-tag {
    top: clamp(12px, 2vh, 22px) !important;
    left: clamp(12px, 2vh, 22px) !important;
    font-size: clamp(0.95rem, 2vh, 1.35rem) !important;
    padding: 4px 10px !important;
}

#arena-left-card-showcase .card.arena-window-card .card-feat-cost {
    top: clamp(12px, 2vh, 22px) !important;
    right: clamp(12px, 2vh, 22px) !important;
    font-size: clamp(1.2rem, 2.6vh, 1.75rem) !important;
    padding: 4px 10px !important;
}

#arena-left-card-showcase .card.arena-window-card .card-rule {
    font-size: clamp(1rem, 2.15vh, 1.4rem) !important;
    line-height: 1.35 !important;
    padding: clamp(10px, 1.8vh, 18px) clamp(12px, 2vh, 20px) !important;
    min-height: clamp(68px, 11vh, 120px) !important;
    border-radius: 9px !important;
}

#arena-left-card-showcase .card.empty-slot.location-slot .location-tag {
    font-size: clamp(0.95rem, 2vh, 1.35rem) !important;
    padding: 4px 10px !important;
}

#arena-left-card-showcase .card.empty-slot.location-slot .location-name-text {
    font-size: clamp(1.15rem, 2.5vh, 1.7rem) !important;
    padding: 6px 10px !important;
}

#arena-left-card-showcase .card.empty-slot.location-slot .location-rule-box {
    font-size: clamp(0.98rem, 2.1vh, 1.35rem) !important;
    line-height: 1.35 !important;
    padding: clamp(10px, 1.8vh, 18px) !important;
}

.arena-showcase-close {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1.5px solid #94a3b8 !important;
    color: #f8fafc !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 25 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.85) !important;
}

.arena-showcase-close:hover {
    background: #ef4444 !important;
    border-color: #fff !important;
}

.arena-showcase-hint {
    position: absolute !important;
    bottom: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(9, 13, 22, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    color: #38bdf8 !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    padding: 2px 10px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    z-index: 25 !important;
}

/* ============================================================================
   STAGE 3: MOUSING OVER THE UPSIZED CARD SHOWS EXTRA BREAKDOWN INFORMATION ON
   THE RIGHT SIDE OF THE SCREEN (#arena-right-breakdown-panel)
   ============================================================================ */
#arena-right-breakdown-panel {
    position: fixed !important;
    right: 12px !important;
    top: 48px !important;
    max-height: calc(100vh - 56px) !important;
    width: min(680px, calc(100vw - min(44vw, (100vh - 68px) * 0.615) - 28px)) !important;
    z-index: 9600 !important;
    background: linear-gradient(165deg, rgba(11, 15, 25, 0.97) 0%, rgba(17, 24, 39, 0.96) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.55) !important;
    border-radius: 10px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 28px rgba(56, 189, 248, 0.2) !important;
    padding: clamp(7px, 1.2vh, 13px) clamp(12px, 1.8vw, 18px) !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    display: none;
    flex-direction: column !important;
    gap: clamp(5px, 0.85vh, 9px) !important;
    color: #e2e8f0 !important;
    font-family: 'Inter', sans-serif !important;
    animation: arenaBreakdownIn 0.16s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

@keyframes arenaBreakdownIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

.arena-bd-header {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    padding-bottom: clamp(4px, 0.65vh, 7px);
}

.arena-bd-tag {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(0.6rem, 1.2vh, 0.72rem);
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.arena-bd-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(0.95rem, 1.95vh, 1.25rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.arena-bd-sub {
    font-size: clamp(0.66rem, 1.3vh, 0.76rem);
    color: #94a3b8;
    font-weight: 600;
}

.arena-bd-section {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.5vh, 5px);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    padding: clamp(5px, 0.8vh, 8px) clamp(8px, 1.2vw, 12px);
}

.arena-bd-sec-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(0.62rem, 1.2vh, 0.72rem);
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.arena-bd-rule-box {
    font-size: clamp(0.68rem, 1.38vh, 0.82rem);
    line-height: 1.24;
    color: #f1f5f9;
    background: rgba(15, 23, 42, 0.75);
    border-left: 3px solid #facc15;
    padding: clamp(4px, 0.65vh, 7px) clamp(7px, 1vw, 10px);
    border-radius: 4px;
}

.arena-bd-rows {
    display: flex;
    flex-direction: column;
    gap: clamp(2px, 0.35vh, 4px);
    font-size: clamp(0.68rem, 1.35vh, 0.8rem);
}

.arena-bd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
}

.arena-bd-row strong {
    text-align: right;
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(0.72rem, 1.45vh, 0.86rem);
    white-space: nowrap;
    flex-shrink: 0;
}

.arena-bd-total {
    margin-top: 2px;
    padding-top: clamp(3px, 0.45vh, 5px);
    border-top: 1px solid rgba(56, 189, 248, 0.3);
    font-weight: 700;
    color: #fff;
}

/* ============================================================================
   BONUS POINTS GLOW & MORPHED CORNER ACTION BUTTONS
   ============================================================================ */
.arena-side-pts-box.has-bonus-pts {
    border-color: #facc15 !important;
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.72), inset 0 0 12px rgba(250, 204, 21, 0.25) !important;
    animation: bonusPtsBoxPulse 1.8s infinite alternate ease-in-out !important;
}

@keyframes bonusPtsBoxPulse {
    from {
        box-shadow: 0 0 14px rgba(250, 204, 21, 0.6), inset 0 0 10px rgba(250, 204, 21, 0.2);
    }
    to {
        box-shadow: 0 0 26px rgba(250, 204, 21, 0.95), 0 0 38px rgba(74, 222, 128, 0.45), inset 0 0 16px rgba(250, 204, 21, 0.38);
    }
}

.arena-val-self-pts.bonus-pts-glow {
    color: #fef08a !important;
    text-shadow: 0 0 8px #4ade80, 0 0 18px #facc15, 0 0 30px rgba(250, 204, 21, 0.9) !important;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.8)) !important;
}

.arena-val-opp-pts.bonus-pts-glow {
    color: #fde047 !important;
    text-shadow: 0 0 8px #fb7185, 0 0 18px #facc15, 0 0 30px rgba(250, 204, 21, 0.9) !important;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.8)) !important;
}

#btn-end-turn.corner-mode-cycle {
    background: linear-gradient(135deg, #0d9488, #0f766e) !important;
    border: 1.5px solid #2dd4bf !important;
    color: #f0fdfa !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85), 0 0 18px rgba(45, 212, 191, 0.65) !important;
}

#btn-end-turn.corner-mode-shift {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border: 1.5px solid #38bdf8 !important;
    color: #f0f9ff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.65) !important;
}

#btn-end-turn.corner-mode-draft {
    background: linear-gradient(135deg, #15803d, #166534) !important;
    border: 1.5px solid #4ade80 !important;
    color: #f0fdf4 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85), 0 0 18px rgba(74, 222, 128, 0.65) !important;
}

#btn-end-turn.corner-mode-play {
    background: linear-gradient(135deg, #7e22ce, #6b21a8) !important;
    border: 1.5px solid #facc15 !important;
    color: #fef08a !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85), 0 0 18px rgba(250, 204, 21, 0.65) !important;
}

/* ============================================================================
   MOBILE & COMPACT VIEWPORT BREAKDOWN PANEL SIZING & SMALL WINDOW OVERRIDES
   ============================================================================ */
@media (max-width: 1024px), (max-height: 760px) {
    html body #arena-right-breakdown-panel {
        right: 8px !important;
        top: 48px !important;
        max-height: calc(100vh - 54px) !important;
        width: max-content !important;
        min-width: min(560px, calc(100vw - 16px)) !important;
        max-width: calc(100vw - 16px) !important;
        padding: 6px 12px !important;
        gap: 4px !important;
        border-radius: 8px !important;
    }

    .arena-bd-header {
        padding-bottom: 3px !important;
        gap: 1px !important;
    }

    .arena-bd-tag {
        font-size: 0.56rem !important;
        letter-spacing: 0.4px !important;
    }

    .arena-bd-title {
        font-size: 0.88rem !important;
        line-height: 1.02 !important;
    }

    .arena-bd-sub {
        font-size: 0.62rem !important;
    }

    .arena-bd-section {
        padding: 4px 8px !important;
        gap: 2px !important;
        border-radius: 6px !important;
    }

    .arena-bd-sec-title {
        font-size: 0.58rem !important;
        letter-spacing: 0.4px !important;
    }

    .arena-bd-rule-box {
        font-size: 0.64rem !important;
        line-height: 1.15 !important;
        padding: 3px 7px !important;
    }

    .arena-bd-rows {
        font-size: 0.63rem !important;
        gap: 1.5px !important;
    }

    .arena-bd-row {
        gap: 8px !important;
    }

    .arena-bd-row strong {
        font-size: 0.68rem !important;
        white-space: nowrap !important;
    }

    .arena-bd-total {
        margin-top: 1px !important;
        padding-top: 2px !important;
    }
}

@media (max-width: 850px) {
    html body .game-board {
        padding: 2px 8px 0 8px !important;
        gap: 2px !important;
    }

    html body #arena-battlefield-lanes {
        padding: 0 4px !important;
        gap: 4px !important;
    }

    html body .arena-lane-row {
        gap: 8px !important;
    }

    html body .arena-side-stat {
        min-width: 52px !important;
        padding: 4px 8px !important;
        border-radius: 8px !important;
    }

    html body .arena-side-val {
        font-size: clamp(1.25rem, 3.2vh, 2rem) !important;
    }

    html body #opponent-battlefield-row,
    html body #active-battlefield-row {
        padding: 4px 8px !important;
        gap: 6px !important;
    }

    html body #hand-zone-container {
        padding-right: 118px !important;
        height: clamp(88px, 15.5vh, 136px) !important;
    }

    html body #market-row {
        padding: 4px 12px 2px 12px !important;
    }

    html body #market-row .card {
        flex: 0 0 clamp(54px, min(9.5vh, 13vw), 92px) !important;
        width: clamp(54px, min(9.5vh, 13vw), 92px) !important;
        min-width: clamp(54px, min(9.5vh, 13vw), 92px) !important;
        max-width: clamp(54px, min(9.5vh, 13vw), 92px) !important;
        height: clamp(82px, min(14.5vh, 19.5vw), 140px) !important;
        min-height: clamp(82px, min(14.5vh, 19.5vw), 140px) !important;
        max-height: clamp(82px, min(14.5vh, 19.5vw), 140px) !important;
    }

    html body #standard-controls #btn-end-turn,
    html body #btn-end-turn {
        right: 10px !important;
        bottom: 10px !important;
        min-height: 36px !important;
        padding: 6px 14px !important;
        font-size: 0.85rem !important;
    }
}
