/* ── Krabsy — Shared Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;900&display=swap');

:root {
  --ocean-deep: #0288d1;
  --coral: #ff6b6b;
  --teal: #00c49a;
  --teal-dark: #00a882;
  --sand-gold: #ffd166;
  --white: #fff;
  --bg: #f0f7fa;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.12);
  --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.18);
  --radius: 12px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.logo-krab {
  color: var(--ocean-deep);
}

.logo-sy {
  color: var(--coral);
}

.logo-crab {
  font-size: 1.4rem;
  margin-left: 2px;
}

.lang-toggle {
  display: flex;
  gap: 0;
  background: #e8f0f3;
  border-radius: 20px;
  overflow: hidden;
}

.lang-btn {
  border: none;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 14px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.lang-btn.active {
  background: var(--ocean-deep);
  color: var(--white);
  border-radius: 20px;
}

/* ── Tagline ── */
.tagline {
  font-family: 'Fredoka One', cursive;
  text-align: center;
  font-size: 1.15rem;
  color: var(--ocean-deep);
  padding: 16px 20px 4px;
}

/* ── Game Grid ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 600px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 24px 40px;
  }
}

@media (min-width: 960px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 32px 48px;
  }
}

@media (min-width: 1200px) {
  .game-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Game Card ── */
.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  aspect-ratio: 16 / 9;
  background: #1a2a3a;
}

.game-card:hover {
  transform: scale(1.03);
  box-shadow: var(--card-shadow-hover);
}

.game-card.coming-soon {
  cursor: default;
}

.game-card.coming-soon:hover {
  transform: none;
  box-shadow: var(--card-shadow);
}

/* Card thumbnail */
.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder card (no thumbnail) */
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--white);
  text-align: center;
  padding: 16px;
}

.card-placeholder.topic-irregular_verbs {
  background: linear-gradient(135deg, #0288d1, #00c49a);
}

.card-placeholder.topic-tenses {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
}

.card-placeholder.topic-vocabulary {
  background: linear-gradient(135deg, #ff6b6b, #ffd166);
}

.card-placeholder-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.card-placeholder-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  line-height: 1.2;
}

.card-placeholder-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 10px;
  margin-top: 2px;
}

/* ── Card Overlay (game name + description) ── */
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: var(--white);
  padding: 24px 10px 8px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.game-card:hover .card-overlay {
  transform: translateY(0);
}

.card-overlay-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.85rem;
  line-height: 1.2;
}

.card-overlay-desc {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 2px;
  line-height: 1.3;
}

/* Mobile: always show name bar */
@media (max-width: 599px) {
  .card-overlay {
    transform: translateY(0);
    background: rgba(0,0,0,0.6);
    padding: 6px 8px;
  }

  .card-overlay-desc {
    display: none;
  }
}

/* ── Game Page ── */
.game-page-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ocean-deep);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 0 8px;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

.game-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: #1a2a3a;
  padding-bottom: 12px;
}

.game-iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow-hover);
  background: #1a1a2e;
  margin-bottom: 24px;
}

.game-iframe-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Grid heading on game page */
.grid-heading {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: var(--ocean-deep);
  padding: 8px 16px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 600px) {
  .grid-heading {
    padding: 8px 24px;
  }
}

@media (min-width: 960px) {
  .grid-heading {
    padding: 8px 32px;
  }
}

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px 16px;
  font-size: 0.75rem;
  color: #999;
  border-top: 1px solid #e0e8ec;
}

.site-footer a {
  color: #888;
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--ocean-deep);
}

.footer-sep {
  margin: 0 4px;
  color: #ccc;
}

.footer-built {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  color: #bbb;
}
