:root {
  --bg: #0d0a1c;
  --surface: #161229;
  --surface-2: #1f1940;
  --surface-3: #2a2254;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f0ff;
  --muted: #a7a0c8;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --radius: 14px;
  --top: 64px;
  --side: 232px;
  --grad: linear-gradient(120deg, #8b5cf6, #6366f1 45%, #22d3ee);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; min-height: 100vh; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.16s ease-in both; }
::view-transition-new(root) { animation: vt-in 0.22s ease-out both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.topbar { view-transition-name: topbar; }
.sidebar { view-transition-name: sidebar; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- buttons, chips, badges */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-1px); background: var(--surface-3); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35); }
.btn.primary:hover { box-shadow: 0 10px 30px rgba(34, 211, 238, 0.35); }
.btn.big { padding: 14px 30px; font-size: 1.05rem; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary .ic { fill: currentColor; stroke: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.chip:hover { background: var(--surface-2); }
.chip .ic { width: 18px; height: 18px; }
.chip[aria-pressed='true'] { border-color: var(--pink); color: var(--pink); }
.chip[aria-pressed='true'] .ic { fill: var(--pink); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(120deg, #fbbf24, #f97316);
  color: #1b0f00;
  font-weight: 800;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
}
.badge .ic { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.badge.big { font-size: 0.78rem; padding: 6px 12px; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: rgba(13, 10, 28, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; border-radius: 10px; }
.nav-toggle:hover { background: var(--surface-2); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45); }
.logo-mark .ic { width: 24px; height: 24px; color: #fff; }
.logo-text { font-weight: 900; font-size: 1.35rem; letter-spacing: -0.02em; }
.logo-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 16px 0 44px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.search input:focus { border-color: var(--violet); background: var(--surface-2); }
.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  text-decoration: none;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(120deg, #fbbf24, #f97316);
  color: #1b0f00;
  box-shadow: 0 6px 18px rgba(251, 146, 60, 0.35);
}
.btn-premium .ic { width: 18px; height: 18px; fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- layout */

.shell { display: flex; }
.sidebar {
  position: sticky;
  top: var(--top);
  height: calc(100vh - var(--top));
  width: var(--side);
  flex: none;
  overflow-y: auto;
  padding: 14px 10px 24px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: #fff; box-shadow: inset 3px 0 0 var(--violet); }
.nav-item.active .ic { color: var(--cyan); }
.nav-sep { margin: 16px 12px 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: #7a7399; font-weight: 700; }
.nav-premium {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 20px 4px 0;
  padding: 12px;
  border-radius: 14px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(249, 115, 22, 0.12));
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.nav-premium .ic { color: var(--gold); fill: var(--gold); stroke: none; width: 26px; height: 26px; }
.nav-premium b { display: block; color: var(--gold); }
.nav-premium small { color: var(--muted); font-size: 0.78rem; }
.nav-backdrop { display: none; }

.content { flex: 1; min-width: 0; padding: 22px clamp(14px, 2.5vw, 34px) 40px; max-width: 1560px; }

/* ---------------------------------------------------------------- hero */

.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 26px; }
.carousel { position: relative; margin-bottom: 26px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; border-radius: 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.slides::-webkit-scrollbar { display: none; }
.slides .hero-card { flex: 0 0 100%; scroll-snap-align: start; border-radius: 0; box-shadow: none; aspect-ratio: 16 / 6; }
.slides .hero-card.active img:not(.side-art) { animation: kenburns 9s ease-out both; }
@keyframes kenburns { from { transform: scale(1.12) translateX(1.5%); } to { transform: scale(1) translateX(0); } }
.hero-card .blur-bg { filter: blur(26px) saturate(1.4) brightness(0.65); transform: scale(1.2); }
.hero-card .side-art { left: auto; right: 6%; top: 10%; width: auto; height: 80%; aspect-ratio: 4 / 3; border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); z-index: -1; }
.hero-art { position: absolute; inset: 0; z-index: -2; display: flex; align-items: center; justify-content: flex-end; gap: 4%; padding-right: 7%; font-size: clamp(3rem, 9vw, 7rem); }
.hero-art i { font-style: normal; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5)); animation: floaty 4s ease-in-out infinite; }
.hero-art i:nth-child(2) { animation-delay: -1.3s; }
.hero-art i:nth-child(3) { animation-delay: -2.6s; }
@keyframes floaty { 50% { transform: translateY(-12px) rotate(-4deg); } }
.art-account { background: radial-gradient(circle at 75% 40%, rgba(34, 211, 238, 0.45), transparent 55%), linear-gradient(120deg, #2a1a5e, #12304f); }
.art-premium { background: radial-gradient(circle at 78% 45%, rgba(251, 191, 36, 0.5), transparent 55%), linear-gradient(120deg, #3a2208, #1d1033); }
.car-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(13, 10, 28, 0.6); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s; }
.carousel:hover .car-nav, .car-nav:focus-visible { opacity: 1; }
.car-nav.prev { left: 12px; }
.car-nav.next { right: 12px; }
.car-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.car-dots button { width: 9px; height: 9px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.4); cursor: pointer; transition: width 0.25s, background 0.25s; }
.car-dots button[aria-current='true'] { width: 26px; background: #fff; }
.hero-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 8;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  isolation: isolate;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; z-index: -2; }
.hero-card:hover img { transform: scale(1.05); }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10, 6, 24, 0.92) 0%, rgba(10, 6, 24, 0.55) 45%, rgba(10, 6, 24, 0) 75%), linear-gradient(0deg, rgba(10, 6, 24, 0.8), transparent 50%); }
.hero-text { position: absolute; left: clamp(16px, 3vw, 30px); bottom: clamp(16px, 3vw, 28px); right: 30%; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hero-text strong { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); }
.hero-text em { font-style: normal; color: #ddd6fe; max-width: 34ch; }

/* ---------------------------------------------------------------- rows and cards */

.row { margin: 8px 0 30px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.row-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.2rem; font-weight: 800; }
.row-head h2 .ic { color: var(--cyan); }
.more { color: var(--muted); font-weight: 700; font-size: 0.9rem; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--surface); }
.more:hover { color: #fff; background: var(--surface-2); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(168px, 100%), 1fr)); }
.card { min-width: 0; }
.grid.side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { display: block; text-decoration: none; border-radius: var(--radius); transition: transform 0.18s; }
.card:hover { transform: translateY(-4px); }
.thumb { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.thumb.ready { animation: none; background: var(--surface-2); }
.progress-tag { position: absolute; right: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(13, 10, 28, 0.85); color: var(--cyan); font-size: 0.75rem; font-weight: 800; }
.card.exclusive .thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%); background-size: 250% 100%; background-position: 120% 0; pointer-events: none; }
.card.exclusive:hover .thumb::after { animation: shine 1s ease; }
@keyframes shine { to { background-position: -60% 0; } }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease, filter 0.35s; }
.card:hover .thumb img { transform: scale(1.07); filter: brightness(0.85); }
.card:hover .thumb { box-shadow: 0 0 0 2px var(--violet), 0 12px 28px rgba(139, 92, 246, 0.4); }
.card.exclusive .thumb { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.7), 0 8px 20px rgba(0, 0, 0, 0.35); }
.thumb .badge { position: absolute; top: 8px; left: 8px; }
.play-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.play-hint .ic { fill: #fff; stroke: none; width: 22px; height: 22px; margin-left: 3px; }
.card:hover .play-hint { opacity: 1; transform: scale(1); }
.card-title { display: block; margin-top: 8px; font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-head { margin: 4px 0 20px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 900; letter-spacing: -0.02em; }
.page-head h1 .ic { width: 28px; height: 28px; color: var(--cyan); }
.page-head p { margin: 0; color: var(--muted); max-width: 70ch; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 26px 0; }
.pager a, .pager span { min-width: 40px; padding: 8px 12px; border-radius: 10px; text-align: center; text-decoration: none; background: var(--surface); font-weight: 700; }
.pager span { background: var(--grad); }
.empty { color: var(--muted); }
.seo-text { margin-top: 40px; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.seo-text h2 { color: var(--text); margin-top: 0; font-size: 1.1rem; }
.seo-text a { color: var(--cyan); }

.ad-slot { margin: 6px 0 28px; min-height: 100px; border-radius: 12px; overflow: hidden; display: flex; justify-content: center; }

/* ---------------------------------------------------------------- game page */

.crumbs { color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.player {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio);
  max-height: calc(100vh - var(--top) - 120px);
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}
.player.portrait { aspect-ratio: auto; height: min(calc(100vh - var(--top) - 120px), 820px); }
.player-bg { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); object-fit: cover; filter: blur(26px) brightness(0.45) saturate(1.3); z-index: -1; }
.player-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.player-thumb { width: min(260px, 50%); height: auto; border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); aspect-ratio: 4 / 3; object-fit: cover; }
.player-name { font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 900; text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player.portrait iframe { left: 50%; width: min(100%, calc((100vh - var(--top) - 120px) * 9 / 16)); transform: translateX(-50%); }
.player.playing .player-overlay, .player.playing .player-bg { display: none; }
.player-close[hidden], .ad-slot[hidden] { display: none; }
/* "Quit" handle on the left edge, half-way down: never on top of the games' own buttons (corners, top bar, dock). */
.player-close { position: absolute; left: env(safe-area-inset-left); top: 50%; transform: translateY(-50%); z-index: 5; width: 22px; height: 64px; border-radius: 0 16px 16px 0; border: 1px solid rgba(255, 255, 255, 0.15); border-left: 0; background: rgba(13, 10, 28, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; cursor: pointer; color: #fff; }
.player-close .ic { width: 18px; height: 18px; }
.player.immersive, .player.portrait.immersive { position: fixed; inset: 0; z-index: 200; max-height: none; height: 100dvh; width: 100%; border-radius: 0; aspect-ratio: auto; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: #000; }
.rotate-hint { display: none; }
@media (orientation: portrait) {
  .player.immersive.hint-rotate .rotate-hint { display: flex; position: absolute; z-index: 5; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: rgba(13, 10, 28, 0.92); border: 1px solid rgba(34, 211, 238, 0.5); font-weight: 700; white-space: nowrap; pointer-events: none; animation: nudge-in 0.4s ease-out; }
  .rotate-hint .ic { animation: spin90 1.6s ease-in-out infinite; }
}
@keyframes spin90 { 50% { transform: rotate(90deg); } }
.player.immersive iframe { left: 0; width: 100%; transform: none; }
body.immersive-on { overflow: hidden; }
.player:fullscreen { max-height: none; border-radius: 0; }
.player:fullscreen iframe { left: 0; width: 100%; transform: none; }

.game-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.game-bar h1 { margin: 0 10px 0 0; display: inline; font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 900; letter-spacing: -0.02em; vertical-align: middle; }
.game-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.game-info { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; }
.game-info h2 { font-size: 1.1rem; margin: 0 0 8px; }
.game-info h2 + p { margin-top: 0; }
.game-info p { color: #cfc9ea; margin: 0 0 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.tag .ic { width: 16px; height: 16px; color: var(--cyan); }
.tag.muted { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.provider { font-size: 0.8rem; color: #7a7399 !important; margin: 16px 0 0 !important; }
.game-side h2 { font-size: 1.05rem; margin: 0 0 12px; }

/* ---------------------------------------------------------------- premium */

.premium-hero { max-width: 760px; margin: 10px auto; text-align: center; }
.premium-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -0.02em; margin: 14px 0 8px; }
.lead { color: #ddd6fe; font-size: 1.1rem; }
.lead strong { color: var(--gold); font-size: 1.3em; }
.perks { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; text-align: left; }
.perks li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.perks .ic { color: var(--gold); margin-top: 2px; }
.premium-box, .restore-box { background: var(--surface); border: 1px solid rgba(251, 191, 36, 0.35); border-radius: 18px; padding: 22px; margin: 18px 0; }
.restore-box { border-color: var(--line); text-align: left; }
.restore-box h2 { margin: 0 0 6px; font-size: 1.05rem; }
.restore-box p { color: var(--muted); margin: 0 0 10px; }
.consent { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; accent-color: var(--violet); margin-top: 1px; }
.consent a { color: var(--cyan); }
.consent.shake { animation: shake 0.4s; color: var(--red); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.fine { font-size: 0.8rem; color: #7a7399; margin: 12px 0 0; }
.ok { color: var(--green); font-weight: 800; display: flex; gap: 8px; justify-content: center; align-items: center; }
.ok .ic { fill: currentColor; stroke: none; }
.notice { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.35); }
.notice.good { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.4); }
.code { font: 700 1.15rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); letter-spacing: 0.06em; user-select: all; }
.restore-form { display: flex; gap: 8px; flex-wrap: wrap; }
.restore-form input { flex: 1; min-width: 200px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 14px; font: 600 1rem ui-monospace, monospace; text-transform: uppercase; }

/* ---------------------------------------------------------------- documents */

.doc { max-width: 820px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 3vw, 34px); }
.doc h1 { margin-top: 0; font-size: 1.8rem; }
.doc h2 { font-size: 1.1rem; margin-top: 26px; color: var(--cyan); }
.doc p, .doc li { color: #cfc9ea; }
.doc a { color: var(--cyan); }
.muted { color: var(--muted); }
.mock { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0 auto; }
.mock form { margin: 0; }
.mock .price { font-size: 2.4rem; font-weight: 900; margin: 0; }

/* ---------------------------------------------------------------- footer */

.site-foot { border-top: 1px solid var(--line); padding: 30px clamp(16px, 3vw, 40px) 40px; display: grid; gap: 14px; color: var(--muted); font-size: 0.9rem; margin-left: var(--side); }
.foot-brand p { margin: 6px 0 0; max-width: 60ch; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-foot nav a { color: var(--muted); text-decoration: none; }
.site-foot nav a:hover { color: var(--text); }
.copy { margin: 0; font-size: 0.8rem; color: #7a7399; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; background: var(--surface-3); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: toast 0.25s ease-out; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }


/* ---------------------------------------------------------------- keyboard and gamepad focus */

html[data-input='gamepad'] :is(a, button, input, select, [tabindex]):is(:focus, .nav-focus),
:is(a, button, input, select, [tabindex]):focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 12px; }
html[data-input='gamepad'] .card:is(:focus, .nav-focus), .card:focus-visible { outline: none; transform: translateY(-4px); }
html[data-input='gamepad'] .card:is(:focus, .nav-focus) .thumb, .card:focus-visible .thumb { box-shadow: 0 0 0 3px var(--cyan), 0 14px 34px rgba(34, 211, 238, 0.35); }

/* ---------------------------------------------------------------- account (header, menu, invitations) */

.btn-premium.is-premium { background: var(--surface-2); color: var(--gold); box-shadow: none; border: 1px solid rgba(251, 191, 36, 0.35); }
.account-slot { flex: none; position: relative; min-width: 40px; visibility: hidden; }
.account-slot.ready { visibility: visible; }
.btn-login { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-weight: 800; padding: 9px 16px; border-radius: 999px; background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35); }
.btn-login .ic { width: 18px; height: 18px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--grad); color: #fff; font-weight: 900; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 46px; height: 46px; font-size: 1.2rem; }
.avatar.xl { width: 88px; height: 88px; font-size: 2.2rem; box-shadow: 0 10px 30px rgba(139, 92, 246, 0.45); }
.acc-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; }
.acc-btn:hover, .acc-btn[aria-expanded='true'] { background: var(--surface-2); }
.acc-level { font-weight: 800; font-size: 0.85rem; color: var(--cyan); }
.acc-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); z-index: 80; animation: pop 0.16s ease-out; }
.acc-menu-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acc-menu-head small { display: block; color: var(--muted); }
.acc-menu a, .acc-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; text-decoration: none; background: none; border: 0; cursor: pointer; font-weight: 600; }
.acc-menu a:hover, .acc-menu button:hover, .acc-menu a:focus-visible, .acc-menu button:focus-visible { background: var(--surface-2); outline: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

.save-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(120deg, rgba(139, 92, 246, 0.22), rgba(34, 211, 238, 0.14)); border: 1px solid rgba(139, 92, 246, 0.35); }
.save-banner p { margin: 0; flex: 1; font-size: 0.92rem; }
.save-banner .sb-icon { font-size: 1.6rem; }
.save-banner .btn { padding: 9px 18px; flex: none; }
.sb-close { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.sb-close:hover { color: var(--text); background: var(--surface-2); }

.nudge { position: fixed; z-index: 400; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid rgba(139, 92, 246, 0.5); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); animation: nudge-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3); transition: opacity 0.5s, transform 0.5s; }
.nudge.out { opacity: 0; transform: translate(-50%, 20px); }
.nudge p { margin: 0; flex: 1; font-size: 0.92rem; }
.nudge-gift { font-size: 1.8rem; }
.nudge .btn { padding: 9px 16px; flex: none; }
.nudge-close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.85rem; }
@keyframes nudge-in { from { opacity: 0; transform: translate(-50%, 30px) scale(0.95); } }

/* ---------------------------------------------------------------- "Mon espace" */

.account-page { max-width: 860px; margin: 0 auto; }
.acc-guest { text-align: center; max-width: 720px; margin: 10px auto; }
.acc-guest h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -0.02em; margin: 14px 0 8px; }
.acc-guest .perks .ic { color: var(--cyan); }
.acc-guest .perks b { display: block; }
.acc-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.profile-card { display: flex; gap: 20px; align-items: center; padding: 22px; border-radius: 22px; background: radial-gradient(circle at 0 0, rgba(139, 92, 246, 0.35), transparent 60%), var(--surface); border: 1px solid var(--line); position: relative; }
.profile-main { flex: 1; min-width: 0; }
.profile-main h1 { margin: 0 0 6px; font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 900; overflow-wrap: anywhere; }
.level-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.level-chip { font-weight: 900; color: #0d0a1c; background: var(--cyan); padding: 3px 10px; border-radius: 999px; font-size: 0.85rem; }
.xpbar { flex: 1; min-width: 120px; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width 0.8s ease; }
.level-line small { color: var(--muted); }
.streak { margin-top: 8px; color: var(--gold); }
.premium-chip { position: absolute; top: 14px; right: 14px; display: inline-flex; gap: 6px; align-items: center; font-weight: 800; color: var(--gold); }
.premium-chip .ic { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.badge-pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 0.85rem; font-weight: 700; }
.panel { margin-top: 18px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.panel .row-head { margin-bottom: 10px; }
.panel .row-head small { color: var(--muted); }
.challenges, .saves { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.challenge { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.challenge.done:not(.claimed) { box-shadow: inset 0 0 0 1px var(--green); }
.challenge.claimed { opacity: 0.65; }
.ch-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ch-main a { color: var(--cyan); }
.ch-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.ch-main small, .ch-state { color: var(--muted); font-size: 0.85rem; }
.ch-reward { font-weight: 800; white-space: nowrap; }
.challenge .btn { padding: 8px 16px; }
.saves li { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.saves img { width: 64px; height: 48px; object-fit: cover; border-radius: 10px; }
.saves span { flex: 1; min-width: 0; display: grid; }
.saves small { color: var(--muted); }
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.board h3 { margin: 0 0 8px; }
.board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.board li { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); }
.board li.me { box-shadow: inset 0 0 0 1px var(--cyan); }
.board li.empty { color: var(--muted); }
.board .rk { width: 22px; font-weight: 900; color: var(--gold); }
.board .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.acc-manage { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.acc-manage .fine { width: 100%; margin: 4px 0 0; }
.btn.ghost { background: transparent; }
.ok { color: var(--green); font-weight: 700; }

.sk { border-radius: 18px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
.sk-card { height: 132px; }
.sk-row { height: 90px; margin-top: 16px; }
@keyframes sk { to { background-position: -200% 0; } }

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-box { max-width: 520px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px 24px; }
.auth-box h1 { margin-top: 0; }
.auth-box form { margin: 10px 0; }
.auth-box .btn { margin: 4px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .game-layout { grid-template-columns: 1fr; }
  .grid.side { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 960px) {
  .nav-toggle { display: grid; place-items: center; }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--top);
    z-index: 60;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.5);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--top) 0 0; z-index: 55; background: rgba(0, 0, 0, 0.55); }
  .site-foot { margin-left: 0; }
}

@media (max-width: 640px) {
  :root { --top: 58px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .logo-text { display: none; }
  .btn-premium span, .btn-login span, .acc-level { display: none; }
  .btn-premium, .btn-login { padding: 9px; }
  .acc-btn { padding: 2px; }
  .profile-card { flex-direction: column; text-align: center; }
  .level-line { justify-content: center; }
  .save-banner, .nudge { flex-wrap: wrap; }
  .save-banner p, .nudge p { flex-basis: calc(100% - 50px); }
  .challenge { flex-wrap: wrap; }
  .ch-main { flex-basis: 100%; }
  .search input { height: 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .hero-card, .slides .hero-card { aspect-ratio: 16 / 11; }
  .hero-card .side-art { display: none; }
  .hero-art { justify-content: center; align-items: flex-start; padding: 6% 0 0; font-size: 3.4rem; }
  .car-nav { display: none; }
  .hero-text { right: 16px; }
  .player:not(.immersive), .player.portrait:not(.immersive) { aspect-ratio: 4 / 3; height: auto; }
  .player-thumb { width: 42%; }
  .chip span { display: none; }
  .content { padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- installable app */

.nav-install { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--cyan); }
.install-chip { position: fixed; z-index: 350; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: var(--surface-2); border: 1px solid rgba(34, 211, 238, 0.4); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); animation: nudge-in 0.35s ease-out; }
.install-chip img { border-radius: 10px; }
.install-chip p { margin: 0; flex: 1; display: grid; font-size: 0.9rem; }
.install-chip small { color: var(--muted); }
.install-chip .btn { padding: 9px 14px; }
.ios-guide { position: fixed; inset: 0; z-index: 500; display: grid; place-items: end center; background: rgba(0, 0, 0, 0.6); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.ios-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; animation: nudge-in 0.3s ease-out; }
.ios-card h2 { margin: 0 0 8px; }
.ios-card ol { padding-left: 20px; line-height: 1.7; }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); color: var(--cyan); }
.offline .grid { max-width: 520px; margin: 18px auto; grid-template-columns: repeat(2, 1fr); }

/* Notches and home indicators (installed app, landscape phones). */
.topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--top) + env(safe-area-inset-top)); }
}

/* ---------------------------------------------------------------- administration */

.adm { max-width: 1200px; margin: 0 auto; }
.adm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.adm-head h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.6rem; }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; }
.adm-tab.active { background: var(--grad); border-color: transparent; color: #fff; }
.adm-tab .ic { width: 16px; height: 16px; }
.adm-flash { padding: 10px 14px; border-radius: 12px; background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.4); color: var(--green); font-weight: 700; }
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.adm-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; }
.adm-tile small { color: var(--muted); font-weight: 700; }
.adm-tile b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.adm-tile span { color: var(--green); font-size: 0.85rem; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.adm-grid .panel h2 { margin: 0 0 10px; font-size: 1.1rem; }
.adm-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
.adm-dl dt { color: var(--muted); }
.adm-dl dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.adm-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.adm-list small { color: var(--muted); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.adm-table th, .adm-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table th { color: var(--muted); font-weight: 700; }
.adm-table td small { display: block; color: var(--muted); }
.adm-table td small.warn { color: var(--red); }
.adm-table img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.adm-table tr.is-hidden td { opacity: 0.55; }
.adm-table .gold { color: var(--gold); }
.adm-scroll { overflow-x: auto; }
.adm-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0; }
.adm-inline input[type='number'] { width: 70px; }
.adm-inline input, .adm-search input, .adm-search select { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; }
.adm-inline .btn, .adm-list .btn { padding: 7px 14px; font-size: 0.85rem; }
.adm-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.adm-search input { flex: 1; min-width: 200px; }
.adm-search span { color: var(--muted); }
.adm-pages { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
.empty { text-align: center; padding: 40px 10px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
