@media (max-width: 768px) {
    .table-players-container {
        max-height: 50vh;
        padding: 5px;
    }
    
    .table-stats-summary {
        padding: 15px;
    }
    
    .player-card {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .player-rank {
        font-size: 16px;
    }
    
    .player-name {
        font-size: 13px;
    }
    
    .player-stack {
        font-size: 14px;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    }
}

.btn-admin-warning {
    animation: pulse 2s infinite;
}

.table-click-hint {
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-click-hint .alert {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.table-click-hint .alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.table-click-hint .alert strong {
    color: #fbbf24;
    font-weight: 700;
}

.table-click-hint .alert .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.table-click-hint .alert .btn-close:hover {
    opacity: 1;
}

.mobile-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 10px;
    animation: fadeIn 0.3s ease-out;
}

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

.mobile-player-card {
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.mobile-player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: cardShimmer 3s infinite;
}

@keyframes cardShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.mobile-player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: #ffd700;
}

.mobile-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mobile-player-rank {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #000;
    font-weight: bold;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.mobile-player-name {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.mobile-player-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.mobile-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mobile-info-label {
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mobile-info-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.mobile-player-stack {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.mobile-table-badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mobile-table-badge:hover {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
}

@media (max-width: 768px) {
    .mobile-grid-view {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 5px;
    }
    
    .mobile-player-card {
        padding: 12px;
    }
    
    .mobile-player-rank {
        font-size: 16px;
        padding: 4px 8px;
    }
    
    .mobile-player-name {
        font-size: 14px;
    }
    
    .mobile-player-stack {
        font-size: 16px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .mobile-grid-view {
        grid-template-columns: 1fr;
        padding: 3px;
    }
    
    .mobile-player-card {
        padding: 10px;
    }
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0 4px;
    border-radius: 8px;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-icon:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-icon.btn-edit {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-icon.btn-edit:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-icon.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-icon.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.table {
    color: #e2e8f0;
}

.table-dark {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-bottom: 2px solid #fbbf24;
}

.table-dark th {
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    padding: 16px 12px;
}

.table-striped tbody tr {
    background: #1e293b;
    transition: all 0.3s ease;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #0f172a;
}

.table-striped tbody tr:hover {
    background: #334155;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.table-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #000 !important;
    font-weight: 700;
}

.table-warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.table td {
    border: none;
    padding: 14px 12px;
    vertical-align: middle;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.spinner-border {
    border-color: #22c55e;
    border-right-color: transparent;
    width: 3rem;
    height: 3rem;
    border-width: 4px;
}

.stat-trend {
    color: #10b981;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.stat-trend.negative {
    color: #ef4444;
}

.chart-card {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.chart-title {
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    position: relative;
    height: 200px;
    margin-bottom: 16px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.top-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.top-player-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.top-player-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(4px);
}

.top-player-rank {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.top-player-info {
    flex: 1;
    margin: 0 12px;
}

.top-player-name {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.top-player-table {
    color: #64748b;
    font-size: 0.75rem;
}

.top-player-stack {
    color: #10b981;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.table-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.table-stat-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.table-stat-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
}

.table-number {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.table-info {
    flex: 1;
    margin: 0 12px;
}

.table-players {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.table-avg {
    color: #64748b;
    font-size: 0.75rem;
}

.table-total {
    color: #3b82f6;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.perf-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.perf-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.perf-label {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.perf-value {
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.perf-value.stat-card-success {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 8px;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.perf-value.stat-card-danger {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.top-players-list::-webkit-scrollbar,
.table-stats::-webkit-scrollbar {
    width: 6px;
}

.top-players-list::-webkit-scrollbar-track,
.table-stats::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 3px;
}

.top-players-list::-webkit-scrollbar-thumb,
.table-stats::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
}

.top-players-list::-webkit-scrollbar-thumb:hover,
.table-stats::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

@media (max-width: 768px) {
    .btn-custom {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .btn-admin {
        padding: 6px 16px;
        font-size: 0.85rem;
    }
    
    .stat-trend {
        color: #10b981;
        font-size: 0.7rem;
        font-weight: 600;
        margin-top: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }
    
    .form-control {
        font-size: 16px;
    }
    
    .poker-tabs .nav-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    * {
        box-sizing: border-box;
    }
    
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .row {
        margin: 0 !important;
    }
    
    .col-12 {
        padding: 0 !important;
    }
    
    .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0;
    }
    
    .card-body {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .card-body form {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body .d-grid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body .table-responsive {
        margin-left: 2px;
        margin-right: 2px;
    }
    
    .card-body .nav-tabs {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .card-body .tab-content {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .results-table {
        font-size: 0.75rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 6px 2px;
    }
    
    .badge-table, .badge-place {
        padding: 2px 6px;
        font-size: 0.7rem;
        min-width: 30px;
    }
    
    .table-responsive:not(.admin-mode) {
        overflow-x: visible;
    }
    
    .table-responsive:not(.admin-mode) .results-table {
        min-width: auto;
        width: 100%;
    }
    
    .table-responsive:not(.admin-mode) .col-actions {
        display: none;
    }
    
    .table-responsive.admin-mode {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive.admin-mode .results-table {
        min-width: 280px;
        width: auto;
    }
    
    .table-responsive.admin-mode .col-actions {
        display: table-cell;
        width: 70px;
        min-width: 70px;
    }
    
    .col-pos {
        width: 40px;
        min-width: 40px;
    }
    
    .col-stack {
        width: 80px;
        min-width: 80px;
    }

    .admin-mode .btn-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        margin: 0 1px;
    }

    .truncate {
        max-width: 60px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 12px;
        align-items: stretch !important;
    }
    
    .input-group.input-group-sm {
        max-width: 100% !important;
        width: 100%;
    }
    
    .input-group-text {
        background: #1e293b;
        border: 2px solid #334155;
        color: #cbd5e1;
        border-right: none;
    }

    #noResults {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border: 2px solid #334155;
        border-radius: 12px;
        padding: 30px 20px;
        margin: 20px 0;
        text-align: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    #noResults p {
        color: #cbd5e1;
        font-size: 1.1rem;
        margin: 0;
        font-weight: 500;
    }
    
    #noResults p::before {
        content: '🔍 ';
        font-size: 1.5rem;
        margin-right: 8px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .input-group.input-group-sm {
        max-width: 200px !important;
        flex: 1;
        min-width: 180px;
    }
    
    #noResults {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border: 2px solid #334155;
        border-radius: 12px;
        padding: 25px 20px;
        margin: 20px 0;
        text-align: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    #noResults p {
        color: #cbd5e1;
        font-size: 1rem;
        margin: 0;
        font-weight: 500;
    }
    
    #noResults p::before {
        content: '🔍 ';
        font-size: 1.3rem;
        margin-right: 8px;
    }
}

@media (min-width: 769px) {
    #noResults {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border: 2px solid #334155;
        border-radius: 12px;
        padding: 20px;
        margin: 20px 0;
        text-align: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    #noResults p {
        color: #cbd5e1;
        font-size: 1rem;
        margin: 0;
        font-weight: 500;
    }
    
    #noResults p::before {
        content: '🔍 ';
        font-size: 1.2rem;
        margin-right: 8px;
    }
}

.card-header:first-child {
    border-radius: 0 !important;
}