/* ============================
   MEKA GLOBAL OYUN PORTALI
   Ana Stil Dosyası
   ============================ */

:root {
    --bg-primary: #050a14;
    --bg-secondary: rgba(255, 255, 255, 0.08);
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-sidebar: #09101d;
    
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;
    
    --correct: #2ecc71;
    --correct-glow: rgba(46, 204, 113, 0.35);
    --present: #f1c40f;
    --present-glow: rgba(241, 196, 15, 0.35);
    --absent: rgba(255, 255, 255, 0.08);
    --absent-dark: rgba(255, 255, 255, 0.05);
    
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-glow: rgba(102, 126, 234, 0.25);
    --accent-color: #667eea;
    
    --tile-border: rgba(255, 255, 255, 0.1);
    --tile-border-active: rgba(255, 255, 255, 0.3);
    --key-bg: rgba(255, 255, 255, 0.1);
    --key-bg-hover: rgba(255, 255, 255, 0.18);
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-xl: 24px;
    
    --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 18px 50px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.15);
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    
    --font-family: 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
    
    /* Parolla Vars */
    --board-cols: 5;
    --board-rows: 5;
    
    
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; overflow: hidden; }

body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 15% 30%, rgba(102,126,234,0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 85% 70%, rgba(118,75,162,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(46,204,113,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse { 0% { opacity: 0.6; } 100% { opacity: 1; } }

.hidden { display: none !important; }
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-center { text-align: center; }

/* ============================
   PORTAL HOME
   ============================ */
#portal-home {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    padding: 60px 20px 40px;
    overflow-y: auto;
    animation: fadeIn 500ms ease;
}

/* For nicer scrolling */
#portal-home::-webkit-scrollbar { width: 8px; }
#portal-home::-webkit-scrollbar-track { background: transparent; }
#portal-home::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
#portal-home::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

.portal-header { text-align: center; margin-bottom: 40px; }
.portal-header h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; margin-bottom: 10px; letter-spacing: -1px; }
.portal-header p { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-secondary); }

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 960px;
}

.game-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-xl);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.game-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.game-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 900; color: #fff;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.parolla-icon { background: var(--correct); }
.memory-icon { background: var(--accent-gradient); }
.grid-icon { background: #e67e22; font-size: 1.4rem; }

.game-info h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.game-info p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }

/* ============================
   PORTAL LAYOUT (Sidebar + Main)
   ============================ */
#portal-layout {
    position: relative;
    z-index: 10;
    display: flex;
    height: 100vh;
    animation: fadeIn 500ms ease;
}

/* Sidebar */
#sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    transition: transform 300ms ease;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 12px; }

.home-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: all var(--transition-fast);
}
.home-btn:hover { background: rgba(255,255,255,0.1); }

.sidebar-nav { padding: 20px 10px; display: flex; flex-direction: column; gap: 8px; }

.nav-btn {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 16px;
    background: transparent; border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary); font-size: 1rem; font-weight: 600;
    text-align: left; cursor: pointer; transition: all var(--transition-fast);
}
.nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-btn.active { background: rgba(255,255,255,0.1); color: #fff; border-left: 3px solid var(--accent-color); }

.nav-icon {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; font-weight: 800; font-size: 1.1rem;
}
.text-icon { font-size: 1.4rem; }

/* Main Content */
#main-content {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.game-section {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    padding: 0 10px;
    animation: fadeIn 300ms ease;
}

@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* Sidebar Mobile Toggle */
#sidebar-toggle {
    display: none;
    position: fixed; top: 12px; left: 12px; z-index: 101;
    background: var(--bg-sidebar); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary); border-radius: var(--border-radius-sm);
    width: 40px; height: 40px; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: var(--shadow-md);
}

#sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 99; opacity: 0; transition: opacity 300ms ease;
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed; top: 0; bottom: 0; left: 0;
        transform: translateX(-100%);
    }
    #sidebar.open { transform: translateX(0); }
    #sidebar-toggle { display: flex; }
    #sidebar-overlay.open { display: block; opacity: 1; }
    
    /* Make room for toggle button on mobile */
    .game-section { padding-top: 50px; }
    #game-header { padding-left: 40px !important; }
}

/* ============================
   GAME: PAROLLA (Styles Migrated)
   ============================ */
#parolla-app {
    display: flex; flex-direction: column;
    height: 100%; max-width: 540px; width: 100%; margin: 0 auto;
}

/* ... (Parolla styles from previous version) ... */
#game-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.header-left, .header-right { width: 40px; display: flex; align-items: center; }
.header-right { justify-content: flex-end; }
.header-center { flex: 1; display: flex; justify-content: center; }
.icon-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: var(--border-radius-sm); transition: all var(--transition-fast); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); transform: scale(1.1); }
#game-title { font-size: 1.5rem; font-weight: 900; letter-spacing: 4px; display: flex; gap: 1px; }

#mode-selector { display: flex; justify-content: center; gap: 8px; padding: 10px 0 6px; flex-shrink: 0; }
.mode-btn { font-family: var(--font-family); font-size: 0.82rem; font-weight: 700; padding: 8px 20px; border: 1px solid rgba(255,255,255,0.1); border-radius: 100px; background: rgba(255,255,255,0.04); color: var(--text-secondary); cursor: pointer; transition: all var(--transition-normal); letter-spacing: 0.5px; }
.mode-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.mode-btn.active { background: var(--accent-gradient); color: #fff; border-color: transparent; box-shadow: 0 0 16px var(--accent-glow); }

#toast-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: rgba(20,20,40,0.92); backdrop-filter: blur(20px); color: var(--text-primary); padding: 12px 24px; border-radius: var(--border-radius-md); font-weight: 600; font-size: 0.95rem; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.08); animation: toastIn 300ms ease forwards; pointer-events: auto; white-space: nowrap; }
.toast.toast-out { animation: toastOut 300ms ease forwards; }
@keyframes toastIn { from{opacity:0;transform:translateY(-20px) scale(.9)} to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes toastOut { from{opacity:1;transform:translateY(0) scale(1)} to{opacity:0;transform:translateY(-20px) scale(.9)} }

#game-board-container { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px 0; min-height: 0; }
#game-board { display: grid; grid-template-rows: repeat(var(--board-rows), 1fr); gap: 5px; width: fit-content; margin: 0 auto; }
#parolla-app[data-mode="4"] #game-board { max-height: min(420px, 46vh); }
#parolla-app[data-mode="5"] #game-board { max-height: min(420px, 46vh); }
#parolla-app[data-mode="6"] #game-board { max-height: min(420px, 46vh); }

.board-row { display: grid; grid-template-columns: repeat(var(--board-cols), 1fr); gap: 5px; }
.tile { width: clamp(34px, min(12vw, 6vh), 58px); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(1.1rem, 3.8vw, 1.8rem); font-weight: 800; text-transform: uppercase; border: 2px solid var(--tile-border); border-radius: var(--border-radius-sm); background: rgba(255,255,255,0.02); color: var(--text-primary); transition: border-color var(--transition-fast), transform var(--transition-fast); user-select: none; position: relative; overflow: hidden; }
#parolla-app[data-mode="4"] .tile { width: clamp(40px, min(14vw, 6vh), 64px); font-size: clamp(1.3rem, 4.5vw, 2rem); }
#parolla-app[data-mode="6"] .tile { width: clamp(30px, min(10vw, 6vh), 50px); font-size: clamp(0.95rem, 3.2vw, 1.5rem); }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%); pointer-events: none; }
.tile.filled { border-color: var(--tile-border-active); animation: tilePop 100ms ease; }
.tile.active-row { border-color: var(--tile-border-active); }
@keyframes tilePop { 0%{transform:scale(1)} 50%{transform:scale(1.08)} 100%{transform:scale(1)} }
.tile.reveal { animation: tileReveal 500ms ease forwards; }
@keyframes tileReveal { 0%{transform:rotateX(0)} 50%{transform:rotateX(90deg)} 100%{transform:rotateX(0)} }
.tile.correct { background: var(--correct); border-color: var(--correct); box-shadow: 0 0 14px var(--correct-glow); color: #fff; }
.tile.present { background: var(--present); border-color: var(--present); box-shadow: 0 0 14px var(--present-glow); color: #1a1a2e; }
.tile.absent { background: var(--absent); border-color: rgba(255,255,255,0.06); color: var(--text-secondary); }
.tile.win-bounce { animation: winBounce 600ms ease; }
@keyframes winBounce { 0%,100%{transform:translateY(0)} 25%{transform:translateY(-18px) rotate(-3deg)} 50%{transform:translateY(-8px) rotate(2deg)} 75%{transform:translateY(-4px) rotate(-1deg)} }
.board-row.shake { animation: rowShake 400ms ease; }
@keyframes rowShake { 0%,100%{transform:translateX(0)} 15%{transform:translateX(-8px)} 30%{transform:translateX(8px)} 45%{transform:translateX(-6px)} 60%{transform:translateX(6px)} 75%{transform:translateX(-3px)} 90%{transform:translateX(3px)} }

#keyboard-container { padding: 6px 0 14px; display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.keyboard-row { display: flex; gap: 4px; justify-content: center; }
.key { font-family: var(--font-family); font-size: clamp(0.76rem, 2.5vw, 0.92rem); font-weight: 700; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.05); border-radius: var(--border-radius-sm); background: var(--key-bg); backdrop-filter: blur(8px); color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; height: clamp(46px, 7vh, 56px); min-width: clamp(26px, 6.8vw, 42px); flex: 1; max-width: 44px; transition: all var(--transition-fast); position: relative; overflow: hidden; }
.key::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%); pointer-events: none; }
.key:hover { background: var(--key-bg-hover); transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: rgba(255,255,255,0.12); }
.key:active { transform: translateY(1px) scale(0.95); }
.key-wide { min-width: clamp(46px, 11vw, 68px); max-width: 74px; flex: 1.5; }
.key.correct { background: var(--correct); border-color: var(--correct); color: #fff; box-shadow: 0 0 10px var(--correct-glow); }
.key.present { background: var(--present); border-color: var(--present); color: #1a1a2e; box-shadow: 0 0 10px var(--present-glow); }
.key.absent { background: var(--absent-dark); border-color: rgba(255,255,255,0.03); color: var(--text-muted); }
.key.key-pop { animation: keyPop 150ms ease; }
@keyframes keyPop { 0%{transform:scale(1)} 50%{transform:scale(.9)} 100%{transform:scale(1)} }

/* Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,10,20,0.75); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; z-index: 500; animation: modalBgIn 300ms ease; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal-overlay.closing { animation: modalBgOut 250ms ease forwards; }
@keyframes modalBgIn { from{opacity:0} to{opacity:1} }
@keyframes modalBgOut { from{opacity:1} to{opacity:0} }
.modal-content { background: rgba(255,255,255,0.08); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--border-radius-xl); padding: 28px; max-width: 420px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg), var(--shadow-glow); animation: modalIn 300ms cubic-bezier(0.34,1.56,0.64,1); position: relative; }
.modal-overlay.closing .modal-content { animation: modalOut 250ms ease forwards; }
@keyframes modalIn { from{opacity:0;transform:scale(.85) translateY(20px)} to{opacity:1;transform:scale(1) translateY(0)} }
@keyframes modalOut { from{opacity:1;transform:scale(1) translateY(0)} to{opacity:0;transform:scale(.85) translateY(20px)} }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all var(--transition-fast); }
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); transform: rotate(90deg); }
.modal-content h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 14px; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.modal-content h3 { font-weight: 700; margin: 18px 0 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; font-size: 0.78rem; }
.modal-content p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; font-size: 0.92rem; }

/* Modal Helpers */
.help-mode-info { display: flex; gap: 6px; margin: 14px 0; justify-content: center; }
.help-mode-row { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; background: rgba(0,0,0,0.25); border-radius: var(--border-radius-sm); border: 1px solid rgba(255,255,255,0.04); font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.help-mode-row span:first-child { color: var(--text-primary); font-size: 0.9rem; }
.help-section { margin: 16px 0; }
.help-example { margin: 12px 0; padding: 12px; background: rgba(0,0,0,0.25); border-radius: var(--border-radius-md); border: 1px solid rgba(255,255,255,0.04); }
.help-tiles { display: flex; gap: 4px; margin-bottom: 8px; }
.help-tile { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.95rem; border: 2px solid var(--tile-border); border-radius: var(--border-radius-sm); color: var(--text-primary); }
.help-tile.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.help-tile.present { background: var(--present); border-color: var(--present); color: #1a1a2e; }
.help-tile.absent { background: var(--absent); border-color: rgba(255,255,255,0.06); }
.help-example p { margin: 0; font-size: 0.85rem; }
.green-text { color: var(--correct); }
.yellow-text { color: var(--present); }
.gray-text { color: var(--text-muted); }
.help-note { padding: 10px 14px; background: rgba(241,196,15,0.1); border: 1px solid rgba(241,196,15,0.2); border-radius: var(--border-radius-md); margin: 10px 0; }
.help-note p { margin: 0; font-size: 0.85rem; color: var(--present); }
.help-footer { text-align: center; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.help-footer p { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.stat-item { text-align: center; padding: 10px 4px; background: rgba(0,0,0,0.25); border-radius: var(--border-radius-md); border: 1px solid rgba(255,255,255,0.04); }
.stat-number { display: block; font-size: 1.6rem; font-weight: 900; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { display: block; font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; font-weight: 600; }
#guess-distribution { display: flex; flex-direction: column; gap: 3px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.dist-label { width: 14px; text-align: center; font-weight: 700; color: var(--text-secondary); }
.dist-bar { flex: 1; height: 22px; display: flex; align-items: center; justify-content: flex-end; padding: 0 8px; border-radius: 4px; min-width: 22px; font-weight: 700; font-size: 0.78rem; color: #fff; background: var(--absent); transition: width 500ms cubic-bezier(0.4,0,0.2,1); }
.dist-bar.highlight { background: var(--accent-gradient); box-shadow: 0 0 12px var(--accent-glow); }
.share-btn, .new-game-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; border: none; border-radius: var(--border-radius-md); font-family: var(--font-family); font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all var(--transition-normal); margin-top: 10px; }
.share-btn { background: var(--accent-gradient); color: #fff; box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow); }
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow); }
.new-game-btn, .restart-btn { background: rgba(255,255,255,0.06); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--border-radius-md); font-weight: 700; cursor: pointer; transition: all var(--transition-fast); }
.new-game-btn:hover, .restart-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }

/* ============================
   GAME: MEMORY MATCH
   ============================ */
.memory-app {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 600px; padding-top: 20px;
}
.game-header {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.game-header h2 { font-size: 1.8rem; font-weight: 800; }
.memory-stats { display: flex; gap: 20px; font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); }
.restart-btn { padding: 10px 20px; }

#memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    /* 50vh ensures 4 rows of 3/4 cards will not exceed screen height */
    max-width: min(500px, 50vh);
}

.memory-card {
    aspect-ratio: 3/4;
    perspective: 1000px;
    cursor: pointer;
}
.memory-card-inner {
    position: relative; width: 100%; height: 100%;
    text-align: center; transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
    transform-style: preserve-3d;
}
.memory-card.flipped .memory-card-inner { transform: rotateY(180deg); }

.memory-card-front, .memory-card-back {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.memory-card-front {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    font-size: 2rem; font-weight: 900; color: var(--text-muted);
}
.memory-card-front::after {
    content: '?';
}

.memory-card-back {
    background: var(--bg-card);
    border: 2px solid var(--accent-color);
    transform: rotateY(180deg);
    font-size: 3rem;
}
.memory-card.matched .memory-card-back {
    background: var(--correct);
    border-color: var(--correct);
    box-shadow: 0 0 15px var(--correct-glow);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse { from { transform: rotateY(180deg) scale(1); } to { transform: rotateY(180deg) scale(1.05); } }

/* ============================
   GAME: ALFABE
   ============================ */
.alfabe-app {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 600px; padding-top: 10px;
}

.alfabe-stats { display: flex; gap: 20px; font-weight: 700; font-size: 1.1rem; }
.red-text { color: #e74c3c; }

.alfabe-letters-track {
    display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
    margin-bottom: 30px; width: 100%; padding: 15px;
    background: rgba(255,255,255,0.03); border-radius: var(--border-radius-md);
    border: 1px solid rgba(255,255,255,0.05);
}

.alf-letter {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; border-radius: 50%;
    background: rgba(255,255,255,0.1); color: var(--text-secondary);
    transition: all 0.3s ease;
}

.alf-letter.current {
    background: var(--accent-gradient); color: #fff;
    transform: scale(1.2); box-shadow: 0 0 10px var(--accent-glow);
}

.alf-letter.correct { background: var(--correct); color: #fff; }
.alf-letter.wrong { background: #e74c3c; color: #fff; }
.alf-letter.passed { background: #f39c12; color: #fff; }

.alfabe-play-area {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; padding: 30px 20px;
    background: rgba(0,0,0,0.2); border-radius: var(--border-radius-xl);
    border: 1px solid rgba(255,255,255,0.08); text-align: center;
}

.alfabe-current-letter {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--accent-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; font-weight: 900; margin-bottom: 20px;
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.alfabe-question {
    font-size: 1.3rem; font-weight: 600; line-height: 1.5;
    margin-bottom: 30px; color: var(--text-primary);
}

.alfabe-input-area { width: 100%; display: flex; flex-direction: column; gap: 15px; }

#alfabe-input {
    width: 100%; padding: 15px 20px;
    background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-md); color: #fff;
    font-size: 1.2rem; font-family: var(--font-family); text-align: center;
    transition: all 0.3s ease;
}

#alfabe-input:focus {
    outline: none; border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.alfabe-actions { display: flex; gap: 10px; }

.btn-primary, .btn-secondary {
    flex: 1; padding: 14px; border: none; border-radius: var(--border-radius-md);
    font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
}

.btn-primary { background: var(--correct); color: #fff; box-shadow: 0 4px 10px rgba(46,204,113,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(46,204,113,0.4); }

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

/* ============================
   GAME: SUDOKU
   ============================ */
.sudoku-app {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 500px; padding-top: 10px;
}

.sudoku-controls { display: flex; gap: 10px; }
.game-select {
    background: rgba(255,255,255,0.05); color: #fff;
    border: 1px solid rgba(255,255,255,0.1); border-radius: var(--border-radius-sm);
    padding: 8px 12px; font-family: var(--font-family); outline: none; cursor: pointer;
}
.game-select option { background: var(--bg-sidebar); }

.sudoku-board-container { margin: 20px 0; background: #fff; padding: 2px; border-radius: 4px; box-shadow: var(--shadow-md); }

#sudoku-board { border-collapse: collapse; }

.sudoku-cell {
    width: clamp(30px, 9vw, 45px); height: clamp(30px, 9vw, 45px);
    border: 1px solid #ccc; text-align: center;
    font-size: clamp(1rem, 4vw, 1.4rem); font-weight: 600; color: #333;
    cursor: pointer; transition: background 0.2s;
    padding: 0; background: #fff;
}

.sudoku-cell.fixed { font-weight: 900; color: #000; background: #f0f0f0; cursor: default; }
.sudoku-cell.selected { background: #e3f2fd; }
.sudoku-cell.error { color: #e74c3c; background: #ffebee; }

/* Thick borders for 3x3 grids */
.sudoku-cell:nth-child(3n) { border-right: 2px solid #333; }
.sudoku-cell:nth-child(1) { border-left: 2px solid #333; }
tr:nth-child(3n) .sudoku-cell { border-bottom: 2px solid #333; }
tr:nth-child(1) .sudoku-cell { border-top: 2px solid #333; }

.sudoku-numpad {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; max-width: 300px;
}

.numpad-btn {
    padding: 12px 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-sm); color: #fff; font-size: 1.2rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.numpad-btn:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.numpad-clear { background: rgba(231,76,60,0.2); color: #ff7675; }

/* ============================
   GAME: COLOR MATCH
   ============================ */
.color-app {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 500px; padding-top: 20px; position: relative;
}

.color-desc { color: var(--text-secondary); margin-bottom: 20px; text-align: center; }

#color-board {
    display: grid; gap: 4px;
    width: 100%; max-width: 400px; aspect-ratio: 1;
    background: rgba(0,0,0,0.2); padding: 8px; border-radius: var(--border-radius-md);
}

.color-box {
    border-radius: 4px; cursor: pointer; transition: transform 0.1s;
}
.color-box:active { transform: scale(0.95); }

.color-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5,10,20,0.8); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center; z-index: 10;
}
.color-overlay.hidden { display: none; }

/* ============================
   GAME: SLIDER PUZZLE
   ============================ */
.slider-app {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 500px; padding-top: 20px;
}

.slider-board-container {
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-md); padding: 10px; margin-top: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

#slider-board {
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
    gap: 8px; width: clamp(240px, 70vw, 320px); height: clamp(240px, 70vw, 320px);
}

.slider-tile {
    background: var(--accent-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 800; border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); cursor: pointer; user-select: none;
    transition: transform 0.15s ease, filter 0.2s;
}

.slider-tile:active { transform: scale(0.95); filter: brightness(0.9); }
.slider-tile.empty { background: transparent; box-shadow: none; cursor: default; }
.slider-tile.empty:active { transform: none; }

/* ============================
   GAME: MINESWEEPER
   ============================ */
.minesweeper-app {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 500px; padding-top: 20px;
}
.minesweeper-stats { display: flex; gap: 20px; font-weight: 700; font-size: 1.1rem; }
.minesweeper-board-container {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-md); padding: 10px; margin-top: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}
#minesweeper-board {
    display: grid; gap: 3px;
}
.ms-cell {
    /* Fixed base size that gracefully scales down on small screens */
    width: clamp(18px, 4vmin, 36px); height: clamp(18px, 4vmin, 36px);
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem; cursor: pointer; user-select: none;
    box-shadow: inset 2px 2px 5px rgba(255,255,255,0.2), inset -2px -2px 5px rgba(0,0,0,0.2);
    transition: background 0.1s; color: transparent;
}
.ms-cell:active:not(.revealed):not(.flagged) { background: rgba(255,255,255,0.05); box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5); }
.ms-cell.revealed {
    background: rgba(255,255,255,0.05); box-shadow: inset 1px 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.02); cursor: default;
}
.ms-cell.mine { background: #e74c3c !important; color: #fff; }
.ms-cell.flagged { color: #e74c3c; }

.ms-cell.revealed.ms-1 { color: #3498db; }
.ms-cell.revealed.ms-2 { color: #2ecc71; }
.ms-cell.revealed.ms-3 { color: #e74c3c; }
.ms-cell.revealed.ms-4 { color: #9b59b6; }
.ms-cell.revealed.ms-5 { color: #f1c40f; }
.ms-cell.revealed.ms-6 { color: #e67e22; }
.ms-cell.revealed.ms-7 { color: #ecf0f1; }
.ms-cell.revealed.ms-8 { color: #95a5a6; }

/* Icons updates */
.alfabe-icon { background: #9b59b6; font-size: 1.5rem; }
.sudoku-icon { background: #34495e; }
.slider-icon { background: #e67e22; }
.minesweeper-icon { background: #c0392b; }
.color-icon { background: transparent; padding: 5px; }
.color-grid-icon {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; height: 100%;
}
.color-grid-icon span { border-radius: 4px; }
.color-grid-icon span:nth-child(1) { background: #e74c3c; }
.color-grid-icon span:nth-child(2) { background: #3498db; }
.color-grid-icon span:nth-child(3) { background: #2ecc71; }
.color-grid-icon span:nth-child(4) { background: #f1c40f; }


/* ============================
   Confetti & Scrollbar
   ============================ */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 999; }
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ============================
   Responsive Tweaks
   ============================ */
@media (max-width: 500px) {
    #parolla-app { padding: 0 6px; }
    .key { min-width: clamp(22px, 8vw, 36px); font-size: clamp(0.68rem, 2.8vw, 0.85rem); }
    .keyboard-row { gap: 3px; }
    .mode-btn { padding: 6px 14px; font-size: 0.75rem; }
    
    #memory-board { gap: 8px; }
    .game-header h2 { font-size: 1.4rem; }
    
    .alfabe-current-letter { width: 60px; height: 60px; font-size: 2rem; }
    .alfabe-question { font-size: 1.1rem; }
    .sudoku-cell { font-size: 1rem; }
}

@media (max-height: 700px) {
    #parolla-app[data-mode="4"] #game-board { max-height: 40vh; }
    #parolla-app[data-mode="5"] #game-board { max-height: 40vh; }
    #parolla-app[data-mode="6"] #game-board { max-height: 40vh; }
    .key { height: clamp(42px, 6.5vh, 50px); }
    .game-section { padding-top: 10px; }
}


/* SCADA ANIMATIONS */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes flashArrows { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }


/* =========================================
   BATTLESHIP STYLES
   ========================================= */

.battleship-icon svg {
    color: #4facfe;
    filter: drop-shadow(0 2px 4px rgba(79, 172, 254, 0.4));
}

#battleship-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    color: #fff;
}

.battleship-status {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 15px 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.battleship-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.battleship-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 242, 254, 0.3);
}

.battleship-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 242, 254, 0.5);
}

#btn-bs-start {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    box-shadow: 0 4px 10px rgba(67, 233, 123, 0.3);
}
#btn-bs-start:hover {
    box-shadow: 0 6px 15px rgba(67, 233, 123, 0.5);
}

#battleship-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.board-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.board-wrapper h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #e0e0e0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.bs-board {
    display: grid;
    grid-template-columns: repeat(10, 35px);
    grid-template-rows: repeat(10, 35px);
    gap: 2px;
    background: #1a2a40;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(79, 172, 254, 0.2);
    border: 2px solid #2a3a50;
}

.bs-cell {
    width: 35px;
    height: 35px;
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    user-select: none;
}

/* Water animation for empty cells */
@keyframes waterMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bs-cell:not(.has-ship):not(.hit):not(.miss) {
    background: linear-gradient(45deg, rgba(79, 172, 254, 0.1), rgba(0, 242, 254, 0.15));
    background-size: 200% 200%;
    animation: waterMove 4s ease infinite;
}

.bs-board.hidden-fleet .bs-cell.has-ship:not(.hit) {
    background: rgba(79, 172, 254, 0.1); /* Hide PC ships */
}

.bs-cell.has-ship:not(.hit) {
    background: #7f8c8d;
    border-color: #95a5a6;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.bs-cell.clickable {
    cursor: crosshair;
}
.bs-cell.clickable:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    z-index: 10;
}

.bs-cell.hit {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
    animation: hitPulse 0.5s ease;
}

.bs-cell.miss {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 0.7;
}

@keyframes hitPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); background: rgba(231, 76, 60, 0.8); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .bs-board {
        grid-template-columns: repeat(10, 28px);
        grid-template-rows: repeat(10, 28px);
    }
    .bs-cell {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    #battleship-container {
        gap: 20px;
    }
}


/* =========================================
   BATTLESHIP ADVANCED UI
   ========================================= */

.bs-btn-primary {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
    transition: all 0.3s ease;
}
.bs-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.6);
}

.bs-btn-secondary {
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bs-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hover-valid {
    background: rgba(46, 204, 113, 0.4) !important;
    border-color: #2ecc71 !important;
}

.hover-invalid {
    background: rgba(231, 76, 60, 0.4) !important;
    border-color: #e74c3c !important;
}

#bs-ship-yard div:hover {
    background: rgba(79, 172, 254, 0.3) !important;
}


/* =========================================
   BATTLESHIP DRAG & DROP + VISUALS + ANIMATIONS
   ========================================= */

.bs-ship-yard-item {
    position: relative;
    background: linear-gradient(to right, #7f8c8d, #95a5a6);
    border: 2px solid #34495e;
    border-radius: 17px;
    height: 34px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}
.bs-ship-yard-item:active {
    cursor: grabbing;
}
.bs-ship-yard-item[data-horizontal="false"] {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    display: inline-flex;
    margin-right: 10px;
    margin-bottom: 0;
}

/* Placed ships in the grid overlay */
.bs-ship-placed {
    position: absolute;
    background: linear-gradient(135deg, #7f8c8d, #34495e);
    border: 2px solid #2c3e50;
    border-radius: 17px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    z-index: 5;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Head of ship usually pointed */
.bs-ship-placed.horizontal {
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
}
.bs-ship-placed.vertical {
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
}

/* Sunk ships styling */
.bs-ship-placed.sunk {
    background: linear-gradient(135deg, #4a2323, #2c1010);
    border-color: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
}

.bs-board {
    position: relative; /* For absolute positioning of ships */
}

/* Overriding original cells to remove gray block colors for placed ships */
.bs-cell.has-ship:not(.hit) {
    background: rgba(79, 172, 254, 0.1);
    box-shadow: none;
    border-color: rgba(79, 172, 254, 0.2);
}

/* Drag over highlights */
.drag-valid {
    background: rgba(46, 204, 113, 0.5) !important;
    border-color: #2ecc71 !important;
}
.drag-invalid {
    background: rgba(231, 76, 60, 0.5) !important;
    border-color: #e74c3c !important;
}

/* Animations for firing */
.bs-cell {
    position: relative; /* To anchor effects */
}
.anim-target {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border: 2px solid #f1c40f;
    border-radius: 50%;
    animation: targetLock 0.5s forwards;
    pointer-events: none;
    z-index: 10;
}
@keyframes targetLock {
    0% { width: 50px; height: 50px; opacity: 0; }
    50% { opacity: 1; }
    100% { width: 10px; height: 10px; opacity: 1; }
}

.anim-explosion {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px; height: 10px;
    background: radial-gradient(circle, #f1c40f, #e74c3c);
    border-radius: 50%;
    animation: explode 0.5s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}
@keyframes explode {
    0% { width: 10px; height: 10px; opacity: 1; }
    50% { width: 40px; height: 40px; opacity: 0.8; }
    100% { width: 60px; height: 60px; opacity: 0; }
}

.anim-splash {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px; height: 10px;
    background: radial-gradient(circle, #fff, #3498db);
    border-radius: 50%;
    animation: splash 0.5s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}
@keyframes splash {
    0% { width: 10px; height: 10px; opacity: 1; }
    50% { width: 35px; height: 35px; opacity: 0.8; }
    100% { width: 50px; height: 50px; opacity: 0; }
}


/* =========================================
   BATTLESHIP REAL SVG VISUALS
   ========================================= */

.bs-ship-placed {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0 !important;
}
.bs-ship-placed.vertical {
    transform: rotate(90deg);
    transform-origin: 17px 17px; /* Cell center */
}

/* Base styles for yard items to show SVGs */
.bs-ship-yard-item {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    color: transparent !important; /* hide text */
}

/* Ship specifics */
[data-ship-id="carrier"] { background-image: url('assets/ships/carrier.svg'); }
[data-ship-id="battleship"] { background-image: url('assets/ships/battleship.svg'); }
[data-ship-id="cruiser"] { background-image: url('assets/ships/cruiser.svg'); }
[data-ship-id="submarine"] { background-image: url('assets/ships/submarine.svg'); }
[data-ship-id="destroyer"] { background-image: url('assets/ships/destroyer.svg'); }

.anim-svg-wrapper {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    z-index: 10;
    pointer-events: none;
}
.anim-svg-wrapper img {
    width: 100%; height: 100%;
    display: block;
}

/* Target Lock Animation */
.anim-target {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border: 3px solid #ff3b3b;
    border-radius: 50%;
    animation: targetLock 0.5s forwards;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 10px #ff3b3b;
}
@keyframes targetLock {
    0% { width: 60px; height: 60px; opacity: 0; }
    50% { opacity: 1; }
    100% { width: 15px; height: 15px; opacity: 1; border-width: 2px; }
}

/* Sidebar Layout Styles */
#game-portal-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: #0b0f19;
}

#game-portal-layout.hidden {
    display: none;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #131a2a 0%, #0d121e 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    z-index: 100;
}

.sidebar-header {
    padding: 32px 24px 24px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #ffffff, #aab4c8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    background: transparent;
    color: #8b98b0;
    border: none;
    text-align: left;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transform: translateX(4px);
}

.sidebar-btn.active {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    border-left: 3px solid #4facfe;
    font-weight: 600;
}

.sidebar-home-btn {
    margin: 0 20px 24px;
    padding: 14px;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-home-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3);
}

.game-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0b0f19;
}

.game-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Flex container for centering that doesn't cut off top when overflowing */
#section-minesweeper, #section-slider, #section-reflex, #section-memory, #section-sudoku, #section-color, #section-alfabe, #section-parolla {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 10px;
    box-sizing: border-box;
}

#section-minesweeper::before, #section-slider::before, #section-reflex::before, #section-memory::before, #section-sudoku::before, #section-color::before, #section-alfabe::before, #section-parolla::before,
#section-minesweeper::after, #section-slider::after, #section-reflex::after, #section-memory::after, #section-sudoku::after, #section-color::after, #section-alfabe::after, #section-parolla::after {
    content: '';
    margin: auto;
    flex-shrink: 0;
}

/* SCADA needs to fill the screen without padding */
#section-scada {
    display: flex;
    flex-direction: column;
    background: #2b2d35;
    overflow: hidden;
}
