:root {
  --bg-page: #ffffff;
  --bg-subtle: #f8f7fa;
  --bg-chip: #f0eff2;
  --bg-stage: #141827;
  --bg-stage-2: #1f253d;
  --navy: #002b50;
  --cobalt: #4051b5;
  --cobalt-hover: #2f3e9e;
  --gold: #ffab00;
  --gold-soft: #fff6db;
  --ink: #111827;
  --muted: #525d73;
  --border: rgba(0, 43, 80, 0.12);
  --shadow: 0 6px 28px rgba(0, 43, 80, 0.06);
  --radius: 16px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 999;
  background: var(--navy);
  color: var(--bg-page);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Header */
.tg-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.tg-header-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy) !important;
  text-decoration: none !important;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.tg-brand-text small {
  color: var(--cobalt);
  font-weight: 700;
  font-size: 0.85em;
}
.tg-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tg-nav a {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
  transition: background 140ms ease, color 140ms ease;
}
.tg-nav a:hover {
  background: var(--bg-chip);
  color: var(--cobalt);
  text-decoration: none;
}

/* Main Portal Layout (topgames.gg inspired 2-col) */
.tg-shell {
  max-width: 1260px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}
.tg-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.tg-crumb a { color: var(--muted); font-weight: 600; }
.tg-crumb a:hover { color: var(--cobalt); }

.tg-portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

/* Stage & Mode Switcher */
.tg-stage-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 22px;
}
.tg-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.tg-mode-tabs {
  display: inline-flex;
  background: var(--bg-chip);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}
.tg-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.tg-mode-btn.is-active {
  background: var(--navy);
  color: var(--bg-page);
}
.tg-mode-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--gold-soft);
  border: 1px solid rgba(255, 171, 0, 0.45);
  padding: 4px 10px;
  border-radius: 999px;
}

.tg-stage {
  position: relative;
  width: 100%;
  height: min(640px, 74vh);
  min-height: 460px;
  background: radial-gradient(circle at 20% 20%, var(--bg-stage-2), var(--bg-stage) 70%);
  overflow: hidden;
}
.tg-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-stage);
}
.tg-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  color: var(--bg-page);
  background: linear-gradient(135deg, rgba(0, 43, 80, 0.94), rgba(20, 24, 39, 0.96));
}
.tg-cover[hidden], .tg-loader[hidden] { display: none !important; }
.tg-cover-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 171, 0, 0.18);
  border: 1px solid rgba(255, 171, 0, 0.6);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
.tg-cover-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  line-height: 1.15;
  color: var(--bg-page);
}
.tg-cover-sub {
  max-width: 520px;
  margin: 0 0 22px;
  font-size: 0.98rem;
  color: var(--bg-chip);
}
.tg-play-btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(255, 171, 0, 0.35);
  transition: transform 140ms ease, filter 140ms ease;
}
.tg-play-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.tg-cover-alt {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--bg-chip);
}
.tg-cover-alt button {
  background: none;
  border: 0;
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

.tg-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-stage);
  color: var(--bg-page);
}
.tg-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--gold);
  animation: tgSpin 0.8s linear infinite;
}
@keyframes tgSpin { to { transform: rotate(360deg); } }

.tg-fs-exit {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10001;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 43, 80, 0.92);
  color: var(--bg-page);
  font-weight: 700;
  cursor: pointer;
}
html.is-stage-full .tg-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  border-radius: 0;
}
html.is-stage-full .tg-fs-exit { display: inline-flex; }

/* Stage Control Bar (topgames.gg signature bar below iframe) */
.tg-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-page);
  border-top: 1px solid var(--border);
}
.tg-game-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tg-game-title-row h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--navy);
  line-height: 1.2;
}
.tg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tg-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.tg-chip:hover {
  background: var(--bg-chip);
  border-color: var(--cobalt);
  text-decoration: none;
}
.tg-chip-primary {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--bg-page) !important;
}
.tg-chip-primary:hover {
  background: var(--cobalt-hover);
  border-color: var(--cobalt-hover);
}
.tg-share-msg {
  font-size: 0.84rem;
  color: var(--cobalt);
  font-weight: 700;
}

/* Content Cards (About, Gameplay Overview, Control Guide, FAQ, Comments) */
.tg-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.tg-card h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.22rem;
  letter-spacing: 0.01em;
  color: var(--navy);
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-chip);
}
.tg-card h3 {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: 1.04rem;
  color: var(--navy);
}
.tg-card p {
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.72;
}
.tg-card p:last-child { margin-bottom: 0; }
.tg-list {
  margin: 10px 0 0;
  padding-left: 20px;
}
.tg-list li {
  margin: 7px 0;
  color: var(--ink);
}

/* Tier Table / Scoring Visual */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.tier-box {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  text-align: center;
}
.tier-box strong {
  display: block;
  font-family: var(--display);
  font-size: 0.92rem;
  color: var(--navy);
}
.tier-box span {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cobalt);
}
.tier-box.is-max {
  background: var(--navy);
  border-color: var(--navy);
}
.tier-box.is-max strong { color: var(--bg-page); }
.tier-box.is-max span { color: var(--gold); }

/* Sidebar */
.tg-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 76px;
}
.tg-side-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.tg-side-card h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.02rem;
  color: var(--navy);
}
.tg-side-cta {
  background: linear-gradient(145deg, var(--navy), var(--navy));
  color: var(--bg-page);
  border-color: var(--navy);
}
.tg-side-cta h2 { color: var(--bg-page); }
.tg-side-cta p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--bg-chip);
}
.tg-side-cta .tg-play-btn {
  width: 100%;
  padding: 11px 18px;
  font-size: 0.95rem;
}

.tg-side-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tg-side-links a {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--navy);
  text-decoration: none !important;
  transition: border-color 140ms ease, background 140ms ease;
}
.tg-side-links a:hover {
  background: var(--bg-chip);
  border-color: var(--cobalt);
}
.tg-side-links b { font-size: 0.94rem; }
.tg-side-links small { font-size: 0.8rem; color: var(--muted); }

.tg-mini-tiers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tg-mini-tiers li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-subtle);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}
.tg-mini-tiers li span {
  font-weight: 800;
  color: var(--cobalt);
}

/* FAQ */
.tg-faq-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tg-faq-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.tg-faq-item dt {
  font-family: var(--display);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.tg-faq-item dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

/* Comments */
.tg-comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.tg-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
}
.tg-field input, .tg-field textarea {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink);
}
.tg-comment-list .comment {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.tg-comment-list .comment-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
  margin-bottom: 4px;
}
.tg-comment-list .owner-flag {
  background: var(--navy);
  color: var(--bg-page);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
}
.empty-comments { color: var(--muted); font-size: 0.92rem; }
.text-btn {
  background: none;
  border: 0;
  color: var(--cobalt);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

/* Subpage Hero */
.tg-sub-hero {
  margin-bottom: 20px;
}
.tg-sub-hero h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  color: var(--navy);
  line-height: 1.2;
}
.tg-sub-hero p {
  margin: 0;
  font-size: 1.02rem;
  color: var(--muted);
}

/* Footer */
.tg-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 36px 20px 28px;
}
.tg-footer-inner {
  max-width: 1260px;
  margin: 0 auto;
}
.tg-footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}
.tg-foot-brand {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--navy);
}
.tg-foot-desc {
  margin: 0;
  max-width: 460px;
  font-size: 0.9rem;
  color: var(--muted);
}
.tg-foot-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.tg-foot-cols h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--navy);
}
.tg-foot-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tg-foot-cols a {
  font-size: 0.88rem;
  color: var(--muted);
}
.tg-foot-cols a:hover { color: var(--cobalt); }
.tg-foot-copy {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .tg-portal-grid { grid-template-columns: 1fr; }
  .tg-side { position: static; }
  .tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-footer-top { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tg-header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tg-stage { height: 520px; min-height: 440px; }
  .tg-card { padding: 18px; }
}

.tg-foot-head { margin: 0 0 8px; font-size: 0.92rem; font-weight: 700; color: var(--navy); }
