/* ── Multiplayer PRO: Efekty Wizualne ────────────────────────────────────── */
.cell.hit-glow {
    animation: hitPulse 1.5s infinite;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}

.cell.miss-fade {
    opacity: 0.5;
    transition: opacity 2s ease-out;
}

@keyframes hitPulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(255, 0, 0, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 0, 0, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(255, 0, 0, 0.4); }
}

/* ── Reakcje (Emojis) Overlay ───────────────────────────────────────────── */
#reactions-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
}

.emoji-animation {
    font-size: 5rem;
    position: absolute;
    animation: emojiPop 2.5s forwards ease-out;
    opacity: 0;
}

@keyframes emojiPop {
    0% { transform: scale(0) translateY(0); opacity: 0; }
    20% { transform: scale(1.2) translateY(-20px); opacity: 1; }
    80% { transform: scale(1) translateY(-100px); opacity: 1; }
    100% { transform: scale(0.8) translateY(-150px); opacity: 0; }
}

/* ── Panel Reakcji Player ────────────────────────────────────────────────── */
.reaction-bar-wrap {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9005;
    display: flex;
    justify-content: center;
    width: auto;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ukryj panel gdy nie jesteśmy w fazie gry (opcjonalnie, tu uproszczone d_flex) */
.screen:not(.active) ~ .reaction-bar-wrap { display: none; }

.reaction-bar {
    pointer-events: auto;
    display: flex;
    gap: 12px;
    background: rgba(13, 17, 23, 0.85);
    padding: 10px 20px;
    border-radius: 40px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 15px rgba(0, 212, 255, 0.1);
}

.reaction-btn {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.reaction-btn:hover {
    transform: scale(1.3);
}

.reaction-btn:active {
    transform: scale(0.9);
}

/* ── Czat Meczowy ───────────────────────────────────────────────────────── */
#game-chat {
    display: none !important; /* Wyłączony na prośbę użytkownika */
    width: 300px;
    height: 400px;
    background: rgba(20, 25, 40, 0.95);
    border: 1px solid #30363d;
    border-radius: 12px;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: height 0.3s ease;
}

#game-chat.chat-minimized {
    height: 40px;
}

#game-chat.chat-minimized .chat-messages,
#game-chat.chat-minimized .chat-input-area,
#game-chat.chat-minimized .typing-indicator {
    display: none;
}

.chat-header {
    padding: 10px 15px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    max-width: 85%;
    padding: 6px 12px;
    border-radius: 8px;
    word-wrap: break-word;
}

.chat-msg.mine {
    align-self: flex-end;
    background: #238636;
    color: white;
}

.chat-msg.opponent {
    align-self: flex-start;
    background: #30363d;
    color: #c9d1d9;
}

.chat-input-area {
    padding: 10px;
    background: #161b22;
    border-top: 1px solid #30363d;
    display: flex;
    gap: 5px;
}

.chat-input {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    outline: none;
}

/* ── Ranking TOP 10 Styles ────────────────────────────────────────── */
.ranking-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

.ranking-table th {
    padding: 12px 6px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

/* Kolumny stałej szerokości dla lepszej czytelności */
.ranking-table th:nth-child(1), .ranking-table td:nth-child(1) { width: 30px; } /* # */
.ranking-table th:nth-child(2), .ranking-table td:nth-child(2) { width: auto; }  /* Gracz */
.ranking-table th:nth-child(3), .ranking-table td:nth-child(3) { width: 60px; }  /* Mecze */
.ranking-table th:nth-child(4), .ranking-table td:nth-child(4) { width: 50px; }  /* W */
.ranking-table th:nth-child(5), .ranking-table td:nth-child(5) { width: 50px; }  /* P */
.ranking-table th:nth-child(6), .ranking-table td:nth-child(6) { width: 100px; } /* Skuteczność */

.ranking-table td {
    padding: 12px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

.ranking-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

.ranking-table tr:last-child td {
    border-bottom: none;
}

.txt-center { text-align: center; }
.txt-right  { text-align: right; }

.color-win  { color: var(--success); font-weight: bold; }
.color-loss { color: var(--danger); }

.modal-ranking-box {
    background: linear-gradient(180deg, var(--bg-card) 0%, #0a0e1a 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 20px rgba(0, 212, 255, 0.1);
}

.typing-indicator {
    padding: 2px 15px;
    font-size: 0.75rem;
    color: #8b949e;
    font-style: italic;
    height: 1.2rem;
}

/* ── Propozycja rewanżu (PRO) ───────────────────────────────────────────── */
.rematch-offer {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px dashed rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.rematch-msg {
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.rematch-offer-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rematch-offer-btns .btn-sm {
    padding: 8px 20px;
    min-width: 80px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
