.templates-page {
    min-height: 100vh;
    padding: 20px;
}

.glass-container {
    max-width: 1450px;
    margin: 40px auto 0;
    background: rgba(15, 30, 60, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(152, 231, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 60px rgba(92, 188, 255, 0.1) inset;
    position: relative;
}

.page-header-wrapper {
    max-width: 100%;
    margin: 0 0 40px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 25px;
    flex: 0 0 auto;
}

.page-header-logo {
    height: 100px;
    width: auto;
}

.page-header-text {
    text-align: left;
}

.page-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    margin-bottom: 5px;
    background: linear-gradient(90deg, #98e7ff, #5cbcff 60%, #9ec7ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-header p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

.templates-controls {
    max-width: 100%;
    margin: 0 0 30px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls-group .search-bar {
    flex: 0 0 auto;
    width: auto;
    min-width: 150px;
    transition: all 0.3s ease;
}

.controls-group .search-bar input {
    width: 150px;
    transition: width 0.3s ease;
}

.controls-group .search-bar:hover input,
.controls-group .search-bar:focus-within input {
    width: 300px;
}

.search-bar {
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    background: rgba(15, 30, 60, 0.6);
    border: 1px solid rgba(92, 188, 255, 0.3);
    border-radius: 8px;
    color: #98e7ff;
    font-size: 14px;
    transition: all 0.3s ease;
    height: 36px;
    box-sizing: border-box;
}

.search-bar input:focus {
    outline: none;
    border-color: #5cbcff;
    box-shadow: 0 0 20px rgba(92, 188, 255, 0.5);
}

.search-bar input::placeholder {
    color: rgba(152, 231, 255, 0.5);
}

.search-bar i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #98e7ff;
    font-size: 14px;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.category-btn {
    padding: 10px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 25px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-count {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
    margin-left: 4px;
}

.category-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(92, 188, 255, 0.4), 0 0 20px rgba(92, 188, 255, 0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, #5cbcff, #3a9eff);
    color: #0a1628;
    border-color: #5cbcff;
    box-shadow: 0 0 15px rgba(92, 188, 255, 0.7), 0 0 30px rgba(92, 188, 255, 0.4);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.category-btn.ghost-visited {
    background: linear-gradient(135deg, #9D4EDD, #7b2cbf);
    color: #ffffff;
    border-color: #9D4EDD;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.7), 0 0 30px rgba(157, 78, 221, 0.4);
    text-shadow: 0 0 5px rgba(157, 78, 221, 0.5);
    transition: all 0.3s ease;
}

/* Efekt uderzenia duszka w przycisk */
.category-btn.ghost-bump {
    animation: buttonBump 0.3s ease-out;
}

@keyframes buttonBump {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
        box-shadow: 0 8px 20px rgba(157, 78, 221, 0.6);
    }
    100% {
        transform: translateY(0);
    }
}

/* Latający duszek */
.flying-ghost-container {
    position: relative;
    height: 0;
    overflow: visible;
    pointer-events: none;
}

.flying-ghost-container::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    height: 2px;
    background-image: repeating-linear-gradient(
        to right,
        rgba(157, 78, 221, 0.5) 0,
        rgba(157, 78, 221, 0.5) 10px,
        transparent 10px,
        transparent 20px
    );
    pointer-events: none;
}

.flying-ghost {
    width: 40px;
    height: 40px;
    position: absolute;
    top: -10px;
    left: -50px;
    animation: flyGhost 20s ease-in-out infinite, ghostWobble 2s ease-in-out infinite;
    opacity: 1;
}

.flying-ghost .ghost-body {
    --ghost-color: #9D4EDD;
}

.flying-ghost .ghost-eye {
    animation: blink 2.5s infinite;
}

@keyframes flyGhost {
    0% {
        left: 0;
    }
    50% {
        left: calc(100% - 40px);
    }
    100% {
        left: 0;
    }
}

@keyframes ghostWobble {
    0%, 100% {
        transform: rotate(0deg);
    }
    15% {
        transform: rotate(-3deg);
    }
    30% {
        transform: rotate(2deg);
    }
    45% {
        transform: rotate(-2deg);
    }
    60% {
        transform: rotate(3deg);
    }
    75% {
        transform: rotate(-1deg);
    }
}

.templates-stats {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 20px;
}

.sort-controls,
.perpage-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-select,
.per-page-select {
    padding: 8px 12px;
    background: rgba(15, 30, 60, 0.6);
    border: 1px solid rgba(92, 188, 255, 0.3);
    border-radius: 8px;
    color: #98e7ff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.sort-select:hover,
.per-page-select:hover {
    border-color: rgba(92, 188, 255, 0.6);
    background: rgba(15, 30, 60, 0.8);
    box-shadow: 0 0 15px rgba(92, 188, 255, 0.3);
}

.sort-select:focus,
.per-page-select:focus {
    border-color: #5cbcff;
    box-shadow: 0 0 20px rgba(92, 188, 255, 0.5);
}

.sort-select option,
.per-page-select option {
    background: rgba(15, 30, 60, 0.95);
    color: #98e7ff;
}

.stats-text {
    flex: 1;
    min-width: 200px;
    text-align: left;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 30px;
}

.pagination-btn {
    padding: 8px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--accent);
    color: var(--bg1);
    border-color: var(--accent);
}

.pagination-info {
    color: var(--muted);
    font-size: 13px;
    padding: 0 10px;
}

.per-page-select {
    padding: 8px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.per-page-select:hover {
    border-color: var(--accent);
}

.templates-grid {
    max-width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0;
}

.template-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 208, 255, 0.3);
    border-color: var(--accent);
}

.template-preview {
    width: 100%;
    aspect-ratio: 3/4;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
}

.template-info {
    padding: 15px;
}

.template-name-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.template-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-info-btn {
    background: linear-gradient(135deg, rgba(92, 188, 255, 0.15), rgba(92, 188, 255, 0.25));
    border: 1px solid rgba(92, 188, 255, 0.4);
    border-radius: 6px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.template-info-btn:hover {
    background: linear-gradient(135deg, var(--accent), rgba(92, 188, 255, 0.9));
    color: var(--bg1);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(92, 188, 255, 0.6);
}

.template-info-btn i {
    font-size: 12px;
}

.template-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.template-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    background: linear-gradient(135deg, #1a4080, #0b2550);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 208, 255, 0.3);
    border-color: var(--accent);
}

.template-btn.btn-primary {
    background: linear-gradient(135deg, #2a5598, #1a4080);
}

.template-btn.btn-download-zip {
    background: #28a745;
    border-color: rgba(255, 255, 255, 0.3);
}

.template-btn.btn-download-zip:hover {
    background: #218838;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.template-btn.btn-download-atr {
    background: #dc3545;
    border-color: rgba(255, 255, 255, 0.3);
}

.template-btn.btn-download-atr:hover {
    background: #c82333;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.template-btn.btn-download-xex {
    background: #fd7e14;
    border-color: rgba(255, 255, 255, 0.3);
}

.template-btn.btn-download-xex:hover {
    background: #e8670e;
    box-shadow: 0 6px 20px rgba(253, 126, 20, 0.4);
}

.no-templates {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.no-templates i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-templates h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    margin-bottom: 10px;
}

.back-button {
    position: absolute;
    top: 10px;
    left: 10px;
    height: 40px;
    padding: 0 15px;
    background: rgba(15, 30, 60, 0.8);
    border: 1px solid rgba(152, 231, 255, 0.3);
    border-radius: 8px;
    color: #98e7ff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 20;
    white-space: nowrap;
}

.back-button i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.back-button:hover {
    background: rgba(15, 30, 60, 0.95);
    border-color: rgba(152, 231, 255, 0.6);
    box-shadow: 0 0 20px rgba(92, 188, 255, 0.4);
    transform: scale(1.05);
}

.back-button:hover i {
    transform: translateX(-3px);
}

.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: var(--accent);
}

.loading-spinner i {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

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

/* Modal informacji o szablonie */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.info-modal.active {
    display: flex;
}

.info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.info-modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(11, 37, 80, 0.95);
    border: 1px solid rgba(99, 208, 255, 0.3);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                0 0 40px rgba(99, 208, 255, 0.1);
    backdrop-filter: blur(20px);
    animation: slideUp 0.4s ease;
    color: var(--text);
}

.info-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.info-modal-close:hover {
    background: rgba(220, 53, 69, 0.8);
    border-color: #dc3545;
    transform: rotate(90deg);
}

.info-modal-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--accent);
}

.info-modal-meta {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(99, 208, 255, 0.2);
}

.info-modal-body {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 25px;
    color: var(--text);
}

.info-modal-screenshots {
    margin-bottom: 25px;
}

.info-modal-screenshots h3,
.info-modal-video h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--accent);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.screenshot-item {
    aspect-ratio: 4/3;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(99, 208, 255, 0.2);
    transition: all 0.3s ease;
}

.screenshot-item:hover {
    transform: scale(1.05);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(99, 208, 255, 0.3);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-modal-video {
    margin-bottom: 20px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid rgba(99, 208, 255, 0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

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

/* Responsive dla modala */
@media (max-width: 768px) {
    .glass-container {
        padding: 20px;
        border-radius: 15px;
    }
    
    .page-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .page-header-text {
        text-align: center;
    }
    
    .page-header-logo {
        height: 50px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header-wrapper .search-bar {
        width: 100%;
        max-width: none;
    }
    
    .info-modal-content {
        padding: 25px;
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .info-modal-content h2 {
        font-size: 22px;
    }
    
    .screenshots-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== SYSTEM OCEN GWIAZDKOWYCH ===== */
.template-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rating-stars {
    display: flex;
    gap: 4px;
}

.rating-star {
    font-size: 18px;
    color: #4a9eff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 0 3px rgba(74, 158, 255, 0.5);
}

.rating-star:hover,
.rating-star.hover {
    color: #ffd700;
    transform: scale(1.15);
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

.rating-star.active {
    color: #ffd700;
}

.rating-star.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.rating-info {
    font-size: 13px;
    color: var(--muted);
    margin-left: 4px;
}

.rating-average {
    font-weight: 600;
    color: #ffd700;
}

.rating-count {
    opacity: 0.7;
}

.rating-user-voted {
    font-size: 11px;
    color: #4CAF50;
    font-weight: 500;
}

/* ===== STOPKA Z PAC-MANEM ===== */
.page-footer {
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
    position: relative;
}

.pacman-container {
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.pacman-container.hidden {
    display: none;
}

.flying-ghost-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.flying-ghost-container.hidden::before {
    opacity: 0;
}

/* Przycisk toggle Pac-Mana */
.pacman-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 40px;
    padding: 0 15px;
    background: rgba(15, 30, 60, 0.8);
    border: 1px solid rgba(152, 231, 255, 0.3);
    border-radius: 8px;
    color: #F2D648;
    font-size: 14px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.pacman-toggle i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.pacman-toggle-text {
    font-weight: 500;
    color: #98e7ff;
}

.pacman-toggle:hover {
    background: rgba(15, 30, 60, 0.95);
    border-color: rgba(152, 231, 255, 0.6);
    box-shadow: 0 0 20px rgba(92, 188, 255, 0.4);
    transform: scale(1.05);
}

.pacman-toggle.active {
    color: #ff4444;
}

.pacman-toggle.active .pacman-toggle-text {
    color: #ff4444;
}

.pacman-toggle:hover i {
    transform: scale(1.2);
}

.pacman-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Pac-Man */
.pacman {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #F2D648;
    position: absolute;
    animation: movePacmanAround 20s linear infinite;
}

/* Animacja ruchu dookoła boksu */
@keyframes movePacmanAround {
    0% {
        top: -30px;
        left: -30px;
        transform: rotate(0deg);
    }
    23% {
        top: -30px;
        left: calc(100% - 30px);
        transform: rotate(0deg);
    }
    25% {
        top: -30px;
        left: calc(100% - 30px);
        transform: rotate(90deg);
    }
    48% {
        top: calc(100% - 30px);
        left: calc(100% - 30px);
        transform: rotate(90deg);
    }
    50% {
        top: calc(100% - 30px);
        left: calc(100% - 30px);
        transform: rotate(180deg);
    }
    73% {
        top: calc(100% - 30px);
        left: -30px;
        transform: rotate(180deg);
    }
    75% {
        top: calc(100% - 30px);
        left: -30px;
        transform: rotate(270deg);
    }
    98% {
        top: -30px;
        left: -30px;
        transform: rotate(270deg);
    }
    100% {
        top: -30px;
        left: -30px;
        transform: rotate(360deg);
    }
}

/* Duszki */
.ghost {
    width: 50px;
    height: 50px;
    position: absolute;
    animation: moveGhostAround 20s linear infinite, ghostWobble 2s ease-in-out infinite;
    z-index: 1;
}

.ghost-red {
    animation-delay: calc(var(--delay, 0) * -1s);
}

.ghost-pink {
    animation-delay: calc(var(--delay, 2) * -1s);
}

.ghost-cyan {
    animation-delay: calc(var(--delay, 4) * -1s);
}

.ghost-orange {
    animation-delay: calc(var(--delay, 6) * -1s);
}

.ghost-body {
    width: 100%;
    height: 100%;
    background: var(--ghost-color);
    border-radius: 50% 50% 0 0;
    position: relative;
    overflow: hidden;
}

.ghost-red .ghost-body {
    --ghost-color: #FF0000;
}

.ghost-pink .ghost-body {
    --ghost-color: #FFB8FF;
}

.ghost-cyan .ghost-body {
    --ghost-color: #00FFFF;
}

.ghost-orange .ghost-body {
    --ghost-color: #FFB852;
}

.ghost-eyes {
    position: absolute;
    top: 15px;
    left: 12px;
    display: flex;
    gap: 10px;
    z-index: 2;
}

.ghost-eye {
    width: 8px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: relative;
}

.ghost-eye::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
    top: 6px;
    left: 2px;
}

/* Mruganie oczu - każdy duszek inaczej */
.ghost-red .ghost-eye {
    animation: blink 3s infinite;
}

.ghost-pink .ghost-eye {
    animation: blink 4s infinite;
}

.ghost-cyan .ghost-eye {
    animation: blink 3.5s infinite;
}

.ghost-orange .ghost-eye {
    animation: blink 4.5s infinite;
}

@keyframes blink {
    0%, 90%, 100% {
        clip-path: inset(0 0 0 0);
    }
    95% {
        clip-path: inset(85% 0 0 0);
    }
}

.ghost-tail {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    display: flex;
    background: var(--ghost-color);
    z-index: 1;
}

.ghost-tail div {
    flex: 1;
    height: 100%;
    background: var(--ghost-color);
    position: relative;
}

.ghost-tail div::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(15, 30, 60, 0.95);
    border-radius: 50% 50% 0 0;
}

@keyframes moveGhostAround {
    0% {
        top: -30px;
        left: -30px;
    }
    23% {
        top: -30px;
        left: calc(100% - 30px);
    }
    25% {
        top: -30px;
        left: calc(100% - 30px);
    }
    48% {
        top: calc(100% - 30px);
        left: calc(100% - 30px);
    }
    50% {
        top: calc(100% - 30px);
        left: calc(100% - 30px);
    }
    73% {
        top: calc(100% - 30px);
        left: -30px;
    }
    75% {
        top: calc(100% - 30px);
        left: -30px;
    }
    98% {
        top: -30px;
        left: -30px;
    }
    100% {
        top: -30px;
        left: -30px;
    }
}

.pacman__eye {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: 14px;
    right: 24px;
    background: #333333;
}

.pacman__mouth {
    background: rgba(15, 30, 60, 0.95);
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: polygon(100% 74%, 44% 48%, 100% 21%);
    animation: eat 0.5s ease-in-out infinite;
}

/* Animacja pyszczka Pac-Mana */
@keyframes eat {
    0% {
        clip-path: polygon(100% 74%, 44% 48%, 100% 21%);
    }
    25% {
        clip-path: polygon(100% 60%, 44% 48%, 100% 40%);
    }
    50% {
        clip-path: polygon(100% 50%, 44% 48%, 100% 50%);
    }
    75% {
        clip-path: polygon(100% 59%, 44% 48%, 100% 35%);
    }
    100% {
        clip-path: polygon(100% 74%, 44% 48%, 100% 21%);
    }
}

/* Kulki po obwodzie */
.dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.dot {
    width: 10px;
    height: 10px;
    background: #98e7ff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(92, 188, 255, 0.6);
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.dot.eaten {
    opacity: 0;
    transform: scale(0);
}

.footer-text {
    color: #98e7ff;
    font-size: 13px;
    margin: 8px 0 5px;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(92, 188, 255, 0.3);
}

.footer-copyright {
    color: rgba(152, 231, 255, 0.6);
    font-size: 12px;
    margin-top: 3px;
    margin-bottom: 15px;
}

/* Responsywność stopki */
@media (max-width: 768px) {
    .pacman-container {
        height: 50px;
    }
    
    .pacman {
        width: 40px;
        height: 40px;
    }
    
    .pacman__eye {
        width: 6px;
        height: 6px;
        top: 10px;
        right: 16px;
    }
    
    .dot {
        width: 7px;
        height: 7px;
    }
    
    .footer-text {
        font-size: 12px;
    }
    
    .footer-copyright {
        font-size: 11px;
    }
}
