/* pacman-FINAL.css - GPU Accelerated, No Pulse Animation */

/* ============================================
   GŁÓWNY LAYOUT - 3 KOLUMNY
   ============================================ */

body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#layout {
    display: grid;
    grid-template-columns: 400px 900px 400px;
    align-items: center;
    gap: 80px;
    max-width: 1860px;
    padding: 20px;
}

#app {
    position: relative;
    width: 900px;
    height: 900px;
}

/* ============================================
   BANERY
   ============================================ */

.side-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 400px;
}

.side-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1900px) {
    #layout {
        grid-template-columns: 350px 900px 350px;
        gap: 60px;
    }
    .side-banner {
        width: 350px;
    }
}

@media (max-width: 1700px) {
    #layout {
        grid-template-columns: 250px 900px 250px;
        gap: 40px;
    }
    .side-banner {
        width: 250px;
    }
}

@media (max-width: 1400px) {
    #layout {
        grid-template-columns: 900px;
        gap: 0;
    }
    .side-banner {
        display: none;
    }
}

@media (max-width: 950px) {
    #layout {
        padding: 10px;
    }
    #app {
        width: 100%;
        max-width: 900px;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

/* ============================================
   EKRANY GRY
   ============================================ */

.screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* ============================================
   MAIN MENU
   ============================================ */

#main-menu {
    text-align: center;
    z-index: 1;
}

#main-menu h1 {
    font-size: 48px;
    color: #fbbf24;
    margin-bottom: 40px;
    text-shadow: 3px 3px 0px #000;
}

.menu-button {
    display: block;
    width: 300px;
    margin: 20px auto;
    padding: 15px 30px;
    font-size: 24px;
    font-family: monospace;
    background: #1e40af;
    color: #fff;
    border: 3px solid #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    position: relative;
    z-index: 5;
}

.menu-button:hover {
    background: #3b82f6;
    transform: scale(1.05);
}

.menu-button:active {
    transform: scale(1.0);
    background: #1e3a8a;
}

/* ============================================
   OPTIONS MENU
   ============================================ */

#options-menu {
    padding: 40px;
    overflow-y: auto;
    z-index: 20;
}

#options-menu h2 {
    text-align: center;
    font-size: 36px;
    color: #fbbf24;
    margin-bottom: 30px;
}

.option-group {
    margin: 30px 0;
    padding: 20px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
}

.option-group h3 {
    color: #fbbf24;
    margin-bottom: 15px;
    text-align: center;
}

.difficulty-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.difficulty-btn {
    padding: 10px 20px;
    font-family: monospace;
    font-size: 14px;
    background: #333;
    color: #fff;
    border: 2px solid #666;
    cursor: pointer;
    transition: all 0.2s;
}

.difficulty-btn:hover {
    background: #444;
    border-color: #888;
}

.difficulty-btn.selected {
    background: #4CAF50;
    border-color: #4CAF50;
    font-weight: bold;
}

.back-button {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 10px 20px;
    font-family: monospace;
    background: #666;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.back-button:hover {
    background: #777;
}

#btc-info {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    font-size: 14px;
    color: #fbbf24;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
}

/* ============================================
   SCORES MENU
   ============================================ */

#scores-menu {
    padding: 40px;
    text-align: center;
    overflow-y: auto;
    z-index: 20;
}

#scores-menu h2 {
    font-size: 36px;
    color: #fbbf24;
    margin-bottom: 30px;
}

#scores-table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 30px;
    border-collapse: collapse;
    font-size: 18px;
}

#scores-table th {
    background: #1e40af;
    color: #fff;
    padding: 12px;
    border: 2px solid #fff;
    font-weight: bold;
}

#scores-table td {
    padding: 12px;
    border: 2px solid #333;
    background: #1a1a1a;
}

#scores-table tr:hover td {
    background: #2a2a2a;
}

#scores-table .rank-1 {
    color: #ffd700;
    font-weight: bold;
    font-size: 20px;
}

#scores-table .rank-2 {
    color: #c0c0c0;
    font-weight: bold;
}

#scores-table .rank-3 {
    color: #cd7f32;
    font-weight: bold;
}

/* ============================================
   GAME SCREEN
   ============================================ */

#game-screen {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    z-index: 20;
}

#game-screen.active {
    display: flex;
}

#info {
    text-align: center;
    margin-bottom: 10px;
    font-size: 18px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
}

#game-container {
    position: relative;
    width: 900px;
    height: 900px;
    background: #000;
    border: 3px solid #333;
    margin: 0 auto;
}

/* ============================================
   ELEMENTY GRY - GPU ACCELERATED
   ============================================ */

.wall {
    position: absolute;
    background: #1e40af;
}

.pellet,
.powerup,
.pacman,
.ghost {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

.pellet {
    background: #fbbf24;
    border-radius: 50%;
}

.powerup {
    background: #06b6d4;
    border-radius: 50%;
}

.teleport {
    position: absolute;
    background: #a855f7;
    opacity: 0.5;
    animation: teleport-glow 2s ease-in-out infinite;
}

@keyframes teleport-glow {
    0%, 100% {
        box-shadow: 0 0 10px #a855f7;
    }
    50% {
        box-shadow: 0 0 20px #a855f7;
    }
}

.pacman {
    background: #fbbf24;
    border-radius: 50%;
    z-index: 10;
}

.ghost {
    border-radius: 50%;
    z-index: 5;
    transition: background 0.2s;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ============================================
   ANIMACJE
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

#options-menu::-webkit-scrollbar,
#scores-menu::-webkit-scrollbar {
    width: 8px;
}

#options-menu::-webkit-scrollbar-track,
#scores-menu::-webkit-scrollbar-track {
    background: #1a1a1a;
}

#options-menu::-webkit-scrollbar-thumb,
#scores-menu::-webkit-scrollbar-thumb {
    background: #fbbf24;
    border-radius: 4px;
}

#options-menu::-webkit-scrollbar-thumb:hover,
#scores-menu::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* ============================================
   GPU PERFORMANCE HINTS
   ============================================ */

#game-container {
    will-change: contents;
    contain: layout style paint;
}

body {
    contain: layout style;
}