/* ========================================
   GOMOKU - PREMIUM GAME APP DESIGN
   ======================================== */

/* ========= ROOT VARIABLES ========= */
:root {
    /* Color Palette - Vibrant & Energetic */
    --color-bg-primary: #0f0a2e;
    --color-bg-secondary: #1a0f3d;
    --color-bg-tertiary: #2d1b5e;
    --color-accent-primary: #00ffff;
    --color-accent-secondary: #ff00ff;
    --color-accent-gold: #ffea00;
    --color-text-primary: #ffffff;
    --color-text-secondary: #e0d5ff;
    --color-text-muted: #a892ee;
    --color-success: #00ff9d;
    --color-danger: #ff2d5f;
    --color-warning: #ffc200;
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(0, 255, 255, 0.5);
    --shadow-glow-pink: 0 0 25px rgba(255, 0, 255, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-round: 50%;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    /* ========= RESPONSIVE STAT VARIABLES ========= */
    /* Smartphone Portrait */
    --stat-icon-sm-portrait: 1.2rem;
    --stat-label-sm-portrait: 0.6rem;
    --stat-value-sm-portrait: 0.9rem;
    --stat-padding-sm-portrait: 0.25rem 0.5rem;
    --stat-gap-sm-portrait: 0.25rem;
    
    /* Smartphone Landscape */
    --stat-icon-sm-landscape: 1.2rem;
    --stat-label-sm-landscape: 0.6rem;
    --stat-value-sm-landscape: 0.9rem;
    --stat-padding-sm-landscape: 0.25rem 0.5rem;
    --stat-gap-sm-landscape: 0.5rem;
    
    /* Tablet Portrait */
    --stat-icon-md-portrait: 1.4rem;
    --stat-label-md-portrait: 0.7rem;
    --stat-value-md-portrait: 1rem;
    --stat-padding-md-portrait: 0.5rem 0.75rem;
    
    /* Tablet Landscape */
    --stat-icon-md-landscape: 1.4rem;
    --stat-label-md-landscape: 0.8rem;
    --stat-value-md-landscape: 1.2rem;
    --stat-padding-md-landscape: 0.5rem 0.5rem;
    --stat-gap-md-landscape: 0.75rem;
    --stat-min-width-md-landscape: 140px;
    
    /* Desktop Portrait */
    --stat-icon-lg-portrait: 1.5rem;
    --stat-label-lg-portrait: 0.75rem;
    --stat-value-lg-portrait: 1.1rem;
    --stat-padding-lg-portrait: 0.5rem 1rem;
    
    /* Desktop Landscape */
    --stat-icon-lg-landscape: 1.6rem;
    --stat-label-lg-landscape: 0.8rem;
    --stat-value-lg-landscape: 1.15rem;
    --stat-padding-lg-landscape: 1rem;
    --stat-gap-lg-landscape: 0.75rem;
}

/* ========= RESET & BASE ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ========= 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(--color-bg-primary) 0%,
        var(--color-bg-secondary) 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;
}

/* ========= MAIN CONTAINER ========= */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
    position: relative;
}

.screen.hidden {
    display: none;
}

.screen-content {
    padding: var(--spacing-lg);
}

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

/* ========= START SCREEN ========= */
.start-screen-nav {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 10;
}

.game-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-circle {
    width: 120px;
    height: 120px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-round);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-glow);
    animation: logoFloat 3s ease-in-out infinite;
}

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

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

.logo-piece {
    animation: piecePulse 2s ease-in-out infinite;
}

.piece-delay-1 { animation-delay: 0.2s; }
.piece-delay-2 { animation-delay: 0.4s; }
.piece-delay-3 { animation-delay: 0.6s; }
.piece-delay-4 { animation-delay: 0.8s; }

@keyframes piecePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.connecting-line {
    animation: lineGlow 2s ease-in-out infinite;
}

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

.game-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.2em;
    text-shadow: 0 0 40px rgba(0, 245, 255, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
}

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

.game-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Stats Overview */
.stats-overview {
    display: flex;
    align-items: stretch; /* Stretch items to equal height */
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
}

.stat-icon i {
    background: linear-gradient(135deg, var(--color-accent-gold), var(--color-warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-accent-gold), var(--color-warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-stats {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.btn-stats:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.25rem;
}

.btn-icon i {
    color: var(--color-accent-primary);
    filter: drop-shadow(0 0 5px rgba(0, 245, 255, 0.3));
}

.stats-title .stats-icon i {
    color: var(--color-accent-secondary);
    filter: drop-shadow(0 0 5px rgba(252, 0, 255, 0.3));
}

/* Difficulty Selection */
.difficulty-section {
    margin-top: var(--spacing-xl);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.difficulty-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.difficulty-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 var(--transition-slow);
}

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

.difficulty-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
}

.difficulty-card.expert-highlight {
    border-color: var(--color-accent-gold);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(252, 0, 255, 0.05));
}

.difficulty-card.expert-highlight:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.difficulty-badge {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    display: inline-block;
}

.beginner-badge {
    background: linear-gradient(135deg, var(--badge-easy-start), var(--badge-easy-end));
    color: #000;
}

.easy-badge {
    background: linear-gradient(135deg, var(--badge-medium-start), var(--badge-medium-end));
    color: #fff;
}

.medium-badge {
    background: linear-gradient(135deg, var(--badge-hard-start), var(--badge-hard-end));
    color: #000;
}

.hard-badge {
    background: linear-gradient(135deg, var(--badge-expert-start), var(--badge-expert-end));
    color: #fff;
}

.expert-badge {
    background: linear-gradient(135deg, var(--color-accent-gold), var(--color-accent-secondary));
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.difficulty-icon {
    font-size: 3rem;
    text-align: center;
    margin: var(--spacing-md) 0;
}

.difficulty-desc {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.difficulty-ai-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.ai-bars {
    display: flex;
    gap: 4px;
}

.ai-bar {
    width: 8px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.ai-bar.active {
    background: linear-gradient(180deg, var(--color-accent-primary), var(--color-accent-secondary));
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.ai-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Locked Level State */
.difficulty-card.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
    cursor: not-allowed;
    pointer-events: none;
}

.difficulty-card.locked:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: var(--shadow-md);
}

.difficulty-card.locked::before {
    display: none;
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    z-index: 10;
    opacity: 0.8;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}


/* ========= GAME SCREEN ========= */
#game-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
    max-width: 100%;
    padding: 0;
    position: relative;
}

.game-top-bar {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

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

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
}

/* Battle Header */
.battle-header {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
}

.battle-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs) var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    position: relative;
    transition: all var(--transition-fast);
    width: 130px;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0);
}

.battle-card.active {
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.battle-card.active .card-indicator {
    background: var(--color-accent-primary);
    box-shadow: 0 0 10px var(--color-accent-primary);
}

.card-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 40px;
    background: var(--glass-border);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.player-card .card-indicator {
    left: -4px;
}

.ai-card .card-indicator {
    right: -4px;
}

.card-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    overflow: visible;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid var(--glass-border);
    transition: all var(--transition-fast);
}

.player-avatar {
    background: linear-gradient(135deg, var(--board-gradient-start), var(--board-gradient-end));
}

.ai-avatar {
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.card-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-role {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.vs-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-text-muted);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--glass-bg);
    border-radius: var(--radius-md);
}

.turn-indicator {
    font-size: 0.875rem;
    color: var(--color-accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 60px;
    text-align: center;
}

/* Game Board */
.game-board-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-xs);
    overflow: hidden;
    min-height: 0;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-lg);
    width: min(500px, calc(100vw - 2rem));
    height: min(500px, calc(100vh - 200px));
    max-width: min(500px, calc(100vw - 2rem));
    max-height: min(500px, calc(100vh - 200px));
    aspect-ratio: 1;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    aspect-ratio: 1;
    touch-action: manipulation;
}

.cell:hover {
    background: rgba(0, 245, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 245, 255, 0.2);
}

.cell::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.stone {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 85%;
    height: 85%;
    border-radius: 50%;
    animation: stoneDrop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: var(--shadow-md);
}

@keyframes stoneDrop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.stone.black {
    background: radial-gradient(circle at 30% 30%, var(--piece-black-gradient-light), var(--piece-black-gradient-dark));
    border: 2px solid #000;
}

.stone.white {
    background: radial-gradient(circle at 30% 30%, var(--piece-white-gradient-light), var(--piece-white-gradient-dark));
    border: 2px solid #d0d0d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Control Panel */
.control-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.control-stats {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.control-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.control-icon {
    font-size: 1.25rem;
}

.control-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    flex-direction: row; /* Horizontal layout */
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    min-width: 240px;
    position: relative;
    transition: all var(--transition-fast);
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Interactive State */
.stat-card[role="button"] {
    cursor: pointer;
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card[role="button"]:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: var(--color-accent-primary);
}

.stat-card[role="button"]:active {
    transform: translateY(0);
}

.stat-icon {
    font-size: 2.5rem; /* Larger icon */
    color: var(--color-accent-primary);
    margin-bottom: 0; /* Remove bottom margin */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 245, 255, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(0, 245, 255, 0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

/* Combined Stats Styling */
.stat-value-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.win-text {
    color: var(--color-accent-primary); /* Cyan for wins */
}

.lose-text {
    color: var(--color-accent-secondary); /* Pink for losses */
}

.divider {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 1.5rem;
    margin: 0 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
    font-weight: 600;
}

.stat-hint {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    opacity: 0.5; /* Visible by default */
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    position: absolute;
    bottom: 8px;
    right: 12px;
}

.stat-card:hover .stat-hint {
    opacity: 1;
    color: var(--color-accent-primary);
    transform: translateX(-2px); /* Subtle movement on hover */
}

.btn-control {
    /* Inherit stat-item base styles, already applied via class */
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--glass-border);
}

.btn-control:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-control .stat-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-accent-primary);
}

.btn-control .stat-value {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========= END SCREENS ========= */
.end-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.end-screen-animation {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.trophy-container,
.defeat-container {
    position: relative;
    display: inline-block;
}

.trophy-glow,
.defeat-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
}

.trophy-glow {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent);
}

.defeat-glow {
    background: radial-gradient(circle, rgba(100, 100, 150, 0.3), transparent);
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.trophy-icon,
.defeat-icon {
    font-size: 8rem;
    position: relative;
    z-index: 1;
    animation: iconBounce 1s ease-in-out;
}

@keyframes iconBounce {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.notification-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-accent-primary);
    width: 100%;
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--color-accent-primary);
}

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

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.end-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.1em;
}

.victory-title {
    background: linear-gradient(135deg, var(--color-accent-gold), var(--color-warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.defeat-title {
    color: var(--color-text-secondary);
}

.end-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
}

.end-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.end-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    min-width: 150px;
    text-align: center;
}

.end-stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.end-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent-primary);
}

.end-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-xl);
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-glow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-xl);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent-primary);
    transform: translateY(-2px);
}

/* Next Level Button */
.btn-next-level {
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    animation: nextLevelPulse 2s ease-in-out infinite;
}

.btn-next-level:hover {
    box-shadow: 0 0 40px rgba(252, 0, 255, 0.6);
    animation: none;
}

@keyframes nextLevelPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(252, 0, 255, 0.5);
    }
}


/* ========= STATS SCREEN ========= */
.stats-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease;
    max-width: none; /* Override .screen max-width */
    margin: 0; /* Override .screen margin */
}

.stats-modal {
    background: var(--color-bg-secondary);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--glass-border);
}

.stats-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.stats-icon {
    font-size: 1.75rem;
}

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

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.stats-table-container {
    padding: var(--spacing-lg);
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table thead th {
    padding: var(--spacing-md);
    text-align: left;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--glass-border);
}

.stats-table tbody tr {
    transition: background var(--transition-fast);
}

.stats-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stats-table tbody td {
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
}

.stat-highlight {
    color: var(--color-success) !important;
    font-weight: 700;
}

.stat-danger {
    color: var(--color-danger) !important;
    font-weight: 700;
}


/* ========= RESPONSIVE DESIGN ========= */




/* ========= UTILITY CLASSES ========= */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* ========= ANIMATIONS ========= */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Print Styles */
@media print {
    .bg-gradient,
    .bg-grid,
    .particles-container {
        display: none;
    }
}

/* ========= DYNAMIC RESPONSIVE LAYOUT ========= */

#game-screen {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    margin: 0;
    padding: 0;
    transition: none; /* JS handles layout, transition causes lag */
}

/* Portrait Mode: Top/Bottom Bars */
#game-screen.portrait {
    flex-direction: column;
}

#game-screen.portrait .game-top-bar {
    width: 100%;
    height: auto;
    flex-direction: row;
    border-bottom: 1px solid var(--glass-border);
    border-right: none;
    order: 0;
}

#game-screen.portrait .game-board-wrapper {
    width: 100%;
    flex: 1;
    order: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: var(--spacing-md); /* Gap around board */
}

#game-screen.portrait .control-panel {
    width: 100%;
    height: auto;
    flex-direction: row;
    border-top: 1px solid var(--glass-border);
    border-left: none;
    order: 2;
    justify-content: center;
}

/* Landscape Mode: Left/Right Bars */
/* Structural layout handled by game-layout.css */

#game-screen.landscape .game-top-bar {
    border-right: 1px solid var(--glass-border);
    border-bottom: none;
}

#game-screen.landscape .game-board-wrapper {
    padding: var(--spacing-md); /* Gap around board */
}

#game-screen.landscape .control-panel {
    border-left: 1px solid var(--glass-border);
    border-top: none;
    justify-content: space-between;
}

/* Landscape specific adjustments for inner elements */

/* Game Stats - Based on Sudoku's Design */
.game-stats {
    flex: 1;
    display: flex;
    justify-content: space-around;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-md) var(--spacing-sm);
    border-radius: var(--radius-md);
    min-height: 60px;
}

.stat-item .stat-icon {
    font-size: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 60px; /* Fixed minimum width to prevent layout shifts */
}


.stat-info .stat-label {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info .stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    min-width: 3ch; /* Ensure consistent width for numeric values */
    display: inline-block;
    text-align: left;
    font-variant-numeric: tabular-nums; /* Equal-width digits */
}

/* Timer Display - Fixed Width to Prevent Flickering */
#timer-display {
    min-width: 5ch; /* Fixed width for MM:SS format (5 characters) */
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}


/* Turn Indicator Card - Keep "You vs AI" Design */
.turn-indicator-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    min-height: 60px;
}

.player-name {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    font-size: 1.5rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.player-icon {
    font-size: 1.1rem;
}

.player-name.active {
    color: var(--color-accent-primary);
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
    border-color: var(--color-accent-primary);
    background: rgba(0, 245, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.2);
    animation: player-turn-pulse 2s infinite ease-in-out;
}

.player-name.active .avatar-circle {
    box-shadow: 0 0 15px var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    animation: avatarPulse 1.5s infinite ease-in-out;
}

@keyframes avatarPulse {
    0% { box-shadow: 0 0 10px var(--color-accent-primary); transform: scale(1); }
    50% { box-shadow: 0 0 25px var(--color-accent-primary); transform: scale(1.1); }
    100% { box-shadow: 0 0 10px var(--color-accent-primary); transform: scale(1); }
}

.vs-text {
    font-size: 1rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-text-secondary);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Control Panel Grid */
.control-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

/* Landscape Mode - Simple Column Layout */
.landscape .game-stats {
    flex-direction: column;
    gap: var(--spacing-xs);
}

.landscape .stat-item {
    padding: var(--spacing-sm);
}

.landscape .turn-indicator-card {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
}

.landscape .vs-text {
    font-size: 1rem;
    margin: 2px 0;
}

.landscape .control-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
}

.landscape .control-buttons {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
}

.landscape .btn-control {
    justify-content: center;
    width: 100%;
}

.landscape .btn-icon-only {
    margin-bottom: var(--spacing-sm);
}

/* Ensure game board fits in landscape */
.landscape .game-board {
    width: 100%;
    height: auto;
    max-width: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    aspect-ratio: 1;
    margin: 0 auto;
}

/* Player Turn Animation */
@keyframes player-turn-pulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 20px rgba(0, 245, 255, 0.8), 0 0 30px rgba(0, 245, 255, 0.4);
    }
}

/* AI Thinking Animation */
@keyframes thinking-pulse {
    0% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); text-shadow: 0 0 15px var(--color-accent-primary); }
    100% { opacity: 0.5; transform: scale(1); }
}



/* Top Bar Alignment */
.game-top-bar {
    position: relative;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Main menu button uses default .btn-icon-only styling and stays in flex flow */
/* ========= RESPONSIVE DESIGN ========= */

/* ==========================================
   RESPONSIVE BREAKPOINTS - STANDARDIZED
   ========================================== */

/* ========= SMARTPHONE PORTRAIT (≤480px) ========= */
@media only screen and (max-width: 480px) and (orientation: portrait) {
    .game-title {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }

    .stats-overview {
        flex-direction: column;
    }
    
    .logo-circle {
        width: 80px;
        height: 80px;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--spacing-sm);
        min-width: 0;
        gap: var(--spacing-sm);
    }

    .stat-content {
        align-items: center;
    }
    
    .game-stats {
        gap: var(--stat-gap-sm-portrait);
    }
    
    .stat-item {
        padding: var(--stat-padding-sm-portrait);
        gap: var(--stat-gap-sm-portrait);
    }
    
    .stat-item .stat-icon {
        font-size: var(--stat-icon-sm-portrait);
    }
    
    .stat-info .stat-label {
        font-size: var(--stat-label-sm-portrait);
    }
    
    .stat-info .stat-value {
        font-size: var(--stat-value-sm-portrait);
    }
}

/* ========= SMARTPHONE LANDSCAPE (≤812px) ========= */
@media only screen and (max-width: 812px) and (orientation: landscape) {
    .game-stats {
        gap: var(--stat-gap-sm-landscape);
    }
    
    .stat-item {
        flex-direction: row;
        text-align: left;
        gap: var(--stat-gap-sm-landscape);
        min-width: 0;
        width: 100%;
        padding: var(--stat-padding-sm-landscape);
    }
    
    .stat-item .stat-icon {
        font-size: var(--stat-icon-sm-landscape);
        height: 50px;
        width: 50px;
    }
    
    .stat-info .stat-label {
        font-size: var(--stat-label-sm-landscape);
    }
    
    .stat-info .stat-value {
        font-size: var(--stat-value-sm-landscape);
    }
    
    .landscape .stat-item {
        padding: var(--spacing-xs);
    }

    /* Gomoku-specific control panel adjustments */
    .control-stats-grid,
    .control-buttons {
        grid-template-columns: 1fr !important;
    }
    #game-screen.landscape .control-panel {
        flex-direction: column;
        justify-content: center;
        gap: var(--spacing-xs);
        display: grid;
    }
}

/* ========= TABLET PORTRAIT (600px-900px) ========= */
@media only screen and (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
    .stat-item {
        padding: var(--stat-padding-md-portrait);
    }
    
    .stat-item .stat-icon {
        font-size: var(--stat-icon-md-portrait);
    }
    
    .stat-info .stat-label {
        font-size: var(--stat-label-md-portrait);
    }
    
    .stat-info .stat-value {
        font-size: var(--stat-value-md-portrait);
    }
}

/* ========= TABLET LANDSCAPE (900px-1200px) ========= */
@media only screen and (min-width: 900px) and (max-width: 1200px) and (orientation: landscape) {
    .stat-item {
        padding: var(--stat-padding-md-landscape);
        flex-direction: row;
        text-align: left;
        gap: var(--stat-gap-md-landscape);
        min-width: var(--stat-min-width-md-landscape);
    }
    
    .stat-item .stat-icon {
        font-size: var(--stat-icon-md-landscape);
        height: 50px;
        width: 50px;
    }
    
    .stat-info .stat-label {
        font-size: var(--stat-label-md-landscape);
    }
    
    .stat-info .stat-value {
        font-size: var(--stat-value-md-landscape);
    }
    
    /* Gomoku-specific control panel adjustments */
    .control-stats-grid,
    .control-buttons {
        grid-template-columns: 1fr !important;
    }
    #game-screen.landscape .control-panel {
        flex-direction: column;
        justify-content: center;
        gap: var(--spacing-xs);
        display: grid;
    }
}

/* ========= DESKTOP PORTRAIT (≥1200px) ========= */
@media only screen and (min-width: 1200px) and (orientation: portrait) {
    .stat-item {
        padding: var(--stat-padding-lg-portrait);
    }
    
    .stat-item .stat-icon {
        font-size: var(--stat-icon-lg-portrait);
    }
    
    .stat-info .stat-label {
        font-size: var(--stat-label-lg-portrait);
    }
    
    .stat-info .stat-value {
        font-size: var(--stat-value-lg-portrait);
    }
}

/* ========= DESKTOP LANDSCAPE (≥1200px) ========= */
@media only screen and (min-width: 1200px) and (orientation: landscape) {
    .stat-item {
        padding: var(--stat-padding-lg-landscape);
        gap: var(--stat-gap-lg-landscape);
    }
    
    .stat-item .stat-icon {
        font-size: var(--stat-icon-lg-landscape);
    }
    
    .stat-info .stat-label {
        font-size: var(--stat-label-lg-landscape);
    }
    
    .stat-info .stat-value {
        font-size: var(--stat-value-lg-landscape);
    }
}

/* ========= GENERAL MOBILE (≤768px) ========= */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .difficulty-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .end-title {
        font-size: 2rem;
    }
    
    .trophy-icon,
    .defeat-icon {
        font-size: 5rem;
    }

    .player-name {
        font-size: 1.2rem;
        padding: var(--spacing-xs) var(--spacing-xs);
    }

    .vs-text {
        font-size: 0.8rem;
        padding: var(--spacing-xs);
    }
}

/* ========= NOTIFICATIONS ========= */
.game-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    min-width: 300px;
    max-width: 350px;
    overflow: hidden;
    cursor: pointer;
}

.game-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.game-notification:hover {
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
}

.notification-icon {
    font-size: 1.2rem;
    color: var(--color-accent-primary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-round);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.notification-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0;
    line-height: 1.2;
}

.notification-message {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.notification-timer {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-accent-gold);
    margin-left: auto;
}

.notification-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    width: 100%;
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--color-accent-primary);
}

/* ========= LOGO RESPONSIVE SIZING ========= */
@media (min-width: 481px) and (max-width: 1024px) {
    .logo-circle {
        width: 100px;
        height: 100px;
    }
}

/* ========= COMPREHENSIVE MOBILE (max-width: 480px) ========= */
@media (max-width: 480px) {
    .logo-circle {
        width: 80px;
        height: 80px;
    }
    
    .game-title {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }
    
    .stats-overview {
        flex-direction: column;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
    }
    
    .game-board {
        max-width: 95vmin;
        max-height: 95vmin;
    }

    .stat-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--spacing-sm);
        min-width: 0;
        gap: var(--spacing-sm);
    }

    .stat-content {
        align-items: center;
    }
    
    /* Stats Modal */
    .stats-table-container {
        padding: var(--spacing-sm);
    }
    
    .stats-table thead th,
    .stats-table tbody td {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }
    
    .stats-modal {
        max-width: 95%;
        max-height: 95vh;
    }

    .stats-header {
        padding: var(--spacing-md);
    }

    .stats-title {
        font-size: 1.2rem;
    }

    .stats-icon {
        font-size: 1.5rem;
    }
    
    /* Game Layout */
    .control-panel {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-xs);
    }

    .btn-control {
        padding: var(--spacing-sm);
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
    }
    
    .control-stats {
        justify-content: space-around;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .end-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .end-title {
        font-size: 2rem;
    }
    
    .trophy-icon,
    .defeat-icon {
        font-size: 5rem;
    }
    
    .battle-header {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .battle-card {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .avatar-circle {
        font-size: 1.2rem;
    }
    
    .card-name {
        font-size: 0.95rem;
    }
    
    .vs-text {
        font-size: 1.2rem;
    }
}
