@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope-800.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0f1211;
  --surface: rgba(28, 33, 30, 0.9);
  --surface-strong: rgba(24, 28, 26, 0.97);
  --ink: #faf8ef;
  --muted: #bcc5b8;
  --lime: #e2fd51;
  --border: rgba(250, 248, 239, 0.14);
  --gutter: clamp(1rem, 3vw, 2.5rem);
  font-family: Manrope, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 50% 48%, rgba(226, 253, 81, 0.08), transparent 46%),
    radial-gradient(circle at 18% 20%, rgba(92, 168, 255, 0.09), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(255, 138, 92, 0.08), transparent 42%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 100;
  padding: 0.5rem 0.875rem;
  background: var(--lime);
  color: #111;
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Header with brand + right-aligned EN/RU flag switcher */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--gutter);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 18, 17, 0.65);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.languages {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(15, 18, 17, 0.65);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-link:hover {
  color: var(--ink);
  background: rgba(250, 248, 239, 0.08);
}

.lang-link[aria-current="page"] {
  background: var(--lime);
  color: #111;
}

.flag-icon {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* No-JS fallback layout */
.sphere-stage {
  min-height: 100dvh;
  padding: 5.5rem var(--gutter) 4rem;
}

.intro {
  max-width: 52rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.intro h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.intro p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 78rem;
  margin: 0 auto;
}

.game-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.card-media {
  position: relative;
  height: clamp(170px, 24vh, 240px);
  padding: 0.65rem 0.65rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #141816;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.75rem;
  display: block;
}

.game-copy {
  padding: 0.85rem 1.05rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.game-copy h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.genre {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lime);
}

.description {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.game-actions {
  margin-top: auto;
  padding-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
  background: var(--lime);
  color: #111;
}

.btn-secondary {
  background: rgba(250, 248, 239, 0.08);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

/* Interactive 3D Sphere Mode */
html.sphere-ready,
html.sphere-ready body {
  height: 100%;
  overflow: hidden;
}

html.sphere-ready .sphere-stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

html.sphere-ready .sphere-stage.is-dragging {
  cursor: grabbing;
}

html.sphere-ready .intro {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html.sphere-ready .panels {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}

html.sphere-ready .game-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(190px, 21vw, 270px);
  margin: 0;
  transform-origin: center center;
  will-change: transform, opacity;
  cursor: pointer;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

html.sphere-ready .game-panel .card-media {
  height: clamp(150px, 22vh, 210px);
}

html.sphere-ready .game-panel .description,
html.sphere-ready .game-panel .game-actions {
  display: none;
}

html.sphere-ready .game-panel.is-inspected {
  width: clamp(260px, 30vw, 360px);
  background: var(--surface-strong);
  border-color: rgba(226, 253, 81, 0.7);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(226, 253, 81, 0.35);
  cursor: default;
}

html.sphere-ready .game-panel.is-inspected .card-media {
  height: clamp(180px, 26vh, 240px);
}

html.sphere-ready .game-panel.is-inspected .description {
  display: block;
}

html.sphere-ready .game-panel.is-inspected .game-actions {
  display: flex;
}
