/* ── Fonts ───────────────────────────────────────────────────── */
@font-face {
  font-family: 'Satoshi';
  src: url('fonts/Satoshi-Variable.woff2') format('woff2-variations'),
       url('fonts/Satoshi-Variable.woff2') format('woff2');
  font-weight: 100 900; /* Supports all weights including Regular(400), Medium(500), and Black(900) */
  font-style: normal;
  font-display: swap;
}

/* ── Variables ───────────────────────────────────────────────── */
:root {
  --grad-a: #ebca49;
  --grad-b: #49e0ff;
  --grad-c: #66ff99;
  --dark-0: #080c10;
  --dark-1: #0d1219;
  --dark-2: #111820;
}

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

html, body {
  min-height: 100%;
  margin: 0;
  font-family: 'Satoshi', sans-serif;
  color: white;
  text-align: center;
  overflow-x: hidden;
}
body {
  visibility: visible !important;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 60% 40% at 15% 20%, rgba(73, 224, 255, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 75%, rgba(102, 255, 153, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(235, 202, 73, 0.04) 0%, transparent 70%),
    linear-gradient(160deg, var(--dark-1) 0%, var(--dark-0) 50%, var(--dark-2) 100%);
}

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding-top: 56px;
  position: relative;
  z-index: 1;
}

/* ── Typography ──────────────────────────────────────────────── */
.site-title {
  font-weight: 900;
  font-size: clamp(2rem, 8vw, 5rem); /* Optimized responsive scaling for mobile viewports */
  margin: 0 0 48px;
  line-height: 1.2;
  padding: 0 12px 4px; /* Added padding side buffers to ensure it doesn't touch screen edges */
  filter: drop-shadow(0 0 30px rgba(73, 224, 255, 0.15));
  word-break: break-word; /* Forces the long continuous text string to break cleanly on tiny screens */
  overflow-wrap: break-word;
}

/* ── Gradient text ───────────────────────────────────────────── */
.gradient-text,
.gradient-text span {
  background: linear-gradient(270deg, var(--grad-a), var(--grad-b), var(--grad-c), var(--grad-a));
  background-size: 600% 600%;
  animation: gradientFlow 6s ease infinite;
  
  /* Improved cross-browser performance order for clip execution masks */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent !important; /* Forces transparency over inner text spans */
  color: transparent !important;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Staggered page-load fade ────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.site-title    { animation: fadeInUp 0.6s ease both; }
.image-wrapper { animation: fadeInUp 0.6s 0.15s ease both; }

/* ── Image wrapper ───────────────────────────────────────────── */
.image-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 24px;
}

/* Only the image frame is clickable */
.image-area .img-frame {
  cursor: pointer;
}

.image-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Gradient border frame wrapping the main photo */
.image-area .img-frame {
  border-radius: 16px;
  padding: 3px;
  background: linear-gradient(270deg, var(--grad-a), var(--grad-b), var(--grad-c), var(--grad-a));
  background-size: 400% 400%;
  animation: gradientFlow 6s ease infinite;
  display: inline-block;
  transition: filter 0.3s ease, transform 0.3s ease;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.image-area .img-frame img {
  display: block;
  border-radius: 13px;
  max-width: min(72vw, 580px);
}

.image-area .img-frame:hover {
  filter:
    drop-shadow(0 0 18px rgba(73, 224, 255, 0.35))
    drop-shadow(0 0 36px rgba(102, 255, 153, 0.15));
  transform: translateY(-3px);
}

/* Side gifs also get gradient border treatment */
.side-gif {
  width: 200px;
  max-width: 18vw;
  border-radius: 14px;
  padding: 3px;
  background: linear-gradient(270deg, var(--grad-a), var(--grad-b), var(--grad-c), var(--grad-a));
  background-size: 400% 400%;
  animation: gradientFlow 6s ease infinite;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.click-text {
  text-align: center;
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ── Button group ────────────────────────────────────────────── */
.button_group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* ── Page card (tank.html etc.) ──────────────────────────────── */
.page-card {
  padding: 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(73, 224, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  max-width: min(90vw, 520px);
  margin: 24px auto 0;
  text-align: center;
}

.page-card img {
  width: 90%;
  height: auto;
  max-height: calc(100vh - 290px);
  object-fit: contain;
  display: block;
  border-radius: 16px;
  margin: 0 auto 16px;
}

.page-card a {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 26px;
  border-radius: 999px;
  background: #2ea8ff;
  color: white;
  text-decoration: none;
  transition: background 0.2s ease;
}

.page-card a:hover { background: #1c8ae0; }

/* ── crazyShake (kept for potential use) ─────────────────────── */
@keyframes crazyShake {
  0%   { transform: scale(1.05) rotate(0deg); }
  10%  { transform: scale(1.05) rotate(5deg); }
  20%  { transform: scale(1.05) rotate(-5deg); }
  30%  { transform: scale(1.05) rotate(5deg); }
  40%  { transform: scale(1.05) rotate(-5deg); }
  50%  { transform: scale(1.1) rotate(360deg); }
  60%  { transform: scale(1.05) rotate(-3deg); }
  70%  { transform: scale(1.05) rotate(3deg); }
  80%  { transform: scale(1.05) rotate(-2deg); }
  90%  { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1.05) rotate(0deg); }
}

/* ── Video overlay ───────────────────────────────────────────── */
.video-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
  isolation: isolate;
}

.video-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  z-index: 0;
}

.video-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.video-overlay video {
  border-radius: 14px;
  max-width: 80vw;
  max-height: 60vh;
  box-shadow:
    0 0 0 1px rgba(73, 224, 255, 0.15),
    0 0 24px rgba(73, 224, 255, 0.18),
    0 0 48px rgba(102, 255, 153, 0.08),
    0 16px 50px rgba(0, 0, 0, 0.7);
}

.video-info {
  display: flex;
  gap: 20px;
  align-items: center;
  background: rgba(8, 12, 16, 0.9);
  border: 1px solid rgba(73, 224, 255, 0.12);
  padding: 20px 24px;
  border-radius: 14px;
  max-width: 80vw;
  backdrop-filter: blur(8px);
}

.video-thumbnail {
  width: 240px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(270deg, var(--grad-a), var(--grad-b), var(--grad-c), var(--grad-a));
  background-size: 600% 600%;
  animation: gradientFlow 6s ease infinite;
  padding: 3px;
}

.video-info h2 {
  margin: 0;
  font-weight: 900;
  font-size: 2.2rem;
  white-space: nowrap;
}

.video-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.stop-button,
.redirect-button,
.mute-button {
  position: relative;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(13, 18, 25, 0.97), rgba(8, 12, 16, 0.99));
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.stop-button::before,
.redirect-button::before,
.mute-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(270deg, var(--grad-a), var(--grad-b), var(--grad-c), var(--grad-a));
  background-size: 400% 400%;
  animation: gradientFlow 6s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.stop-button {
  color: #ffb3b3;
  border: none;
  padding: 10px 22px;
  font-size: 0.95rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.stop-button:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 20px rgba(255, 80, 80, 0.2), 0 10px 28px rgba(0, 0, 0, 0.5);
}

.stop-button:active { transform: scale(0.98); }

.redirect-button {
  color: #e8f7ff;
  border: none;
  padding: 13px 30px;
  font-size: 1rem;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.redirect-button:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 0 22px rgba(73, 224, 255, 0.22),
    0 0 44px rgba(102, 255, 153, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.5);
}

.redirect-button:active { transform: scale(0.98); }

/* ── Mute button ─────────────────────────────────────────────── */
.mute-button {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  color: #e8f7ff;
  font-size: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.mute-button:hover {
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 0 16px rgba(73, 224, 255, 0.28), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.mute-button:active { transform: translateY(-50%) scale(0.96); }

/* ── Audio nudge ─────────────────────────────────────────────── */
.audio-nudge {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 12px;
  background: linear-gradient(135deg, #0b1117, #0f1620);
  border: 1px solid rgba(73, 224, 255, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #cfe7ff;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2000;
}

.audio-nudge::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  border: 6px solid transparent;
  border-top-color: rgba(73, 224, 255, 0.25);
}

.audio-nudge.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ── Footer ──────────────────────────────────────────────────── */
.page-footer {
  margin-top: 64px;
  padding: 16px 20px;
  color: rgba(200, 230, 255, 0.45);
  font-size: 0.88rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(73, 224, 255, 0.06);
  position: relative;
  letter-spacing: 0.3px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding-top: 36px; }
  .site-title { margin-bottom: 32px; }

  .image-wrapper {
    display: block;
    text-align: center;
    padding: 0 16px;
  }

  .side-gif { display: none; }

  .image-area .img-frame img { max-width: min(88vw, 420px); }

  .click-text { font-size: 1rem; }

  .video-overlay video {
    max-width: 95vw;
    max-height: 45vh;
  }

  .video-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
  }

  .video-thumbnail { width: min(70vw, 220px); }

  .video-info h2 {
    font-size: 1.5rem;
    white-space: normal;
  }

  .video-container { gap: 14px; padding: 0 10px; }
  .stop-button { width: min(80vw, 220px); }
  .button_group { gap: 10px; }
}

/* ── Footer nav pic buttons ──────────────────────────────────── */
.footer-nav {
  position: absolute;
  right: 60px; /* sit just left of the mute button */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-pic-button {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  padding: 2px;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(270deg, var(--grad-a), var(--grad-b), var(--grad-c), var(--grad-a));
  background-size: 400% 400%;
  animation: gradientFlow 6s ease infinite;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}

.nav-pic-button img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.nav-pic-button:hover {
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 0 16px rgba(73, 224, 255, 0.28), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.nav-pic-button:active {
  transform: translateY(-50%) scale(0.96);
}
.img-button {
  border-radius: 14px;
  padding: 4px;
  width: 60px;
  height: 60px;
}

.img-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
  display: block;
}

/* ── No-scroll pages (tank, otgonbayar, etc.) ────────────────── *
 * Constrain the main image so title + image + buttons + footer   *
 * all fit within one viewport without scrolling.                 */
.no-scroll {
  overflow: hidden;
  height: 100vh;
}

.no-scroll .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: calc(100vh - 57px);
  padding-top: 40px;
  overflow: hidden;
}

.no-scroll .site-title {
  margin-bottom: 0;
  flex-shrink: 0;
}

.no-scroll .image-wrapper {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 12px 0;
}

.no-scroll .image-area {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

.no-scroll .image-area .img-frame {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.no-scroll .image-area .img-frame img,
.no-scroll .page-card img {
  max-height: 100%;
  max-width: min(80vw, 520px);
  width: auto;
  object-fit: contain;
}

.no-scroll .page-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 12px auto 0;
}

.no-scroll .button_group {
  margin-top: 16px;
  flex-shrink: 0;
}

.no-scroll .click-text {
  flex-shrink: 0;
}