/* ==========================================================================
   TABLICE INFORMACYJNE, TOKENY I LEGENDA
   ========================================================================== */

.token-board, .global-board, .info-board { 
    background: rgba(0,0,0,0.8); 
    border: 1px solid var(--gold); 
    border-radius: 8px; 
    padding: 10px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.global-board { border-color: var(--text-dim); }
.info-board { border-color: #34495e; }

.token-board h3, .global-board h3, .info-board h3 { 
    color: var(--gold); 
    margin: 0 0 5px 0; 
    font-size: 1em; 
    text-align: center; 
    text-transform: uppercase; 
}
.global-board h3, .info-board h3 { color: var(--text-dim); }

/* --- TOKEN PANEL --- */
#token-panel { 
    background: rgba(0,0,0,0.7); 
    border: 1px solid var(--gold); 
    border-radius: 5px; 
    padding: 8px; 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
    box-sizing: border-box; 
}
.token-panel-title { color: var(--gold); font-size: 0.8em; text-transform: uppercase; font-weight: bold; text-align: center; }
.token-spend-btn { background: #2c3e50; border: 1px solid var(--gold); color: var(--gold); padding: 5px 6px; border-radius: 3px; cursor: pointer; font-size: 0.75em; text-align: left; transition: 0.15s; line-height: 1.3; }
.token-spend-btn:hover:not(:disabled) { background: #3a3000; }
.token-spend-btn:disabled { border-color: #555; color: #666; cursor: not-allowed; }
.token-cost { color: #e67e22; font-weight: bold; }

.token-action-btn { 
    background: #2c3e50; border: 1px solid var(--gold-dim); color: #ecf0f1; 
    padding: 8px; border-radius: 5px; cursor: pointer; text-align: left; 
    font-size: 0.85em; transition: 0.2s; display: flex; 
    justify-content: space-between; align-items: center;
}
.token-action-btn:hover:not(:disabled) { background: #d35400; transform: scale(1.02); }
.token-action-btn:disabled { opacity: 0.5; border-color: #555; cursor: not-allowed; }
.token-action-btn.selected-action { background: var(--blue); border-color: #fff; box-shadow: 0 0 15px var(--blue); }

.global-stack-interactive { 
    cursor: pointer; transition: 0.3s; padding: 10px; border-radius: 5px; 
    border: 1px dashed #555; background: rgba(0,0,0,0.5); text-align: center; 
    color: #888; font-size: 0.8em;
}
.global-stack-interactive:hover { background: rgba(241, 196, 15, 0.2); border-color: var(--gold); }

/* --- LEGENDA (KARTA POMOCY) --- */
.help-card { font-size: 0.85rem; }
.scrollable-legend { max-height: 400px; overflow-y: auto; padding-right: 5px; }
.legend-grid { display: flex; flex-direction: column; gap: 6px; }
.legend-item {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.05); padding: 6px 8px;
    border-radius: 4px; border: 1px solid #333; cursor: help;
}
.legend-item span { font-weight: bold; font-size: 1.1em; }

/* ==========================================================================
   PRZYCISKI STEROWANIA GRACZA
   ========================================================================== */

button.ctrl-btn { 
    padding: 12px 20px; cursor: pointer; background: #34495e; 
    border: 1px solid #555; color: white; border-radius: 5px; 
    font-weight: bold; font-size: 0.95em; transition: 0.2s; 
}
button.ctrl-btn:hover:not(:disabled) { background: #2c3e50; border-color: var(--gold-dim); }
button.ctrl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
button.special-btn { background: #8e44ad; }
button.wywiad-btn { background: var(--green-dark); }
button.pass-btn { background: #555; }

/* ==========================================================================
   LOGI ZDARZEŃ I AKTYWNE ZDARZENIA
   ========================================================================== */

#log-container, #sq-log-container { 
    height: 100%; width: 100%; padding: 8px 10px; overflow-y: auto; 
    font-family: 'Courier New', Courier, monospace; font-size: 0.82em; 
    color: var(--text-dim); box-sizing: border-box; scroll-behavior: smooth; 
    display: flex; flex-direction: column; gap: 1px;
}
.log-entry { 
    margin-bottom: 2px; line-height: 1.4; 
    padding: 3px 6px; border-radius: 3px;
    border-left: 3px solid transparent;
    animation: logFadeIn 0.3s ease;
    transition: background 0.15s;
}
.log-entry:hover { background: rgba(255,255,255,0.04); }
.math-decon { color: #888; font-style: italic; font-size: 0.9em; margin-left: 5px; } 

/* Typ-specific kolorowe akcenty (lewy border) */
.log-entry.log-normal { border-left-color: #555; }
.log-entry.log-sys    { border-left-color: var(--gold-dim); }
.log-entry.log-turn   { border-left-color: #f39c12; }
.log-entry.log-err    { border-left-color: var(--red); }
.log-entry.log-atk    { border-left-color: var(--red); font-weight: bold; }
.log-entry.log-hlp    { border-left-color: var(--green); }
.log-entry.log-reac   { border-left-color: var(--blue); }
.log-entry.log-event  { border-left-color: #9b59b6; font-weight: bold; text-transform: uppercase; }

@keyframes logFadeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

#events h3 { margin: 0 0 5px 0; color: var(--gold); font-size: 1em; }
#active-event-info { font-size: 0.8em; }
#game-info { margin-top: 10px; color: var(--text-dim); font-weight: bold; font-size: 0.85em; }
.golden-goals-text { margin-top: 5px; font-size: 0.8em; color: var(--gold); border-top: 1px solid #555; padding-top: 10px; }
.event-info-text { color: #9b59b6; font-size: 0.85em; margin-top: 10px; font-weight: bold; }

/* --- STOS ZDARZEŃ (LISTA) --- */
#stack-panel h4 { margin: 0 0 8px 0; color: #a29bfe; font-size: 0.85em; text-transform: uppercase; letter-spacing: 1px; }
#stack-list { display: flex; flex-direction: column; gap: 6px; }
.stack-entry { display: flex; align-items: center; gap: 8px; background: rgba(142, 68, 173, 0.15); border: 1px solid #6c3483; border-radius: 5px; padding: 5px 8px; font-size: 0.82em; transition: 0.2s; }
.stack-entry.cancelled { opacity: 0.4; border-color: #555; background: rgba(80,80,80,0.1); }
.stack-entry.modified { border-color: var(--gold-dim); background: rgba(243,156,18,0.1); }
.stack-entry .se-arrow { color: #a29bfe; font-size: 1.1em; flex-shrink: 0; }
.stack-entry .se-name { font-weight: bold; color: #f0f0f0; flex: 1; }
.stack-entry .se-owner { color: #95a5a6; font-size: 0.9em; }
.stack-entry .se-target { color: #e67e22; font-size: 0.9em; }
.stack-entry .se-status { font-size: 0.8em; font-weight: bold; }
.stack-entry .se-status.ok { color: var(--green); }
.stack-entry .se-status.cancelled { color: var(--red); }
.stack-entry .se-status.modified { color: var(--gold-dim); }

.stack-counter-btns { display: flex; gap: 4px; }
.stack-counter-btn { padding: 2px 6px; border-radius: 3px; border: none; cursor: pointer; font-size: 0.75em; font-weight: bold; color: #fff; transition: 0.15s; }
.stack-counter-btn.block { background: var(--red-dark); } .stack-counter-btn.block:hover { background: var(--red); }
.stack-counter-btn.weaken { background: var(--blue-dark); } .stack-counter-btn.weaken:hover { background: var(--blue); }
.stack-counter-btn.steal { background: #8e44ad; } .stack-counter-btn.steal:hover { background: #9b59b6; }
.stack-empty-hint { color: #555; font-size: 0.8em; text-align: center; padding: 6px; }

/* ==========================================================================
   STOSY KART (TALIA I ODRZUCONE)
   ========================================================================== */

.card-pile {
    width: 140px; height: 190px; margin: 0 auto;
    border-radius: 8px; display: flex; align-items: center;
    justify-content: center; position: relative; perspective: 1000px;
}

#draw-pile {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#discard-pile {
    border: 2px dashed #555; background: rgba(0,0,0,0.4);
    overflow: hidden; width: 140px; height: 190px;
    margin: 0 auto; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; position: relative;
}

.deck-visual {
    width: 61px;
    height: 91px;
    position: relative;
    margin: 0 auto;
}
.deck-layer-1, .deck-layer-2 {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 4px;
}
.deck-layer-1 { top: -2px; left: -2px; box-shadow: -1px 1px 3px rgba(0,0,0,0.5); }
.deck-layer-2 { top: -4px; left: -4px; box-shadow: -2px 2px 3px rgba(0,0,0,0.5); }
.discard-placeholder { font-size: 2rem; opacity: 0.3; }

/* ==========================================================================
   TEMPO GRY
   ========================================================================== */

.tempo-controls { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.tempo-btn { background: #2c3e50; border: 1px solid #555; color: #ecf0f1; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 0.85em; transition: 0.2s; flex: 1; }
.tempo-btn:hover { background: #34495e; border-color: var(--gold); }
.tempo-btn.tempo-active { background: var(--red); border-color: #fff; font-weight: bold; box-shadow: 0 0 10px rgba(231, 76, 60, 0.5); }

/* ==========================================================================
   MODALE (WYSKAKUJĄCE OKNA) I PEŁNY LOG
   ========================================================================== */

.modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.85); z-index: 100; display: flex; 
    justify-content: center; align-items: center; border-radius: 10px;
}
.modal-content { background: #2c3e50; padding: 30px; border-radius: 10px; text-align: center; border: 2px solid var(--gold-dim); width: 400px; }
.modal-content h2 { margin-top: 0; color: var(--gold); }
.cancel-btn { margin-top: 20px; background: #7f8c8d; padding: 10px 20px; cursor: pointer; border: none; color: white; border-radius: 5px; font-weight: bold; }
.cancel-btn:hover { background: #95a5a6; }

#full-log-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 10000; justify-content: center; align-items: center; }
.full-log-content { background: #111; width: 80%; height: 85%; border: 2px solid #8e44ad; border-radius: 10px; display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; box-shadow: 0 0 30px rgba(142,68,173,0.5); }
.full-log-header { display: flex; justify-content: space-between; align-items: center; color: var(--gold); border-bottom: 1px solid #444; padding-bottom: 10px; margin-bottom: 10px; }
.full-log-text { flex: 1; overflow-y: auto; font-family: 'Courier New', Courier, monospace; font-size: 1.1em; color: var(--text-dim); line-height: 1.5; padding-right: 15px; text-align: left; }
.close-log-btn { background: var(--red-dark); color: white; border: none; padding: 8px 20px; cursor: pointer; border-radius: 5px; font-weight: bold; font-size: 1em; transition: 0.2s; }
.close-log-btn:hover { background: var(--red); }
.expand-log-btn { position: absolute; bottom: 10px; right: 15px; background: rgba(142, 68, 173, 0.6); border: 1px solid #9b59b6; color: white; width: 32px; height: 32px; border-radius: 5px; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 1.2em; transition: 0.2s; z-index: 10; box-shadow: 0 0 10px rgba(0,0,0,0.8); }
.expand-log-btn:hover { background: rgba(142, 68, 173, 1); transform: scale(1.1); }

/* ==========================================================================
   TESTER / AUTOPLAY
   ========================================================================== */

.autoplay-btn { position: fixed; bottom: 20px; left: 20px; background-color: #8e44ad; color: white; border: 2px solid #9b59b6; padding: 12px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; z-index: 1000; transition: 0.3s; box-shadow: 0 0 15px rgba(142, 68, 173, 0.6); }
.autoplay-btn:hover { background-color: #9b59b6; transform: scale(1.05); }
.autoplay-dropdown { display: none; position: absolute; bottom: 100%; left: 0; background-color: #2c3e50; border: 2px solid #9b59b6; border-radius: 8px; margin-bottom: 5px; flex-direction: column; overflow: hidden; min-width: 220px; box-shadow: 0 -5px 15px rgba(0,0,0,0.5); }
.autoplay-wrapper:hover .autoplay-dropdown { display: flex; }
.autoplay-dropdown button { background: none; border: none; color: white; padding: 12px 15px; text-align: left; cursor: pointer; font-weight: bold; border-bottom: 1px solid #34495e; transition: 0.2s; }
.autoplay-dropdown button:hover { background-color: #8e44ad; padding-left: 20px; }
.autoplay-dropdown button:last-child { border-bottom: none; }
/* ==========================================================================
   MINI-MAPA WŁADZY
   ========================================================================== */
.minimap-section { padding: 10px; }

.minimap-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.minimap-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.minimap-zone-label {
    font-size: 0.7em;
    font-weight: bold;
    width: 55px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 4px;
}

.zone-biała  { color: #ecf0f1; }
.zone-szara  { color: #95a5a6; }
.zone-czarna { color: #e74c3c; }
.zone-eliminated { color: #555; }

.minimap-pip {
    background: #444;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.65em;
    color: #ccc;
    cursor: default;
    white-space: nowrap;
}

.minimap-active {
    border-color: #f1c40f;
    color: #f1c40f;
    box-shadow: 0 0 5px rgba(241,196,15,0.5);
}

.minimap-human {
    border-color: #3498db;
    color: #3498db;
}

.minimap-eliminated {
    opacity: 0.4;
    text-decoration: line-through;
}

/* ==========================================================================
   GLOBALNY STOS KART (LEWA KOLUMNA)
   ========================================================================== */
.global-stack-interactive {
    min-height: 60px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 5px;
}

.global-stack-card {
    position: relative;
    border-radius: 6px;
    border: 2px solid #555;
    background: rgba(20,20,40,0.95);
    padding: 6px 8px;
    cursor: default;
}

.gs-card-name {
    font-size: 0.78em;
    font-weight: bold;
    color: #eee;
    border-radius: 3px;
    padding: 1px 4px;
}

.gs-timer-bar {
    height: 3px;
    background: #8e44ad;
    border-radius: 2px;
    margin-top: 4px;
    transition: width 0.1s linear;
}

/* ==========================================================================
   INTERAKTYWNA PLANSZA (scoreboard z pionkami, w prawej kolumnie)
   ========================================================================== */
.board-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#interactive-board {
    flex: 1;
    min-height: 580px;
    width: 100%;
    background-image: url('../grafiki/plansza.jpg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border-radius: 6px;
    border: 2px solid #f39c12;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px 4px;
    box-sizing: border-box;
}

.board-row {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    width: 100%;
}

.pawn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 6px rgba(0,0,0,0.8);
    transition: top 0.4s ease, opacity 0.3s;
    flex-shrink: 0;
    position: relative;
}

.pawn-label {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #fff;
    background: rgba(0,0,0,0.7);
    border-radius: 2px;
    padding: 0 2px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.pawn:hover .pawn-label { opacity: 1; }

/* Marker poziomów (12=wygrana, 0=start, -7=eliminacja) */
.board-score-marker {
    position: absolute;
    right: 2px;
    font-size: 8px;
    color: rgba(255,255,255,0.7);
    line-height: 1;
}

/* Licznik kart na stosach (draw pile / discard pile) */
.pile-count-badge {
    display: block;
    text-align: center;
    font-size: 0.78em;
    color: #ecf0f1;
    background: rgba(0,0,0,0.75);
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: 4px;
    font-weight: bold;
}

/* ==========================================================================
   EKRAN KOŃCA GRY (WIN OVERLAY)
   ========================================================================== */
.win-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    animation: fadeInOverlay 0.5s ease;
}
.win-overlay.hidden { display: none; }

@keyframes fadeInOverlay { from { opacity:0; } to { opacity:1; } }

.win-box {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 3px solid #f1c40f;
    border-radius: 20px;
    padding: 50px 60px;
    text-align: center;
    box-shadow: 0 0 60px rgba(241,196,15,0.5);
    animation: winBoxPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
    max-width: 500px;
    width: 90%;
}

@keyframes winBoxPop { from { transform:scale(0.5); opacity:0; } to { transform:scale(1); opacity:1; } }

.win-trophy { font-size: 5em; animation: trophySpin 1s ease 0.3s both; }
@keyframes trophySpin { from { transform:rotate(-20deg) scale(0.5); } to { transform:rotate(0) scale(1); } }

.win-box h2 { font-size: 2.2em; color: #f1c40f; margin: 10px 0 5px; text-shadow: 0 0 20px rgba(241,196,15,0.8); }
.win-box p  { color: #bdc3c7; font-size: 1.1em; margin-bottom: 20px; }

.win-stats {
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0 25px;
    text-align: left;
    font-size: 0.9em;
    color: #ecf0f1;
    line-height: 1.8;
}

.win-btn {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    border: none;
    border-radius: 30px;
    padding: 14px 40px;
    font-size: 1.1em;
    font-weight: bold;
    color: #1a1a2e;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(241,196,15,0.4);
}
.win-btn:hover { transform: scale(1.05); box-shadow: 0 6px 25px rgba(241,196,15,0.7); }

/* ==========================================================================
   BANER TURY AI
   ========================================================================== */
.ai-banner {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #2c3e50, #34495e, #2c3e50);
    border-bottom: 2px solid #f39c12;
    padding: 8px 30px;
    border-radius: 0 0 12px 12px;
    color: #f39c12;
    font-weight: bold;
    font-size: 0.95em;
    z-index: 8000;
    animation: bannerSlideDown 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.ai-banner.hidden { display: none; }

@keyframes bannerSlideDown {
    from { transform: translateX(-50%) translateY(-100%); }
    to   { transform: translateX(-50%) translateY(0); }
}

/* ==========================================================================
   PRZYCISK "ZAGRAJ ZAZNACZONĄ KARTĘ"
   ========================================================================== */
.play-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    font-weight: bold;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.play-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46,204,113,0.5);
}
.play-btn.card-selected {
    animation: pulseGreen 1.2s infinite;
}
@keyframes pulseGreen {
    0%,100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.5); }
    50%      { box-shadow: 0 0 0 8px rgba(46,204,113,0); }
}

/* ==========================================================================
   DRAG & DROP
   ========================================================================== */
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }
.card.dragging {
    opacity: 0.4;
    transform: scale(0.95) rotate(3deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.player-stat.drag-over {
    border-color: #f1c40f !important;
    background: rgba(241,196,15,0.15) !important;
    box-shadow: 0 0 20px rgba(241,196,15,0.6) !important;
    transform: scale(1.02);
}

/* ==========================================================================
   LOG TIMESTAMPS I ULEPSZENIA
   ========================================================================== */
.log-ts {
    font-size: 0.72em;
    color: #555;
    margin-right: 5px;
    font-family: monospace;
}
.log-prefix { color: #666; margin-right: 3px; }

/* ==========================================================================
   BOARD – ETYKIETY STREF (lewa krawędź)
   ========================================================================== */
.board-zone-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0;
}

/* Pulsowanie aktywnego gracza na planszy */
@keyframes pawnPulse {
    0%,100% { box-shadow: 0 0 6px #f1c40f; }
    50%      { box-shadow: 0 0 14px #f1c40f, 0 0 4px #fff; }
}

/* ==========================================================================
   KARTA – hover tooltip (pełny opis przy najechaniu)
   ========================================================================== */
.card {
    position: relative;
}
.card:hover .card-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.card-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 220px;
    background: #1a1a2e;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78em;
    color: #ecf0f1;
    z-index: 5000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 8px 25px rgba(0,0,0,0.9);
    line-height: 1.5;
}
.card-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #555;
}

/* ==========================================================================
   STREFY GRY (zgodnie ze specyfikacją: BIAŁA 2-12, SZARA -1..1, CZARNA -7..-2)
   ========================================================================== */

/* Nadpisanie poprzednich definicji – nowe kolory stref */
.zone-biała  { color: #ecf0f1 !important; text-shadow: 0 0 8px rgba(255,255,255,0.4); }
.zone-szara  { color: #95a5a6 !important; }
.zone-czarna { color: #e74c3c !important; text-shadow: 0 0 8px rgba(231,76,60,0.4); }

/* Etykiety stref na planszy (lewa krawędź wiersza) */
.board-zone-label {
    font-size: 7px;
    font-weight: bold;
    white-space: nowrap;
    padding: 0 2px;
    border-radius: 2px;
    margin-right: auto;
    opacity: 0.8;
    letter-spacing: 0.3px;
}
.board-zone-white { color: #ecf0f1; }
.board-zone-gray  { color: #95a5a6; }
.board-zone-black { color: #e74c3c; }

/* Panel gracza – obramowanie strefy */
.player-stat[data-zone="BIAŁA"] { border-top: 3px solid #ecf0f1; }
.player-stat[data-zone="SZARA"] { border-top: 3px solid #95a5a6; }
.player-stat[data-zone="CZARNA"]{ border-top: 3px solid #e74c3c; }

/* ==========================================================================
   PRZYCISK WYMIANY KART
   ========================================================================== */
button.exchange-btn {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    font-weight: bold;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
button.exchange-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52,152,219,0.5);
}

/* ==========================================================================
   OCZEKUJĄCE KARTY NA PANELACH GRACZY (PENDING AREA - REAL CARDS)
   ========================================================================== */
.sq-pending-area {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    height: 240px !important;
    min-height: 240px !important;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 4px;
    max-width: none !important;
    width: 100%;
}


.pending-real-card-wrapper {
    position: relative;
    width: 96px; /* Zarezerwowany obszar (240px * 0.4) */
    height: 136px; /* Zarezerwowany obszar (340px * 0.4) */
    z-index: 1;
    transition: z-index 0s;
}

.pending-real-card-wrapper .sq-card {
    transform: scale(0.4);
    transform-origin: top left;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Pozwalamy hoverowi działać na wrapper */
}

.pending-real-card-wrapper:hover {
    z-index: 100;
}

.pending-real-card-wrapper:hover .sq-card {
    transform: scale(0.9) translateY(-20px) translateX(-30px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.9);
}

.pending-real-card-timer-bg {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.8);
    border: 1px solid var(--gold);
    border-radius: 4px;
    overflow: hidden;
    z-index: 10;
}

.pending-real-card-timer-fill {
    height: 100%;
    background: var(--red);
    transition: width 0.1s linear;
}

/* ==========================================================================
   VISUAL TARGETING (PULSUJĄCE CELE + CROSSHAIR)
   ========================================================================== */
.player-stat.targetable {
    cursor: crosshair;
    animation: targetPulse 1.2s infinite;
    border-color: rgba(241, 196, 15, 0.6) !important;
}
.player-stat.targetable:hover {
    border-color: #f1c40f !important;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.5) !important;
    transform: scale(1.03);
}

@keyframes targetPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(241,196,15,0.3); }
    50%      { box-shadow: 0 0 0 6px rgba(241,196,15,0); }
}

/* Targeting for self (green cards) */
.player-stat.targetable-self {
    cursor: pointer;
    animation: targetSelfPulse 1.2s infinite;
    border-color: rgba(46, 204, 113, 0.6) !important;
}

@keyframes targetSelfPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.3); }
    50%      { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
}

/* ==========================================================================
   GLOBALNE KARTY STOSU (KOLORY)
   ========================================================================== */
.global-stack-card.global-red    { border-color: #c0392b; }
.global-stack-card.global-green  { border-color: #27ae60; }
.global-stack-card.global-blue   { border-color: #2980b9; }
.global-stack-card.global-greenred { border-color: #f39c12; }

/* ==========================================================================
   CardPhysicsEngine — fizyczne karty v5.3-fix
   ========================================================================== */

/* Kontener stosu globalnego — potrzebuje overflow:visible dla kart */
#global-stack-visual {
    position: relative;
    overflow: visible;
    min-height: 60px;
    padding-bottom: 10px;
}

/* Wrapper fizycznej karty na stosie globalnym */
.sq-global-stack-card {
    transform-origin: top left;
}

/* Kontener pending-area gracza — ujednolicony powyżej */

/* Mini-hand: fizyczne karty-miniaturki (skala 0.1) */
.sq-mini-hand {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    align-items: flex-start;
    overflow: visible;
    min-height: 28px;
    padding: 2px 0;
}

/* Wrapper karty w mini-hand — zarezerwuj 17px szerokości (0.1 * 175px) */
.sq-mini-hand > .sq-card-wrapper {
    width: 17px !important;
    height: 26px !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
    margin: 0 1px !important;
    transform-origin: top left !important;
    transform: scale(0.1) !important;
}

/* Karta fizyczna w locie — wzmocniony cień */
.sq-card-wrapper[style*="position: fixed"],
.sq-card-wrapper[style*="position:fixed"] {
    box-shadow: 0 20px 60px rgba(0,0,0,0.95), 0 0 25px rgba(255,255,255,0.15) !important;
}

/* ==========================================================================
   DOLNA BELKA INFORMACYJNA (TURA, RUNDA, CHEAT BUTTON)
   ========================================================================== */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45px;
    background: #222;
    border-top: 2px solid #444;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9000;
    box-sizing: border-box;
    padding: 0 20px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.bottom-bar .turn-info-badge {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.05em;
    font-weight: bold;
    text-align: center;
    margin: 0;
    padding: 0;
    letter-spacing: 0.05em;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.3);
}

/* Przycisk oszusta wewnątrz belki */
.bottom-bar .sq-cheat-btn {
    position: absolute;
    right: 20px;
    background: #111;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    font-family: var(--font-display);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.2);
}

.bottom-bar .sq-cheat-btn:hover {
    background: var(--gold);
    color: #111;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.bottom-bar .sq-cheat-btn.active {
    background: var(--red);
    border-color: var(--red-dark);
    color: #fff;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

