:root {
    /* Colors - Vibrant & Energetic */
    --primary-bg: #0f0a2e;
    --secondary-bg: #1a0f3d;
    --accent-color: #00ffff;
    --text-color: #ffffff;
    --board-color: #2d1b5e;
    --line-color: #a892ee;
    --glass-bg: rgba(31, 15, 62, 0.8);
    --glass-border: rgba(255, 255, 255, 0.15);
    
    /* Spacing */
    --gap-small: 0.5rem;
    --gap-medium: 1rem;
    --gap-large: 1.5rem;
    --padding-small: 0.5rem;
    --padding-medium: 1rem;
    --padding-large: 1.5rem;
    
    /* Font Sizes */
    --font-size-avatar: 2.5rem;
    --font-size-stat-icon: 2rem;
    --font-size-player-name: 1rem;
    --font-size-stat-label: 0.7rem;
    --font-size-stat-value: 1.1rem;
    
    /* Component Sizes */
    --player-card-height: 60px;
    --status-dot-size: 12px;
    --turn-badge-size: 36px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* ========= ANIMATED BACKGROUND ========= */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 20% 30%, 
        rgba(0, 255, 255, 0.25) 0%, 
        transparent 50%
    ),
    radial-gradient(
        circle at 80% 70%, 
        rgba(255, 0, 255, 0.25) 0%, 
        transparent 50%
    ),
    linear-gradient(
        135deg,
        var(--primary-bg) 0%,
        var(--secondary-bg) 100%
    );
    z-index: -2;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* ========= START SCREEN ========= */
.screen {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-content {
    padding: 2rem;
    width: 100%;
}

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

/* Start Screen Navigation */
.start-screen-nav {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10;
}

.btn-icon-only {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.btn-icon-only svg {
    width: 24px;
    height: 24px;
}

/* ========= GAME HEADER ========= */
.game-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.logo-circle {
    width: 140px;
    height: 140px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    padding: 1.5rem;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-svg {
    width: 100%;
    height: 100%;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00ffff, #ff00ff, #ffea00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.2em;
    text-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
    margin: 0;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.game-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Stats Overview */
.stats-overview {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    max-width: 400px;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.stat-icon i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.3));
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-value-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
}

.win-text {
    background: linear-gradient(135deg, #22c55e, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lose-text {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.divider {
    color: #64748b;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-hint i {
    color: #94a3b8;
}

/* Game Mode Section */
.game-mode-section {
    margin-top: 3rem;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #cbd5e1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.mode-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.mode-card:hover::before {
    left: 100%;
}

.mode-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #3b82f6;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.mode-card.mode-highlight {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(59, 130, 246, 0.05));
}

.mode-card.mode-highlight:hover {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.mode-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: inline-block;
    width: fit-content;
}

.ai-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.player-badge {
    background: linear-gradient(135deg, #22c55e, #10b981);
    color: #fff;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.mode-icon {
    font-size: 4rem;
    text-align: center;
    margin: 1rem 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.mode-icon i {
    font-size: 4rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.mode-desc {
    text-align: center;
    color: #cbd5e1;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.mode-features {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #94a3b8;
}

.feature-tag i {
    margin-right: 0.25rem;
    color: #94a3b8;
}

.mode-status {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    color: #fbbf24;
    margin-top: auto;
}

.mode-status.online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* How to Play Section */
.how-to-play-section {
    margin-top: 4rem;
    margin-bottom: 3rem;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.rule-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.rule-card:hover {
    transform: translateY(-5px);
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.rule-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.rule-icon i {
    font-size: 3rem;
    background: linear-gradient(135deg, #ef4444, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.4));
}

.rule-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.rule-text {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* ========= LOBBY SCREEN ========= */
.lobby-content {
    padding: 2rem;
}

.lobby-header-section {
    margin-bottom: 3rem;
}

.btn-back {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    transform: translateX(-3px);
}

.btn-back svg {
    width: 20px;
    height: 20px;
}

.lobby-title-section {
    text-align: center;
}

.lobby-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00ffff, #ff00ff, #ffea00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.1em;
    margin: 0 0 0.5rem 0;
    animation: titleGlow 3s ease-in-out infinite;
}

.lobby-subtitle {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
}

/* Lobby Summary Stats */
.lobby-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.lobby-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.lobby-stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.lobby-stat-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.lobby-stat-icon i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.lobby-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lobby-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.lobby-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Room List Section */
.room-list-section {
    margin-top: 2rem;
}

.room-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Room Cards */
.room-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.room-card:hover::before {
    left: 100%;
}

.room-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.room-card.active {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(59, 130, 246, 0.05));
}

.room-card.active:hover {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

/* Room Header */
.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.room-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    letter-spacing: 0.05em;
}

.room-status {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.room-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

/* Room Meta */
.room-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.room-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.room-type-badge.public {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.room-type-badge.private {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Room Players */
.room-players {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.player-info:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

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

.player-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.player-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* VS Badge */
.vs-badge {
    align-self: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    margin: -12px 0; /* Negative margin to overlap */
    z-index: 10;
    backdrop-filter: blur(4px);
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.8);
}

/* ========= MODAL ========= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content-wrapper {
    position: relative;
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1rem;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.modal-content-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.premium-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal:not(.hidden) .premium-modal {
    transform: scale(1);
}

/* Modal Header */
.modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(34, 197, 94, 0.1));
}

.modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ef4444, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.05em;
    margin: 0;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ef4444;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-label i {
    color: var(--accent-color);
}

.form-input {
    width: 100%;
    padding: 0.875rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.form-input::placeholder {
    color: #64748b;
}

.form-help {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Role Selection */
.role-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.role-option {
    cursor: pointer;
    position: relative;
}

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(34, 197, 94, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.role-option input:checked + .role-card::before {
    opacity: 1;
}

.role-option input:checked + .role-card {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.role-icon {
    font-size: 2.5rem;
    transition: all 0.3s ease;
    z-index: 1;
}

.role-name {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 1;
}

/* Modal Footer */
.modal-footer {
    padding: 1.5rem;
    display: flex;
    justify-content: flex-end;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-modal-primary {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 2rem;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-modal-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
}

.btn-modal-primary:active {
    transform: translateY(0) scale(0.98);
}

/* Standard Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.primary-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Game Over Modal */
#game-over-modal .modal-content {
    max-width: 500px;
    text-align: center;
    padding: 2rem;
}

#game-over-modal h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ef4444, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

#game-over-modal p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: var(--secondary-bg);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid;
}

.notification.error { border-left-color: #ef4444; }
.notification.success { border-left-color: #22c55e; }
.notification.info { border-left-color: #3b82f6; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100%); }
}

/* ========= SHARED GAME STYLES ========= */

/* Game Screen */
#game-screen {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Game Container */
.game-container {
    width: 100%;
    max-width: var(--container-max-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0rem;
}

/* Header */
.header {
    width: 100%;
    max-width: var(--container-max-width);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem; /* Space for absolute VS badge */
    margin-bottom: var(--gap-medium);
    position: relative;
    padding: 0;
}

/* Player Cards */
.player-card {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: var(--padding-small) 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    min-width: 0;
    position: relative;
    overflow: hidden;
    height: var(--player-card-height);
}

.player-card.active-turn {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(30, 41, 59, 0.8));
}

.player-card.winner {
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.player-avatar {
    font-size: var(--font-size-avatar);
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.player-info-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    flex: 1;
    gap: 0.25rem;
}

.player-name {
    font-size: var(--font-size-player-name);
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-status-text {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    transition: color 0.3s;
}

.active-turn .player-status-text {
    color: var(--accent-color);
    font-weight: 700;
}

/* Status Dot (Absolute) */
.status-dot {
    width: var(--status-dot-size);
    height: var(--status-dot-size);
    border-radius: 50%;
    position: absolute;
    top: 8px;
    right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 8px currentColor;
    z-index: 5;
}

.status-dot.online { 
    background-color: #22c55e; 
    color: rgba(34, 197, 94, 0.6);
    animation: pulse-status 2s infinite;
}
.status-dot.away { background-color: #f97316; color: rgba(249, 115, 22, 0.6); }
.status-dot.offline { background-color: #94a3b8; color: rgba(148, 163, 184, 0.6); }

@keyframes pulse-status {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Turn Display (VS Badge) - Absolutely Positioned */
#turn-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    pointer-events: none; /* Allow clicks to pass through */
}

.turn-badge {
    width: var(--turn-badge-size);
    height: var(--turn-badge-size);
    border-radius: 50%;
    background: var(--secondary-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Mobile Responsive - How to Play */
@media (max-width: 480px) {
    .rules-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        max-width: 100%;
    }
    
    .rule-card {
        min-width: 0;
    }
}

/* Tablet Responsive - How to Play */
@media (min-width: 481px) and (max-width: 1024px) {
    .rules-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem;
        max-width: 100%;
    }
}
