/* Ranked Matchmaking Styles */

/* Header Navigation Buttons */
.practice-header.has-nav {
    display: flex;
    align-items: center;
    text-align: center;
}

.practice-header.has-nav .practice-header-text {
    flex: 1;
    min-width: 0;
}

.practice-header .nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    border: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.practice-header .nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-color);
}

.practice-header .nav-btn.nav-btn-toggle {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    border-color: rgba(99, 102, 241, 0.4);
}

.practice-header .nav-btn.nav-btn-toggle:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.25));
    border-color: rgba(99, 102, 241, 0.6);
}

/* Mode Selection Modal */
.ranked-modal-content {
    max-width: 900px;
    width: 95%;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
}

.ranked-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.ranked-mode-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ranked-mode-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mode-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.mode-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    flex: 1;
}

.mode-bo-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.mode-rating {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.mode-rating.placement {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

/* Rank Badge Styles - Cool gradient banners */
.mode-rank {
    position: relative;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    display: inline-block;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rank-text {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rank-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 3s infinite;
    z-index: 1;
}

@keyframes shine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

/* Bronze Rank */
.rank-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B5A2B 100%);
    color: #FFF5E6;
    border: 2px solid #CD7F32;
}

/* Silver Rank */
.rank-silver {
    background: linear-gradient(135deg, #E8E8E8 0%, #A0A0A0 100%);
    color: #2C2C2C;
    border: 2px solid #C0C0C0;
}

/* Gold Rank */
.rank-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #2C2C2C;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* Platinum Rank */
.rank-platinum {
    background: linear-gradient(135deg, #E5E4E2 0%, #9CA3AF 100%);
    color: #1F2937;
    border: 2px solid #E5E4E2;
    box-shadow: 0 4px 15px rgba(229, 228, 226, 0.3);
}

/* Diamond Rank */
.rank-diamond {
    background: linear-gradient(135deg, #B9F2FF 0%, #4FC3F7 100%);
    color: #0D47A1;
    border: 2px solid #4FC3F7;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.5);
}

/* Master Rank */
.rank-master {
    background: linear-gradient(135deg, #D946EF 0%, #7C3AED 100%);
    color: #FFFFFF;
    border: 2px solid #9D4EDD;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.5);
}

/* Grandmaster Rank - Most prestigious! */
.rank-grandmaster {
    background: linear-gradient(135deg, #FF6B6B 0%, #C92A2A 100%);
    color: #FFFFFF;
    border: 2px solid #FF6B6B;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6);
    animation: grandmaster-glow 2s ease-in-out infinite;
}

@keyframes grandmaster-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.5), 0 0 15px rgba(255, 107, 107, 0.2);
    }
}

.ranked-mode-card button {
    width: 100%;
    margin-top: 0.5rem;
}

.ranked-mode-card button:hover {
    transform: none;
}

/* Queue Overlay */
.queue-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.queue-container {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.queue-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.your-rating {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.queue-spinner {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.queue-status h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.queue-timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.queue-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.queue-cancel-btn {
    margin-top: 1rem;
    min-width: 150px;
}

/* Match Found Overlay */
.match-found-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgb(99, 102, 241) 0%, rgb(139, 92, 246) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: matchFoundPulse 0.5s ease;
}

@keyframes matchFoundPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.match-found-container {
    text-align: center;
    color: white;
    padding: 2rem;
}

.match-found-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 3rem;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    animation: titleBounce 0.6s ease;
}

@keyframes titleBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.match-players {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.player-info {
    background: rgba(30, 20, 60, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 0.8rem 1.5rem;
    width: 200px;
    height: 180px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: slideIn 0.5s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.player-you {
    animation-delay: 0.1s;
}

.player-opponent {
    animation-delay: 0.3s;
}

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

.player-avatar-wrap,
.ranked-loading-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.avatar-level-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.player-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #6366f1) 0%, #1a6fbf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 2rem;
    flex-shrink: 0;
}

.player-avatar-wrap .player-avatar {
    margin-bottom: 0;
}

.player-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.player-rating {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 600;
}

.vs-divider {
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: vsRotate 0.5s ease 0.5s;
}

@keyframes vsRotate {
    0% {
        transform: rotate(-90deg) scale(0);
    }
    50% {
        transform: rotate(10deg) scale(1.2);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

.match-countdown {
    font-size: 1.2rem;
    font-weight: 600;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 2v2 Match Found Layout */
.match-teams-2v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.team-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.team-label {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.team-yours .team-label {
    color: #60a5fa;
}

.team-opponent .team-label {
    color: #f87171;
}

.team-players {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-players .player-info {
    width: 200px;
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    box-sizing: border-box;
    padding: 0.7rem 1rem;
    overflow: hidden;
    flex: 0 0 150px;
}

.team-players .player-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.team-players .player-name {
    font-size: 1.1rem;
}

.team-players .player-rating {
    font-size: 0.95rem;
}

/* 2v2 Results */
.results-2v2 {
    text-align: center;
}

.results-2v2 h3 {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.results-2v2-teams {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin: 0.4rem 0;
}

.results-2v2-team {
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    min-width: 0;
    flex: 1;
    border: 2px solid var(--border-color, #333);
}

.results-2v2-team.winner {
    border-color: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

.results-2v2-team.loser {
    opacity: 0.7;
}

.results-2v2-team-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
}

.results-2v2-team-score {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 0.3rem;
}

.results-2v2-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color, #333);
}

.results-2v2-player:first-of-type {
    border-top: none;
}

.results-2v2-elo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.match-info {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease 0.7s both;
}

.match-mode {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.match-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
}

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

/* Ranked Results Screen */
.ranked-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding: 1rem 0;
}

.ranked-results-overlay::-webkit-scrollbar {
    display: none;
}

.ranked-results-container {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    max-width: 420px;
    width: 85%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.5s ease;
    margin: auto;
}

.match-result {
    text-align: center;
    padding: 0.5rem 0;
    margin-bottom: 0.6rem;
    border-radius: 10px;
}

.match-result h1 {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 0;
}

.match-result.victory {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.1) 100%);
    border: 2px solid #22c55e;
    color: #22c55e;
}

.match-result.defeat {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 2px solid #ef4444;
    color: #ef4444;
}

.match-result.draw {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.2) 0%, rgba(107, 114, 128, 0.1) 100%);
    border: 2px solid #9ca3af;
    color: #9ca3af;
}

.match-details {
    text-align: center;
    margin-bottom: 0.6rem;
}

.match-details h3 {
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.player-comparison {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0.4rem 0;
}

.player-result {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    text-align: center;
    box-sizing: border-box;
}

.player-result.you {
    border-color: var(--primary-color);
}

.player-result .player-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.player-result .player-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.player-result .player-accuracy {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.vs {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.elo-changes {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.6rem;
    text-align: center;
}

.elo-change {
    margin-bottom: 0.2rem;
}

.elo-change .change-value {
    font-size: 1.3rem;
    font-weight: 900;
    display: block;
    margin-bottom: 0;
}

.elo-change.positive .change-value {
    color: #22c55e;
}

.elo-change.negative .change-value {
    color: #ef4444;
}

.elo-change .change-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.elo-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.elo-rating .old-rating {
    color: var(--text-secondary);
}

.elo-rating .arrow {
    color: var(--primary-color);
}

.elo-rating .new-rating {
    color: var(--primary-color);
    font-size: 1.05rem;
}

.rank-info {
    text-align: center;
    margin-bottom: 0.6rem;
}

.placement-progress {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
}

.placement-progress h4 {
    color: #f59e0b;
    margin-bottom: 0.1rem;
    font-size: 0.8rem;
}

.placement-count {
    font-size: 1rem;
    font-weight: 700;
    color: #f59e0b;
    margin: 0.1rem 0;
}

.placement-progress p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin: 0;
}

.current-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.rank-badge {
    font-size: 1.2rem;
    font-weight: 900;
    padding: 0.4rem 1.2rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
    border-color: #cd7f32;
    color: white;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #999999 100%);
    border-color: #c0c0c0;
    color: #1a1a1a;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    border-color: #ffd700;
    color: #1a1a1a;
}

.rank-badge.platinum {
    background: linear-gradient(135deg, #e5e4e2 0%, #b9f2ff 100%);
    border-color: #e5e4e2;
    color: #1a1a1a;
}

.rank-badge.diamond {
    background: linear-gradient(135deg, #b9f2ff 0%, #00bfff 100%);
    border-color: #00bfff;
    color: #1a1a1a;
}

.rank-elo {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.4rem;
}

.results-actions .btn {
    min-width: 0;
    flex: 1;
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
}

.results-report-link {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.btn-report-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s;
}

.btn-report-text:hover {
    color: #dc3545;
}

/* BO3 Series Results */
.bo3-series-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin: 0.4rem auto;
}

.bo3-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.bo3-player .player-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.bo3-wins {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.bo3-separator {
    width: 2px;
    height: 30px;
    background: var(--border-color);
    border-radius: 1px;
}

.bo3-games-breakdown {
    margin-top: 0.3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.3rem;
}

.bo3-game-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

.bo3-game-row.won {
    background: rgba(34, 197, 94, 0.1);
}

.bo3-game-row.lost {
    background: rgba(239, 68, 68, 0.1);
}

.bo3-game-row.draw {
    background: rgba(234, 179, 8, 0.1);
}

.bo3-game-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 55px;
}

.bo3-game-mode {
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}

.bo3-game-score {
    color: var(--text-primary);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.bo3-game-result {
    font-weight: 700;
    min-width: 35px;
    text-align: center;
}

.bo3-game-row.won .bo3-game-result {
    color: #22c55e;
}

.bo3-game-row.lost .bo3-game-result {
    color: #ef4444;
}

.bo3-game-row.draw .bo3-game-result {
    color: #eab308;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .practice-header .nav-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 5px;
    }

    .practice-header.has-nav {
        flex-direction: row;
        gap: 0.5rem;
    }

    .ranked-modes-grid {
        grid-template-columns: 1fr;
    }

    .match-found-title {
        font-size: 2.5rem;
    }

    .match-players {
        flex-direction: column;
        gap: 1.5rem;
    }

    .vs-divider {
        margin: 0;
    }

    .queue-container {
        padding: 2rem 1rem;
    }

    .queue-header h2 {
        font-size: 1.5rem;
    }

    .queue-timer {
        font-size: 2rem;
    }

    .spinner {
        width: 60px;
        height: 60px;
    }

    .ranked-results-container {
        padding: 1rem;
        width: 90%;
    }

    .match-result h1 {
        font-size: 1.5rem;
    }

    .player-comparison {
        flex-direction: column;
        gap: 0.75rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
    }

    /* 2v2 Match Found */
    .match-teams-2v2 {
        flex-direction: column;
        gap: 0.75rem;
    }

    .team-players {
        flex-direction: row !important;
        gap: 0.5rem !important;
    }

    .team-players .player-info {
        width: 140px !important;
        height: 105px !important;
        min-height: 105px !important;
        max-height: 105px !important;
        flex: 0 0 105px !important;
        padding: 0.5rem 0.5rem;
    }

    .team-players .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }

    .team-players .player-name {
        font-size: 0.8rem;
        margin-bottom: 0.05rem;
    }

    .team-players .player-rating {
        font-size: 0.65rem;
    }

    .match-found-container {
        padding: 1rem;
    }

    .player-info {
        width: 140px;
        height: 155px;
        box-sizing: border-box;
        padding: 1rem;
        overflow: hidden;
    }

    .player-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    /* 2v2 Results */
    .results-2v2-teams {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Loading screen */
    .ranked-loading-players {
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-bottom: 1rem !important;
    }

    .ranked-loading-team {
        flex-direction: row !important;
        gap: 1.5rem !important;
    }

    .ranked-loading-player {
        height: 100px !important;
    }

    .ranked-loading-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }

    .ranked-loading-name {
        font-size: 0.9rem;
    }

    .ranked-loading-game h2 {
        font-size: 1.5rem;
    }

    .ranked-loading-vs {
        margin: 0;
    }

    /* BO3 */
    .bo3-game-start-content {
        padding: 1.5rem;
    }

    .mode-icon-large {
        font-size: 3.5rem;
    }

    .modal-content {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .ban-phase-content {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .match-found-title {
        font-size: 1.8rem;
    }

    .player-info {
        width: 130px;
        height: 145px;
        box-sizing: border-box;
        padding: 0.8rem;
        overflow: hidden;
    }

    .player-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 0.4rem;
    }

    .player-name {
        font-size: 0.9rem;
    }

    .match-players {
        gap: 1.5rem;
    }

    .team-players .player-info {
        width: 120px !important;
        height: 100px !important;
        min-height: 100px !important;
        max-height: 100px !important;
        flex: 0 0 100px !important;
        padding: 0.5rem;
    }

    .team-players .player-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .team-players .player-name {
        font-size: 0.75rem;
    }

    .team-players .player-rating {
        font-size: 0.6rem;
    }

    .player-rating {
        font-size: 0.75rem;
    }

    .ranked-results-container {
        width: 95%;
        padding: 0.75rem;
    }

    .match-result h1 {
        font-size: 1.3rem;
    }

    .elo-change .change-value {
        font-size: 1.1rem;
    }

}

/* Modal Overlay Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2rem;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* BO3 Ban Phase Styles */
.ban-phase-content {
    max-width: 500px;
    text-align: center;
    padding: 1.25rem;
}

.ban-phase-content h2 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.ban-timer {
    font-size: 1rem;
    color: var(--primary-color);
    margin: 0.4rem 0;
}

.opponent-info {
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.ban-instruction {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.ban-modes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.ban-mode-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ban-mode-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ban-mode-card.selected {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
}

.ban-mode-card .mode-icon {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.ban-mode-card .mode-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.ban-skip-btn {
    margin-top: 0.5rem;
}

.ban-status {
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* BO3 Game Start Styles */
.bo3-game-start-content {
    max-width: 500px;
    text-align: center;
    padding: 3rem;
}

.series-score {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.game-mode-display {
    margin: 2rem 0;
}

.mode-icon-large {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.game-mode-display h3 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.banned-modes {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.game-start-countdown {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--text-color);
}

#game-countdown {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Ranked Loading Screen */
.ranked-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary, #0f1724);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    pointer-events: all;
}

.ranked-loading-container {
    text-align: center;
    color: var(--text-color, #fff);
    padding: 2rem;
}

.ranked-loading-game {
    margin-bottom: 2.5rem;
}

.ranked-loading-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.ranked-loading-game h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color, #fff);
}

.ranked-loading-players {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.ranked-loading-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
}

.ranked-loading-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    height: 130px;
    justify-content: flex-start;
}

.ranked-loading-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #6366f1) 0%, #1a6fbf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.ranked-loading-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.ranked-loading-name.you-name {
    color: #fff;
}

.ranked-loading-name.opponent-name {
    color: #fff;
}

.ranked-loading-vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-secondary, #888);
    opacity: 0.8;
}

/* Match found overlay - player name colors */
.player-info.player-you .player-name,
.player-info.player-opponent .player-name {
    color: #fff;
}

.ranked-loading-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.ranked-loading-status p {
    font-size: 1.1rem;
    color: var(--text-secondary, #888);
}

.ranked-loading-status .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Portrait orientation optimizations */
@media (orientation: portrait) {
    .practice-header.has-nav {
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: center;
    }

    .practice-header.has-nav .practice-header-text {
        order: 1;
        width: 100%;
        flex: none;
    }

    .practice-header .nav-btn-left {
        order: 2;
    }

    .practice-header .nav-btn-right {
        order: 2;
    }

    .practice-header .nav-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .match-found-title {
        font-size: 2rem;
    }

    .player-info {
        min-width: 130px;
        padding: 1rem;
    }

    .vs-divider {
        margin: 0;
        font-size: 2rem;
    }

    .ranked-results-container {
        width: 95%;
        padding: 1rem;
    }

    .match-result h1 {
        font-size: 1.5rem;
    }

    .player-comparison {
        gap: 0.5rem;
    }

    .ban-phase-content {
        max-width: 95vw;
    }
}
