:root {
  --frame-width: min(96vw, 430px);
  --frame-ratio: 9 / 19.5;
  --page-bg: #08130d;
  --panel-bg: rgba(0, 0, 0, 0.34);
  --text: #fff8d8;
  --accent: #d4af37;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #1f3d28 0%, var(--page-bg) 58%, #020503 100%);
}

.page-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.top-bar {
  width: var(--frame-width);
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  background: var(--panel-bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.back-link:hover,
.back-link:focus {
  text-decoration: underline;
}

.title {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}

.phone-frame {
  width: var(--frame-width);
  aspect-ratio: var(--frame-ratio);
  max-height: calc(100dvh - 64px);
  max-width: calc((100dvh - 64px) * 9 / 19.5);
  border: 10px solid #101010;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 45px rgba(0, 0, 0, 0.58);
}

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

@media (max-height: 620px) {
  .page-wrap {
    justify-content: flex-start;
    gap: 6px;
  }

  .top-bar {
    padding: 6px 8px;
  }

  .phone-frame {
    max-height: calc(100dvh - 48px);
    max-width: calc((100dvh - 48px) * 9 / 19.5);
    border-width: 7px;
    border-radius: 22px;
  }
}

@media (max-width: 360px) {
  :root {
    --frame-width: 98vw;
  }

  .back-link,
  .title {
    font-size: 12px;
  }
}
