/* Battle View Styles */

/* Hexagon counter with round display */
.hexagon-counter {
    width: 16px;
    height: 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    color: var(--accent-green);
    white-space: nowrap;
    text-align: center;
    font-weight: bold;
    z-index: 10;
}

/* Selected case preview styles */
.selected-case-preview {
    position: relative;
    transition: all 0.3s ease;
}

.selected-case-preview.current {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
    border-radius: 8px;
}

/* Current opening case highlight */
.selected-case-preview.current-opening {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.9);
    border-radius: 8px;
    animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 25px rgba(16, 185, 129, 1);
    }
    100% {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
    }
}

.selected-case-preview.removing {
    animation: case-remove 0.5s ease-out forwards;
}

@keyframes case-remove {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes case-shift {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-10px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Animation for remaining cases shifting */
.selected-case-preview.shift-left {
    animation: shift-left 0.5s ease-out forwards;
}

@keyframes shift-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-10px);
    }
}

/* Player total elements are hidden by default and shown after animation completes */
.player-total {
    display: none;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-green);
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.25rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

/* Show player totals when they have the visible class (added by JS after animation) */
.player-total.visible {
    display: block;
}

/* Highlight player totals when the battle has ended */
.battle-view[data-battle-status="completed"] .player-total {
    font-size: 1.25rem;
    background-color: rgba(16, 185, 129, 0.1);
}

:root {
    --dark-bg: #0F0F1B;
    --darker-bg: #0a0c17;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --card-bg: #131525;
    --card-bg-hover: #1a1e2e;
    --text-light: #ffffff;
    --text-muted: #8a8d95;
}

.battle-view {
    color: var(--text-light);
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1rem auto;
    max-width: 1536px;
    width: 100%;
    position: relative;
}

/* Battle Header */
.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(to right, rgba(19, 21, 37, 0.9), rgba(10, 12, 23, 0.9));
}

.battle-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.battle-icon {
    width: 28px;
    height: 28px;
    filter: invert(60%) sepia(9%) saturate(188%) hue-rotate(182deg) brightness(89%) contrast(84%);
}

/* Battle Stats Container - now below the header */
.battle-stats-container {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(to bottom, rgba(19, 21, 37, 0.7), rgba(10, 12, 23, 0.7));
}

.battle-stats {
    display: flex;
    gap: 1.5rem;
}

.battle-stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label i {
    color: var(--accent-blue);
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
}

.battle-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.battle-status-badge.waiting {
    background-color: var(--accent-yellow);
    color: #000;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.battle-status-badge.in_progress {
    background-color: var(--accent-blue);
    color: var(--text-light);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.battle-status-badge.completed {
    background-color: var(--accent-green);
    color: #000;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Battle Content */
/* Battle Lobby */
.battle-lobby {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.battle-lobby::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-green));
    z-index: 1;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lobby-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.battle-info {
    display: flex;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
}

.lobby-actions {
    display: flex;
    gap: 1rem;
}

.join-button {
    position: relative;
    color: white;
    border: 2px solid var(--accent-green);
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 9999px;
    padding: 0.75rem 2.5rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.join-button:hover {
    border-color: #0ea271;
    background-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.lobby-content {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background: linear-gradient(to bottom, rgba(19, 21, 37, 0.5), rgba(10, 12, 23, 0.5));
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1), transparent);
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.lobby-case {
    background: linear-gradient(to bottom, rgba(19, 21, 37, 0.9), rgba(10, 12, 23, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.lobby-case:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.case-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    padding: 1rem;
    transition: all 0.3s;
}

.lobby-case:hover .case-image {
    transform: scale(1.05);
}

.case-details {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.case-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-light);
}

.case-price {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 0.875rem;
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.player-card {
    display: flex;
    align-items: center;
    background: linear-gradient(to right, rgba(19, 21, 37, 0.9), rgba(10, 12, 23, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.player-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.player-card.empty {
    opacity: 0.6;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10%;
    margin-right: 1rem;
    overflow: hidden;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-avatar.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 1.25rem;
    border-color: rgba(255, 255, 255, 0.2);
}

.player-details {
    flex: 1;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-light);
}

.player-balance {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 0.875rem;
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}

.player-status {
    margin-left: 1rem;
    font-size: 1.25rem;
}

.player-status.joined {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.player-status.waiting {
    color: var(--accent-yellow);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.lobby-status {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pulse-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.2);
    position: relative;
    animation: pulse 2s infinite;
}

.pulse-circle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.status-message p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Highlight animation for new participants */
.player-card.highlight-animation {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
        background-color: rgba(16, 185, 129, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Player join animation */
@keyframes player-join {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translateY(5px) scale(1.05);
    }
    70% {
        transform: translateY(-3px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Player leave animation - similar to join but in reverse */
@keyframes player-leave {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translateY(5px) scale(0.95);
    }
    70% {
        transform: translateY(-3px) scale(0.92);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

/* Apply animations to player elements */
.battle-player-column.player-joining {
    animation: player-join 0.8s ease-out forwards;
}

.battle-player-column.player-leaving {
    animation: player-leave 0.8s ease-out forwards;
}

/* Glow effect for player joining */
.player-joining .player-header {
    position: relative;
    overflow: hidden;
}

.player-joining .player-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.3), transparent);
    animation: glow-sweep 1.2s ease-out;
}

@keyframes glow-sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Animation for items sliding out from under player-header - only for player drops */
.player-cases .fade-in {
    position: relative;
    z-index: 5;
    animation: slide-from-header 1s ease-out forwards;
}

@keyframes slide-from-header {
    0% {
        opacity: 0;
        transform: translateY(-50px); /* Increased distance for more pronounced effect */
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Regular fade-in animation for other elements */
.fade-in:not(.player-cases .fade-in) {
    animation: simple-fade-in 0.5s ease-out forwards;
}

@keyframes simple-fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Battle Arena */
.battle-arena {
    display: grid;
    grid-template-columns: 1fr;
}

/* Battle Cases - now on the right side of the header */
.battle-cases-container {
    display: flex;
    align-items: center;
}

/* Battle Players - moved below cases */
.battle-players-container {
    margin: 1rem 0;
    order: 2;
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Simplified player header for battle rounds */
.player-header.simplified {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Case Opening Animations - full width and at the top */
.case-opening-animations {
    order: 1;
    width: 100%;
}

.case-opening-animations.full-width {
    grid-column: 1 / -1;
}

/* Leading badge for the player who is currently winning */
.leading-badge {
    background-color: var(--accent-green);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Highlight the leading player's column */
.playerBox.leading {
    border-color: var(--accent-green);
    border: 3px;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Highlight the winner in green */
.playerBox.winner {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    background-color: rgba(16, 185, 129, 0.1);
    position: relative;
}

/* Highlight losers in red */
.playerBox.loser {
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.05);
    position: relative;
}

/* Result overlay for winner and loser */
.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
    border-radius: 0.75rem;
}

.battle-player-column.winner .result-overlay,
.battle-player-column.loser .result-overlay {
    opacity: 1;
}

.result-overlay .character {
    width: 180px;
    height: 180px;
    margin-bottom: 1rem;
    object-fit: contain;
}

.result-overlay .result-text {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.result-overlay .value-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-overlay .total-won-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.result-overlay.winner .result-text {
    color: var(--accent-green);
}

.result-overlay.winner .value-text,
.result-overlay.winner .total-won-text {
    color: var(--accent-green);
}

.result-overlay.loser .result-text {
    color: var(--accent-red);
}

/* Winner badge */
.winner-badge {
    background-color: var(--accent-green);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Confetti animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 100;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background-color: #f00;
    animation: confetti-fall 3s ease-in-out infinite;
    z-index: 100;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-5%) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(105%) rotate(360deg);
        opacity: 0;
    }
}

/* Additional confetti shapes */
.confetti-piece.square {
    border-radius: 0;
}

.confetti-piece.circle {
    border-radius: 50%;
}

.confetti-piece.triangle {
    width: 0;
    height: 0;
    background-color: transparent !important;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid #f00;
}

/* Emoji button styles */
.emoji-trigger {
    position: absolute;
    top: -15px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(19, 21, 37, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    font-size: 14px;
}

.emoji-trigger:hover {
    transform: scale(1.1);
    background-color: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Emoji cooldown styles */
.emoji-trigger.cooldown {
    cursor: not-allowed;
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: white;
    font-weight: bold;
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Emoji container styles */
.emoji-container {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 10px;
    background-color: rgba(19, 21, 37, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 10px 15px;
    z-index: 9999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: visible;
    height: auto;
    min-height: 60px;
    width: auto;
    min-width: 350px;
}

.emoji-container.active {
    display: flex;
}

.emoji-button {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    flex-shrink: 0;
}

.emoji-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.emoji-button:active {
    transform: scale(0.95);
}

/* Emoji animation styles */
.emoji-animation {
    position: absolute;
    font-size: 48px;
    pointer-events: none;
    animation: emoji-fly 3s ease-out forwards;
    z-index: 1000;
}

@keyframes emoji-fly {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }
    10% {
        transform: translate(0, -20px) scale(1);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translate(0, -120px) scale(1.2);
        opacity: 0;
    }
}

/* Emoji message styles */
.emoji-message {
    position: absolute;
    display: flex;
    align-items: center;
    background-color: rgba(19, 21, 37, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 15px;
    z-index: 90;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    animation: emoji-message-appear 4s ease-out forwards;
    pointer-events: none;
}

.emoji-message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
}

.emoji-message-emoji {
    font-size: 24px;
    margin-left: 5px;
}

@keyframes emoji-message-appear {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    10% {
        transform: translateY(0);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes infiniteScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Efekty ruletki */
.fade-container {
    transition: opacity 0.5s ease-out;
}
.slide-container {
    position: relative;
    overflow: hidden;
}
.slide-row {
    transition: all 0.2s;
    transform-origin: top center;
    opacity: 1;
    margin-bottom: 1px;
}
.slide-row.new-row {
    transform: translateY(100%);
    opacity: 0;
}
.slide-row.removing {
    transform: translateY(100%);
    opacity: 0;
    height: 0;
    margin: 0;
}

/* Case spinner */
/* Case spinner in the combined view */
.case-spinner {
    width: 100% !important;
    height: 400px !important;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Highlight the spinner of the leading player */
.case-spinner.leading-spinner {
    border: 2px solid rgb(34 197 94 / var(--tw-border-opacity, 1));
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

/* Change the triangle colors for the leading spinner */
.case-spinner.leading-spinner .spinner-inner::before {
    border-color: transparent transparent transparent rgb(34 197 94 / var(--tw-border-opacity, 1));
}

.case-spinner.leading-spinner .spinner-inner::after {
    border-color: transparent rgb(34 197 94 / var(--tw-border-opacity, 1)) transparent transparent;
}

.case-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/img/lightning-icon.png') no-repeat center;
    background-size: 20%;
    opacity: 0.1; /* Ustawiamy przezroczystość */
    z-index: -1; /* Umieszczamy tło za innymi elementami */
}

.spinner-inner {
    width: 100%;
    height: 90%;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* Center line for the spinner with triangular indicators */
/* Lewy trójkąt (ma wskazywać w LEWO) */
.spinner-inner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 20px; /* zmiana! */
    border-color: transparent transparent transparent #ffffff0d; /* zmiana! */
    z-index: 20;
}


/* Prawy trójkąt (ma wskazywać w PRAWO) */
.spinner-inner::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 20px 15px 0; /* zmiana! */
    border-color: transparent #ffffff0d transparent transparent; /* zmiana! */
    z-index: 20;
}

/* Roulette-style animation with slowdown effect and precise stopping - vertical version */
.spinner-items {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    transition: transform 5s cubic-bezier(0.23, 1, 0.32, 1);
    --final-position: -2000px; /* Default value, will be overridden by JS */
}

.spinner-items.spinning {
    transform: translateY(var(--final-position));
}

.spinner-item {
    flex: 0 0 140px;
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin: 5px 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform-origin: center;
    transform: scale(1.5);
    z-index: 10;
}

.spinner-item::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.spinner-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

/* Final item display */
.final-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
    z-index: 10;
    border-radius: 8px;
}

.final-item.visible {
    opacity: 1;
    transform: scale(1);
}

.final-item img {
    max-width: 80%;
    max-height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.item-value {
    margin-top: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}



/* Vertical line for roulette */
.vertical-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 15;
    pointer-events: none; /* Żeby strzałki nie blokowały kliknięć jeśli są tylko dekoracją */
}

.vertical-line::before,
.vertical-line::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 20;
}

.vertical-line::before {
    left: 10px;
    border-width: 15px 20px 15px 0;
    border-color: transparent #10b981 transparent transparent;
}

.vertical-line::after {
    right: 10px;
    border-width: 15px 0 15px 20px;
    border-color: transparent transparent transparent #10b981;
}
/* Acceleration info */
.acceleration-info {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tick sound animation */
@keyframes tick-pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.tick-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    z-index: 20;
}

/* Particles for high-value items */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0;
}

.particle.active {
    animation: particle-float 3s ease-out forwards;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(var(--r));
    }
}

.participant-info {
    display: flex;
    align-items: center;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 0.5rem 0.5rem;
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    border: 2px solid var(--accent-blue);
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.participant-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.participant-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.total-value {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent-green);
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}


.battle-case-item {
    background: linear-gradient(to bottom, rgba(19, 21, 37, 0.7), rgba(10, 12, 23, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
    width: 80px;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.battle-case-item:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.battle-case-item img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    padding: 0.5rem;
    transition: all 0.3s;
}

.battle-case-item:hover img {
    transform: scale(1.1);
}

.battle-case-item.opened {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.battle-case-item.opened:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.battle-case-item.opened:hover img {
    transform: none;
}

.case-name {
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-light);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.case-price {
    padding: 0.25rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--accent-green);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Battle Players */
.battle-players {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.battle-player {
    display: flex;
    align-items: center;
    background: linear-gradient(to right, rgba(19, 21, 37, 0.7), rgba(10, 12, 23, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.battle-player:hover {
    transform: translateY(-3px);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Battle Rounds */
.battle-rounds {
    margin-top: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(to bottom, rgba(19, 21, 37, 0.5), rgba(10, 12, 23, 0.5));
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rounds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rounds-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.rounds-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1), transparent);
    margin-left: 1rem;
}

.rounds-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
}

.progress-bar {
    width: 200px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-green));
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.battle-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 2), 1fr);
    gap: 1.5rem;
}

.battle-player-column {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.player-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #1b1d2c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.player-cases {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    background: rgba(0, 0, 0, 0.1);
}

.case-container {
    background: linear-gradient(to bottom, rgba(19, 21, 37, 0.7), rgba(10, 12, 23, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.case-container:hover {
    transform: translateY(-3px);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.case-container.opened {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.case-waiting {
    position: relative;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.case-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.waiting-icon {
    font-size: 2rem;
    color: var(--text-muted);
    animation: pulse 2s infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.item-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    transition: all 0.3s;
}

.case-container:hover .item-image img {
    transform: scale(1.05);
}

.item-details {
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 0.5rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.item-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-light);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.item-price {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--accent-green);
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}

/* Action buttons */
.action-button {
    color: white;
    border: 2px solid var(--accent-blue);
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-button:hover {
    border-color: #2563eb;
    background-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.action-button.join {
    border-color: var(--accent-green);
    background-color: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    width: 15rem;
    height: 3rem;
}

.action-button.join:hover {
    border-color: #0ea271;
    background-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.action-button.spectate {
    border-color: var(--accent-blue);
    background-color: rgba(59, 130, 246, 0.1);
}

.action-button.spectate:hover {
    border-color: #2563eb;
    background-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.action-button.new-battle {
    border-color: var(--accent-green);
    background-color: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.action-button.new-battle:hover {
    border-color: #0ea271;
    background-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}
