:root {
  --shell-bg-1: #0b1521;
  --shell-bg-2: #1d3348;
  --shell-panel: #122337;
  --shell-border: #1f3d59;
  --shell-accent: #0d79d9;
  --shell-text: #e6f1ff;
  --shell-muted: #a4b7cc;
  --shell-max: 1200px;
  --game-aspect: 1.6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--shell-text);
  background: radial-gradient(circle at 20% 20%, #22344a 0%, #0b1521 55%),
              linear-gradient(135deg, #0b1521 0%, #1d3348 100%);
  min-height: 100vh;
}

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

.game-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
  gap: 18px;
}

.game-shell__header {
  width: 100%;
  max-width: var(--shell-max);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.opinr-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18, 36, 52, 0.9);
  border: 1px solid var(--shell-border);
  font-size: 0.95rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.opinr-back-link:hover {
  background: rgba(27, 77, 116, 0.95);
  border-color: #2a6aa5;
  transform: translateY(-1px);
}

.game-title {
  text-align: center;
}

.game-title__name {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  margin: 0;
}

.game-title__version {
  margin: 4px 0 0;
  color: var(--shell-muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.fullscreen-button {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--shell-border);
  background: rgba(18, 36, 52, 0.9)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M4 9V4h5V2H2v7h2zm15-5v5h2V2h-7v2h5zM4 15H2v7h7v-2H4v-5zm17 5h-5v2h7v-7h-2v5z'/></svg>")
    center/60% no-repeat;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.fullscreen-button:hover {
  background-color: rgba(27, 77, 116, 0.95);
  border-color: #2a6aa5;
  transform: translateY(-1px);
}

.fullscreen-button.is-active {
  background: rgba(18, 36, 52, 0.9)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M9 4H4v5H2V2h7v2zm13-2h-7v2h5v5h2V2zM4 15v5h5v2H2v-7h2zm13 5v-5h-2v7h7v-2h-5z'/></svg>")
    center/60% no-repeat;
}

.game-stats {
  width: 100%;
  max-width: var(--shell-max);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--shell-muted);
  font-size: 0.95rem;
}

.ad-slot {
  width: min(100%, 970px);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px dashed rgba(88, 130, 170, 0.45);
  background: rgba(10, 22, 32, 0.35);
}

.ad-slot.is-hidden {
  display: none;
}

.ad-slot__placeholder {
  color: rgba(150, 176, 205, 0.6);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.game-frame-wrap {
  width: min(100%, var(--shell-max));
  aspect-ratio: var(--game-aspect);
  background: #000;
  border-radius: 18px;
  border: 3px solid var(--shell-accent);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.game-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.footer {
  margin-top: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: #f2f7ff;
  background: #0f7ef1;
  padding: 16px 24px;
  border-radius: 14px;
  width: min(100%, 520px);
}

.orientation-lock {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 2000;
}

.orientation-lock.hidden {
  display: none;
}

.orientation-panel {
  background: #13202d;
  padding: 2rem 2.5rem;
  border: 2px solid #275d8d;
  border-radius: 18px;
  color: #fff;
  font-size: 1rem;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.orientation-panel__button {
  margin-top: 16px;
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  border: none;
  background: #1b4d74;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .game-shell {
    padding: 18px 12px 32px;
  }

  .game-shell__header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .opinr-back-link {
    justify-self: center;
  }

  .fullscreen-button {
    width: 46px;
    height: 46px;
  }

  .game-stats {
    font-size: 0.9rem;
  }

  .game-frame-wrap {
    border-radius: 14px;
  }

  .footer {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .game-shell {
    gap: 14px;
  }

  .game-stats {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}
