/* ==========================================================
   MIGHANTECT — PixelGather style · Mobile-native responsive
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1a1f2e;
  --ink-2: #4b5365;
  --ink-3: #8a92a6;
  --line: #e7eaf0;

  --blue: #3b6df0;
  --blue-deep: #2a4fc7;
  --blue-soft: #e8f0ff;
  --green: #3ecf6a;
  --green-deep: #25a84c;
  --yellow: #ffd84d;
  --purple: #8b5cf6;
  --lilac: #c8b6ff;
  --pink: #ff8fb8;
  --cyan: #5dd3e8;
  --orange: #ff9f59;
  --red: #ff6b6b;
  --gold: #f6b93b;
  --silver: #c7cdd9;

  --shadow-card: 0 2px 0 rgba(26,31,46,0.06), 0 6px 16px rgba(26,31,46,0.05);
  --shadow-hard: 0 4px 0 rgba(26,31,46,0.08), 0 8px 20px rgba(26,31,46,0.06);
  --r: 18px;
  --r-lg: 24px;

  --sb-w: 260px;
}

html, body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-weight: 600;
  overscroll-behavior: none;
}
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============ LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.logo { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; }
.logo-mark {
  width: 30px; height: 30px;
  display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 3px;
}
.pix { border-radius: 4px; }
.pix-1 { background: var(--blue); }
.pix-2 { background: var(--green); }
.pix-3 { background: var(--yellow); }
.pix-4 { background: var(--pink); }
.logo-text { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 19px; }

.btn-create {
  display: block;
  background: #fff; color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 11px 14px;
  text-align: center;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn-create:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.btn-create:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }

.side-nav {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14.5px;
  color: var(--ink-2);
  font-weight: 700;
  width: 100%;
  text-align: left;
  transition: all .15s;
}
.side-link:hover { background: #f4f6fb; color: var(--ink); }
.side-link.active {
  background: var(--blue-soft);
  color: var(--blue-deep);
  box-shadow: inset 0 0 0 1px #c9daff;
}
.side-ico { font-size: 16px; flex-shrink: 0; }
.side-link .chev { margin-left: auto; font-size: 11px; transition: transform .2s; }
.side-link.has-sub[aria-expanded="true"] .chev { transform: rotate(-180deg); }

.sub-nav {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 2px 30px;
  padding-left: 8px;
  border-left: 2px solid var(--line);
}
.sub-nav.open { display: flex; }
.sub-link {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 700;
}
.sub-link:hover { background: #f4f6fb; color: var(--ink); }
.sub-link.active { color: var(--blue-deep); background: var(--blue-soft); }

.side-spacer { flex: 1; min-height: 20px; }

.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
  margin: 0 -4px -4px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
}
.user-info { line-height: 1.1; }
.user-hi { font-size: 11px; color: var(--ink-3); }
.user-name { font-size: 14px; color: var(--ink); font-weight: 800; }

/* ============ MOBILE HEADER + DRAWER + TABBAR ============ */
.mobile-top {
  display: none;
  position: sticky; top: 0;
  background: #fff;
  padding: 10px 14px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  z-index: 100;
}
.m-menu {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 20px;
  font-weight: 800;
  background: #fff;
}
.m-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700; font-size: 17px;
  flex: 1;
}
.m-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; font-weight: 800;
}
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  animation: fade .2s;
}
.drawer-overlay.open { display: block; }
@keyframes fade { from{opacity:0}to{opacity:1} }

.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 90;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}
.mobile-tabbar .tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 800;
}
.tab-ico { font-size: 20px; line-height: 1; }
.mobile-tabbar .tab.active { color: var(--blue-deep); }
.tab-center {
  background: var(--blue);
  color: #fff !important;
  width: 52px; height: 52px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: -20px;
  box-shadow: 0 4px 12px rgba(59,109,240,0.4);
  justify-content: center;
}
.tab-center .tab-ico { font-size: 26px; }

/* ============ MAIN ============ */
.main {
  padding: 20px 28px 40px;
  min-width: 0;
}

.top-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 0 0 16px;
}
.top-bar .dot, .demo-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red    { background: #ff6259; }
.dot.yellow { background: #ffc130; }
.dot.green  { background: #29cc45; }
.url-bar {
  flex: 1; margin: 0 auto;
  max-width: 340px;
  background: #e4e7ef; border-radius: 8px;
  text-align: center; padding: 4px 12px;
  font-size: 12px; color: var(--ink-2); font-weight: 700;
}

/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, #4671f0, #3b6df0 60%, #5a8cff);
  border-radius: var(--r-lg);
  padding: 36px 40px;
  color: #fff;
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 30px;
  align-items: center;
  box-shadow: var(--shadow-hard);
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}
.hero-copy h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 42px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.hero-copy p {
  font-size: 15px; font-weight: 500;
  color: rgba(255,255,255,0.9);
  max-width: 400px;
  margin-bottom: 22px;
  line-height: 1.5;
}
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-stats {
  display: flex; gap: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats b { font-family: 'Fredoka', sans-serif; font-size: 22px; font-weight: 700; }
.hero-stats span { font-size: 11px; opacity: .8; font-weight: 700; }

.btn-primary {
  display: inline-block;
  background: var(--green); color: #083916;
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 0 var(--green-deep);
  transition: transform .1s, box-shadow .1s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--green-deep); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-deep); }

.btn-secondary {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 800; font-size: 15px;
  border: 1.5px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.25); }

.btn-ghost {
  display: inline-block;
  background: #fff; color: var(--ink);
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 800; font-size: 15px;
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn-ghost.small { padding: 9px 16px; font-size: 13px; }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.cta-block .btn-ghost {
  background: transparent; color: #fff;
  border-color: #fff; box-shadow: 0 3px 0 #fff;
}

.btn-chip {
  display: inline-block;
  background: var(--ink); color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  transition: background .15s;
}
.btn-chip:hover { background: #000; }

/* ---- ISO scene ---- */
.hero-art { position: relative; min-height: 280px; display: grid; place-items: center; }
.iso-scene {
  position: relative;
  width: 300px; height: 230px;
  transform: rotateX(55deg) rotateZ(-45deg);
  transform-style: preserve-3d;
}
.tile { position: absolute; width: 110px; height: 110px; border: 2px solid rgba(0,0,0,0.1); }
.tile.t1 { left: 0; top: 0; background: #8be4a9; }
.tile.t2 { left: 110px; top: 0; background: #9aeab3; }
.tile.t3 { left: 0; top: 110px; background: #9aeab3; }
.tile.t4 { left: 110px; top: 110px; background: #8be4a9; }

.iso-building { position: absolute; transform-style: preserve-3d; }
.iso-building .face { position: absolute; border: 2px solid rgba(0,0,0,0.18); }

.b-main { left: 20px; top: 20px; width: 80px; height: 80px; }
.b-main .face.top   { inset: 0; background: var(--yellow); transform: translateZ(60px); }
.b-main .face.left  { width: 60px; height: 80px; background: #d9b02c; transform-origin: left; transform: rotateY(-90deg); }
.b-main .face.right { width: 80px; height: 60px; background: #e8bf33; left: 0; bottom: 0; transform-origin: bottom; transform: rotateX(90deg); }

.b-lab { left: 140px; top: 10px; width: 60px; height: 60px; }
.b-lab .face.top   { inset: 0; background: var(--purple); transform: translateZ(75px); }
.b-lab .face.left  { width: 75px; height: 60px; background: #6b46c9; transform-origin: left; transform: rotateY(-90deg); }
.b-lab .face.right { width: 60px; height: 75px; background: #7a52d4; left: 0; bottom: 0; transform-origin: bottom; transform: rotateX(90deg); }

.b-lib { left: 40px; top: 140px; width: 60px; height: 60px; }
.b-lib .face.top   { inset: 0; background: var(--pink); transform: translateZ(45px); }
.b-lib .face.left  { width: 45px; height: 60px; background: #d8729a; transform-origin: left; transform: rotateY(-90deg); }
.b-lib .face.right { width: 60px; height: 45px; background: #ed82a8; left: 0; bottom: 0; transform-origin: bottom; transform: rotateX(90deg); }

.iso-building .window {
  position: absolute; width: 10px; height: 12px;
  background: #aee4ff; border: 1.5px solid rgba(0,0,0,0.3);
  transform: translateZ(60.5px);
}
.b-main .window.w1 { left: 18px; top: 20px; }
.b-main .window.w2 { right: 18px; top: 20px; }
.b-lab  .window.w1 { left: 20px; top: 20px; transform: translateZ(75.5px); }

.tree { position: absolute; transform-style: preserve-3d; }
.tree .leaves { position: absolute; width: 26px; height: 26px; background: #3db560; border: 2px solid rgba(0,0,0,0.2); border-radius: 50%; transform: translateZ(30px); }
.tree .trunk { position: absolute; width: 6px; height: 12px; background: #8b6340; left: 10px; top: 14px; transform: translateZ(14px); }
.tr1 { left: 210px; top: 130px; width: 26px; height: 26px; }
.tr2 { left: 10px; top: 205px; width: 26px; height: 26px; }

.npc { position: absolute; width: 14px; height: 26px; transform-style: preserve-3d; }
.npc .head { position: absolute; width: 10px; height: 10px; background: #ffd9b8; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.3); left: 2px; transform: translateZ(28px); }
.npc .body { position: absolute; width: 12px; height: 16px; background: var(--blue); border-radius: 4px 4px 2px 2px; border: 1.5px solid rgba(0,0,0,0.3); left: 1px; top: 8px; transform: translateZ(10px); }
.n1 { left: 170px; top: 150px; } .n1 .body { background: var(--red); }
.n2 { left: 120px; top: 190px; } .n2 .body { background: var(--green-deep); }
.n3 { left: 200px; top: 90px; }  .n3 .body { background: var(--gold); }

.iso-label {
  position: absolute; right: 20px; top: 20px;
  background: #fff; color: var(--ink);
  padding: 6px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 800;
  box-shadow: var(--shadow-card);
  z-index: 10;
}

/* ============ BLOCK ============ */
.block { margin-top: 40px; scroll-margin-top: 20px; }
.block-head {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-tag {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue-deep);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.block-head h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 26px; font-weight: 600;
  letter-spacing: -0.3px;
}
.see-all {
  font-size: 14px; color: var(--blue-deep); font-weight: 800;
  white-space: nowrap;
}
.see-all:hover { text-decoration: underline; }

/* ============ DEMO SECTION ============ */
.demo-frame { display: grid; gap: 16px; }
.demo-window {
  background: #2a3140;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-hard);
}
.demo-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: #1f2532;
}
.demo-title {
  flex: 1; text-align: center;
  color: #8a92a6; font-size: 12px; font-weight: 700;
}
.demo-scene {
  background: linear-gradient(135deg, #7fd4ff, #a2e5ff);
  min-height: 280px;
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr;
  padding: 20px;
  gap: 16px;
}
.demo-scene-inner {
  display: grid; place-items: center;
}
.demo-iso { width: 240px; height: 200px; }
.demo-chat {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px;
  max-height: 260px;
  overflow: hidden;
}
.chat-bubble {
  background: #f0f3fa;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.4;
}
.chat-bubble b { color: var(--blue-deep); font-size: 11px; }
.chat-user { background: var(--blue); color: #fff; align-self: flex-end; max-width: 85%; }
.chat-user b { color: #fff; }
.chat-typing {
  font-size: 11px; color: var(--ink-3);
  padding: 4px 10px;
  font-style: italic;
  font-weight: 700;
}
.chat-typing span {
  display: inline-block;
  animation: dot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

.demo-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.demo-feat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.feat-ico { font-size: 18px; }

/* ============ BUILD GRID ============ */
.build-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.build-card {
  background: #fff;
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  position: relative;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
}
.build-card:hover { transform: translateY(-4px); box-shadow: 0 6px 0 rgba(26,31,46,0.08), 0 12px 24px rgba(26,31,46,0.08); }
.build-num {
  position: absolute; top: 14px; right: 16px;
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: rgba(0,0,0,0.08);
}
.build-ico {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 24px;
  margin-bottom: 6px;
}
.build-1 .build-ico { background: #ffe9a8; }
.build-2 .build-ico { background: #d4e5ff; }
.build-3 .build-ico { background: #ffd1e4; }
.build-4 .build-ico { background: #d9f5e4; }
.build-card h3 { font-family: 'Fredoka', sans-serif; font-size: 17px; font-weight: 600; }
.build-card p { font-size: 13px; color: var(--ink-2); line-height: 1.4; margin: 4px 0 8px; }
.build-link { font-size: 12px; color: var(--blue-deep); font-weight: 800; margin-top: auto; }

/* ============ ID CARD ROW (Agents) — Portrait-first ============ */
.id-card-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.id-card {
  --acc: var(--blue);
  --tint: var(--blue-soft);
  position: relative;
  background: #fff;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
}
.id-card:hover {
  transform: translateY(-6px);
  border-color: var(--acc);
  box-shadow: 0 6px 0 rgba(26,31,46,0.08), 0 18px 34px rgba(26,31,46,0.10);
}

/* Portrait hero (top 58% of card) */
.id-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1.5px solid var(--line);
  isolation: isolate;
}
.id-portrait::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%);
  pointer-events: none;
}
.id-portrait::after {
  content: '';
  position: absolute;
  left: -20%; right: -20%; bottom: -40%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.18), transparent 70%);
  pointer-events: none;
}
.id-avatar {
  position: relative;
  z-index: 2;
  width: 82px; height: 82px;
  border-radius: 22px;
  background: rgba(255,255,255,.28);
  border: 3px solid rgba(255,255,255,.85);
  display: grid; place-items: center;
  font-size: 42px;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  transition: transform .3s ease;
}
.id-card:hover .id-avatar { transform: scale(1.06) rotate(-2deg); }

/* Full-portrait image (AI-generated) */
.id-photo {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform .4s ease;
  mix-blend-mode: normal;
}
.id-card:hover .id-photo { transform: scale(1.05); }
.id-photo.img-fail { display: none; }

/* Rarity pill (top-left) */
.id-rarity {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 3;
  background: rgba(255,255,255,.95);
  color: var(--ink);
  font-family: 'Fredoka', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  letter-spacing: .4px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.id-card.rarity-legendary .id-rarity { background: var(--gold); color: #fff; }
.id-card.rarity-epic .id-rarity      { background: var(--purple); color: #fff; }
.id-card.rarity-rare .id-rarity      { background: var(--blue); color: #fff; }

/* Online status (top-right) */
.id-status {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 3;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  border-radius: 20px;
  padding: 4px 9px 4px 7px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.id-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(62,207,106,.25); }

/* Sparkles */
.id-sparkle {
  position: absolute;
  z-index: 1;
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255,255,255,.8);
  opacity: .75;
}
.id-sparkle.s1 { top: 22%; right: 18%; width: 6px; height: 6px; }
.id-sparkle.s2 { bottom: 28%; left: 14%; width: 10px; height: 10px; opacity: .5; }
.id-sparkle.s3 { top: 48%; right: 10%; width: 4px; height: 4px; opacity: .6; }

/* Info zone (bottom) */
.id-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.id-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.id-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 2px;
}
.id-role {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 700;
  line-height: 1.3;
}
.id-price {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tint);
  color: var(--acc);
  font-family: 'Fredoka', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.id-price .coin-chip {
  font-size: 10px;
  color: var(--gold);
}
.id-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.id-spec .tag {
  background: #f4f6fb;
  color: var(--ink-2);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1px;
}
.id-btns { display: flex; gap: 6px; margin-top: 2px; }
.id-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition: all .15s ease;
  border: 1.5px solid transparent;
}
.id-btn.detail {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}
.id-btn.detail:hover {
  border-color: var(--acc);
  color: var(--acc);
}
.id-btn.hire {
  background: var(--acc);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,.1);
}
.id-btn.hire:hover {
  filter: brightness(.95);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0,0,0,.15);
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}
.about-hero {
  background: linear-gradient(135deg, #ffd84d, #ffb84d);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.about-emoji { font-size: 48px; margin-bottom: 10px; }
.about-hero h3 { font-family: 'Fredoka', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.about-hero p { font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 500px; }
.about-stat {
  background: #fff;
  border-radius: var(--r);
  border: 1px solid var(--line);
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  box-shadow: var(--shadow-card);
}
.about-stat > div { display: flex; flex-direction: column; gap: 2px; }
.about-stat b { font-family: 'Fredoka', sans-serif; font-size: 28px; color: var(--blue-deep); }
.about-stat span { font-size: 12px; color: var(--ink-3); font-weight: 700; }

/* ============ SKILL FILTER + GRID ============ */
.chip-filter {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-filter::-webkit-scrollbar { display: none; }
.chip {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 8px 15px;
  font-size: 13px; font-weight: 800;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all .15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.skill-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.skill-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform .15s;
  cursor: pointer;
}
.skill-card:hover { transform: translateY(-3px); }
.skill-ico {
  width: 46px; height: 46px;
  border-radius: 12px;
  margin: 0 auto 8px;
  display: grid; place-items: center;
  font-size: 22px;
}
.skill-card h4 { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.skill-card .cat { font-size: 9px; font-weight: 800; text-transform: uppercase; color: var(--ink-3); letter-spacing: 0.5px; }
.skill-card .badge {
  position: absolute; top: 6px; right: 6px;
  font-size: 8px; font-weight: 900;
  padding: 2px 6px; border-radius: 20px;
  color: #fff; letter-spacing: 0.5px;
}
.badge.hot { background: var(--red); }
.badge.core { background: var(--green); }
.badge.new { background: var(--blue); }

.plugin-callout {
  margin-top: 18px;
  background: linear-gradient(135deg, #1a1f2e, #2a3a60);
  color: #fff;
  border-radius: var(--r);
  padding: 24px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: center;
}
.plugin-ico {
  width: 80px; height: 80px;
  background: var(--yellow);
  border-radius: 20px;
  display: grid; place-items: center;
  font-size: 40px;
  border: 3px solid #fff;
}
.plugin-body h3 { font-family: 'Fredoka', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.plugin-body p { font-size: 13.5px; color: rgba(255,255,255,0.8); line-height: 1.5; margin-bottom: 12px; }
.plugin-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.plugin-tags .tag {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
}

/* ============ ROOM BUILDER ============ */
.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  margin-bottom: 20px;
}
.builder-text {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.builder-text h3 { font-family: 'Fredoka', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.builder-text p { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin-bottom: 14px; }
.builder-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.builder-list li { font-size: 13.5px; font-weight: 700; }

.builder-preview {
  background: linear-gradient(135deg, #f0f5ff, #e4ecff);
  border-radius: var(--r);
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  position: relative;
}
.builder-grid-bg {
  background:
    linear-gradient(rgba(59,109,240,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,109,240,0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: 12px;
  height: 220px;
  position: relative;
  border: 2px dashed rgba(59,109,240,0.3);
}
.placed {
  position: absolute;
  border-radius: 6px;
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 rgba(26,31,46,0.2);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: #fff;
}
.sofa-p { left: 20px; top: 50px; width: 60px; height: 30px; background: var(--blue); }
.desk-p { right: 40px; top: 40px; width: 50px; height: 35px; background: #8b6340; }
.plant-p { left: 100px; top: 140px; width: 28px; height: 28px; background: var(--green); border-radius: 50%; }
.panel-p { right: 30px; top: 110px; width: 52px; height: 32px; background: var(--purple); color: #fff; }
.cursor-hint {
  position: absolute; right: 60px; top: 130px;
  font-size: 24px;
  animation: grab 1.8s ease-in-out infinite;
}
@keyframes grab { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-8px, -4px); } }

.builder-tools {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  display: flex; gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
}
.builder-tools button {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  background: #f4f6fb;
}
.builder-tools button.active { background: var(--blue); color: #fff; }
.builder-tools button:hover { background: #e4eaf5; }
.builder-tools button.active:hover { background: var(--blue-deep); }

.obj-types { margin-top: 20px; }
.obj-types > h3 { font-family: 'Fredoka', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.obj-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.obj-card {
  background: #fff;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  padding: 22px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.obj-img {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: #f4f6fb;
  display: grid; place-items: center;
  font-size: 28px;
  margin-bottom: 12px;
}
.obj-tag {
  position: absolute; top: 16px; right: 16px;
  font-size: 10px; font-weight: 900;
  padding: 3px 9px;
  border-radius: 20px;
  color: #fff;
  letter-spacing: 0.5px;
}
.obj-tag.deco { background: var(--pink); }
.obj-tag.func { background: var(--blue); }
.obj-tag.custom { background: var(--purple); }
.obj-card h4 { font-family: 'Fredoka', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.obj-card p { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* ============ VISUAL SOP ============ */
.sop-showcase {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.sop-canvas {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 10px 0 20px;
  scrollbar-width: thin;
}
.sop-node {
  flex-shrink: 0;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 3px 0 var(--ink);
  display: flex; align-items: center; gap: 10px;
  min-width: 170px;
}
.node-ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--blue-soft);
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.sop-node b { font-family: 'Fredoka', sans-serif; font-size: 14px; font-weight: 700; display: block; }
.sop-node small { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.n-trigger .node-ico { background: #fff3b3; }
.n-research .node-ico { background: #d4e5ff; }
.n-write .node-ico { background: #ffd1e4; }
.n-post .node-ico { background: #d9f5e4; }
.sop-line { width: 40px; height: 30px; flex-shrink: 0; }
.sop-caption {
  text-align: center;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
}

/* ============ COINOMICS ============ */
.coin-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.coin-big {
  border-radius: var(--r);
  padding: 26px;
  border: 2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  display: flex; flex-direction: column; gap: 14px;
}
.coin-big.c-gold { background: linear-gradient(135deg, #ffe27a, #ffd84d); }
.coin-big.c-silver { background: linear-gradient(135deg, #e3e7ef, #c7cdd9); }
.coin-big-head { display: flex; align-items: center; gap: 14px; }
.coin-big-ico {
  width: 60px; height: 60px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 30px;
  flex-shrink: 0;
}
.coin-big h3 { font-family: 'Fredoka', sans-serif; font-size: 24px; font-weight: 700; }
.coin-big-sub { font-size: 12px; color: var(--ink-2); font-weight: 800; }
.coin-intro { font-size: 14px; color: var(--ink-2); line-height: 1.5; font-weight: 600; }
.coin-use {
  list-style: none;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,0.08);
}
.coin-use li { font-size: 13.5px; color: var(--ink); font-weight: 700; line-height: 1.5; }
.coin-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.coin-price { display: flex; flex-direction: column; }
.coin-price b { font-family: 'Fredoka', sans-serif; font-size: 16px; }
.coin-price small { font-size: 11px; color: var(--ink-2); font-weight: 700; }

.coin-flow {
  margin-top: 20px;
  background: #fff;
  border-radius: var(--r);
  border: 1px solid var(--line);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}
.flow-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  min-width: 100px;
}
.flow-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--blue-soft);
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 4px;
}
.flow-step b { font-size: 13px; font-family: 'Fredoka', sans-serif; font-weight: 700; }
.flow-step small { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.flow-arrow { color: var(--ink-3); font-size: 22px; font-weight: 800; }

/* ============ USE CASES ============ */
.uc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.uc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.uc-card:hover { transform: translateY(-3px); box-shadow: 0 5px 0 rgba(26,31,46,0.06), 0 10px 22px rgba(26,31,46,0.08); }
.uc-ico {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 28px;
  margin-bottom: 10px;
}
.uc-1 .uc-ico { background: #ffd1e4; }
.uc-2 .uc-ico { background: #d4e5ff; }
.uc-3 .uc-ico { background: #ffd1d1; }
.uc-4 .uc-ico { background: #fff3b3; }
.uc-5 .uc-ico { background: #d9f5e4; }
.uc-6 .uc-ico { background: #d0c1ff; }
.uc-7 .uc-ico { background: #ffe0a8; }
.uc-card h3 { font-family: 'Fredoka', sans-serif; font-size: 17px; font-weight: 700; }
.uc-card p { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 4px 0 10px; }
.uc-link { color: var(--blue-deep); font-size: 12px; font-weight: 800; margin-top: auto; }
.uc-wide {
  grid-column: span 3;
  background: linear-gradient(135deg, #1a1f2e, #2c3654);
  color: #fff;
  border: none;
}
.uc-wide h3 { color: #fff; }
.uc-wide p { color: rgba(255,255,255,0.75); }
.uc-wide .uc-link { color: var(--yellow); }

/* ============ NEWS ============ */
.news-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.news-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.news-tag {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue-deep);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}
.news-tag.tag-green { background: #d9f5e4; color: var(--green-deep); }
.news-tag.tag-pink { background: #ffd1e4; color: #c2185b; }
.news-card h4 { font-family: 'Fredoka', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.news-card p { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-bottom: 10px; }
.news-card small { font-size: 11px; color: var(--ink-3); font-weight: 700; }

/* ============ CTA BLOCK ============ */
.cta-block {
  margin-top: 50px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 40px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 26px; align-items: center;
}
.cta-art {
  font-size: 60px;
  text-align: center;
  background: var(--yellow);
  border-radius: 20px;
  padding: 14px;
  border: 3px solid #fff;
}
.cta-copy h2 { font-family: 'Fredoka', sans-serif; font-size: 26px; font-weight: 700; line-height: 1.15; margin-bottom: 8px; }
.cta-copy p { color: rgba(255,255,255,0.75); font-size: 14px; margin-bottom: 18px; }
.cta-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ KONTAK ============ */
.kontak-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kontak-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-card);
  text-align: center;
  display: flex; flex-direction: column; gap: 2px;
  transition: transform .15s;
}
.kontak-card:hover { transform: translateY(-3px); }
.k-ico {
  font-size: 32px;
  margin-bottom: 6px;
}
.kontak-card b { font-family: 'Fredoka', sans-serif; font-size: 15px; font-weight: 700; }
.kontak-card span { font-size: 12px; color: var(--ink-3); font-weight: 700; }

/* ============ FOOTER ============ */
.foot {
  margin-top: 30px;
  padding: 20px 0 60px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--ink-3); font-weight: 700;
  flex-wrap: wrap; gap: 10px;
}
.foot a:hover { color: var(--ink); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .id-card-row { grid-template-columns: repeat(3, 1fr); }
  .skill-grid { grid-template-columns: repeat(4, 1fr); }
  .build-grid { grid-template-columns: repeat(2, 1fr); }
  .uc-grid { grid-template-columns: repeat(2, 1fr); }
  .uc-wide { grid-column: span 2; }
  .demo-features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  /* Mobile app layout */
  :root { --r: 16px; --r-lg: 18px; }

  .mobile-top { display: flex; }
  .mobile-tabbar { display: flex; }

  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; height: 100vh;
    z-index: 101;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
  }
  .sidebar.open { transform: translateX(0); }

  .main {
    padding: 0 14px 90px;
  }
  .top-bar { display: none; }

  .block { margin-top: 28px; }
  .block-head h2 { font-size: 22px; }
  .section-tag { font-size: 10px; }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 16px;
    border-radius: var(--r);
  }
  .hero-copy h1 { font-size: 32px; }
  .hero-copy p { font-size: 14px; }
  .hero-stats { gap: 18px; }
  .hero-stats b { font-size: 18px; }
  .hero-art { min-height: 230px; }
  .iso-scene { transform: scale(0.8) rotateX(55deg) rotateZ(-45deg); }

  .demo-scene { grid-template-columns: 1fr; padding: 14px; min-height: auto; }
  .demo-iso { width: 200px; height: 170px; margin: 0 auto; }
  .demo-chat { max-height: none; }

  .build-grid { grid-template-columns: 1fr 1fr; }
  .build-card { padding: 16px; }
  .build-card h3 { font-size: 15px; }
  .build-card p { font-size: 12px; }

  .id-card-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  /* Horizontal swipe ID cards */
  .id-card-row.swipe {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 8px;
    scrollbar-width: none;
  }
  .id-card-row.swipe::-webkit-scrollbar { display: none; }
  .id-card-row.swipe .id-card { scroll-snap-align: start; }
  .id-portrait { aspect-ratio: 5 / 4; }
  .id-avatar { width: 72px; height: 72px; font-size: 38px; border-radius: 20px; }

  .about-grid { grid-template-columns: 1fr; }
  .about-hero { padding: 22px; }
  .about-stat { grid-template-columns: repeat(4, 1fr); padding: 16px; }
  .about-stat b { font-size: 20px; }

  .skill-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .skill-card { padding: 14px 8px; }
  .skill-card h4 { font-size: 12px; }

  .plugin-callout { grid-template-columns: 1fr; padding: 20px; }
  .plugin-ico { width: 64px; height: 64px; font-size: 30px; border-radius: 16px; }

  .builder-grid { grid-template-columns: 1fr; gap: 14px; }
  .builder-text { padding: 20px; }
  .builder-preview { padding: 14px; }

  .obj-row { grid-template-columns: 1fr; gap: 10px; }
  .obj-card { padding: 18px; }

  .sop-showcase { padding: 16px; }
  .sop-canvas { padding: 0 0 10px; gap: 0; }
  .sop-node { min-width: 150px; padding: 10px 12px; }
  .sop-node b { font-size: 13px; }

  .coin-split { grid-template-columns: 1fr; }
  .coin-big { padding: 20px; }
  .coin-big h3 { font-size: 20px; }

  .coin-flow { padding: 14px; gap: 4px; }
  .flow-step { min-width: 75px; }
  .flow-ico { width: 40px; height: 40px; font-size: 18px; }
  .flow-step b { font-size: 11px; }
  .flow-step small { font-size: 9px; }
  .flow-arrow { font-size: 16px; }

  .uc-grid { grid-template-columns: 1fr; }
  .uc-wide { grid-column: span 1; }

  .news-row { grid-template-columns: 1fr; }

  .cta-block { grid-template-columns: 1fr; padding: 24px; gap: 14px; }
  .cta-art { width: 80px; height: 80px; font-size: 40px; padding: 12px; margin: 0 auto; }
  .cta-copy h2 { font-size: 22px; }

  .kontak-row { grid-template-columns: 1fr 1fr; }

  .foot { padding: 16px 0 20px; text-align: center; flex-direction: column; }
}

/* ============================================================
   AGENT DETAIL MODAL (RPG-style) — Raidon Thenion inspired
   ============================================================ */
.agent-modal {
  --acc: #8b5cf6;
  --tint: #efe7ff;
  --grad: linear-gradient(140deg,#c8b6ff 0%,#8b5cf6 55%,#6d28d9 100%);
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.agent-modal.open { display: flex; animation: amFade .25s ease; }
.agent-modal[aria-hidden="true"].open { aria-hidden: false; }
@keyframes amFade { from { opacity: 0; } to { opacity: 1; } }

.am-bg {
  position: absolute; inset: 0;
  background: rgba(15, 20, 35, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.am-shell {
  position: relative;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.2) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: amPop .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes amPop { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* Topbar */
.am-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #0f1423;
  color: #fff;
  border-bottom: 2px solid rgba(0,0,0,0.1);
}
.am-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 10px 4px 6px;
  border-radius: 10px;
  transition: background .15s;
}
.am-back:hover { background: rgba(255,255,255,.1); }
.am-back span { font-size: 22px; line-height: 1; }

.am-currency { display: flex; gap: 8px; }
.c-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.c-chip b { font-family: 'Fredoka', sans-serif; font-size: 13px; font-weight: 700; }
.c-chip.c-gold   { color: #f6b93b; }
.c-chip.c-silver { color: #c7cdd9; }
.c-chip.c-gem    { color: #ff8fb8; }

.am-close {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s;
}
.am-close:hover { background: rgba(255,255,255,0.18); }

/* Body — 3 columns */
.am-body {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 0;
  background: #f7f8fc;
}
.am-body::-webkit-scrollbar { width: 8px; }
.am-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 10px; }

/* LEFT panel */
.am-left {
  padding: 28px 24px;
  background: #fff;
  border-right: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.am-name h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.am-role {
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 700;
}
.am-rarity-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tint);
  color: var(--acc);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
  border: 1.5px solid transparent;
}
.am-rarity-pill.rarity-legendary { background: #fff4d6; color: #d97706; border-color: #f6b93b; }
.am-rarity-pill.rarity-epic      { background: #efe7ff; color: #6d28d9; border-color: #8b5cf6; }
.am-rarity-pill.rarity-rare      { background: #e1ecff; color: #1e40af; border-color: #3b6df0; }
.am-rarity-label { opacity: .7; font-weight: 700; }
.am-rarity-value { font-family: 'Fredoka', sans-serif; letter-spacing: .4px; }

.am-bio {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 600;
}

.am-trophy {
  margin-top: auto;
  display: grid;
  grid-template-columns: 48px 1fr 28px;
  gap: 12px;
  align-items: center;
  background: #f4f6fb;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.am-trophy-num {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--acc), var(--ink));
  color: #fff;
  display: grid; place-items: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.am-trophy-body { min-width: 0; }
.am-trophy-label { font-size: 10px; color: var(--ink-3); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.am-trophy-track {
  height: 8px;
  background: #e0e5ef;
  border-radius: 6px;
  overflow: hidden;
  margin: 4px 0 2px;
}
.am-trophy-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--acc), #ffd84d);
  border-radius: 6px;
  transition: width .5s ease;
}
.am-trophy-xp { font-size: 11px; color: var(--ink-2); font-weight: 800; }

.am-info {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--acc);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-style: italic;
}

/* CENTER — hero with glow arrows */
.am-center {
  position: relative;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(ellipse at 50% 55%, var(--tint) 0%, transparent 65%),
    linear-gradient(180deg, #f7f8fc 0%, #eceff6 100%);
  overflow: hidden;
  min-height: 460px;
}
.am-hero-glow {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -38%);
  width: 340px; height: 340px;
  background:
    conic-gradient(from 180deg at 50% 100%,
      transparent 0%, transparent 20%,
      color-mix(in srgb, var(--acc) 35%, transparent) 40%,
      color-mix(in srgb, var(--acc) 65%, transparent) 50%,
      color-mix(in srgb, var(--acc) 35%, transparent) 60%,
      transparent 80%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  opacity: .85;
  filter: blur(2px);
  z-index: 0;
}
.am-hero-img {
  position: relative;
  z-index: 2;
  width: 78%;
  max-width: 420px;
  max-height: 440px;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.22));
  animation: amFloat 3.5s ease-in-out infinite;
}
@keyframes amFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.am-hero-arrow {
  position: absolute;
  width: 22px; height: 22px;
  border-right: 3px solid var(--acc);
  border-top: 3px solid var(--acc);
  transform: rotate(-45deg);
  opacity: .8;
  z-index: 1;
  animation: amArrow 1.6s ease-in-out infinite;
}
.am-hero-arrow.a1 { left: 22%; top: 35%; animation-delay: 0s; }
.am-hero-arrow.a2 { left: 28%; top: 55%; animation-delay: .2s; }
.am-hero-arrow.a3 { right: 22%; top: 35%; animation-delay: .4s; transform: rotate(45deg); border-left: 3px solid var(--acc); border-top: 3px solid var(--acc); border-right: none; }
.am-hero-arrow.a4 { right: 28%; top: 55%; animation-delay: .6s; transform: rotate(45deg); border-left: 3px solid var(--acc); border-top: 3px solid var(--acc); border-right: none; }
@keyframes amArrow {
  0%,100% { transform: rotate(-45deg) translate(0,0); opacity: .35; }
  50% { transform: rotate(-45deg) translate(6px,-6px); opacity: .9; }
}
.am-hero-arrow.a3, .am-hero-arrow.a4 {
  animation-name: amArrowR;
}
@keyframes amArrowR {
  0%,100% { transform: rotate(45deg) translate(0,0); opacity: .35; }
  50% { transform: rotate(45deg) translate(-6px,-6px); opacity: .9; }
}

/* RIGHT panel */
.am-right {
  padding: 24px 22px;
  background: #0f1423;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.am-level {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding: 6px 0 10px;
  border-bottom: 1.5px solid rgba(255,255,255,.08);
  letter-spacing: .5px;
}
.am-skill {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px 12px;
}
.am-skill-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.am-skill-head b {
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.am-skill-head .am-info {
  background: rgba(255,255,255,.1);
  color: var(--acc);
}
.am-skill-sub {
  font-size: 10px;
  color: #8a92a6;
  font-weight: 700;
  font-style: italic;
  margin: -2px 0 6px;
  letter-spacing: .2px;
}
.am-skill-name { font-size: 12px; color: #c8cdda; font-weight: 700; margin-bottom: 6px; }
.am-cd-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,.28);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
}
.am-cd-label { color: #8a92a6; }
.am-cd { color: var(--acc); font-family: 'Fredoka', sans-serif; font-weight: 700; }

/* Equipment grid */
.am-equip { display: flex; flex-direction: column; gap: 8px; }
.am-equip-head {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.am-equip-head .am-slot-bonus { color: var(--green); font-family: 'Fredoka', sans-serif; font-weight: 700; margin-left: 4px; }
.am-equip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.am-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.08);
  display: grid; place-items: center;
  font-size: 22px;
  transition: all .15s;
}
.am-slot.filled { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.am-slot.filled:hover { transform: translateY(-2px); border-color: var(--acc); }
.am-slot.add {
  background: rgba(62,207,106,.12);
  border-color: rgba(62,207,106,.4);
  color: var(--green);
  font-family: 'Fredoka', sans-serif;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
}
.am-slot.add:hover { background: rgba(62,207,106,.22); transform: scale(1.05); }
.am-slot.add[data-bonus="1"]::after {
  content: 'NEW';
  position: absolute;
  top: -6px; right: -6px;
  background: var(--red);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: .5px;
}
.am-slot.locked { opacity: .5; color: #8a92a6; font-size: 16px; }
.am-slot-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--red);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: .5px;
  z-index: 2;
}

/* Upgrade */
.am-upgrade {
  margin-top: auto;
  background: linear-gradient(135deg, rgba(62,207,106,.18), rgba(62,207,106,.05));
  border: 1.5px solid rgba(62,207,106,.35);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
}
.am-upgrade-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}
.am-upgrade-cost {
  display: flex; justify-content: center; gap: 14px;
  font-size: 13px; font-weight: 800;
}
.am-upgrade-gold { color: #ffd84d; }
.am-upgrade-silver { color: #c7cdd9; }

/* Footer */
.am-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: #fff;
  border-top: 1.5px solid var(--line);
}
.am-btn {
  flex: 1;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 700;
  transition: all .15s;
  border: 1.5px solid transparent;
}
.am-btn-customize {
  background: #f0f3fa;
  color: var(--ink);
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.am-btn-customize:hover { background: #e2e7f2; }
.am-btn-select {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(26,31,46,.15);
}
.am-btn-select:hover { transform: translateY(-1px); box-shadow: 0 5px 0 rgba(26,31,46,.2); filter: brightness(1.03); }

/* Responsive */
@media (max-width: 1000px) {
  .am-body { grid-template-columns: 1fr; }
  .am-left, .am-right { border-right: none; border-bottom: 1.5px solid var(--line); }
  .am-right { background: #0f1423; border-bottom: none; }
  .am-center { min-height: 340px; padding: 20px; }
  .am-hero-glow { width: 260px; height: 260px; }
}
@media (max-width: 600px) {
  .agent-modal { padding: 0; }
  .am-shell { max-height: 100vh; width: 100%; border-radius: 0; }
  .am-name h1 { font-size: 34px; }
  .am-topbar { padding: 10px 12px; }
  .am-currency { gap: 4px; }
  .c-chip { padding: 4px 8px; font-size: 11px; }
  .am-footer { padding: 12px; }
  .am-btn { padding: 12px 14px; font-size: 14px; }
  .am-btn-customize { max-width: 150px; }
}

/* ============================================================
   SKILL TOOLTIP (for .am-slot.filled hover/click)
   ============================================================ */
.skill-tip {
  position: fixed;
  z-index: 260;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,.25), 0 0 0 1px rgba(139,92,246,.12);
  padding: 14px 16px;
  font-family: 'Nunito', sans-serif;
  opacity: 0;
  transform: translateY(4px) scale(.98);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.skill-tip.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.skill-tip::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}
.skill-tip[data-arrow="right"]::after { right: -7px; border-left: none; border-bottom: none; }
.skill-tip[data-arrow="left"]::after  { left: -7px;  border-right: none; border-top: none; }

.skill-tip .tip-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 10px;
}
.skill-tip .tip-ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--tint);
  display: grid; place-items: center;
  font-size: 22px;
  border: 1.5px solid var(--line);
  flex-shrink: 0;
}
.skill-tip .tip-name {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.skill-tip .tip-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--acc);
  background: var(--tint);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.skill-tip .tip-row { margin-bottom: 8px; }
.skill-tip .tip-row:last-child { margin-bottom: 0; }
.skill-tip .tip-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.skill-tip .tip-row p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 600;
}
.skill-tip .tip-row pre {
  background: #f4f6fb;
  color: var(--ink);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.55;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 600;
}

@media (max-width: 600px) {
  .skill-tip { width: calc(100vw - 24px); }
  .skill-tip::after { display: none; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
