/* ---------------------------
   Base + Variables (Green Theme)
   --------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=Space+Mono:wght@400;700&display=swap');

:root{
  --bg: #0f1a14;   /* deep green */
  --bg-2: #0b1410; /* darker panel */
  --grid: rgba(80, 200, 150, 0.12); /* subtle green grid */
  --text: #eafff2;              /* light mint text */
  --muted: #a8e4c6;             /* muted mint */
  --accent: #4aff8c;            /* neon green accent */
  --accent-2: #3cffd4;          /* aqua-mint secondary */
  --soft: rgba(74,255,140,.25);  /* soft inner green glow */
  --shadow: 0 0 40px rgba(255, 255, 255, 0.25);
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  color: var(--text);
}
body {
  margin: 0;
  font-family: "Chakra Petch", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

  background: radial-gradient(
                circle at center,
                #1d7a50 0%,     
                var(--bg) 55%,  
                var(--bg-2) 100%
              );
}


/* ---------------------------
   Hero layout
   --------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* subtle grid and particles */
.grid-overlay {
  position: absolute;
  inset: 0;
  background:
    /* tiny dots */
    radial-gradient(circle at 20% 30%, var(--grid) 1px, transparent 1px) 0 0/ 60px 60px,
    radial-gradient(circle at 70% 60%, var(--grid) 1px, transparent 1px) 0 0/ 80px 80px,
    /* faint grid */
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0/ 56px 56px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0/ 56px 56px;
  opacity: .8;
  pointer-events: none;
}

.hero-inner{
  width: min(1100px, 92vw);
  padding: 40px 0 80px;
  text-align: center;
  position: relative;
}

/* Mascot card (green) */
/* === Kamaru: center fixed, no border, neon green glow === */
.mascot{
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(180px, 22vw, 240px);
  height: clamp(180px, 22vw, 240px);
  background: transparent !important;
  border: none !important;
  overflow: visible;
  isolation: isolate;
}
.mascot img{
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Center mascot in hero */
.hero-inner{
  display: flex;
  flex-direction: column;
  align-items: center;   
  justify-content: center;
  text-align: center;
}



.mascot{
  margin-bottom: 24px;
}


.mascot.glow::before{ display: none; }
/* Remove glowing background */
.mascot.glow{
  box-shadow: none !important;
}
.mascot.glow::after{
  display: none !important;
}

/* Headline */
.headline{
  font-size: clamp(28px, 5.2vw, 64px);
  line-height: 1.1;
  letter-spacing: .02em;
  margin: 0 0 10px;
  font-weight: 700;
}
.headline span{
  display: inline-block;
  text-shadow: 0 0 24px rgba(74, 255, 140, .28);
}

/* Ticker */
.ticker{
  font: 700 clamp(26px, 4vw, 44px) "Space Mono", monospace;
  margin: 6px 0 16px;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(74, 255, 140, .32);
}

/* Socials (green) */
.social-row{
  display: inline-flex;
  gap: 12px;
  margin: 12px 0 18px;
}
.social-btn{
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(74, 255, 140, .30);
  background: rgba(20, 60, 40, .65);
  box-shadow: inset 0 0 30px rgba(74,255,140,.12);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}
.social-btn:hover{
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow:
    0 0 22px rgba(74,255,140,.30),
    inset 0 0 40px rgba(74,255,140,.18);
}

/* Meta line */
.chainline{
  margin: 10px 0 24px;
  color: var(--muted);
  letter-spacing: .08em;
  font-size: clamp(12px, 1.5vw, 14px);
}

/* CTAs (green) */
.cta-row{
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.btn.cta{
  --h: 48px;
  height: var(--h);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid rgba(74,255,140,.35);
  background: linear-gradient(180deg, rgba(20,80,50,.95), rgba(10,40,28,.95));
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow:
    0 0 0 1px rgba(74,255,140,.10) inset,
    inset 0 0 40px rgba(74,255,140,.15);
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn.cta.primary{
  background: linear-gradient(180deg, rgba(30,160,100,.98), rgba(12,88,54,.98));
  border-color: rgba(74,255,140,.55);
}
.btn.cta:hover{
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow:
    0 0 26px rgba(74,255,140,.35),
    inset 0 0 55px rgba(74,255,140,.20);
}

/* Contract card (green) */
.contract-card{
  width: min(980px, 92vw);
  margin: 14px auto 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(74,255,140,.25);
  background: linear-gradient(180deg, rgba(20,60,40,.7), rgba(10,30,20,.7));
  box-shadow: inset 0 0 60px rgba(74,255,140,.15);
  text-align: left;
}
.contract-card .label{
  font: 700 12px "Space Mono", monospace;
  letter-spacing: .12em;
  color: #a4f5cf;
  margin-bottom: 8px;
}
.contract-input{
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.contract-input input{
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(10,30,20,.85);
  border: 1px solid rgba(74,255,140,.25);
  color: var(--text);
  font: 600 14px/46px "Space Mono", monospace;
  letter-spacing: .02em;
  outline: none;
}
.icon-btn{
  width: 46px; height: 46px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(15,45,30,.85);
  border: 1px solid rgba(74,255,140,.25);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.icon-btn:hover{
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(74,255,140,.35);
}
.tooltip{
  position: absolute;
  right: 58px;
  top: -24px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #0f3d2a;
  border: 1px solid rgba(74,255,140,.3);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.tooltip.show{
  opacity: 1;
  transform: translateY(0);
}
.contract-card .mini{
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
  opacity: .85;
}

/* Small tweaks for very narrow screens */
@media (max-width: 420px){
  .social-btn{ width: 42px; height: 42px; }
  .btn.cta{ --h: 46px; padding: 0 14px; }
  .mascot{ width: 112px; height: 112px; }
  .mascot img{ width: 80px; height: 80px; }
}

/* Custom image icon inside CTA button */
.btn.cta .icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: inline-block;
  vertical-align: -2px;
}

/* Narrative / description box */
.desc-box {
  width: min(900px, 92vw);
  margin: 30px auto 20px;
  padding: 20px 26px;
  border-radius: 14px;
  background: rgba(20,60,40,.75);
  border: 1px solid rgba(74,255,140,.25);
  box-shadow: inset 0 0 50px rgba(74,255,140,.1);
  text-align: center;
}
.desc-box p {
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.6;
  color: var(--text);
}
.desc-box .prompt {
  color: var(--accent);
  font-weight: 700;
  margin-right: 4px;
}

/* Scroll down indicator */
.scroll-down {
  margin-top: 16px;
  font-size: 22px;
  color: var(--accent);
  animation: bounce 1.6s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ==================== SECTION 2 (Gallery) ==================== */
.library{
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 80px 0 0px;
  overflow: hidden; /* keep rain within section */
}

/* faint grid background for continuity */
.library::before{
  content:"";
  position:absolute; inset:0;
  background:
    radial-gradient(circle at 15% 25%, var(--grid) 1px, transparent 1px) 0 0/ 64px 64px,
    radial-gradient(circle at 75% 65%, var(--grid) 1px, transparent 1px) 0 0/ 84px 84px,
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0/ 56px 56px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0/ 56px 56px;
  pointer-events:none;
  opacity:.6;
}

/* rain canvas sits behind cards */
#rainCanvas{
  position:absolute; inset:0;
  width:100%; height:100%;
  pointer-events:none;
  opacity:.45;
}

/* 6 columns per row on desktop */
.kiki-grid{
  position: relative;
  width: min(1400px, 95vw);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 20px;
  z-index: 1;
}
.kiki-spacer{
  aspect-ratio: 1/1;
  visibility: hidden;
}


/* card base (image only) */
.kiki-card{
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(18,52,38,.6);
  border: 1px solid rgba(74,255,140,.22);
  box-shadow: inset 0 0 40px rgba(74,255,140,.10);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  isolation: isolate;
}

/* image fills the card */
.kiki-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform .25s ease, filter .25s ease;
}

/* subtle glow overlay for consistency with Section 1 */
.kiki-card::after{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(120% 120% at 50% 0%, rgba(74,255,140,.22), transparent 55%),
              linear-gradient(180deg, transparent 70%, rgba(0,0,0,.22));
  pointer-events:none;
  opacity:.35;
  mix-blend-mode: screen;
  transition: opacity .25s ease;
}

/* hover state */
.kiki-card:hover{
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow:
    0 10px 28px rgba(0,0,0,.35),
    0 0 26px rgba(74,255,140,.28),
    inset 0 0 60px rgba(74,255,140,.16);
}
.kiki-card:hover img{
  transform: scale(1.06);
  filter: saturate(1.05) contrast(1.04);
}
.kiki-card:hover::after{ opacity:.55; }

/* focus-visible for keyboard users */
.kiki-card:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Breakpoints: gracefully reduce columns */
@media (max-width: 1280px){
  .kiki-grid{ gap: 18px; }
}
@media (max-width: 1080px){
  .kiki-grid{ grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px){
  .kiki-grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px){
  .kiki-grid{ grid-template-columns: repeat(2, 1fr); }
}


/* ===== Global grid overlay (fixed, continuous across sections) ===== */
.global-grid{
  position: fixed;
  inset: 0;
  z-index: 0;                   
  pointer-events: none;
  opacity: .8;

  background:
    radial-gradient(circle at 20% 30%, var(--grid) 1px, transparent 1px) 0 0/ 60px 60px,
    radial-gradient(circle at 70% 60%, var(--grid) 1px, transparent 1px) 0 0/ 80px 80px,
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0/ 56px 56px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0/ 56px 56px;
}

.hero, .library, .desc-box, .contract-card{
  position: relative;
  z-index: 1;
}


.grid-overlay{ display: none !important; }
.library::before{ display: none !important; }


/* ===== Neon glow for the mascot card ===== */
.mascot.glow{
  position: relative;
  isolation: isolate;                    /* create stacking context so ::after can sit behind */
  border-color: rgba(74,255,140,.45);    /* slightly brighter border */
  box-shadow:
    inset 0 0 60px rgba(74,255,140,.20),
    0 0 24px rgba(74,255,140,.25);       /* subtle outer glow base */
  animation: mascotPulse 2.8s ease-in-out infinite;
}

/* inner frame (thin line inside the card) */
.mascot.glow::before{
  content:"";
  position:absolute;
  inset:10px;
  border-radius: 16px;
  border:1px solid rgba(74,255,140,.22);
  box-shadow: inset 0 0 18px rgba(74,255,140,.10);
  pointer-events:none;
  z-index: 1;
}

/* outer halo behind the card */
.mascot.glow::after{
  content:"";
  position:absolute;
  inset:-14px;                           /* extend outside to make the halo visible */
  border-radius: 28px;
  background: radial-gradient(closest-side, rgba(74,255,140,.55), rgba(74,255,140,0) 70%);
  filter: blur(14px);
  opacity:.75;
  z-index: -1;                           /* place behind the card */
  transition: opacity .25s ease, filter .25s ease;
}

/* image sits above decoration and gets a tiny lift on hover */
.mascot.glow img{
  position: relative;
  z-index: 2;
  transition: transform .25s ease, filter .25s ease;
  filter: drop-shadow(0 0 12px rgba(74,255,140,.35));
}

.mascot.glow:hover{
  animation-duration: 1.6s;
}
.mascot.glow:hover::after{
  opacity: .95;
  filter: blur(18px);
}
.mascot.glow:hover img{
  transform: scale(1.03);
}

/* breathing glow animation */
@keyframes mascotPulse{
  0%,100%{
    box-shadow:
      inset 0 0 50px rgba(74,255,140,.16),
      0 0 18px rgba(74,255,140,.22);
  }
  50%{
    box-shadow:
      inset 0 0 80px rgba(74,255,140,.26),
      0 0 40px rgba(74,255,140,.36);
  }
}


/* ===================== SECTION 3: Narrative Post ===================== */
.story{ padding-top: -24px !important; }

.story-grid{
  width: min(1200px, 94vw);
  margin: 0 auto;
  display: grid;
  margin-top: 20px;
  grid-template-columns: repeat(3, 1fr);   /* 3 panels */
  gap: 28px;
  align-items: stretch;                     
}

/* Card shell */
.story-card{
  background: linear-gradient(180deg, rgba(20,60,40,.70), rgba(10,30,20,.70));
  border: 1px solid rgba(74,255,140,.25);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35), inset 0 0 40px rgba(74,255,140,.10);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;

  /* NEW: biar isi bisa bagi ruang dengan rapi */
  display: flex;
  flex-direction: column;
}

/* Image area — seragam tingginya */
.story-media{
  position: relative;
  overflow: hidden;
  background: rgba(18,52,38,.75);

  /* NEW: rasio area gambar; portrait biar cocok sama aset mu */
  aspect-ratio: var(--story-media-ratio, 3 / 4);
  /* kalau mau lebih kotak, ubah ke 4/5 atau 1/1 */
}

.story-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;    
  display: block;
}

/* glow overlay tetap */
.story-media::after{
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(74,255,140,.20), transparent 60%),
    linear-gradient(180deg, transparent 70%, rgba(0,0,0,.25));
  pointer-events: none;
  mix-blend-mode: screen;
}



@media (max-width: 1024px){
  .story-grid{ grid-template-columns: 1fr 1fr; }
  :root{ --story-media-ratio: 4 / 3; } 
}
@media (max-width: 680px){
  .story-grid{ grid-template-columns: 1fr; }
  :root{ --story-media-ratio: 16 / 9; } 
}

/* Text bubble */
.story-text{
  padding: 18px 18px 22px;
}
.story-badge{
  display: inline-block;
  font: 700 11px "Space Mono", monospace;
  letter-spacing: .12em;
  color: #a4f5cf;
  border: 1px solid rgba(74,255,140,.28);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20,60,40,.55);
  margin-bottom: 10px;
}
.story-title{
  margin: 10px 0 8px;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.25;
  color: var(--text);
  text-shadow: 0 0 16px rgba(74,255,140,.20);
}
.story-text p{
  margin: 0;
  color: var(--text);
  opacity: .92;
  line-height: 1.6;
}

/* Hover: lift + image zoom + brighter border */
.story-card:hover{
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow:
    0 14px 34px rgba(0,0,0,.45),
    0 0 30px rgba(74,255,140,.28),
    inset 0 0 60px rgba(74,255,140,.16);
}
.story-card:hover .story-media img{
  transform: scale(1.06);
  filter: saturate(1.05) contrast(1.05);
}

/* Reveal on scroll */
.reveal{ opacity: 0; transform: translateY(18px); }
.reveal.show{ opacity: 1; transform: translateY(0); transition: opacity .55s ease, transform .55s ease; }

/* Responsive */
@media (max-width: 1024px){
  .story-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px){
  .story-grid{ grid-template-columns: 1fr; }
}



/* ===== Section 3 header ===== */
.story-header{
  width: min(1200px, 94vw);
  margin: 0 auto 26px;
  text-align: center;
}
.story-heading{
  font: 700 clamp(18px, 3vw, 28px) "Space Mono", monospace;
  letter-spacing: .12em;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(74,255,140,.28);
  margin: 0 0 6px;
}
.story-sub{
  color: var(--muted);
  opacity: .9;
  margin: 0;
}

/* ===== Modal base ===== */
.modal{
  position: fixed; inset: 0; display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
}
.modal.open{ display: flex; }

.modal-backdrop{
  position: absolute; inset: 0;
  background: rgba(0, 16, 10, .7);
  backdrop-filter: blur(6px);
}

.modal-dialog{
  position: relative;
  width: min(1000px, 94vw);
  max-height: 92vh;
  background: linear-gradient(180deg, rgba(20,60,40,.90), rgba(10,30,20,.92));
  border: 1px solid rgba(74,255,140,.35);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0,0,0,.55), 0 0 40px rgba(74,255,140,.25) inset;
  overflow: hidden;
  transform: translateY(8px);
  animation: modalIn .28s ease forwards;
}
@keyframes modalIn{ to{ transform: translateY(0); } }

/* Top-right controls */
.modal-close, .modal-full{
  position: absolute; top: 10px;
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(20,60,40,.7);
  color: var(--text);
  border: 1px solid rgba(74,255,140,.35);
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .1s ease;
  z-index: 2;
}
.modal-close{ right: 10px; }
.modal-full { right: 54px; }
.modal-close:hover, .modal-full:hover{
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(74,255,140,.35), inset 0 0 30px rgba(74,255,140,.18);
  transform: translateY(-1px);
}

/* Media area inside modal */
.modal-media{
  position: relative;
  background: rgba(18,52,38,.9);
  aspect-ratio: 16/9;
  overflow: hidden;
}
.modal-media img{
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: #07130c;
}

/* Text area inside modal */
.modal-body{
  padding: 16px 18px 22px;
  max-height: 38vh;
  overflow: auto;
}

/* Fullscreen fallback via CSS (if Fullscreen API blocked) */
.modal.fill .modal-dialog{
  width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0;
}
.modal.fill .modal-media{ height: 66vh; }
.modal.fill .modal-body{ max-height: 34vh; }

/* Prevent body scroll while modal is open */
body.no-scroll{ overflow: hidden; }


.story-grid{
}

.modal-prev, .modal-next{
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(20,60,40,.7);
  color: var(--text);
  border: 1px solid rgba(74,255,140,.35);
  cursor: pointer;
  z-index: 3;
  transition: border-color .2s ease, box-shadow .2s ease, transform .1s ease;
}
.modal-prev{ left: 10px; }
.modal-next{ right: 10px; }
.modal-prev:hover, .modal-next:hover{
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(74,255,140,.35), inset 0 0 30px rgba(74,255,140,.18);
  transform: translateY(-50%) scale(1.03);
}

.story-grid{
  row-gap: clamp(22px, 2.2vw, 32px);
  column-gap: clamp(22px, 2.2vw, 32px);
}


/* ===================== FOOTER ===================== */
.site-footer{
  position: relative;
  z-index: 1;                                  /* above global grid */
  margin-top: clamp(36px, 6vw, 80px);
  padding: clamp(24px, 3.5vw, 38px) 0;
  background: linear-gradient(180deg, rgba(20,60,40,.65), rgba(10,30,20,.82));
  border-top: 1px solid rgba(74,255,140,.25);
  box-shadow: 0 -10px 30px rgba(0,0,0,.35), inset 0 10px 40px rgba(74,255,140,.08);
}
.footer-inner{
  width: min(1200px, 94vw);
  margin: 0 auto;
  text-align: center;
}
.footer-sigil{
  margin: 0 0 6px;
  font: 700 clamp(16px, 2.6vw, 22px) "Space Mono", monospace;
  letter-spacing: .14em;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(74,255,140,.28);
}
.footer-heart{
  margin: 0;
  color: var(--text);
  opacity: .92;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.footer-heart i{
  filter: drop-shadow(0 0 8px rgba(74,255,140,.35));
  animation: heartbeat 1.8s ease-in-out infinite;
}
@keyframes heartbeat{
  0%,100%{ transform: scale(1); }
  14%    { transform: scale(1.25); }
  28%    { transform: scale(1); }
  42%    { transform: scale(1.18); }
  70%    { transform: scale(1); }
}
.footer-copy{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .02em;
}


/* ===================== MARKET / DEX ===================== */
.market{
  position: relative;
  z-index: 1;
  padding: clamp(28px, 4vw, 48px) 0 clamp(32px, 5vw, 60px);
}
.market-header{
  width: min(1200px, 94vw);
  margin: 0 auto clamp(14px, 2.5vw, 22px);
  text-align: center;
}

.dex-card{
  width: min(1200px, 94vw);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(20,60,40,.70), rgba(10,30,20,.78));
  border: 1px solid rgba(74,255,140,.28);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0,0,0,.45), inset 0 0 40px rgba(74,255,140,.10);
  overflow: hidden;
}

/* Action bar */
.dex-actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 10px;
  border-bottom: 1px solid rgba(74,255,140,.18);
  background: rgba(15,45,30,.55);
}
.dex-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(74,255,140,.35);
  background: rgba(20,60,40,.75);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  box-shadow: inset 0 0 24px rgba(74,255,140,.12);
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease;
}
.dex-btn:hover{
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(74,255,140,.32), inset 0 0 30px rgba(74,255,140,.18);
}

/* Frame wrapper: responsive height */
.dex-framewrap{
  position: relative;
  height: clamp(460px, 60vh, 720px); /* default height */
  background: #07130c;
}
.dex-framewrap iframe{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
}

/* Expanded mode */
.dex-card.expanded .dex-framewrap{
  height: 82vh;
}
.dex-card.expanded .dex-expand i::before{
  content: "\f145"; /* bootstrap icons 'arrows-angle-contract' */
}
.dex-card.expanded .dex-expand span{
  content: "Collapse";
}

/* Mobile tweaks */
@media (max-width: 640px){
  .dex-actions{ justify-content: center; }
  .dex-framewrap{ height: clamp(420px, 58vh, 620px); }
}

/* ===================== KIKI Custom Maker ===================== */
.maker{
  position: relative; z-index: 1;
  padding: clamp(36px, 5vw, 64px) 0;
}
.maker-header{
  width: min(1200px, 94vw);
  margin: 0 auto clamp(18px, 3vw, 28px);
  text-align: center;
}

/* Card container */
.maker-card{
  width: min(980px, 94vw);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(20,60,40,.72), rgba(10,30,20,.82));
  border: 1px solid rgba(74,255,140,.28);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0,0,0,.45), inset 0 0 40px rgba(74,255,140,.10);
  padding: clamp(16px, 2.2vw, 22px);
}

/* Stage / preview */
.maker-stage{
  display: grid; place-items: center;
  background: rgba(15,45,30,.55);
  border: 1px solid rgba(74,255,140,.18);
  border-radius: 16px;
  padding: clamp(14px, 2vw, 18px);
  box-shadow: inset 0 0 30px rgba(74,255,140,.08);
}
#makerCanvas{
  width: min(460px, 86vw);
  height: auto;
  aspect-ratio: 1 / 1; /* keep square on resize */
  border-radius: 14px;
  background: #000; /* won't be seen; canvas draws full */
}

/* Controls */
.maker-ctrl{
  margin-top: clamp(16px, 2vw, 22px);
  text-align: center;
}
.maker-label{
  margin: 14px 0 10px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .06em;
}

/* Swatches */
.swatches{
  display: grid;
  grid-template-columns: repeat(10, 40px);
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}
@media (max-width: 680px){
  .swatches{ grid-template-columns: repeat(5, 40px); }
}
.swatch{
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--sw);
  border: 2px solid rgba(255,255,255,.75);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.swatch:hover{ transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.swatch.active{ outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }

/* Buttons (align with your theme) */
.maker-actions{
  display: flex; gap: 10px; justify-content: center; margin-top: 10px;
}
.btn.maker-btn{
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px;
  border-radius: 12px; font-weight: 700; letter-spacing: .03em;
  border: 1px solid rgba(74,255,140,.35);
  color: var(--text); text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, rgba(20,60,40,.9), rgba(10,30,20,.92));
  box-shadow: inset 0 0 30px rgba(74,255,140,.12);
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn.maker-btn.primary{
  background: linear-gradient(180deg, rgba(34,120,80,.95), rgba(20,60,40,.95));
  border-color: rgba(74,255,140,.55);
}
.btn.maker-btn.ghost{
  background: transparent;
  border-color: rgba(74,255,140,.25);
}
.btn.maker-btn:hover{
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(74,255,140,.32), inset 0 0 36px rgba(74,255,140,.16);
}

.story-continued {
  margin-top: 32px;
  text-align: center;
  font: 700 clamp(18px, 3vw, 24px) "Space Mono", monospace;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(74,255,140,.28);
  opacity: 0.9;
}
