:root {
  --bg: #070c18;
  --bg-top: #101b33;
  --surface: rgba(16, 25, 45, 0.88);
  --surface-strong: rgba(20, 31, 56, 0.96);
  --border: rgba(255, 255, 255, 0.10);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #fbbf24;
  --teal: #00ebb5;
}

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

html, body {
  min-height: 100%;
  background: radial-gradient(circle at 50% 0%, var(--bg-top) 0%, var(--bg) 58%);
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

/* Compact Studio Header: keeps featured TikTok challenge visible immediately on mobile */
.studio-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.studio-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.studio-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-install-pwa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 235, 181, 0.45);
  background: rgba(0, 235, 181, 0.14);
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}

.btn-install-pwa:hover {
  background: rgba(0, 235, 181, 0.22);
}

.btn-install-pwa.hidden {
  display: none;
}

.btn-share-site {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-share-site:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(0, 235, 181, 0.09);
}

.share-toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--teal);
  color: #06141b;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.share-toast.hidden {
  display: none;
}

.studio-mark {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--teal), #38bdf8);
  box-shadow: 0 0 12px rgba(0, 235, 181, 0.45);
  flex-shrink: 0;
}

.studio-name {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #ffffff;
}

.studio-tagline {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.studio-headline {
  font-size: clamp(22px, 5.2vw, 34px);
  font-weight: 950;
  letter-spacing: -0.4px;
  line-height: 1.15;
  color: #ffffff;
}

/* Featured "Vu sur TikTok" Emmental Card */
.featured-section {
  margin-bottom: 28px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr;
  background: linear-gradient(155deg, rgba(251, 191, 36, 0.13) 0%, var(--surface-strong) 48%);
  border: 1.5px solid rgba(251, 191, 36, 0.42);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

.featured-media {
  position: relative;
  aspect-ratio: 16 / 10;
  max-height: 240px;
  width: 100%;
  background: #0b1120;
  overflow: hidden;
}

.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(8, 13, 26, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.featured-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.featured-title {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 950;
  line-height: 1.18;
  color: #ffffff;
}

.featured-sub {
  font-size: 14px;
  color: #cbd5e1;
  font-weight: 500;
}

.btn-featured {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 13px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd166 0%, #f59e0b 100%);
  color: #161002;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.30);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-featured:hover {
  filter: brightness(1.06);
}

.btn-featured:active {
  transform: scale(0.985);
}

/* All Games Section */
.games-section {
  margin-bottom: 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
}

.section-note {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent, var(--teal));
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.game-card:hover {
  border-color: var(--accent, var(--teal));
  transform: translateY(-2px);
}

.game-media {
  aspect-ratio: 16 / 10;
  width: 100%;
  background: #0b1120;
  overflow: hidden;
}

.game-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.game-body {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.game-name {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
}

.game-desc {
  font-size: 14px;
  color: var(--muted);
  flex: 1;
  margin-bottom: 8px;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--accent, var(--teal));
  color: #06141b;
  font-size: 15px;
  font-weight: 900;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-play:hover {
  filter: brightness(1.08);
}

.btn-play:active {
  transform: scale(0.985);
}

.studio-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* Desktop / Tablet Landscape */
@media (min-width: 780px) {
  .page-wrap {
    padding: 28px 24px 40px;
  }

  .studio-header {
    margin-bottom: 22px;
  }

  .featured-card {
    grid-template-columns: 1.1fr 1fr;
    align-items: stretch;
  }

  .featured-media {
    max-height: none;
    height: 100%;
    aspect-ratio: auto;
    min-height: 260px;
  }

  .featured-body {
    padding: 28px 28px;
    justify-content: center;
    gap: 12px;
  }

  .btn-featured {
    width: auto;
    align-self: flex-start;
    min-width: 220px;
  }

  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}
