/* Variables */
:root {
  --color-bg: #f6f7fb;
  --color-surface: rgba(255, 255, 255, 0.86);
  --color-stroke: rgba(10, 20, 40, 0.12);
  --color-text: rgba(10, 20, 40, 0.92);
  --color-muted: rgba(10, 20, 40, 0.72);
  --color-soft: rgba(10, 20, 40, 0.18);
  --color-accent: #2f67ff;
  --color-accent-ink: #ffffff;

  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-soft: 0 18px 48px rgba(10, 20, 40, 0.14);
  --shadow-hard: 0 22px 60px rgba(10, 20, 40, 0.22);

  --container: 1120px;
  --container-pad: clamp(16px, 4vw, 28px);

  --space-1: clamp(10px, 1.4vw, 14px);
  --space-2: clamp(14px, 2vw, 20px);
  --space-3: clamp(18px, 2.8vw, 28px);
  --space-4: clamp(22px, 3.4vw, 36px);

  --text-sm: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
  --text-md: clamp(1rem, 0.96rem + 0.25vw, 1.1rem);
}

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

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-text);
  background: radial-gradient(900px 560px at 12% -10%, rgba(47, 103, 255, 0.14), transparent 60%),
    radial-gradient(900px 560px at 88% 0%, rgba(132, 204, 255, 0.18), transparent 55%),
    var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Layout */
.frame {
  width: min(var(--container), calc(100% - (var(--container-pad) * 2)));
  margin-inline: auto;
}

.page-main {
  padding-block: var(--space-4);
}

/* Header */
.tr-site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 247, 251, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-stroke);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 14px);
  min-width: 0;
}

.brand-logo {
  width: clamp(124px, 16vw, 170px);
  height: auto;
}

.brand-name {
  display: none;
  font-weight: 650;
  letter-spacing: 0.2px;
  font-size: var(--text-md);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.2vw, 12px) clamp(14px, 2.2vw, 18px);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), rgba(132, 204, 255, 0.95));
  color: var(--color-accent-ink);
  font-weight: 750;
  letter-spacing: 0.2px;
  border: 0;
  text-align: center;
}

.primary-action:hover {
  filter: brightness(1.03);
}

/* Game embed */
.embed-section {
  padding-block: var(--space-3);
}

.embed-card {
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-stroke);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.embed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-stroke);
}

.embed-label {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  letter-spacing: 0.2px;
}

.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1vw, 10px) clamp(10px, 1.6vw, 14px);
  border-radius: 999px;
  border: 1px solid var(--color-stroke);
  background: transparent;
  color: var(--color-text);
  font-weight: 650;
  font-size: var(--text-sm);
}

.ghost-action:hover {
  background: rgba(10, 20, 40, 0.04);
}

.embed-shell {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
  background: rgba(10, 20, 40, 0.06);
}

.game-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.embed-shell.is-playing .game-frame {
  pointer-events: all;
}

/* Poster overlay */
.embed-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.embed-poster.is-hidden {
  display: none !important;
}

.poster-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 40, 0.08), rgba(10, 20, 40, 0.38));
  pointer-events: none;
}

.poster-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  justify-content: center;
  align-items: center;
  padding: var(--space-2);
}

.poster-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 1.4vw, 14px) clamp(16px, 2.6vw, 22px);
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  text-align: center;
  width: min(420px, 100%);
}

.poster-action-solid {
  background: linear-gradient(90deg, var(--color-accent), rgba(132, 204, 255, 0.95));
  color: var(--color-accent-ink);
  box-shadow: var(--shadow-hard);
}

.poster-action-ghost {
  background: rgba(255, 255, 255, 0.86);
  color: rgba(10, 20, 40, 0.92);
  border-color: rgba(255, 255, 255, 0.46);
}

.poster-action-ghost:hover {
  background: rgba(255, 255, 255, 0.95);
}

/* Footer */
.tr-site-footer {
  border-top: 1px solid var(--color-stroke);
  background: rgba(255, 255, 255, 0.72);
}

.footer-inner {
  padding-block: var(--space-4);
  display: grid;
  gap: var(--space-3);
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.brand-footer .brand-logo {
  width: clamp(124px, 16vw, 170px);
}

.icon-row {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 14px);
  padding: 0;
  margin: 0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(40px, 5vw, 44px);
  height: clamp(40px, 5vw, 44px);
  border-radius: 999px;
  border: 1px solid var(--color-stroke);
  background: rgba(10, 20, 40, 0.92);
}

.icon-link:hover {
  background: rgba(10, 20, 40, 0.84);
}

.icon-link img {
  width: 22px;
  height: 22px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 16px);
}

.badge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.8vw, 14px);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-stroke);
  background: rgba(10, 20, 40, 0.92);
}

.badge-link:hover {
  background: rgba(10, 20, 40, 0.84);
}

.badge-link img {
  width: clamp(78px, 10vw, 96px);
  height: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 16px);
}

.footer-links a {
  color: var(--color-muted);
  font-weight: 650;
  font-size: var(--text-sm);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.footer-links a:hover {
  border-color: var(--color-stroke);
  background: rgba(10, 20, 40, 0.04);
  color: var(--color-text);
}

.footer-note {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Media queries */
@media (max-width: 760px) {
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .embed-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .poster-actions {
    align-items: center;
  }

  .poster-action {
    height: 42px;
    max-width: 220px;
  }
}
