/* =========================================
   CSS Variables & Theming
========================================= */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent-primary: #8b5cf6; /* Vibrant violet */
    --accent-secondary: #06b6d4; /* Vibrant cyan */
    --accent-glow: 0 0 15px rgba(139, 92, 246, 0.5);
    
    --cell-bg: rgba(255, 255, 255, 0.03);
    --cell-border: rgba(255, 255, 255, 0.08);
    --cell-active: rgba(139, 92, 246, 0.2);
    --cell-filled: rgba(6, 182, 212, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* =========================================
   Reset & Base Styles
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* =========================================
   Layout Containers
========================================= */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.game-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* =========================================
   Typography & Header
========================================= */
.logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: transparent;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
}

.score-board {
    display: flex;
    gap: 1.5rem;
}

.score-card, .timer-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
}

.score-card .label, .timer-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.score-card .value, .timer-card .value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 0.25rem;
}

.timer-card .value {
    color: var(--accent-secondary);
}

/* =========================================
   Glassmorphism Panels
========================================= */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
}

/* =========================================
   10x10 Game Board
========================================= */
.board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* For overlays */
}

.word-overlays {
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
    pointer-events: none; /* Let clicks pass through to cells */
}

/* Base styles for the highlighting pill */
.word-pill {
    position: absolute;
    background: rgba(6, 182, 212, 0.2);
    border: 2px solid rgba(6, 182, 212, 0.4);
    border-radius: 20px;
    transition: all 0.5s ease;
    z-index: 5;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 4px;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
}

.cell {
    background: var(--cell-bg);
    border: 1px solid var(--cell-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.cell.active {
    background: var(--cell-active);
    border-color: var(--accent-primary);
    box-shadow: var(--accent-glow);
    transform: scale(1.1);
    z-index: 10;
}

.cell.filled {
    background: var(--cell-filled);
    border-color: var(--accent-secondary);
}

/* =========================================
   Controls Sidebar
========================================= */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sub-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.info-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

.status-message {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.direction-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dir-icon {
    font-size: 1.2rem;
    font-weight: 900;
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.glass-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1rem;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--accent-glow);
}

.glass-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

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

.primary-btn:disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
}
/* =========================================
   Settings Overlay & Modal
========================================= */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.settings-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.settings-panel {
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideUp 0.5s ease-out;
}

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

.settings-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.settings-group {
    margin-bottom: 2.5rem;
}

.timer-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.option-btn.active {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.start-btn {
    width: 100%;
    font-size: 1.1rem;
    padding: 1.25rem;
    margin-top: 1rem;
}
