:root {
  --bg: #07111f;
  --panel: rgba(8, 14, 25, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.13);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.72);
  --accent: #ffc72c;
  --header-h: 58px;
  --bar-h: 48px;
  --shell-pad: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 180, 255, 0.18), transparent 42%),
    radial-gradient(circle at 80% 100%, rgba(255, 199, 44, 0.12), transparent 40%),
    linear-gradient(180deg, #0a1730 0%, #07111f 48%, #050c18 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 8, 20, 0.35), rgba(2, 8, 20, 0.72));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
  background: rgba(4, 8, 16, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-logo img {
  display: block;
  height: 46px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 15px;
  font-weight: 900;
  color: var(--muted);
}

.nav a:hover,
.nav a:focus-visible {
  color: #fff;
}

.topbar-spacer {
  width: 180px;
}

.desktop-shell {
  width: 100%;
  margin: 0;
  padding: var(--shell-pad) 14px;
}

.center-game {
  width: 100%;
  height: calc(100dvh - var(--header-h) - (var(--shell-pad) * 2));
  min-height: 280px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-card,
.bottom-actions,
.info-section {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.game-card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: #000;
}

.game-frame-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.game-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.bottom-actions {
  height: var(--bar-h);
  flex-shrink: 0;
  padding: 0 10px;
  border-radius: 0 0 16px 16px;
  border-top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  background: rgba(31, 32, 55, 0.96);
}

.bar-left,
.bar-center,
.bar-right {
  display: flex;
  align-items: center;
}

.bar-left {
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}

.bar-game-icon {
  width: 42px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
}

.bar-center {
  justify-content: center;
}

.bar-right {
  justify-content: flex-end;
  gap: 8px;
}

.bar-btn {
  position: relative;
  height: 34px;
  min-width: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: 0.18s ease;
}

.bar-btn:hover,
.bar-btn:focus-visible {
  background: rgba(255, 255, 255, 0.17);
  transform: translateY(-1px);
}

.bar-btn.active-like {
  color: #70ffb3;
  background: rgba(46, 232, 123, 0.16);
  border-color: rgba(46, 232, 123, 0.45);
}

.bar-btn.active-dislike {
  color: #ff3b73;
  background: rgba(255, 59, 115, 0.14);
  border-color: rgba(255, 59, 115, 0.45);
}

.btn-icon,
.bar-btn svg,
.hide-bar-btn svg,
.modal-close svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
}

.bar-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: rgba(90, 90, 94, 0.96);
  color: #fff;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.bar-btn[data-tooltip]:hover::after,
.bar-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#fullscreenBtn[data-tooltip]::after {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}

#fullscreenBtn[data-tooltip]:hover::after,
#fullscreenBtn[data-tooltip]:focus-visible::after {
  transform: translateX(0) translateY(0);
}

.hide-bar-btn {
  display: none;
  height: 24px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  gap: 6px;
}

.hide-bar-btn svg {
  width: 14px;
  height: 14px;
}

#gameShell.fs-active {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100vw;
  height: 100dvh;
  background: #000;
  border-radius: 0;
}

#gameShell.fs-active .game-card,
#gameShell.fs-active .bottom-actions {
  border-radius: 0;
}

#gameShell.fs-active .hide-bar-btn {
  display: inline-flex;
  align-items: center;
}

#gameShell.fs-active.bar-hidden .bottom-actions {
  display: none;
}

.gh-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 28px 68px 0;
  background: rgba(0, 0, 0, 0.34);
}

.gh-modal.show {
  display: flex;
}

.gh-modal-box {
  width: min(520px, calc(100vw - 46px));
  border-radius: 24px;
  background: #202236;
  color: #fff;
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
  position: relative;
}

.gh-modal-box h2 {
  font-size: 26px;
  margin-bottom: 14px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: #fff;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
}

.controls-grid div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.controls-grid h3 {
  margin-bottom: 10px;
}

.controls-grid p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.55;
}

.info-section {
  width: calc(100% - 28px);
  max-width: none;
  margin: 16px 14px 42px;
  padding: 28px 32px 36px;
  border-radius: 16px;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.game-meta-list a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-meta-list a:hover,
.game-meta-list a:focus-visible {
  color: #fff;
}

.game-article h1 {
  font-size: 28px;
  margin-bottom: 16px;
}

.game-article h2 {
  font-size: 22px;
  margin: 22px 0 10px;
}

.game-article h3 {
  font-size: 17px;
  margin: 16px 0 8px;
}

.game-article p,
.game-article li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.game-article ul {
  padding-left: 18px;
  margin-bottom: 8px;
}

.game-meta-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 24px;
  margin-bottom: 8px;
}

.game-meta-list li {
  color: var(--text);
  font-weight: 700;
}

.game-meta-list span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-footer {
  padding: 0 14px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.play-screen {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(255, 210, 50, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.35), rgba(7, 17, 31, 0.82));
}

.play-screen.is-hidden {
  display: none;
}

.play-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.play-screen-inner img {
  width: min(420px, 72vw);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.play-btn {
  position: relative;
  overflow: hidden;
  min-width: 280px;
  min-height: 88px;
  padding: 18px 46px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, #a5ff8d 0%, #57ea50 46%, #25b92d 100%);
  color: #061506;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.14),
    0 12px 0 rgba(10, 92, 25, 0.72),
    0 24px 52px rgba(46, 232, 123, 0.34),
    0 0 54px rgba(87, 255, 81, 0.4);
  animation: play-pulse 2.1s ease-in-out infinite;
}

.play-btn:hover,
.play-btn:focus-visible {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-3px) scale(1.04);
}

.play-btn:disabled {
  cursor: wait;
  animation: none;
  filter: saturate(0.7);
}

.play-btn::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  pointer-events: none;
}

.play-main {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.play-sub {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #145018;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.play-status {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

@keyframes play-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (max-width: 768px) {
  .play-btn {
    min-width: 220px;
    min-height: 72px;
    padding: 14px 32px;
  }

  .play-main {
    font-size: 26px;
  }

  .play-screen-inner img {
    width: min(280px, 78vw);
  }
}

@media (max-width: 1100px) {
  .game-meta-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1366px) {
  :root {
    --header-h: 52px;
  }

  .topbar-logo img {
    height: 40px;
  }

  .topbar-spacer {
    width: 80px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 50px;
    --shell-pad: 8px;
  }

  .topbar {
    padding: 0 10px;
    gap: 10px;
  }

  .topbar-logo img {
    height: 34px;
  }

  .topbar-spacer {
    display: none;
  }

  .nav {
    font-size: 13px;
  }

  .desktop-shell {
    padding: var(--shell-pad) 8px;
  }

  .center-game {
    height: calc(100dvh - var(--header-h) - (var(--shell-pad) * 2));
  }

  .bar-left span {
    display: none;
  }

  .bar-btn {
    min-width: 36px;
    padding: 0 8px;
  }

  .gh-modal {
    padding: 0 14px 60px;
    justify-content: center;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .info-section {
    width: calc(100% - 16px);
    margin: 12px 8px 28px;
    padding: 20px 16px 24px;
  }

  .game-meta-list {
    grid-template-columns: 1fr 1fr;
  }

  .game-article h1 {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .game-meta-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .bar-right {
    gap: 4px;
  }

  .bar-btn span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bar-btn,
  .gh-modal-box,
  .play-btn {
    transition: none;
    animation: none;
  }
}
