/* ===========================================================
   GRAMBLER — cartoon landing (mascot: slot-head businessman)
   Light, clean vector-cartoon style. Bold outlines, flat fills,
   rounded chunky UI. Replaces the old pixel arcade theme.
   =========================================================== */

:root {
  --blue:      #1b53e6;
  --blue-2:    #0f3fc4;
  --blue-ink:  #0a2a86;
  --sky:       #2aabee;
  --gold:      #f7b731;
  --gold-2:    #e79a12;
  --green:     #22c36b;
  --green-2:   #16a35a;
  --red:       #ef4b4b;
  --red-2:     #cc3535;
  --ink:       #10213f;
  --line:      #10213f;      /* cartoon outline */
  --paper:     #eef4ff;
  --paper-2:   #dbe7ff;
  --card:      #ffffff;
  --muted:     #6b7a99;

  --round:     22px;
  --font:      "Fredoka", "Baloo 2", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% -10%, #ffffff 0%, var(--paper) 55%, var(--paper-2) 100%);
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old IE/Edge */
}
body { overflow-x: hidden; }
/* hide scrollbar visually but keep scrolling (WebKit/Chromium) */
html::-webkit-scrollbar, body::-webkit-scrollbar,
*::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
img { max-width: 100%; }

/* soft dotted texture */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(27,83,230,.06) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
}

/* ---------- Boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--paper); transition: opacity .45s ease;
}
#boot.hidden { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot-plane {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--sky); position: relative;
  box-shadow: 0 8px 0 rgba(0,0,0,.12), inset 0 -6px 0 rgba(0,0,0,.12);
  animation: floaty 1.3s ease-in-out infinite;
}
.boot-plane::after {
  content: ""; position: absolute; inset: 0;
  background: no-repeat center/54% conic-gradient(from 0deg, transparent 0 0);
  -webkit-mask: no-repeat center/54% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 2 2 11l7 3 3 7 10-19z' fill='%23fff'/%3E%3C/svg%3E");
  background: #fff;
}
.boot-text { font-weight: 600; letter-spacing: 2px; color: var(--blue); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ---------- Stage / landing ---------- */
#stage {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 18px 40px;
}

/* first screen — always fits the app window (no scroll to reach game buttons) */
.play {
  width: 100%;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 2.5vh, 22px);
  padding: 72px 0 18px;
}

#brand {
  text-align: center;
  opacity: 0; transform: translateY(10px);
  animation: rise .6s .1s ease forwards;
  flex: 0 0 auto;
}
#brand h1 {
  margin: 0; font-weight: 700; letter-spacing: 1px;
  font-size: clamp(38px, 9vw, 68px);
  color: var(--blue);
  -webkit-text-stroke: 3px var(--line);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(16,33,63,.18);
}
#brand p {
  margin: 6px 0 0; font-weight: 500; color: var(--muted);
  font-size: clamp(12px, 3.4vw, 16px); letter-spacing: .5px;
}

/* mascot hero — flexes to fit the first screen */
#hero {
  position: relative;
  margin: 0;
  filter: drop-shadow(0 20px 22px rgba(16,33,63,.22));
  animation: bob 4s ease-in-out infinite;
  flex: 0 1 auto; min-height: 0;
}
#hero img {
  height: min(42vh, 400px);
  max-height: 100%;
  width: auto; display: block;
}
#hero::after { /* ground shadow */
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  width: 58%; height: 26px; border-radius: 50%;
  background: radial-gradient(rgba(16,33,63,.28), rgba(16,33,63,0) 70%);
  z-index: -1;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* game buttons */
#apps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; width: min(560px, 100%);
  opacity: 0; transform: translateY(12px);
  animation: rise .6s .25s ease forwards;
  flex: 0 0 auto;
}
.app {
  cursor: pointer; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px 14px;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--round);
  box-shadow: 0 6px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease;
}
.app:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--line); }
.app:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.app .ico {
  width: 62px; height: 62px; border-radius: 16px;
  display: grid; place-items: center; font-size: 34px;
  border: 3px solid var(--line);
}
.app[data-app="dice"] .ico { background: var(--red); }
.app[data-app="grambling"] .ico { background: var(--gold); }
.app[data-app="longshort"] .ico { background: var(--green); }
.app .nm { font-weight: 600; font-size: clamp(12px, 3.2vw, 15px); color: var(--ink); letter-spacing: .3px; }

@media (max-width: 460px) {
  .app { padding: 12px 4px 10px; border-width: 2.5px; box-shadow: 0 5px 0 var(--line); }
  .app .ico { width: 52px; height: 52px; font-size: 28px; }
}

/* ---------- Sections ---------- */
.sec { width: min(680px, 100%); margin-top: 34px; }
.sec-title {
  text-align: center; margin: 0 0 16px; font-weight: 700; letter-spacing: .5px;
  font-size: clamp(20px, 5vw, 28px); color: var(--blue);
  -webkit-text-stroke: 2px var(--line); paint-order: stroke fill;
}

/* how to play */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step {
  position: relative; background: var(--card); border: 3px solid var(--line);
  border-radius: 18px; box-shadow: 0 6px 0 var(--line); padding: 22px 14px 16px; text-align: center;
}
.step-n {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #fff; border: 3px solid var(--line);
  font-weight: 700; font-size: 16px;
}
.step b { display: block; font-size: 16px; color: var(--ink); margin: 6px 0 6px; }
.step p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* token card */
.token-card {
  background: var(--card); border: 3px solid var(--line); border-radius: 22px;
  box-shadow: 0 8px 0 var(--line); padding: 22px 20px;
}
.token-lead { margin: 0 0 18px; text-align: center; font-size: 15px; color: var(--ink); line-height: 1.5; }
.token-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.tstat {
  background: var(--paper); border: 2.5px solid var(--line); border-radius: 14px;
  padding: 10px 6px; text-align: center;
}
.tstat span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.tstat b { font-size: 14px; color: var(--ink); }

.token-ca {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--paper); border: 2.5px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 16px; cursor: pointer; font-family: var(--font);
  position: relative; transition: background .2s ease;
}
.token-ca:active { transform: translateY(1px); }
.token-ca > span:first-child { font-weight: 700; color: var(--muted); font-size: 13px; }
.token-ca code {
  flex: 1; text-align: left; font-family: ui-monospace, monospace; font-size: 13px;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.token-ca .ca-ico { font-size: 18px; color: var(--blue); }
.token-ca.copied { background: #e6f9ee; border-color: var(--green); }
.token-ca.copied::after {
  content: attr(data-msg); position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: var(--green); color: #fff; font-weight: 700; font-size: 11px; padding: 4px 8px; border-radius: 8px;
}

.socials { display: flex; gap: 12px; }
.soc {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; font-weight: 700; font-size: 15px; color: #fff;
  border: 3px solid var(--line); border-radius: 14px; padding: 13px; min-height: 50px;
  box-shadow: 0 5px 0 var(--line); transition: transform .08s ease, box-shadow .08s ease;
}
.soc:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.soc svg { width: 22px; height: 22px; }
.soc.tg { background: var(--sky); }
.soc.x  { background: #111; }

#foot { margin: 30px 0 6px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- language button ---------- */
#lang-btn {
  font-family: var(--font); font-weight: 700; font-size: 14px; color: var(--ink);
  background: var(--card); border: 3px solid var(--line); border-radius: 999px;
  padding: 9px 14px; cursor: pointer; box-shadow: 0 4px 0 var(--line); min-width: 46px;
}
#lang-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }

/* ---------- side floating memecoins (desktop) ---------- */
#floaters { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.fl {
  position: absolute; width: 66px; height: 66px; border-radius: 50%;
  border: 3px solid var(--line); object-fit: cover; background: #fff;
  box-shadow: 0 8px 0 rgba(16,33,63,.12); opacity: .95;
  animation: bob 5s ease-in-out infinite;
}
.f1 { left: 4%;  top: 22%; animation-delay: 0s; }
.f2 { left: 8%;  top: 58%; width: 78px; height: 78px; animation-delay: .8s; }
.f3 { left: 3%;  top: 80%; width: 54px; height: 54px; animation-delay: 1.6s; }
.f4 { right: 5%; top: 20%; width: 74px; height: 74px; animation-delay: .4s; }
.f5 { right: 8%; top: 52%; animation-delay: 1.2s; }
.f6 { right: 3%; top: 78%; width: 58px; height: 58px; animation-delay: 2s; }
@media (max-width: 1080px) { #floaters { display: none; } }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  #stage { padding: 0 14px 30px; }
  .play { padding: 64px 0 14px; gap: clamp(8px, 2vh, 18px); }
  #hero img { height: min(40vh, 360px); }
  #brand h1 { -webkit-text-stroke: 2.5px var(--line); }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .step { box-shadow: 0 5px 0 var(--line); }
  .token-stats { grid-template-columns: repeat(2, 1fr); }
  .socials { flex-direction: column; }
  #hud { padding: 10px 10px; gap: 7px; }
  #lang-btn { font-size: 12px; padding: 7px 11px; min-width: 40px; }
}

/* legacy pixel-only nodes hidden if present */
#scene, #camera, #world, #marquee, #labels, #hint, #lever, #tg-badge, #skip { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  #hero, .boot-plane { animation: none; }
}
