/* ====================== NOTUS GAS BURNER v2 ====================== */
.gb-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background: #0a1408;
  font-family: system-ui, -apple-system, Segoe UI, Impact, sans-serif;
}

/* Two jungle layers — smooth crossfade */
.gb-bg-stack {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.gb-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center bottom;
  transition: opacity 1.6s ease-in-out, filter 1.6s ease;
  transform: scale(1.04);
}

.gb-bg-normal {
  opacity: 1;
  z-index: 0;
  filter: brightness(0.78) saturate(1.05);
}

.gb-bg-burned {
  opacity: 0;
  z-index: 1;
  filter: brightness(0.95) saturate(1.25) contrast(1.05);
}

/* burnStrength 0–1 driven via inline style --gb-burn */
.gb-bg-stack {
  --gb-burn: 0;
}

.gb-bg-burned {
  opacity: var(--gb-burn);
}

.gb-bg-normal {
  opacity: calc(1 - var(--gb-burn) * 0.85);
}

.gb-bg-stack.is-raging .gb-bg-burned {
  animation: gb-bg-pulse 0.55s ease-in-out infinite;
}

@keyframes gb-bg-pulse {
  0%, 100% { filter: brightness(0.95) saturate(1.25); }
  50% { filter: brightness(1.1) saturate(1.45); }
}

.gb-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 55%, transparent 25%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 38%);
}

#gb-particles {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* Stage */
.gb-stage {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 84px 14px 22px;
  box-sizing: border-box;
}

.gb-title-block {
  text-align: center;
  margin-bottom: 4px;
  user-select: none;
  z-index: 5;
}

.gb-title {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.1rem, 7.5vw, 4.2rem);
  letter-spacing: 0.04em;
  color: #ff6a00;
  text-shadow:
    0 0 14px rgba(255, 80, 0, 0.9),
    0 0 42px rgba(255, 40, 0, 0.5),
    3px 3px 0 #1a0500;
  line-height: 1;
}

.gb-subtitle {
  margin: 8px 0 0;
  font-size: clamp(0.9rem, 2.4vw, 1.2rem);
  color: #ffc299;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ===== Gorilla integrated into jungle (no floating box) ===== */
.gb-hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: 300px;
  /* no background, no border, no card */
  background: transparent;
  box-shadow: none;
}

.gb-gorilla-wrap {
  position: relative;
  width: min(92vw, 460px);
  aspect-ratio: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible;
}

/* Ground contact shadow so he sits in the scene */
.gb-gorilla-wrap::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 4%;
  height: 10%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* Soft orange body glow (scales with --gb-level) */
.gb-body-glow {
  position: absolute;
  inset: 12% 10% 8%;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 50% 55%,
    rgba(255, 120, 20, calc(0.15 + var(--gb-level, 0) * 0.12)) 0%,
    rgba(255, 60, 0, calc(0.08 + var(--gb-level, 0) * 0.08)) 40%,
    transparent 70%
  );
  transition: opacity 0.6s ease, filter 0.6s ease;
  filter: blur(8px);
}

.gb-body-glow.on {
  opacity: 1;
  animation: gb-glow-breathe 1.4s ease-in-out infinite;
}

@keyframes gb-glow-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.75; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* Transparent PNG — sits on jungle, no black square / floating card */
.gb-gorilla {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 calc(var(--gb-level, 0) * 12px) rgba(255, 90, 0, calc(var(--gb-level, 0) * 0.4)));
  transition: filter 0.5s ease, transform 0.25s ease;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.gb-gorilla.charging {
  animation: gb-charge 0.32s ease-in-out infinite;
  filter:
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 28px rgba(255, 120, 0, 0.85))
    brightness(1.12);
}

.gb-gorilla.firing {
  animation: gb-recoil 0.5s ease-out;
}

@keyframes gb-charge {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}

@keyframes gb-recoil {
  0% { transform: translateX(0) scale(1); }
  25% { transform: translateX(-10px) scale(1.05); }
  100% { transform: translateX(0) scale(1); }
}

/* ===== CSS 3D-ish fire jet from weapon nozzle ===== */
.gb-weapon-fire {
  position: absolute;
  z-index: 3;
  /* muzzle tip of the gun (down-right of character) */
  left: 79%;
  top: 58%;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transform-origin: left center;
  transform: rotate(-6deg);
  transition: opacity 0.35s ease;
  perspective: 400px;
}

.gb-weapon-fire.on {
  opacity: 1;
}

.gb-flame {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotateY(-12deg);
  border-radius: 40% 80% 80% 40%;
  filter: blur(1px);
  mix-blend-mode: screen;
  animation: gb-flame-flicker 0.18s ease-in-out infinite alternate;
}

.gb-flame-core {
  width: calc(48px + var(--gb-level, 1) * 28px);
  height: calc(18px + var(--gb-level, 1) * 8px);
  background: linear-gradient(90deg, #fff6a0 0%, #ffcc33 25%, #ff6600 70%, transparent 100%);
  box-shadow: 0 0 18px #ff8800, 0 0 36px #ff4400;
  animation-duration: 0.12s;
}

.gb-flame-mid {
  width: calc(70px + var(--gb-level, 1) * 40px);
  height: calc(28px + var(--gb-level, 1) * 12px);
  left: 10px;
  background: linear-gradient(90deg, #ffaa22 0%, #ff4400 55%, transparent 100%);
  box-shadow: 0 0 22px #ff5500;
  opacity: 0.9;
  animation-duration: 0.16s;
}

.gb-flame-outer {
  width: calc(100px + var(--gb-level, 1) * 55px);
  height: calc(40px + var(--gb-level, 1) * 18px);
  left: 16px;
  background: linear-gradient(90deg, rgba(255, 80, 0, 0.85) 0%, rgba(255, 30, 0, 0.35) 60%, transparent 100%);
  box-shadow: 0 0 30px rgba(255, 40, 0, 0.7);
  opacity: 0.75;
  animation-duration: 0.22s;
}

@keyframes gb-flame-flicker {
  from { transform: translateY(-50%) scaleY(1) scaleX(1) rotateY(-12deg); }
  to { transform: translateY(-48%) scaleY(1.15) scaleX(1.08) rotateY(-8deg); }
}

/* level-based fire scale */
.gb-weapon-fire[data-level="1"] { --gb-level: 1; }
.gb-weapon-fire[data-level="2"] { --gb-level: 2; }
.gb-weapon-fire[data-level="3"] { --gb-level: 3; }
.gb-weapon-fire[data-level="4"] { --gb-level: 4; }
.gb-weapon-fire[data-level="5"] { --gb-level: 5; }

.gb-weapon-fire[data-level="4"] .gb-flame-outer,
.gb-weapon-fire[data-level="5"] .gb-flame-outer {
  animation: gb-flame-flicker 0.14s ease-in-out infinite alternate, gb-flame-roar 0.5s ease-in-out infinite;
}

@keyframes gb-flame-roar {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Status / toast */
.gb-status {
  min-height: 26px;
  text-align: center;
  font-size: 0.95rem;
  color: #ffb380;
  margin: 6px 0 10px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.gb-toast {
  position: fixed;
  left: 50%;
  bottom: 148px;
  transform: translateX(-50%) translateY(16px);
  z-index: 50;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(18, 6, 0, 0.94);
  border: 2px solid #ff6a00;
  box-shadow: 0 0 28px rgba(255, 80, 0, 0.45);
  color: #fff;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-align: center;
}

.gb-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.gb-toast a {
  color: #ff9a4a;
  font-weight: 700;
}

.gb-toast.error { border-color: #ff3344; }
.gb-toast.success { border-color: #00ff66; box-shadow: 0 0 24px rgba(0, 255, 100, 0.3); }

/* ===== Share result square (over gorilla) ===== */
.gb-share-card {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  animation: gb-share-in 0.35s ease-out;
}

.gb-share-card[hidden] {
  display: none !important;
}

@keyframes gb-share-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.gb-share-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 140, 60, 0.7);
  border-radius: 50%;
  background: rgba(20, 6, 0, 0.85);
  color: #ffb380;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.gb-share-close:hover {
  color: #fff;
  border-color: #ff6a00;
}

.gb-share-square {
  width: min(78%, 280px);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 16px;
  box-sizing: border-box;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 100, 0, 0.25) 0%, transparent 55%),
    linear-gradient(165deg, #2a1000 0%, #120500 55%, #0a0300 100%);
  border: 2px solid #ff6a00;
  box-shadow:
    0 0 28px rgba(255, 80, 0, 0.45),
    inset 0 0 24px rgba(255, 90, 0, 0.12);
  text-align: center;
  color: #fff;
}

.gb-share-brand {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #ff8a30;
  opacity: 0.9;
}

.gb-share-emoji {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255, 100, 0, 0.8));
}

.gb-share-title {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 1.45rem;
  color: #00ff66;
  text-shadow: 0 0 12px rgba(0, 255, 100, 0.4);
  margin: 2px 0 4px;
}

.gb-share-line {
  font-size: 0.95rem;
  color: #ffd0a8;
  line-height: 1.35;
}

.gb-share-explorer {
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ff9a4a;
  text-decoration: underline;
}

.gb-share-explorer:hover {
  color: #ffc080;
}

.gb-share-x-btn {
  border: none;
  border-radius: 9999px;
  padding: 12px 28px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  color: #fff;
  background: #1da1f2;
  box-shadow: 0 4px 18px rgba(29, 161, 242, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.gb-share-x-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.gb-share-x-btn:active {
  transform: translateY(0);
}

/* Buttons */
.gb-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 920px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 5;
}

.gb-burn-btn {
  position: relative;
  flex: 1 1 140px;
  min-width: 118px;
  max-width: 168px;
  padding: 14px 10px 12px;
  border-radius: 16px;
  border: 2px solid;
  cursor: pointer;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(180deg, #2a0c00 0%, #120400 100%);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  overflow: hidden;
  user-select: none;
}

.gb-burn-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.03); }
.gb-burn-btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.gb-burn-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.3); }

.gb-burn-btn .gb-btn-icon { display: block; font-size: 1.3rem; margin-bottom: 4px; }
.gb-burn-btn .gb-btn-label { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.gb-burn-btn .gb-btn-iters {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.9;
}

.gb-burn-btn[data-level="1"] {
  border-color: #ff9a3c;
  box-shadow: 0 0 12px rgba(255, 140, 40, 0.35);
}
.gb-burn-btn[data-level="2"] {
  border-color: #ff7a1a;
  box-shadow: 0 0 16px rgba(255, 100, 0, 0.5);
}
.gb-burn-btn[data-level="3"] {
  border-color: #ff5500;
  box-shadow: 0 0 20px rgba(255, 70, 0, 0.65), inset 0 0 18px rgba(255, 80, 0, 0.12);
}
.gb-burn-btn[data-level="4"] {
  border-color: #ff3300;
  box-shadow: 0 0 26px rgba(255, 40, 0, 0.8), inset 0 0 22px rgba(255, 60, 0, 0.2);
  animation: gb-btn-glow 1.4s ease-in-out infinite;
}
.gb-burn-btn[data-level="5"] {
  border-color: #ff1100;
  box-shadow: 0 0 32px rgba(255, 20, 0, 0.95), 0 0 56px rgba(255, 60, 0, 0.4);
  animation: gb-btn-glow 0.9s ease-in-out infinite;
}

@keyframes gb-btn-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

.gb-burn-btn.busy { pointer-events: none; }

.gb-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #a07050;
  text-align: center;
  text-shadow: 0 1px 4px #000;
}

@media (max-width: 640px) {
  .gb-stage { padding-top: 72px; padding-bottom: 14px; }
  .gb-hero { min-height: 240px; }
  .gb-gorilla-wrap { width: min(96vw, 380px); }
  .gb-weapon-fire { left: 78%; top: 57%; }
  .gb-buttons { gap: 8px; }
  .gb-burn-btn {
    flex: 1 1 42%;
    max-width: none;
    min-width: 0;
    padding: 12px 8px 10px;
  }
  .gb-toast { bottom: 168px; }
}

body:has(.gb-page) {
  margin: 0;
  background: #0a1408;
}

body:has(.gb-page) .title {
  display: none;
}
