/* =========================================
   PERUSASETUKSET
========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: #f4e7c1;
  background:
    linear-gradient(rgba(5, 12, 30, 0.82), rgba(5, 12, 30, 0.92)),
    url("tausta.png") center center / cover fixed;
  overflow-x: hidden;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("tausta.png") center / cover no-repeat;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    120deg,
    rgba(5, 12, 30, 0.82),
    rgba(5, 12, 30, 0.58)
  );
}

/* =========================================
   YLÄPALKKI
========================================= */

.header {
  height: 78px;
  padding: 0 7%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #08152d, #142b50);
  border-bottom: 2px solid #c9a44c;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.logo {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #f5d783;
}

.logo span {
  color: #f5d783;
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  color: #f4e7c1;
  text-decoration: none;
  font-weight: bold;
  transition: color .2s;
}

nav a:hover {
  color: #ffc75c;
}

/* =========================================
   PÄÄALUE
========================================= */

main {
  max-width: 1400px;
  margin: auto;
  padding: 65px 25px;
}

/* =========================================
   ESITTELY
========================================= */

.intro {
  text-align: center;
  margin-bottom: 55px;
}

.eyebrow {
  color: #f5d783;
  letter-spacing: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 15px;
}

.intro h1 {
  font-size: clamp(36px, 6vw, 65px);
  margin-bottom: 15px;
  color: #f5d783;
  text-shadow: 0 4px 15px #000;
}

.intro h1 span {
  color: #ffc75c;
}

.description {
  color: #e8d9b2;
  font-size: 17px;
}

/* =========================================
   PELIKORTIT (ISOT PAINIKKEET)
========================================= */

.games {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, #102344, #0b1933);
  border: 2px solid #c9a44c;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(201, 164, 76, 0.2);
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  outline: none;
  position: relative;
  user-select: none;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-8px) scale(1.02);
  border-color: #ffe7a0;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.75),
    0 0 18px rgba(245, 215, 131, 0.4);
}

.game-card:active {
  transform: translateY(-2px) scale(1.0);
}

/* Pelikannen kuva-alue ja skaalaus */
.game-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #08152d;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transform-origin: center;
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
}

.game-card:hover .game-card-media img {
  transform: scale(1.05);
  filter: brightness(1.08);
}

/* Tilamerkki kuvan kulmassa */
.card-overlay-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(8, 21, 45, 0.88);
  border: 1px solid #c9a44c;
  color: #f5d783;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.card-overlay-badge.is-soon {
  background: rgba(11, 25, 51, 0.88);
  border-color: #8c733a;
  color: #d1b87a;
}

/* Paikkamerkki kuville joita ei vielä ole */
.placeholder-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(145deg, #0e1e3b, #081226);
  color: #c9a44c;
}

.placeholder-icon {
  font-size: 56px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.game-card:hover .placeholder-icon {
  transform: scale(1.15) rotate(5deg);
}

.placeholder-title {
  font-size: 15px;
  font-weight: bold;
  color: #f5d783;
  opacity: 0.8;
  letter-spacing: 1px;
}

/* Pelikortin tekstialue */
.game-info {
  padding: 18px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(180deg, #0f2142, #0b1933);
}

.game-info h2 {
  font-size: 17px;
  margin: 0;
  color: #f5d783;
  font-weight: bold;
  line-height: 1.35;
}

/* Pelikortin iso painike */
.game-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;

  color: #f5d783;
  background: #142b50;
  border: 1px solid #c9a44c;
  border-radius: 8px;

  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.game-card:hover .game-btn {
  color: #08152d;
  background: linear-gradient(135deg, #f5d783, #ffc75c);
  border-color: #ffe7a0;
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(245, 215, 131, 0.4);
}

.game-card.is-upcoming:hover .game-btn {
  color: #f5d783;
  background: linear-gradient(135deg, #1b3662, #142b50);
  border-color: #c9a44c;
  box-shadow: none;
}

/* =========================================
   YLEISET PAINIKKEET
========================================= */

button {
  min-width: 0;
  max-width: 100%;
  padding: 8px 11px;

  color: #f5d783;
  background: #142b50;
  border: 1px solid #c9a44c;
  border-radius: 6px;

  font-size: 13px;
  font-weight: bold;
  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

button:hover {
  color: #08152d;
  background: #f5d783;
  border-color: #ffe7a0;
  transform: scale(1.04);
}

button:focus-visible {
  outline: 2px solid #ffe7a0;
  outline-offset: 2px;
}

/* =========================================
   LISÄTIETOLAATIKKO
========================================= */

.info-box {
  display: none;
  max-width: 600px;
  margin: 50px auto 0;
  padding: 30px;
  text-align: center;
  background: linear-gradient(145deg, #102344, #0b1933);
  border: 1px solid #c9a44c;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

.info-box h2 {
  color: #f5d783;
  margin-bottom: 15px;
}

.info-box p {
  line-height: 1.6;
  margin-bottom: 20px;
  color: #e8d9b2;
}

/* =========================================
   TILATEKSTI
========================================= */

.status {
  text-align: center;
  margin-top: 25px;
  color: #f5d783;
  font-weight: bold;
  font-size: 16px;
  min-height: 24px;
  transition: all 0.3s ease;
}

.status.visible {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(16, 35, 68, 0.95);
  border: 1px solid #c9a44c;
  border-radius: 8px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(201, 164, 76, 0.3);
}

/* =========================================
   ALATUNNISTE
========================================= */

footer {
  text-align: center;
  padding: 25px;
  color: #c9b783;
  background: rgba(5, 13, 29, 0.92);
  border-top: 1px solid #8f7134;
  font-size: 12px;
  letter-spacing: 2px;
}

/* =========================================
   MOBIILINÄKYMÄ
========================================= */

@media (max-width: 1050px) {
  .games {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
}

@media (max-width: 580px) {
  .header {
    padding: 0 18px;
  }

  .logo {
    font-size: 19px;
  }

  nav {
    gap: 13px;
  }

  main {
    padding: 45px 16px;
  }

  .games {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 380px;
    margin: 0 auto;
  }

  .game-info {
    padding: 14px 12px;
  }
}