/* ============================================================
   HOLY MOLY – THE GAME · landing / game page
   ============================================================ */

@font-face {
  font-family: "KonsoleWideBold";
  src: url("fonts/WideBold.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "KonsoleSemiBold";
  src: url("fonts/CompactSemibold.otf") format("opentype");
  font-display: swap;
}

:root {
  --holy-yellow: #f8e821;
  --holy-purple: #6d28d9;
  --holy-purple-deep: #3b0f73;
  --ink: #0b0710;
  --text: #ffffff;
  --muted: #b9a9d6;
  --radius: 16px;
  --maxw: 1280px;
  --header-h: 72px;
  /* vertical space taken by header + footer + breathing room */
  --chrome: 210px;
}

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

html, body { height: 100%; }

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "KonsoleSemiBold", system-ui, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--holy-purple-deep) 0%, var(--ink) 60%) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(11, 7, 16, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand { display: flex; align-items: center; }
.brand img { height: 34px; width: auto; display: block; }

.learn-more {
  font-family: "KonsoleWideBold";
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}
.learn-more:hover { color: var(--holy-yellow); }

.stores { display: flex; align-items: center; gap: 8px; }
.stores-label {
  font-family: "KonsoleWideBold";
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.store-link {
  font-family: "KonsoleWideBold";
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.store-link:hover {
  background: var(--holy-yellow);
  color: #000;
  border-color: var(--holy-yellow);
  transform: translateY(-1px);
}

/* ---------------- Game stage ---------------- */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px);
}

.game-frame {
  position: relative;
  /* Fit within both width and height while keeping a clean 16:9 box.
     A matched aspect ratio means Unity does not letterbox, so the native
     text-input overlay maps 1:1 onto the canvas. */
  width: min(100%, calc((100vh - var(--chrome)) * 16 / 9));
  max-width: var(--maxw);
  aspect-ratio: 16 / 9;
  margin: auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------------- Poster (pre-start) ---------------- */
.poster {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vh, 36px);
  padding: 24px;
  text-align: center;
  background: url("img/Holy_Moly_BG.png") center / cover no-repeat, var(--holy-purple);
}
.poster-logo {
  width: min(58%, 420px);
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
}

.play-btn {
  font-family: "KonsoleWideBold";
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 16px 44px;
  border: none;
  border-radius: 999px;
  color: #000;
  background: var(--holy-yellow);
  box-shadow: 0 10px 30px rgba(248, 232, 33, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.play-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 42px rgba(248, 232, 33, 0.5); }
.play-btn:active { transform: translateY(0); }

/* ---------------- Loading ---------------- */
.loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(8, 5, 12, 0.85);
}
.loading.show { display: flex; }
.bar {
  width: min(60%, 320px);
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--holy-yellow), #ffd000);
  transition: width 0.15s ease;
}
.loading-text {
  font-family: "KonsoleWideBold";
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------- Footer ---------------- */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer .credit { margin: 0; }

.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}
.legal-group { display: inline-flex; align-items: center; gap: 8px; }
.legal-label {
  font-family: "KonsoleWideBold";
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.legal-group a {
  font-size: 0.75rem;
  color: var(--muted);
  transition: color 0.2s ease;
}
.legal-group a:hover { color: var(--holy-yellow); }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
  :root { --header-h: 60px; --chrome: 160px; }
  .learn-more { display: none; }
  .stores-label { display: none; }
}

@media (max-width: 420px) {
  .store-link { padding: 6px 10px; font-size: 0.72rem; }
  .brand img { height: 28px; }
}
