/*
 * Tap Power Pro - Professional Game Styles
 * Mobile-first, RTL Persian, Ultra-modern UI
 */

:root {
    /* Core Colors */
    --bg-primary: #0a0a12;
    --bg-secondary: #12121f;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.03);
    
    /* Accent Colors */
    --accent-blue: #00d4ff;
    --accent-red: #ff4757;
    --accent-green: #51cf66;
    --accent-yellow: #ffd43b;
    --accent-purple: #a855f7;
    --accent-orange: #fb923c;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-success: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    --gradient-warning: linear-gradient(135deg, #ffd43b 0%, #f59f00 100%);
    --gradient-danger: linear-gradient(135deg, #ff4757 0%, #dc2626 100%);
    --gradient-bg: linear-gradient(180deg, #0a0a12 0%, #12121f 50%, #0a0a12 100%);
    
    /* Shadows */
    --shadow-glow-blue: 0 0 30px rgba(0, 212, 255, 0.4);
    --shadow-glow-green: 0 0 30px rgba(81, 207, 102, 0.4);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50%;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
}

body {
    background: var(--gradient-bg);
    color: white;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* ==================== MAIN MENU ==================== */
#main-menu {
    justify-content: center;
    align-items: center;
    padding: var(--space-lg);
    background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
}

.logo-container {
    text-align: center;
    margin-bottom: var(--space-xl);
    position: relative;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.game-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
}

.title-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.title-icon {
    animation: lightning 1.5s ease-in-out infinite;
}

@keyframes lightning {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.3; }
}

.game-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: var(--space-sm);
}

.version-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.4);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 280px;
    position: relative;
    z-index: 1;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-btn.primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow-blue);
}

.menu-btn.primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.5);
}

.menu-btn.primary.pulse {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.7); }
}

.menu-btn.secondary {
    background: var(--bg-card);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.menu-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    font-size: 1.2rem;
}

.footer-info {
    margin-top: var(--space-xl);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

/* Eitaa Close Button */
.menu-btn.eitaa-close {
    background: rgba(255, 71, 87, 0.2);
    border: 2px solid rgba(255, 71, 87, 0.3);
    color: var(--accent-red);
    margin-top: var(--space-md);
    font-size: 0.9rem;
    max-width: 200px;
}

.menu-btn.eitaa-close:hover {
    background: rgba(255, 71, 87, 0.3);
    border-color: rgba(255, 71, 87, 0.5);
}

/* ==================== SETUP SCREEN ==================== */
.screen-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.screen-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.setup-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.mode-selection h3,
.ai-settings h3 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: var(--space-sm);
}

.mode-buttons {
    display: flex;
    gap: var(--space-sm);
}

.mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

.mode-icon {
    font-size: 1.8rem;
}

.mode-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.mode-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Player Cards */
.player-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.player-badge {
    background: var(--accent-blue);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 900;
}

.player-badge.p2 {
    background: var(--accent-red);
}

.player-position {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.player-card label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-xs);
}

.player-card input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    text-align: center;
    margin-bottom: var(--space-sm);
    transition: all 0.2s ease;
}

.player-card input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.color-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.color-section label {
    margin-bottom: 0;
}

.color-picker {
    display: flex;
    gap: var(--space-xs);
}

.color-btn {
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn[data-color="#00d4ff"] { background: var(--accent-blue); }
.color-btn[data-color="#ff6b6b"] { background: var(--accent-red); }
.color-btn[data-color="#51cf66"] { background: var(--accent-green); }
.color-btn[data-color="#ffd43b"] { background: var(--accent-yellow); }

.color-btn.active {
    border-color: white;
    box-shadow: 0 0 15px currentColor;
    transform: scale(1.1);
}

/* AI Settings */
.difficulty-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.difficulty-icon {
    font-size: 1.5rem;
}

.difficulty-info {
    display: flex;
    flex-direction: column;
}

.difficulty-name {
    font-weight: 700;
    color: var(--accent-yellow);
}

.difficulty-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.difficulty-slider-container input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    outline: none;
    -webkit-appearance: none;
}

.difficulty-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.difficulty-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Game Settings (Round Time & Total Rounds) */
.game-settings {
    margin-bottom: var(--space-sm);
}

.game-settings h3 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.setting-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.setting-icon {
    font-size: 1.5rem;
}

.setting-info {
    display: flex;
    flex-direction: column;
}

.setting-value {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 1rem;
}

.setting-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.setting-slider-container input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    outline: none;
    -webkit-appearance: none;
}

.setting-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.start-game-btn {
    width: 100%;
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-lg);
    background: var(--gradient-success);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: auto;
}

.start-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-green);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.start-game-btn:hover .btn-glow {
    opacity: 1;
}

.btn-content {
    position: relative;
    z-index: 1;
}

/* ==================== GAME SCREEN PRO ==================== */
.timer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.timer-bar {
    height: 100%;
    background: var(--gradient-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    transition: width 1s linear;
}

.game-header.pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-section {
    display: flex;
    align-items: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255, 71, 87, 0.2);
    color: var(--accent-red);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 71, 87, 0.3);
    transform: scale(1.05);
}

.round-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
}

.round-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.round-value {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--accent-blue);
}

.combo-badge-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 212, 59, 0.1);
    border: 1px solid rgba(255, 212, 59, 0.3);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
}

.combo-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
}

.combo-value {
    font-size: 1rem;
    font-weight: 900;
    color: var(--accent-yellow);
}

/* Target Section */
.target-section {
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
}

.target-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
}

.target-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.target-indicator-container {
    position: relative;
    width: 48px;
    height: 48px;
}

.target-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: targetPulse 1.5s ease-in-out infinite;
}

@keyframes targetPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

.target-indicator {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px currentColor;
    transition: all 0.3s ease;
}

/* Game Area Pro */
.game-area.pro {
    flex: 1;
    display: flex;
    padding: var(--space-sm);
    gap: var(--space-sm);
}

.player-zone.pro {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.player-info.pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
}

.player-name-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.player-lives {
    display: flex;
    gap: 2px;
}

.life {
    color: var(--accent-red);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.life.lost {
    color: rgba(255, 255, 255, 0.2);
}

.player-score-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.score-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
}

.player-score {
    font-size: 1.4rem;
    font-weight: 900;
    transition: all 0.2s ease;
}

/* Tap Zone Pro */
.tap-zone.pro {
    flex: 1;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    padding: var(--space-sm);
}

.tap-zone.pro.correct {
    animation: zoneCorrect 0.4s ease;
    border-color: var(--accent-green);
}

.tap-zone.pro.wrong {
    animation: zoneWrong 0.4s ease;
    border-color: var(--accent-red);
    background: rgba(255, 71, 87, 0.1);
}

@keyframes zoneCorrect {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

@keyframes zoneWrong {
    0%, 25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}

.grid-container {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--space-sm);
}

.color-slot {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    /* Ensure minimum touch target size for mobile */
    min-height: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.color-slot:active {
    transform: scale(0.95);
}

.spawned-color {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.1s ease;
    /* Ensure it fills the slot for better touch area */
    display: block;
    pointer-events: none; /* Let the slot handle the click/touch */
}

.spawned-color:active {
    transform: scale(0.95);
}

.zone-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0.3;
}

.zone-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* VS Divider */
.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--accent-yellow);
}

/* Ready Overlay */
.ready-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 18, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.ready-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.ready-content {
    text-align: center;
    padding: var(--space-lg);
}

.ready-badge {
    margin-bottom: var(--space-lg);
}

.ready-round {
    display: inline-block;
    background: var(--gradient-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--bg-primary);
}

.ready-target-section {
    margin-bottom: var(--space-lg);
}

.ready-label {
    display: block;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: var(--space-md);
}

.ready-target-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.ready-target-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: readyPulse 1.5s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; box-shadow: 0 0 30px currentColor; }
    50% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.ready-target-color {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 30px currentColor;
}

.ready-hint {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-lg);
}

.ready-btn {
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    background: var(--gradient-success);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    animation: readyPulseBtn 2s ease-in-out infinite;
}

@keyframes readyPulseBtn {
    0%, 100% { box-shadow: 0 0 20px rgba(81, 207, 102, 0.4); }
    50% { box-shadow: 0 0 40px rgba(81, 207, 102, 0.7); }
}

/* ==================== GAME OVER PRO ==================== */
.result-container.pro {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.result-header {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.result-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--space-sm);
}

.result-header h2 {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
}

.winner-display {
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 212, 59, 0.1), rgba(255, 107, 107, 0.1));
    border: 1px solid rgba(255, 212, 59, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.winner-crown {
    font-size: 2.5rem;
    margin-bottom: var(--space-xs);
}

.winner-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-xs);
}

.winner-name {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient-warning);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.final-scores.pro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.score-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.score-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.score-player-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.player-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.score-value {
    font-size: 2rem;
    font-weight: 900;
    display: block;
}

.score-card.p1 .score-value {
    color: var(--accent-blue);
}

.score-card.p2 .score-value {
    color: var(--accent-red);
}

.vs-small {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: var(--space-xs);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent-yellow);
}

.result-buttons.pro {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: auto;
}

.result-btn {
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-btn.primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.result-btn.secondary {
    background: var(--bg-card);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ==================== HELP SCREEN PRO ==================== */
.help-content.pro {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.help-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.help-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.help-card h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--accent-blue);
}

.help-card p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
}

.help-card ul {
    list-style: none;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.help-card ul li {
    padding: var(--space-xs) 0;
    padding-right: var(--space-md);
    position: relative;
}

.help-card ul li::before {
    content: '›';
    position: absolute;
    right: 0;
    color: var(--accent-blue);
    font-weight: 700;
}

.help-card strong {
    color: var(--accent-yellow);
}

.combo-showcase {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.combo-item {
    background: var(--gradient-warning);
    color: var(--bg-primary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.difficulty-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.diff-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.diff-level {
    font-weight: 700;
    color: var(--accent-blue);
}

.diff-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== UTILITY ==================== */
.hidden {
    display: none !important;
}

/* Combo Badge Animation */
.combo-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gradient-warning);
    color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 900;
    animation: comboPop 0.5s ease;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(255, 212, 59, 0.5);
}

/* Score Popup */
.score-popup {
    position: absolute;
    font-size: 1.8rem;
    font-weight: 900;
    animation: scoreFloat 1s ease-out forwards;
    pointer-events: none;
    z-index: 10;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.score-popup.positive {
    color: var(--accent-green);
}

.score-popup.negative {
    color: var(--accent-red);
}

/* Responsive */
@media (max-width: 360px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .player-name {
        font-size: 0.75rem;
    }
    
    .player-score {
        font-size: 1.1rem;
    }
    
    .color-slot {
        min-height: 50px;
    }
}

/* Mobile Touch Optimizations */
@media (pointer: coarse) {
    /* Larger touch targets for touch devices */
    .color-slot {
        min-height: 70px;
        min-width: 70px;
    }
    
    .menu-btn, .result-btn, .start-game-btn {
        min-height: 56px;
    }
    
    .mode-btn {
        min-height: 80px;
    }
    
    .back-btn, .icon-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Disable text selection on game elements */
    .color-slot, .tap-zone, .menu-btn, .result-btn {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Prevent callout menu on iOS */
    .color-slot, .spawned-color {
        -webkit-touch-callout: none;
    }
    
    /* Prevent text selection */
    #app {
        -webkit-user-select: none;
    }
}

/* Animation for particles */
@keyframes particleBurst {
    0% { 
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance));
        opacity: 0;
    }
}

@keyframes comboPop {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes scoreFloat {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(1.5); opacity: 0; }
}

/* Shake animation for wrong taps - stronger effect */
@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-8px) rotate(-3deg); }
    20% { transform: translateX(8px) rotate(3deg); }
    30% { transform: translateX(-8px) rotate(-3deg); }
    40% { transform: translateX(8px) rotate(3deg); }
    50% { transform: translateX(-6px) rotate(-2deg); }
    60% { transform: translateX(6px) rotate(2deg); }
    70% { transform: translateX(-4px) rotate(-1deg); }
    80% { transform: translateX(4px) rotate(1deg); }
    90% { transform: translateX(-2px) rotate(0deg); }
}

.color-slot.shake {
    animation: shake 0.5s ease-in-out;
    border-color: #ff4757 !important;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.6) !important;
}

/* Success feedback for correct taps */
.color-slot.correct {
    animation: slotSuccess 0.4s ease;
    border-color: #51cf66 !important;
    box-shadow: 0 0 25px rgba(81, 207, 102, 0.7), inset 0 0 15px rgba(81, 207, 102, 0.3) !important;
}

@keyframes slotSuccess {
    0% { transform: scale(1); border-color: #51cf66; }
    25% { transform: scale(0.92); border-color: #51cf66; box-shadow: 0 0 30px rgba(81, 207, 102, 0.9); }
    50% { transform: scale(1.05); border-color: #51cf66; }
    75% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* Particle styles */
.particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: particleFly 0.6s ease-out forwards;
}

.particle.success {
    box-shadow: 0 0 10px currentColor;
}

.particle.error {
    box-shadow: 0 0 15px currentColor;
    animation: particleFlyError 0.8s ease-out forwards;
}

@keyframes particleFly {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0);
        opacity: 0;
    }
}

@keyframes particleFlyError {
    0% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
    30% {
        transform: translate(calc(-50% + var(--tx, 0px) * 0.5), calc(-50% + var(--ty, 0px) * 0.5)) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0);
        opacity: 0;
    }
}

/* Floating text styles */
.floating-text {
    position: fixed;
    font-weight: 900;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 1s ease-out forwards;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.floating-text.success {
    color: #51cf66;
    font-size: 3rem !important;
    text-shadow: 0 0 20px rgba(81, 207, 102, 0.8);
    animation: checkmarkPop 0.6s ease-out forwards !important;
}

.floating-text.error {
    color: #ff4757;
    font-size: 2.5rem !important;
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.8);
    animation: xPop 0.5s ease-out forwards !important;
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50px) scale(1.2);
        opacity: 0;
    }
}

@keyframes checkmarkPop {
    0% {
        transform: translate(-50%, 0) scale(0);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -20px) scale(1.3);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -30px) scale(1.1);
    }
    100% {
        transform: translate(-50%, -60px) scale(1);
        opacity: 0;
    }
}

@keyframes xPop {
    0% {
        transform: translate(-50%, 0) scale(0) rotate(-45deg);
        opacity: 0;
    }
    40% {
        transform: translate(-50%, -10px) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    60% {
        transform: translate(-50%, -15px) scale(1) rotate(5deg);
    }
    100% {
        transform: translate(-50%, -50px) scale(0.8);
        opacity: 0;
    }
}
