/* =================================
   Gomoku Game - Modern Redesign
   Professional, Clean, Responsive
   ================================= */

/* Color Palette */
:root {
    /* Deep purple & gold theme */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f59e0b;
    --accent: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Board colors */
    --board-wood: #d4a574;
    --board-line: #5d4332;
    --board-shadow: rgba(0, 0, 0, 0.3);

    /* Stone colors */
    --stone-black: #1a1a1a;
    --stone-white: #ffffff;

    /* Neutrals */
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;

    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.25);

    /* Sizes */
    --board-size: 580px;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ==================
   Header Redesign
   ================== */

.game-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.game-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.header-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: white;
    color: var(--neutral-700);
}

.btn-secondary:hover {
    background: var(--neutral-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* ==================
   Main Game Area
   ================== */

.game-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.5s ease;
}

/* Background Themes */
.game-main.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-main.bg-traditional {
    background:
        linear-gradient(rgba(103, 126, 234, 0.8), rgba(118, 75, 162, 0.8)),
        url('img/gomoku-1.jpeg') center/cover fixed;
}

.game-main.bg-modern {
    background:
        linear-gradient(rgba(103, 126, 234, 0.7), rgba(118, 75, 162, 0.7)),
        url('img/gomoku-2.jpeg') center/cover fixed;
}

.game-description {
    text-align: center;
    padding: 0 1rem;
}

.game-description p {
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0;
}

/* ==================
   Welcome Screen
   ================== */

.welcome-screen {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--glass-border);
    max-width: 1100px;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-screen.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.welcome-content {
    text-align: center;
}

.welcome-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-description {
    font-size: 1.125rem;
    color: var(--neutral-700);
    margin: 0 0 2.5rem;
    line-height: 1.6;
}

/* Setup Section */
.game-setup {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
    align-items: start;
}

.setup-sections {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.setup-section {
    text-align: center;
}

.setup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin: 0 0 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-selection,
.color-selection {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.difficulty-option,
.color-option {
    flex: 1;
    min-width: 140px;
    max-width: 180px;
    padding: 1.5rem 1rem;
    background: white;
    border: 3px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.difficulty-option:hover,
.color-option:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.difficulty-option.active,
.color-option.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.difficulty-option i {
    font-size: 2rem;
    color: var(--primary);
}

.difficulty-option.active i,
.color-option.active span {
    color: white;
}

.difficulty-option span,
.color-option span {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--neutral-800);
}

.difficulty-option.active span {
    color: white;
}

.difficulty-option small,
.color-option small {
    font-size: 0.875rem;
    color: var(--neutral-700);
    opacity: 0.8;
}

.difficulty-option.active small,
.color-option.active small {
    color: white;
    opacity: 0.9;
}

.color-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-preview.black {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.color-preview.white {
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    border: 3px solid var(--neutral-300);
}

/* Start Button */
.game-controls {
    margin-top: 2rem;
}

.game-controls button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    width: 100%;
}

.game-controls button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.game-controls button:active {
    transform: translateY(-1px);
}

/* Stats Grid */
.welcome-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    border: 2px solid transparent;
}

.stat-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================
   Game Board Area
   ================== */

.game-board-container {
    display: none;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--glass-border);
    max-width: 900px;
    margin: 0 auto;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-board-container.visible {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 1;
    transform: scale(1);
}

/* Game Status Bar */
.game-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border-radius: 16px;
    border: 2px solid rgba(99, 102, 241, 0.15);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-piece {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.player-piece.black {
    background: linear-gradient(135deg, #333, #111);
}

.player-piece.white {
    background: linear-gradient(135deg, #fff, #f0f0f0);
    border: 3px solid var(--neutral-300);
}

#currentPlayerText {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--neutral-800);
}

.game-info {
    display: flex;
    gap: 1.5rem;
}

.info-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.info-value {
    font-weight: 700;
    color: var(--primary);
}

.game-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: white;
    color: var(--neutral-700);
    border: 2px solid var(--neutral-200);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Board Wrapper */
.board-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    position: relative;
}

.game-canvas {
    position: relative;
}

#boardCanvas {
    border-radius: 16px;
    box-shadow:
        0 0 0 4px rgba(139, 105, 20, 0.4),
        0 12px 40px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
    transition: var(--transition);
}

#boardCanvas:hover {
    box-shadow:
        0 0 0 4px rgba(139, 105, 20, 0.6),
        0 16px 48px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.1);
}

/* AI Thinking Indicator */
.ai-thinking {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--glass-border);
    display: none;
    z-index: 10;
}

.ai-thinking.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.thinking-spinner {
    width: 32px;
    height: 32px;
    border: 4px solid var(--neutral-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.thinking-content span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neutral-800);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Move History */
.move-history {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: 12px;
    padding: 1.25rem;
    max-height: 180px;
    overflow-y: auto;
    border: 2px solid rgba(99, 102, 241, 0.1);
}

.history-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin: 0 0 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.move-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.move-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    transition: var(--transition);
    border: 1px solid var(--neutral-200);
}

.move-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.move-number {
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
}

.move-player {
    font-weight: 600;
    color: var(--neutral-800);
    flex: 1;
}

.move-position {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--neutral-700);
    background: var(--neutral-100);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.no-moves {
    text-align: center;
    color: var(--neutral-700);
    font-style: italic;
    padding: 2rem;
}

/* ==================
   Instructions
   ================== */

.game-instructions {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    max-width: 1200px;
    margin: 0 auto;
}

.game-instructions h3 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.instruction-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.instruction-item:hover {
    transform: translateY(-8px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.instruction-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.instruction-item h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin: 0 0 0.75rem;
}

.instruction-item p {
    color: var(--neutral-700);
    line-height: 1.6;
    margin: 0;
}

/* ==================
   Modals
   ================== */

.victory-modal,
.help-modal,
.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.victory-modal.visible,
.help-modal.visible,
.share-modal.visible {
    opacity: 1;
    visibility: visible;
}

.victory-content,
.help-content,
.share-content {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.victory-modal.visible .victory-content,
.help-modal.visible .help-content,
.share-modal.visible .share-content {
    transform: scale(1);
}

.help-content {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.help-close,
.share-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--neutral-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--neutral-700);
    transition: var(--transition);
}

.help-close:hover,
.share-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

/* Victory Modal */
.victory-header {
    text-align: center;
    margin-bottom: 2rem;
}

.victory-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease;
}

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

.victory-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.victory-message {
    font-size: 1.125rem;
    color: var(--neutral-700);
    margin: 0;
}

.victory-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.victory-stat {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.victory-stat .stat-label {
    font-size: 0.875rem;
    color: var(--neutral-700);
    margin-bottom: 0.5rem;
}

.victory-stat .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.victory-actions {
    display: flex;
    gap: 1rem;
}

.victory-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.victory-btn.primary {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.victory-btn.secondary {
    background: linear-gradient(135deg, var(--secondary), #d97706);
    color: white;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.victory-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Help Modal */
.help-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin: 0 0 1rem;
}

.help-section p,
.help-section ul {
    color: var(--neutral-700);
    line-height: 1.7;
    margin: 0 0 1rem;
}

.help-section ul {
    padding-left: 1.5rem;
}

.help-section li {
    margin-bottom: 0.5rem;
}

.help-section strong {
    color: var(--primary);
    font-weight: 700;
}

/* Share Modal */
.share-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.share-result {
    text-align: center;
    font-size: 1.125rem;
    color: var(--neutral-700);
    margin: 0 0 2rem;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    transition: var(--transition);
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.facebook {
    background: #4267b2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
}

/* Theme Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: var(--neutral-100);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.theme-option {
    cursor: pointer;
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    border: 3px solid transparent;
    transition: var(--transition);
}

.theme-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.modern-preview {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.classic-preview {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.dark-preview {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.rainbow-preview {
    background: linear-gradient(135deg, #fa709a, #fee140, #30cfd0);
}

.theme-name {
    font-weight: 700;
    color: var(--neutral-800);
}

/* ==================
   Recommended Zone
   ================== */

.recommended-zone {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.recommended-zone h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recommended-zone p {
    color: var(--neutral-700);
    font-size: 1.125rem;
    margin: 0 0 2rem;
}

.recommended-zone p a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.recommended-zone p a:hover {
    text-decoration: underline;
}

.recommended-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.recommended-links a {
    padding: 0.875rem 2rem;
    background: white;
    color: var(--neutral-800);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    border: 2px solid var(--neutral-200);
    transition: var(--transition);
}

.recommended-links a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ==================
   Responsive Design
   ================== */

@media (max-width: 768px) {
    :root {
        --board-size: 400px;
    }

    .header-content {
        padding: 0 1rem;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .header-controls {
        gap: 0.25rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .btn span:not(.btn-icon) {
        display: none;
    }

    .game-main {
        padding: 1rem;
        gap: 1rem;
    }

    .welcome-screen,
    .game-board-container {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-description {
        font-size: 1rem;
    }

    .game-setup {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .difficulty-selection,
    .color-selection {
        flex-direction: column;
    }

    .difficulty-option,
    .color-option {
        max-width: 100%;
    }

    .welcome-stats {
        grid-template-columns: 1fr;
    }

    .game-status {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .status-info {
        flex-direction: column;
        gap: 1rem;
    }

    .game-actions {
        width: 100%;
        justify-content: center;
    }

    .action-btn span {
        display: none;
    }

    .board-wrapper {
        padding: 1rem 0;
    }

    .instruction-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .game-instructions {
        padding: 2rem 1.5rem;
    }

    .victory-content,
    .help-content,
    .share-content {
        padding: 2rem;
    }

    .victory-stats {
        grid-template-columns: 1fr;
    }

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

    .recommended-zone {
        padding: 2rem 1.5rem;
    }

    .recommended-links {
        flex-direction: column;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .instruction-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    :root {
        --board-size: 360px;
    }

    .welcome-title {
        font-size: 1.75rem;
    }

    .game-controls button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .victory-title {
        font-size: 2rem;
    }
}

/* ==================
   Animations
   ================== */

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

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

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Focus States */
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .game-header,
    .header-controls,
    .game-actions,
    .recommended-zone {
        display: none;
    }
}
