/* Reset i zmienne */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body::before {
	content: '';
	position: fixed;
	left: 0;
	top: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	height: 100vh;
	z-index: -1;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(90deg, rgba(0,0,0,0.12) 0%, #ffffff 50%, rgba(0,0,0,0.12) 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
	
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px var(--shadow);
    padding: 30px 0;
    margin-bottom: 30px;
}

header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

header h1 {
    font-size: clamp(0.625rem, 2.75vw + 0.625rem, 2rem);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

header .subtitle {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 5px;
    background: var(--light);
    padding: 5px;
    border-radius: 8px;
}

.lang-btn {
    padding: 8px 14px;
    background: transparent;
    color: var(--dark);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.lang-btn:hover {
    background: white;
    color: var(--primary);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
}

.back-link:hover {
    background: var(--light);
    transform: translateX(-5px);
}

/* Navigation */
.main-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px var(--shadow);
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-form button,
.btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.search-form button:hover,
.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-clear {
    padding: 12px 24px;
    background: #ef4444;
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
}

.btn-clear:hover {
    background: #dc2626;
}

.btn-primary {
    background: var(--secondary);
}

.btn-primary:hover {
    background: #059669;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 20px var(--shadow);
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.filter-list {
    list-style: none;
}

.filter-list li {
    margin-bottom: 8px;
}

.filter-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: var(--dark);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
}

.filter-list a:hover {
    background: var(--light);
    color: var(--primary);
}

.filter-list a.active {
    background: var(--primary);
    color: white;
}

.filter-list .count {
    font-size: 0.85rem;
    color: var(--gray);
}

.filter-list a.active .count {
    color: white;
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--light);
    color: var(--dark);
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.tag.active {
    background: var(--primary);
    color: white;
}

/* Content Area */
.content {
    min-height: 500px;
}

.search-info {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow);
}

.no-results {
    background: white;
    padding: 60px 40px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
}

.no-results h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.no-results p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.game-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: var(--transition);
	position: relative;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.game-card a {
    text-decoration: none;
    color: inherit;
}

.game-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.game-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.game-card:hover .play-overlay {
    opacity: 1;
}

.play-button {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    transform: scale(0.8);
    transition: var(--transition);
}

.game-card:hover .play-button {
    transform: scale(1);
}

.game-info {
    padding: 20px;
}

.game-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.game-info p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.page-info {
    color: var(--gray);
    font-weight: 600;
}

/* Game Page */
.game-page {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 40px;
}

.game-header {
    margin-bottom: 30px;
}
.flex-row, .game-title-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;	
}
.game-title-row {

    margin-bottom: 15px;
}

.game-title-row h1 {
    flex: 1;
    margin: 0;
}

.game-header h1 {
    font-size: clamp(0.625rem, 2.75vw + 0.625rem, 2rem);
    color: var(--dark);
    margin-bottom: 15px;
}

.game-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    margin-right: 5px;
    transition: var(--transition);
}

.category-badge:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Game Container */
.game-container {
    margin-bottom: 40px;
}

.game-frame-wrapper {
    position: relative;
    width: 100%;
    background: var(--dark);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.game-frame-wrapper iframe {
    display: block;
    width: 100%;
    height: 600px;
    border: none;
}

.fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.game-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Game Details */
.game-details {
    margin-bottom: 40px;
}

.details-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

.details-section:last-child {
    border-bottom: none;
}

.details-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.details-section p {
    color: var(--gray);
    line-height: 1.8;
}

/* Similar Games */
.similar-games {
    margin-top: 40px;
}

.similar-games h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--dark);
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    text-align: center;
    color: var(--gray);
    margin-top: 40px;
}
@media (min-width: 1280px){
	body {margin-top:120px}
	header{
		position: fixed;
  top: 0;
  padding: 10px 0;
  z-index: 1000;
  width: 100%;
  background: #fff;
  -webkit-animation: headerPinnedSlideDown 400ms forwards;
  animation: headerPinnedSlideDown 400ms forwards;
  -webkit-box-shadow: 0px 1px 10px 0px rgba(0,0,0,0.1);
  box-shadow: 0px 1px 10px 0px rgba(0,0,0,0.1);
	}
	
}
/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
.filter-list {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(33.25%, 1fr));
}	
    
    .game-header h1 {
        font-size: clamp(0.625rem, 2.959vw + 0.607rem, 2.5rem);
    }
	 h2 {
        font-size: clamp(0.625rem, 2.17vw + 0.611rem, 2rem)
    }
}

@media (max-width: 768px) {
    header .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .language-switcher {
        width: 100%;
        justify-content: center;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .game-page {
        padding: 20px;
    }

    
    .game-frame-wrapper iframe {
        height: 400px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 20px 0;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    .flex-row{
		display:grid;
	}
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-frame-wrapper iframe {
        height: 300px;
    }
	.filter-list {

	grid-template-columns: 1fr;
}
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===== RATING SYSTEM ===== */
.rating-container {
	display: flex;
	gap: 0 2rem;
}

.rating-stars {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: clamp(0.625rem, 6.51vw + 0.625rem, 3.75rem);
	line-height: 1;
}
.rating-flex {
	display: flex;
	align-items: center;
	place-content: space-between;
}
.star {
    color: #fbbf24;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.star-full {
    color: #fbbf24;
}

.star-half {
    background: linear-gradient(90deg, #fbbf24 50%, #d1d5db 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.star-empty {
    color: #d1d5db;
}

.rating-text {
    margin-left: 8px;
    font-size: 16px;
    color: var(--gray);
    font-weight: 600;
}

/* Interaktywne gwiazdki */
.rating-interactive {
	display: inline-flex;
	gap: 4px;
	cursor: pointer;
	line-height: 1;
	font-size: clamp(0.625rem, 6.836vw + 0.625rem, 5rem);
}

.star-interactive {
    color: #d1d5db;
    transition: all 0.2s ease;
    cursor: pointer;
}

.star-interactive:hover,
.star-interactive.hover,
.star-interactive.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.user-rating-info {
    margin-top: 8px;
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

.rating-prompt {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
}

.rating-prompt h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.rating-message {
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

.rating-message.success {
    background: #d1fae5;
    color: #065f46;
}

.rating-message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== FAVORITES SYSTEM ===== */
.favorite-btn {
    position: relative;
    background: white;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
	 background: var(--primary);
}

.favorite-btn::before {
    content: '🤍';
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.favorite-btn.active {
    background: var(--shadow);
    border-color: var(--primary);
}

.favorite-btn.active::before {
    content: '❤️';
}

.favorite-btn.animating {
    animation: heartBeat 0.6s ease;
}

/* Loading state - ukryty na start */
.favorite-btn[style*="opacity: 0"] {
    pointer-events: none; /* Disable clicks podczas ładowania */
}
.favorite-icon {
	position: absolute;
	top: 6px;
	right: 6px;
	font-size: 50px;
	cursor: pointer;
	color: white;
	text-shadow: 0 0 4px #000;
	transition: transform .2s ease, color .2s ease;
	z-index: 5;
	line-height: 1;
}

.favorite-icon.active {
    color: red;
    transform: scale(1.2);
}

.favorite-icon:hover {
    transform: scale(1.15);
}

#favorites-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

#favorites-count {
	background: #ff4b77;
	color: #fff;
	font-size: inherit;
	aspect-ratio: 1/1;
	display: flex;
	width: 40px;
	place-content: center;
	border-radius: 25px;
	border: 2px solid black;
	align-items: center;
	height: 40px;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.2); }
}

/* Licznik ulubionych */
.favorites-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Sekcja ulubionych */
.favorites-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 30px;
}

.favorites-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.favorites-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Rating distribution */
.rating-distribution {
    margin: 20px 0;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.rating-bar-label {
    font-size: 14px;
    color: var(--gray);
    min-width: 60px;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.rating-bar-count {
    font-size: 14px;
    color: var(--gray);
    min-width: 40px;
    text-align: right;
}

/* Game card rating badge */
.game-card .rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.rating-badge .star {
    font-size: 14px;
}