:root {
  --bg-950: #0a0a0b;
  --bg-900: #0f1013;
  --bg-800: #17181d;
  --bg-700: #21232a;
  --text-100: #e7e7ea;
  --text-300: #b8bac2;
  --text-400: #9aa0ab;
  --brand-500: #8b5cf6;
  --brand-600: #7c3aed;
  --ring: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-950);
  color: var(--text-100);
  font-family: Inter, "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fullscreen background using Blasted_Lands.png */
body.has-bg {
  /* Responsive title overlay (position/size via CSS variables) */
  --title-offset: 8vh; /* distance ABOVE vertical center */
  --title-size: min(90vw, 720px);
  background:
    url('../images/dungeon_tracer_text.png') center calc(50% - var(--title-offset)) / var(--title-size) no-repeat,
    url('../images/Blasted_Lands.png') center / cover no-repeat fixed,
    var(--bg-950);
}

/* iOS Safari: avoid background-attachment: fixed to prevent bottom black gap */
@supports (-webkit-touch-callout: none) {
  body.has-bg {
    background:
      url('../images/dungeon_tracer_text.png') center calc(50% - var(--title-offset)) / var(--title-size) no-repeat,
      url('../images/Blasted_Lands.png') center / cover no-repeat,
      var(--bg-950);
  }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
  body.has-bg { --title-offset: 10vh; --title-size: min(82vw, 480px); }
  .cta { margin-top: 44vh; }
  .subtitle { font-size: 15px; transform: translateY(-16px); }
  .store-buttons { gap: 12px; }
}

/* Small tablets (481–768px) */
@media (min-width: 481px) and (max-width: 768px) {
  body.has-bg { --title-offset: 9vh; --title-size: min(78vw, 580px); }
  .cta { margin-top: 40vh; }
  .subtitle { font-size: 16px; transform: translateY(-20px); }
}

/* Laptops (769–1279px) */
@media (min-width: 769px) and (max-width: 1279px) {
  body.has-bg { --title-offset: 8vh; --title-size: min(70vw, 820px); }
}

/* Desktops (≥1280px) */
@media (min-width: 1280px) {
  body.has-bg { --title-offset: 10vh; --title-size: min(60vw, 960px); }
}

/* Ultra-wide (≥1600px) */
@media (min-width: 1600px) {
  body.has-bg { --title-offset: 12vh; --title-size: min(52vw, 1100px); }
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.backdrop .radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 0%, rgba(124,58,237,0.25), transparent 60%);
  opacity: 0.4;
}

.backdrop .fade-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 224px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.container {
  max-width: 1120px;
  padding: 0 16px;
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(120%) blur(12px);
  background: rgba(0,0,0,0.35);
}

.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 20px;
  text-decoration: none;
  color: var(--text-100);
}

.brand .logo {
  height: 32px; width: 32px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand-600) 80%, transparent);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}

.nav {
  display: none;
  gap: 24px;
  font-size: 14px;
}

.nav a { color: #d4d4d8; text-decoration: none; }
.nav a:hover { color: #ffffff; }

@media (min-width: 768px) {
  .nav { display: flex; }
}

/* Hero */
.hero {
  position: relative;
}

.hero .row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  padding: 64px 16px;
}

@media (min-width: 768px) {
  .hero .row { grid-template-columns: 1fr 1fr; padding: 96px 16px; }
}

.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.hero p.lead {
  margin-top: 16px;
  color: var(--text-300);
  font-size: 18px;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--text-100);
  font-weight: 700;
  text-decoration: none;
  transition: filter .2s ease, background-color .2s ease, transform .1s ease;
}

.btn:active { transform: translateY(1px); }

.btn:hover { background: transparent; }

.btn-primary {
  background: transparent;
  color: var(--text-100);
  box-shadow: none;
}

.btn-primary:hover { filter: none; background: transparent; }

/* Steam image button */
.btn-steam { padding: 0; border: 0; background: transparent; }
.btn-steam:hover { background: transparent; }
.steam-img { display: block; height: 40px; width: auto; }

.btn-secondary {
  background: var(--bg-800);
  color: var(--text-100);
  border: 1px solid var(--ring);
}

.btn-secondary:hover { background: var(--bg-700); }

.video-card {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--ring);
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.6);
}

.video-aspect {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(0,0,0,0.4);
  display: grid;
  place-items: center;
}

.video-aspect .play { display: inline-block; text-align: center; }
.video-aspect .play p { margin-top: 10px; font-size: 14px; color: var(--text-300); }

/* Sections */
section { padding: 64px 0; }

section h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  margin: 0;
}

.muted { color: var(--text-400); font-size: 14px; margin-top: 8px; }

/* Cards */
.cards {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 20px;
}

.card .icon { color: var(--brand-500); margin-bottom: 8px; }
.card h3 { margin: 0; font-weight: 700; }
.card p { margin: 8px 0 0; color: var(--text-300); }

/* Screenshots */
.screen-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .screen-grid { grid-template-columns: repeat(3, 1fr); }
}

.screen-grid img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--ring);
}

/* News */
.updates {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .updates { grid-template-columns: repeat(2, 1fr); }
}

.update {
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 20px;
}

.update h3 { margin: 0; font-weight: 700; }
.update ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-300); }

/* Community */
.center { text-align: center; }
.center .cta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Footer */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  border-top: 1px solid var(--ring);
  margin-top: 0;
  color: #e5e7eb;
  font-size: 12px;
  background: transparent;
}

.site-footer .row {
  display: flex; flex-direction: column; gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  color: inherit;
  font-size: inherit;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

@media (min-width: 768px) {
  .site-footer .row { flex-direction: row; align-items: center; gap: 32px; }
}

.spacer { flex: 1 1 auto; }

.footer-links { display: none; }
.site-footer .row { align-items: center; justify-content: center; text-align: center; }

/* Footer font override (copyright style) */
.site-footer p {
  font-family: Inter, "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: #e5e7eb;
}

/* BGM toggle floating button */
.bgm-toggle {
  position: fixed;
  right: 16px;
  bottom: 64px; /* above fixed footer */
  z-index: 30;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--ring);
  border-radius: 999px;
  padding: 8px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.bgm-toggle img { display: block; width: 24px; height: 24px; }
.bgm-toggle:hover { background: rgba(0,0,0,0.35); }

/* Responsive tweaks */
@media (max-width: 640px) {
  .site-footer { font-size: 11px; }
  .steam-img, .store-img { height: 34px; }
  .discord-img { height: 24px; }
  .store-buttons { gap: 12px; }
}

@media (min-width: 1024px) {
  .cta { margin-top: 42vh; }
}

/* Portrait: stack buttons vertically */
@media (orientation: portrait) {
  .store-buttons {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
}

/* Minimal landing layout */
.landing {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.landing-inner {
  text-align: center;
  padding: 48px 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
}

/* CTA box positioned lower with a subtle dark backdrop sized to content */
.cta {
  margin-top: 34vh; /* slightly closer to title */
  display: inline-block;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.brand-stack { display: none; }

.logo-image {
  display: inline-block;
  max-width: min(760px, 90vw);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.55));
}

.title {
  margin: 0;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: Cinzel, Inter, "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Flaming text effect */
.title.fire {
  position: relative;
  color: #fff7d6;
  text-shadow:
    0 0 1px #ffffff,
    0 0 6px rgba(255, 239, 163, 0.9),
    0 0 14px rgba(255, 174, 66, 0.8),
    0 0 26px rgba(255, 102, 0, 0.6),
    0 0 44px rgba(255, 38, 0, 0.4);
  animation: flame-flicker 1.8s infinite steps(10);
}

.title.fire::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  width: min(680px, 90%);
  height: 50%;
  background: radial-gradient(40% 120% at 50% 0%, rgba(255,193,7,0.35), rgba(255,87,34,0.25) 60%, rgba(244,67,54,0) 75%);
  filter: blur(16px);
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: flame-breathe 1.6s ease-in-out infinite alternate;
}

@keyframes flame-flicker {
  0% { text-shadow: 0 0 1px #fff, 0 0 6px rgba(255,239,163,.9), 0 0 14px rgba(255,174,66,.8), 0 0 26px rgba(255,102,0,.6), 0 0 44px rgba(255,38,0,.4); }
  20% { text-shadow: 0 0 2px #fff, 0 0 7px rgba(255,239,163,.95), 0 0 16px rgba(255,174,66,.85), 0 0 28px rgba(255,102,0,.65), 0 0 46px rgba(255,38,0,.45); }
  40% { text-shadow: 0 0 1px #fff, 0 0 8px rgba(255,239,163,.9), 0 0 18px rgba(255,174,66,.8), 0 0 30px rgba(255,102,0,.6), 0 0 50px rgba(255,38,0,.45); }
  60% { text-shadow: 0 0 2px #fff, 0 0 6px rgba(255,239,163,.95), 0 0 16px rgba(255,174,66,.85), 0 0 26px rgba(255,102,0,.65), 0 0 46px rgba(255,38,0,.45); }
  80% { text-shadow: 0 0 1px #fff, 0 0 7px rgba(255,239,163,.9), 0 0 14px rgba(255,174,66,.8), 0 0 24px rgba(255,102,0,.6), 0 0 42px rgba(255,38,0,.4); }
  100% { text-shadow: 0 0 1px #fff, 0 0 6px rgba(255,239,163,.9), 0 0 14px rgba(255,174,66,.8), 0 0 26px rgba(255,102,0,.6), 0 0 44px rgba(255,38,0,.4); }
}

@keyframes flame-breathe {
  0% { transform: translateX(-50%) translateY(0) scale(1); opacity: 0.6; filter: blur(14px); }
  100% { transform: translateX(-50%) translateY(-4px) scale(1.04); opacity: 0.8; filter: blur(18px); }
}

@media (prefers-reduced-motion: reduce) {
  .title.fire { animation: none; }
  .title.fire::after { animation: none; }
}

.subtitle {
  display: inline-block;
  margin: 6px 0 6px;
  transform: translateY(-38px);
  color: var(--text-400);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-shadow: none;
  font-family: "Caveat", "Nanum Pen Script", Inter, "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.subtitle .line1, .subtitle .line2, .subtitle .sep { display: inline; }
.subtitle .sep { padding: 0 4px; }

/* Portrait: force two-line layout for subtitle */
@media (orientation: portrait) {
  .subtitle .line1 { display: block; }
  .subtitle .sep { display: none; }
  .subtitle .line2 { display: block; }
}

/* Burning effect utility (can be applied to any text element) */
.flame {
  position: relative;
  color: #fff7d6;
  text-shadow:
    0 0 1px #ffffff,
    0 0 6px rgba(255, 239, 163, 0.9),
    0 0 14px rgba(255, 174, 66, 0.8),
    0 0 26px rgba(255, 102, 0, 0.6),
    0 0 44px rgba(255, 38, 0, 0.4);
  animation: flame-flicker 1.8s infinite steps(10);
}

.flame::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  width: 110%;
  height: 60%;
  background: radial-gradient(40% 120% at 50% 0%, rgba(255,193,7,0.35), rgba(255,87,34,0.25) 60%, rgba(244,67,54,0) 75%);
  filter: blur(16px);
  opacity: 0.65;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: flame-breathe 1.6s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  .flame { animation: none; }
  .flame::after { animation: none; }
}

/* removed .cta-copy */

.store-buttons {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.social-buttons {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.btn-store { background: transparent; color: var(--text-100); border: 0; }

/* App Store image button to match Steam style */
.btn-appstore { padding: 0; border: 0; background: transparent; }
.btn-appstore:hover { background: transparent; }
.store-img { display: block; height: 40px; width: auto; }

/* Discord image button */
.btn-discord { padding: 0; border: 0; background: transparent; }
.btn-discord:hover { background: transparent; }
.discord-img { display: block; height: 28px; width: auto; }

/* Google Play image button */
.btn-googleplay { padding: 0; border: 0; background: transparent; }
.btn-googleplay:hover { background: transparent; }



