:root {
  --green: #0e8a45;
  --green-dark: #0a6e38;
  font-family: 'Montserrat', sans-serif;
}

/* RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #fff;
  color: #111;
}

/* ----------- GAME PAGE ----------- */

.game-page {
  width: 100%;
  padding: 0px 16px 0px 16px;
}

/* ----------- PAGE CONTENT ----------- */
.page {
  width: 100%;
  padding: 100px 16px 10px 16px;
}

.section {
  margin-top: 22px;
}

.section h2 {
  color: var(--green-dark);
  font-size: 1.2rem;
  font-weight: 700;
  padding-bottom: 10px;
}

.row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 14px;
}

.card {
  overflow: hidden; /* Ważne, aby ukryć to, co wychodzi poza kartę przy powiększaniu */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative; /* Potrzebne dla pozycjonowania overlay i label */
}

.card img {
  width: 100%;
  border-radius: 4px;
}

.label {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

/* Kontener grid, który już wcześniej zdefiniowaliśmy */
.best-games-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr); 
    gap: 15px;
}

/* Karta gry (podstawowe style) */
.best-card {
    overflow: hidden; /* Ważne, aby ukryć to, co wychodzi poza kartę przy powiększaniu */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative; /* Potrzebne dla pozycjonowania overlay i label */
}

/* Link do gry - ustawiamy go jako blok i relative, by label był względem niego */
.game-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none; /* Usuń podkreślenie linku */
    color: inherit; /* Zachowaj kolor tekstu */
}

/* Wrapper obrazka, aby obrazek mógł się skalować niezależnie */
.game-image-wrapper {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-out; /* Płynna animacja powiększania */
}

/* Obrazek w środku */
.game-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Usuń dodatkowy margines pod obrazem */
}

/* Etykieta/tytuł gry */
.game-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 10px;
    background: linear-gradient(180deg,transparent 0,#000); /* Gradient dla lepszej czytelności */
    color: white;
    font-size: 1em;
    font-weight: bold;
    text-align: left;
    transform: translateY(100%); /* Początkowo ukryty poniżej karty */
    transition: transform 0.3s ease-out; /* Płynna animacja pojawiania się */
    opacity: 0; /* Początkowo niewidoczny */
    pointer-events: none; /* Pozwala klikać na link pod spodem */
}

.game-label .game-title {
    display: block; /* Upewnij się, że span zachowuje się jak blok */
    white-space: nowrap; /* Zapobiega łamaniu się tekstu */
    overflow: hidden; /* Ukrywa przepełniony tekst */
    text-overflow: ellipsis; /* Dodaje "..." do przepełnionego tekstu */
}


/* Efekty po najechaniu kursorem na cały link do gry */
.game-link:hover .game-image-wrapper {
    transform: scale(1.1); /* Powiększenie obrazka o 10% */
}

.game-link:hover .game-label {
    transform: translateY(0); /* Pokaż etykietę (przesuń w górę) */
    opacity: 1; /* Spraw, by była widoczna */
}

/* Style dla dużej i małej karty (jeśli są inne proporcje, możesz je dostosować tutaj) */
.best-card--large {
    grid-column: span 2; 
    grid-row: span 2; 
}

.best-card--small {
    grid-column: span 1;
    grid-row: span 1;
}

.footer {
  background: #0e8a45;
  padding: 18px 0;
  width: 100%;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-copy {
  color: #ffffff;
  font-size: 14px;
  white-space: nowrap;
  font-weight: 600;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  max-width: 1400px;
  margin: 20px auto;
  padding: 100px 16px 5px 16px;
}

/* LEWA STRONA — GRA */
.game-main { width: 100%; }

.game-main h2 {
  color: var(--green-dark);
  font-size: 2rem;
  font-weight: 700;
  padding-bottom: 10px;
}

.game-embed iframe {
  width: 100%;
  height: 600px;
  background: #000;
}

.alert-success {
    background-color: #e6ffed;
    color: #006622;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 600;
}

.game-rating h3 {
    margin-bottom: 5px;
}

.current-rating-info {
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* BANER REKLAMOWY */
.game-ad {
  margin-top: 35px;
}

.game-ad img {
  width: 100%;
  border-radius: 6px;
}

/* PRAWA KOLUMNA */

.sidebar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.sidebar-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.game-sidebar {
  padding-top: 10px;
}

.game-sidebar h3 {
  color: var(--green-dark);
  font-size: 1.2rem;
  font-weight: 700;
  padding-bottom: 10px;
}

.sidebar-card img {
  width: 100%;
}

.sidebar-card span {
  display: block;
  padding: 8px;
  font-weight: 600;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.pagination-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 5px;
}

.pagination-nav li {
    display: inline;
}

.pagination-nav a,
.pagination-nav span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

.pagination-nav a:hover {
    background-color: #f1f1f1;
}

.pagination-nav li.active span {
    background-color: #0ea45f; /* Kolor z logo OnlyGames */
    color: white;
    border-color: #0ea45f;
}

.pagination-nav li.disabled span {
    color: #ccc;
    cursor: not-allowed;
}

.pagination-nav li.disabled.dots span {
    border: none;
    background: transparent;
    padding: 8px 0;
    color: #666;
    font-size: 1.2em;
}

/* TEXT CONTAINER */

.text-container {
  max-width: 900px;
  margin: auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.text-container h1 {
  color: var(--green-dark); /* Główny kolor strony */
  padding-bottom: 10px;
  margin-top: 0;
  text-align: center;
}

.text-container h2 {
  color: var(--green-dark); /* Akcentujący kolor sekcji */
  margin-top: 30px;
  padding-left: 15px;
  border-left: 5px solid var(--green-dark);
}

.text-container p {
  margin-bottom: 15px;
}

.text-container .highlight {
  font-weight: bold;
  color: var(--green-dark); /* Czerwony kolor dla wyróżnienia kluczowych fraz */
}

.text-container .cta {
  background-color: var(--green-dark);
  padding: 15px;
  border-radius: 5px;
  text-align: center;
  font-size: 1.2em;
  margin-top: 40px;
  font-weight: bold;
}

.text-container .cta a {
  color: #333;
  text-decoration: none;
}

.text-container .icon {
  color: #007bff;
  margin-right: 8px;
}

.text-container .list-style {
  padding-left: 20px;
}

.text-container .list-style li {
  margin-bottom: 5px;
}

/* MOBILE — prawa kolumna pod spodem */
@media (max-width: 1118px) {
  .page {
    padding: 60px 16px;
  }
  .game-layout {
    padding: 60px 16px;
  }
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  
  .game-sidebar {
    margin-top: 30px;
  }

  .game-main h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  .game-embed iframe {
    height: 400px;
  }
  
  .game-main h2 {
    font-size: 1.2rem;
  }
  .section h2 {
    font-size: 1rem;
  }
}

/* Responsive grid */
@media (max-width: 1200px) {
  .row {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (max-width: 1000px) {
  .row {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 720px) {
  .row {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .row {
    grid-template-columns: repeat(2, 1fr);
  }
}