/* ═══════════════════════════════════════════════════════════════════════
   FRANYXAI — ISLE FRENZY  ·  scoped .fxisle-*
   3D agar.io dino arena. Self-contained; sits inside #fxIsleGame.
═══════════════════════════════════════════════════════════════════════ */

.fxisle-wrap {
  position: relative;
  width: 100%;
  height: clamp(480px, 84vh, 1100px);   /* fill more of the screen, less empty space */
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #9fe0d3 0%, #6cae8e 60%, #4d8466 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.18);
  transition: box-shadow .12s ease;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Fredoka', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
/* Fullscreen: the wrap takes over the whole viewport (ResizeObserver re-sizes canvas). */
.fxisle-wrap:fullscreen,
.fxisle-wrap:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }

/* iOS pseudo-fullscreen — iPhone Safari has no element Fullscreen API, so we
   pin the wrap over the whole viewport ourselves. 100dvh tracks Safari's bars. */
.fxisle-wrap.fxisle-pseudofs {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  margin: 0; border-radius: 0; z-index: 2147483000;
}
html.fxisle-noscroll, body.fxisle-noscroll { overflow: hidden !important; touch-action: none; }

/* Rotate-to-landscape prompt (iOS can't lock orientation; we ask nicely). */
.fxisle-rotate {
  position: absolute; inset: 0; z-index: 2147483001;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(4,16,12,.85); color: #eafff6; backdrop-filter: blur(3px);
  font: 700 1.15rem/1.45 'Nunito', system-ui, sans-serif; cursor: pointer; padding: 24px;
}
.fxisle-rotate-ic { font-size: 2.6rem; margin-bottom: 10px; animation: fxisleRotateSpin 2.2s ease-in-out infinite; }
.fxisle-rotate-in small { display: block; margin-top: 8px; opacity: .72; font-weight: 600; font-size: .8rem; }
@keyframes fxisleRotateSpin { 0%,55% { transform: rotate(0); } 80%,100% { transform: rotate(90deg); } }

.fxisle-canvas { position: absolute; inset: 0; touch-action: none; }
/* touch-action:none → mobile delivers pointer events immediately instead of
   hijacking touches for scroll/zoom (fixes "tap/steer gak kebaca di HP"). */
.fxisle-canvas canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }

/* ── Boot / loading / error ───────────────────────────────────────────── */
.fxisle-boot {
  min-height: 440px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 40px 24px;
  color: #eafff6;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.05rem;
  letter-spacing: .3px;
  background: radial-gradient(120% 120% at 50% 0%, #2b6f5e, #14342b);
  border-radius: 18px;
}
.fxisle-boot small { opacity: .7; font-size: .85rem; }

/* ── HUD: live leaderboard (top-left) ─────────────────────────────────── */
.fxisle-hud {
  position: absolute; top: 14px; left: 14px;
  width: 184px;
  padding: 7px 8px 8px;
  border-radius: 14px;
  background: rgba(8, 28, 22, .52);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  pointer-events: none; z-index: 4;
}
.fxisle-lb-hd {
  display: flex; align-items: center; gap: 6px;
  margin: 0 2px 5px;
  font-size: .6rem; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: #ffd54a;
}
.fxisle-lb-hd svg { width: 13px; height: 13px; flex: none; }
.fxisle-lb-row, .fxisle-lb-me {
  display: grid; grid-template-columns: 16px 1fr auto;
  align-items: center; gap: 7px;
  padding: 2px 4px; border-radius: 7px;
  color: #eafff6; line-height: 1.5;
}
.fxisle-lb-rk { font-size: .72rem; font-weight: 700; color: #aee8d4; text-align: center; }
.fxisle-lb-nm { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fxisle-lb-sz { font-size: .78rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.fxisle-lb-list .fxisle-lb-row:first-child .fxisle-lb-rk { color: #ffd54a; }   /* gold #1 */
.fxisle-lb-row.me { background: rgba(41,182,246,.26); box-shadow: inset 0 0 0 1px rgba(41,182,246,.5); }
.fxisle-lb-row.me .fxisle-lb-rk { color: #7fd6ff; }
.fxisle-lb-me {
  margin-top: 5px; padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,.2);
  background: rgba(41,182,246,.2);
  box-shadow: inset 0 0 0 1px rgba(41,182,246,.4);
}
.fxisle-lb-me[data-show="0"] { display: none; }
.fxisle-lb-me .fxisle-lb-rk { color: #7fd6ff; }

/* ── Minimap (bottom-left) ────────────────────────────────────────────── */
.fxisle-mini {
  position: absolute; bottom: 12px; left: 14px;
  padding: 5px; border-radius: 14px;
  background: rgba(8, 28, 22, .42);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  pointer-events: none; z-index: 4; line-height: 0;
}
.fxisle-mini canvas { display: block; border-radius: 10px; }

/* ── Toast (death / events) ───────────────────────────────────────────── */
.fxisle-toast {
  position: absolute; top: 16px; left: 50%; transform: translate(-50%, -16px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(10, 30, 24, .82);
  color: #fff; font-size: .9rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.16);
  opacity: 0; pointer-events: none; z-index: 6;
  transition: opacity .25s ease, transform .25s ease;
}
.fxisle-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Kill feed (top-centre) — brief "Kamu makan X!" on the player's kills ── */
.fxisle-killfeed {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; z-index: 6;
}
.fxisle-kf-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(10, 30, 24, .8);
  box-shadow: 0 6px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,213,74,.35);
  color: #eafff6; font-size: .86rem; font-weight: 500; white-space: nowrap;
  opacity: 0; transform: translateY(-10px) scale(.92);
  transition: opacity .22s ease, transform .22s cubic-bezier(.2,.9,.25,1);
}
.fxisle-kf-row.in  { opacity: 1; transform: translateY(0) scale(1); }
.fxisle-kf-row.out { opacity: 0; transform: translateY(-6px) scale(.96); }
.fxisle-kf-row b { color: #ffd54a; font-weight: 800; }
.fxisle-kf-skull { font-size: 1rem; }
@media (max-width: 640px) { .fxisle-killfeed { top: 50px; } .fxisle-kf-row { font-size: .8rem; padding: 5px 12px; } }

/* ── Start overlay ────────────────────────────────────────────────────── */
.fxisle-overlay {
  position: absolute; inset: 0; z-index: 8;
  display: flex; align-items: flex-start; justify-content: center;   /* scroll-safe centering */
  overflow-y: auto;                                                  /* tall card never clips */
  padding: 24px;
  background: radial-gradient(100% 100% at 50% 30%, rgba(6,22,18,.35), rgba(6,22,18,.78));
  backdrop-filter: blur(3px);
  transition: opacity .35s ease, visibility .35s ease;
}
.fxisle-overlay.hidden { opacity: 0; visibility: hidden; }

.fxisle-card {
  max-width: 440px; width: 100%;
  margin: auto;                          /* vertically centred when it fits, scrolls when not */
  text-align: center;
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20,48,40,.92), rgba(10,28,22,.95));
  box-shadow: 0 30px 70px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.12);
  color: #eafff6;
}
.fxisle-kicker {
  font-size: .72rem; letter-spacing: 1.5px; color: #7CFFB0;
  text-transform: uppercase; margin-bottom: 8px;
}
.fxisle-h {
  margin: 0 0 8px; font-size: 1.9rem; font-weight: 600;
  background: linear-gradient(90deg, #aef5d0, #7fd0ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.fxisle-p { margin: 0 0 12px; font-size: .86rem; line-height: 1.45; color: #cdeede; }
.fxisle-p b { color: #fff; }
.fxisle-keys {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
  font-size: .78rem; color: #bfe6d6;
}
.fxisle-keys b { color: #fff; }

.fxisle-play {
  appearance: none; border: 0; cursor: pointer;
  padding: 14px 34px;
  border-radius: 14px;
  font-family: inherit; font-size: 1.1rem; font-weight: 600;
  color: #06231a;
  background: linear-gradient(180deg, #8af0bf, #34c98a);
  box-shadow: 0 10px 26px rgba(40,200,140,.4), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .12s ease, box-shadow .12s ease;
}
.fxisle-play:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(40,200,140,.5), inset 0 1px 0 rgba(255,255,255,.5); }
.fxisle-play:active { transform: translateY(0); }

.fxisle-note { margin-top: 14px; font-size: .72rem; opacity: .6; }

/* ── DINO SELECTION SCREEN ─────────────────────────────────────────── */
.fxisle-card--pick { max-width: 680px; }
.fxisle-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 4px 0 10px;
}
.fxisle-pick-card {
  --dc: #34c98a;
  appearance: none; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 9px 9px;
  border-radius: 14px;
  color: #eafff6;
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.10);
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.fxisle-pick-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--dc) 55%, transparent);
  background: rgba(255,255,255,.07);
}
.fxisle-pick-card.on {
  border-color: var(--dc);
  background: color-mix(in srgb, var(--dc) 16%, rgba(10,28,22,.6));
  box-shadow: 0 0 0 1px var(--dc), 0 10px 24px color-mix(in srgb, var(--dc) 35%, transparent);
}
.fxisle-pick-emoji { font-size: 1.6rem; line-height: 1; }
.fxisle-pick-name  { font-size: .82rem; font-weight: 700; color: #fff; }
.fxisle-pick-blurb { font-size: .64rem; line-height: 1.25; color: #a9d8c6; opacity: .85; }
.fxisle-pick-status { min-height: 1.1em; margin: 0 0 10px; font-size: .72rem; color: #7CFFB0; opacity: .85; }
.fxisle-play-name { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .fxisle-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fxisle-pick-blurb { display: none; }
}

@media (max-width: 560px) {
  .fxisle-wrap { height: clamp(420px, 72vh, 640px); }
  .fxisle-h { font-size: 1.7rem; }
  .fxisle-stat { min-width: 54px; padding: 6px 9px; }
  .fxisle-stat b { font-size: 1.2rem; }
}

/* ── Boost button (hold) — Phase 3 ─────────────────────────────────────── */
.fxisle-boost {
  position: absolute; right: 16px; bottom: 16px; z-index: 5;
  width: 64px; height: 64px; border-radius: 50%;
  line-height: 1; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: #fff; -webkit-user-select: none; user-select: none; touch-action: none;
  -webkit-touch-callout: none;   /* iOS: no long-press callout stealing the hold */
  background: radial-gradient(120% 120% at 50% 30%, rgba(255,170,90,.92), rgba(220,90,40,.92));
  border: 1.5px solid rgba(255,255,255,.4);
  box-shadow: 0 8px 22px rgba(210,80,30,.45), inset 0 0 0 1px rgba(255,255,255,.18);
  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease;
  opacity: .9;
}
.fxisle-boost:hover  { opacity: 1; }
.fxisle-boost:active {
  transform: scale(.9);
  filter: brightness(1.25);
  box-shadow: 0 0 0 4px rgba(255,170,90,.3), 0 8px 22px rgba(210,80,30,.5);
}

/* ── Bite + Skill buttons — Phase 4 ────────────────────────────────────── */
.fxisle-bite, .fxisle-skill {
  position: absolute; z-index: 5; cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: none; -webkit-touch-callout: none;
  color: #fff; border: 1.5px solid rgba(255,255,255,.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease, opacity .12s ease;
  opacity: .92;
}
.fxisle-bite {                                   /* primary attack — left of boost */
  right: 92px; bottom: 16px; width: 64px; height: 64px; border-radius: 50%;
  font-size: 1.6rem; line-height: 1;
  background: radial-gradient(120% 120% at 50% 30%, rgba(255,120,120,.95), rgba(200,40,40,.95));
  box-shadow: 0 8px 22px rgba(200,40,40,.45), inset 0 0 0 1px rgba(255,255,255,.18);
}
.fxisle-bite:hover  { opacity: 1; }
.fxisle-bite:active { transform: scale(.9); filter: brightness(1.2);
  box-shadow: 0 0 0 4px rgba(255,120,120,.3), 0 8px 22px rgba(200,40,40,.5); }
.fxisle-skill {                                  /* species ability — left of bite */
  right: 168px; bottom: 18px; min-width: 60px; height: 60px; padding: 0 10px; border-radius: 16px; gap: 2px;
  background: radial-gradient(120% 120% at 50% 25%, rgba(120,200,255,.92), rgba(40,120,200,.92));
  box-shadow: 0 8px 22px rgba(40,120,200,.4), inset 0 0 0 1px rgba(255,255,255,.18);
}
.fxisle-skill .fxisle-skill-ic { display: flex; line-height: 0; }
.fxisle-skill .fxisle-skill-cd { font: 800 .56rem/1 'Nunito', sans-serif; letter-spacing: .02em; }
.fxisle-skill:hover  { opacity: 1; }
.fxisle-skill:active { transform: scale(.92); filter: brightness(1.2); }
.fxisle-skill.cooling { opacity: .5; filter: grayscale(.5); }
.fxisle-full:hover, .fxisle-gear:hover { filter: brightness(1.25); }

/* Button icon (SVG) + keyboard-key hint shared by boost / bite / skill */
.fxisle-btn-ic { display: flex; line-height: 0; }
.fxisle-btn-ic svg, .fxisle-skill-ic svg { display: block; }
.fxisle-btn-key {
  font: 800 .52rem/1 'Nunito', sans-serif; letter-spacing: .04em;
  padding: 1px 5px; border-radius: 6px; margin-top: 1px;
  background: rgba(0,0,0,.28); color: rgba(255,255,255,.92);
  text-transform: uppercase;
}
.fxisle-pick-skill-ic { display: inline-flex; vertical-align: -3px; margin-right: 3px; }
.fxisle-pick-skill-ic svg { width: 14px; height: 14px; }

/* ── Lobby card: mini stat bars + skill/trait lines — Phase 4 ──────────── */
.fxisle-pick-stats { display: flex; flex-direction: column; gap: 3px; width: 100%; margin: 4px 0 2px; }
.fxisle-stat-row { display: flex; align-items: center; gap: 6px; }
.fxisle-stat-row i { font-style: normal; font-size: .54rem; color: #a9d8c6; width: 34px; text-align: left; }
.fxisle-stat-bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.10); overflow: hidden; }
.fxisle-stat-bar b { display: block; height: 100%; border-radius: 3px; background: var(--dc); }
.fxisle-pick-skill { font-size: .6rem; line-height: 1.25; color: #d6f3e6; margin-top: 4px; }
.fxisle-pick-skill b { color: #fff; font-weight: 800; }
.fxisle-pick-trait { font-size: .58rem; line-height: 1.2; color: #ffd59e; opacity: .92; margin-top: 2px; }

/* ── "+N" growth popup — Phase 3 ──────────────────────────────────────── */
.fxisle-gain {
  position: absolute; left: 50%; top: 46%; z-index: 6;
  transform: translate(-50%, 0) scale(.7);
  font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 800;
  font-size: 1.6rem; color: #7CFFB0;
  text-shadow: 0 2px 8px rgba(0,0,0,.55), 0 0 14px rgba(124,255,176,.5);
  pointer-events: none; opacity: .96;
  transition: transform .7s cubic-bezier(.2,.9,.25,1), opacity .7s ease;
}
.fxisle-gain.go { transform: translate(-50%, -64px) scale(1.05); opacity: 0; }

/* Tier announce — big centred banner the first time you reach Alpha/Raksasa/Titan. */
.fxisle-tier {
  position: absolute; left: 50%; top: 32%; z-index: 8;
  transform: translate(-50%, 0) scale(.6); opacity: 0;
  font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 800;
  font-size: 3rem; letter-spacing: 1px; white-space: nowrap;
  text-shadow: 0 3px 12px rgba(0,0,0,.6), 0 0 26px currentColor;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.2,1.3,.3,1), opacity .4s ease;
}
.fxisle-tier.go { transform: translate(-50%, -10px) scale(1); opacity: 1; }
@media (max-width: 560px) { .fxisle-tier { font-size: 2rem; } }

@media (max-width: 560px) {
  .fxisle-boost { width: 72px; height: 72px; right: 14px; bottom: 20px; font-size: 2rem; }
  .fxisle-bite  { right: 96px; bottom: 24px; width: 64px; height: 64px; }
  .fxisle-skill { right: 14px; bottom: 100px; min-width: 56px; height: 52px; }
  /* Bottom-left is the movement joystick on touch — move the minimap to the
     top-right (below the gear) so the two never overlap while steering. */
  .fxisle-hud  { width: 150px; padding: 6px 6px 7px; }
  .fxisle-hud .fxisle-lb-nm { font-size: .74rem; }
  .fxisle-mini { top: 54px; right: 12px; bottom: auto; left: auto; }
}

/* ── Lobby: name field + dual play buttons (online entry) ── */
.fxisle-name-l{display:block;margin:14px 0 4px;font-size:.82rem;font-weight:700;color:var(--fxisle-dim,#9aa);letter-spacing:.3px}
.fxisle-name{width:100%;box-sizing:border-box;padding:11px 13px;border-radius:12px;border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.28);color:#fff;font-size:1rem;font-weight:600;outline:none}
.fxisle-name:focus{border-color:#ffce54;box-shadow:0 0 0 3px rgba(255,206,84,.2)}
.fxisle-play-row{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}
.fxisle-play-row .fxisle-play,.fxisle-play-row .fxisle-play-online{flex:1 1 0;min-width:150px}
.fxisle-play-online{padding:13px 16px;border:none;border-radius:14px;cursor:pointer;font-size:1rem;font-weight:800;color:#1a1205;background:linear-gradient(135deg,#ffd76b,#ff9f43);box-shadow:0 6px 18px rgba(255,159,67,.35)}
.fxisle-play-online:hover{filter:brightness(1.06)}
.fxisle-play-online:active{transform:translateY(1px)}
