:root{
  --bg0:#05060d;
  --ink:#eef0ff;
  --muted:#9aa0bd;
  --accent:#9b6bff;     /* ansem/solana purple */
  --accent2:#14f195;    /* solana green */
  --panel:rgba(18,20,40,.82);
  --line:rgba(255,255,255,.08);
  --shadow:0 18px 50px rgba(0,0,0,.5);
  --radius:18px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
html,body,button,input{ font-family:'Inter',ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial; }
body{
  margin:0; color:var(--ink); overflow:hidden;
  background:
    radial-gradient(1200px 700px at 50% -8%, #1a1342 0%, #0a0a1e 48%, #05060d 100%),
    var(--bg0);
}

/* GAME CANVAS */
#game{ position:fixed; inset:0; display:block; background:transparent; transition:filter .85s ease; }

/* Death veil */
#death-fx{ position:fixed; inset:0; pointer-events:none; opacity:0; transition:opacity .85s ease; z-index:40; }
body.dying #death-fx{ opacity:1; background:radial-gradient(60% 45% at 50% 55%, transparent 0%, rgba(0,0,0,.4) 70%), rgba(0,0,0,.3); }
body.dying #game{ filter:blur(6px) brightness(.7) saturate(.9); }

/* HUD */
#hud{
  position:fixed; left:0; right:0; top:0; height:48px; padding:8px 16px;
  display:flex; align-items:center; gap:14px;
  background:linear-gradient(to bottom, rgba(8,8,22,.82), rgba(8,8,22,.45));
  border-bottom:1px solid var(--line); backdrop-filter:blur(10px); z-index:60;
}
.brand{ display:flex; align-items:center; gap:9px; font-size:16px; letter-spacing:.01em; margin-right:auto; }
.brand .logo-img{ width:28px; height:28px; border-radius:50%; object-fit:cover; border:2px solid var(--accent); box-shadow:0 0 14px rgba(155,107,255,.5); }
.tld{ color:var(--accent2); }
#hud .stats{ display:flex; gap:18px; color:var(--muted); font-weight:600; font-size:13px; font-variant-numeric:tabular-nums; }
#hud .stats #marketcap{ color:var(--ink); }
.pill-btn{
  height:32px; padding:0 16px; border-radius:999px; cursor:pointer; font-weight:600;
  background:rgba(255,255,255,.06); color:var(--ink); border:1px solid var(--line);
  transition:background .15s, transform .1s;
}
.pill-btn:hover{ background:rgba(255,255,255,.12); }
.pill-btn:active{ transform:scale(.96); }

.playing #restart{ display:none !important; }
body.menu #leaderboard, body.menu #minimap, body.menu #hint{ display:none !important; }
body.menu #hud .stats, body.menu #hud #restart{ display:none !important; }
body.dying #hud{ display:none !important; }

/* Leaderboard */
#leaderboard{
  position:fixed; top:64px; right:16px; width:300px;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:12px 12px; backdrop-filter:blur(12px); z-index:30;
}
.card-title{ font-weight:800; letter-spacing:.12em; font-size:12px; color:var(--accent); margin:2px 6px 10px; }
#leaderboard ul{ list-style:none; padding:0; margin:0; max-height:54vh; overflow:auto; }
#leaderboard li{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:7px 9px; border-radius:11px; font-size:14px; }
#leaderboard li + li{ margin-top:2px; }
#leaderboard li:nth-child(1) .name{ color:#ffd76b; font-weight:700; }
#leaderboard li.me{ background:linear-gradient(90deg, rgba(155,107,255,.18), rgba(155,107,255,.05)); outline:1px solid rgba(155,107,255,.3); }
#leaderboard li .left{ display:flex; align-items:center; gap:9px; overflow:hidden; }
.dot{ width:9px; height:9px; border-radius:999px; flex:0 0 9px; box-shadow:0 0 8px currentColor; }
#leaderboard .name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; opacity:.96; }
#leaderboard li span:last-child{ font-variant-numeric:tabular-nums; color:var(--muted); font-weight:600; }
#leaderboard ul::-webkit-scrollbar{ width:8px; }
#leaderboard ul::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.1); border-radius:8px; }

/* Minimap */
#minimap{
  position:fixed; right:18px; bottom:18px; width:220px; height:160px;
  background:rgba(8,8,20,.85); border-radius:14px; box-shadow:var(--shadow);
  border:1px solid var(--line); z-index:25;
}

/* Hint */
#hint{
  position:fixed; left:50%; bottom:14px; transform:translateX(-50%);
  color:#dfe3ff; opacity:.9; font-size:12px; text-shadow:0 1px 2px rgba(0,0,0,.6);
  background:rgba(8,8,22,.5); border:1px solid var(--line); border-radius:999px; padding:7px 16px;
  backdrop-filter:blur(8px); z-index:26;
}

/* Start overlay */
#start-overlay{
  position:fixed; inset:0; display:grid; place-items:center;
  background:radial-gradient(900px 600px at 50% 0%, rgba(26,19,66,.55), rgba(8,8,20,.85));
  z-index:50; opacity:0; pointer-events:none; transition:opacity .5s ease;
}
body.menu #start-overlay{ opacity:1; pointer-events:auto; }

.start-card{
  width:min(420px, 92vw); text-align:center;
  background:var(--panel); border:1px solid var(--line); border-radius:24px; padding:30px 26px 24px;
  box-shadow:var(--shadow), 0 0 60px rgba(155,107,255,.12); backdrop-filter:blur(16px);
  animation:pop .45s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop{ from{ opacity:0; transform:translateY(14px) scale(.97); } to{ opacity:1; transform:none; } }
.start-logo{ width:108px; height:108px; border-radius:50%; object-fit:cover; display:block; margin:0 auto 14px; border:3px solid var(--accent); box-shadow:0 0 34px rgba(155,107,255,.45); }
.start-card h1{ margin:0 0 6px; font-size:32px; font-weight:800; letter-spacing:-.01em; background:linear-gradient(90deg,#fff,#cbb6ff); -webkit-background-clip:text; background-clip:text; color:transparent; }
.start-card .sub{ margin:0 0 16px; color:var(--muted); font-size:14px; }
#arena-hint{ color:var(--accent2); font-weight:600; }
.field{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; text-align:left; }
.field span{ color:#c9cffc; font-size:13px; font-weight:500; }
.field input[type="text"]{
  flex:1; height:44px; padding:0 14px; border-radius:13px; border:1px solid var(--line);
  background:rgba(0,0,0,.3); color:var(--ink); outline:none; font-size:15px; transition:border-color .15s;
}
.field input[type="text"]:focus{ border-color:var(--accent); }
.field.color input[type="color"]{ width:54px; height:44px; padding:4px; border-radius:13px; border:1px solid var(--line); background:rgba(0,0,0,.3); cursor:pointer; }
.play-btn{
  width:100%; height:50px; margin-top:14px; border-radius:14px; border:0;
  background:linear-gradient(95deg, var(--accent), #6a45d6); color:#fff; font-weight:800; font-size:16px;
  letter-spacing:.02em; cursor:pointer; box-shadow:0 10px 28px rgba(155,107,255,.4);
  transition:transform .1s, box-shadow .2s, filter .15s;
}
.play-btn:hover{ filter:brightness(1.08); box-shadow:0 12px 34px rgba(155,107,255,.55); }
.play-btn:active{ transform:scale(.98); }
.tip{ margin:12px 4px 0; color:var(--muted); font-size:12px; }

/* Blob color swatches */
.field-col{ margin:14px 0; text-align:left; }
.field-label{ display:block; color:#c9cffc; font-size:13px; font-weight:500; margin-bottom:9px; }
#swatches{ display:grid; grid-template-columns:repeat(9, 1fr); gap:7px; }
.swatch{ aspect-ratio:1/1; border-radius:9px; border:2px solid transparent; cursor:pointer; padding:0;
  transition:transform .1s, border-color .12s; box-shadow:inset 0 0 0 1px rgba(0,0,0,.3); }
.swatch:hover{ transform:scale(1.14); }
.swatch.active{ border-color:#fff; box-shadow:0 0 0 2px var(--accent), inset 0 0 0 1px rgba(0,0,0,.3); }
.custom-color{ display:inline-flex; align-items:center; gap:8px; margin-top:11px; color:var(--muted); font-size:12px; cursor:pointer; }
.custom-color input[type="color"]{ width:42px; height:30px; padding:3px; border-radius:9px; border:1px solid var(--line); background:rgba(0,0,0,.3); cursor:pointer; }

/* ===== fuller menu: side panels ===== */
#start-overlay{ display:flex; align-items:center; justify-content:center; gap:22px; padding:20px; }
.menu-side{
  width:244px; align-self:center;
  background:var(--panel); border:1px solid var(--line); border-radius:20px; padding:18px 16px;
  box-shadow:var(--shadow); backdrop-filter:blur(14px);
  animation:pop .5s cubic-bezier(.2,.9,.3,1.2);
}
.menu-side .card-title{ margin-bottom:12px; }
.side-sub{ color:var(--muted); font-size:12px; margin:0 2px 12px; text-align:left; }
.side-foot{ color:var(--muted); font-size:11px; margin:14px 2px 0; opacity:.8; text-align:left; }
.kol-list{ display:flex; flex-direction:column; gap:9px; }
.kol-row{ display:flex; align-items:center; gap:11px; padding:7px 9px; border-radius:12px; background:rgba(255,255,255,.04); border:1px solid var(--line); }
.kol-row img{ width:34px; height:34px; border-radius:50%; object-fit:cover; border:2px solid var(--accent); }
.kol-row span{ font-weight:600; font-size:14px; }
.how-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:11px; text-align:left; }
.how-list li{ font-size:13px; color:#d7dcf5; line-height:1.35; }
.how-list b{ color:var(--accent2); font-weight:700; }
@media (max-width: 920px){ .menu-side{ display:none; } #start-overlay{ gap:0; } }

/* ===== custom (non-native) validation ===== */
.form-error{ max-height:0; overflow:hidden; opacity:0; color:#ff7a7a; font-size:13px; font-weight:600; text-align:left; transition:opacity .2s ease, max-height .2s ease, margin .2s ease; }
.form-error.show{ max-height:40px; opacity:1; margin-top:10px; }
.field input.invalid{ border-color:#ff5e5e !important; box-shadow:0 0 0 2px rgba(255,94,94,.25); }

/* swatches: 8 per row */
#swatches{ grid-template-columns:repeat(8, 1fr); }

/* ===== icons (replacing emojis) ===== */
.ic{ width:17px; height:17px; flex:0 0 17px; }
.card-title{ display:flex; align-items:center; gap:7px; }
.how-list li{ display:flex; align-items:flex-start; gap:10px; }
.how-list .ic{ margin-top:1px; color:var(--accent2); }

/* ===== X buttons ===== */
.xbtn{ display:inline-flex; align-items:center; gap:8px; height:32px; padding:0 14px; border-radius:999px;
  background:#000; color:#fff; border:1px solid rgba(255,255,255,.2); font-weight:600; font-size:13px;
  cursor:pointer; text-decoration:none; transition:background .15s, transform .1s, border-color .15s; }
.xbtn:hover{ background:#16181c; border-color:rgba(255,255,255,.4); }
.xbtn:active{ transform:scale(.96); }
.xlogo{ width:15px; height:15px; flex:0 0 15px; }
#connectx{ margin-left:8px; }
.xfollow{ position:fixed; right:18px; bottom:18px; z-index:55; box-shadow:var(--shadow); display:none; }
body.menu .xfollow{ display:inline-flex; }
.xbtn.connected{ background:#0c2a19; border-color:var(--accent2); color:#bdf7d8; }
.field input.locked{ opacity:.85; cursor:not-allowed; border-color:var(--accent2); background:rgba(20,241,149,.06); }

/* ===== RESPONSIVE / MOBILE ===== */
.start-card{ max-height:92vh; overflow-y:auto; }
@media (max-width: 768px){
  #hud{ height:44px; padding:6px 10px; gap:8px; }
  .brand{ font-size:14px; } .brand .logo-img{ width:24px; height:24px; }
  #hud .stats{ gap:10px; font-size:11px; }
  .xbtn{ font-size:12px; height:30px; padding:0 11px; }
  #leaderboard{ width:158px; top:54px; right:10px; padding:9px; }
  #leaderboard li{ font-size:12px; padding:5px 7px; }
  #leaderboard ul{ max-height:42vh; }
  #minimap{ width:140px; height:104px; right:10px; bottom:10px; }
  #hint{ font-size:10.5px; padding:6px 12px; max-width:92vw; text-align:center; bottom:10px; line-height:1.3; }
  .start-card{ width:94vw; padding:22px 16px 20px; }
  .start-card h1{ font-size:26px; } .start-logo{ width:88px; height:88px; }
  #swatches{ gap:6px; }
  .xfollow{ right:10px; bottom:10px; height:30px; font-size:12px; }
}
@media (max-width: 460px){
  #connectx span{ display:none; } #connectx{ padding:0 10px; margin-left:6px; }
  #hud .stats{ display:none; }
  #leaderboard{ width:138px; }
  #minimap{ display:none; }
  .start-card h1{ font-size:23px; } .start-card .sub{ font-size:13px; }
  .field input[type="text"]{ height:42px; }
  .play-btn{ height:48px; }
}
/* prevent any horizontal scroll on small screens */
html,body{ max-width:100%; overflow-x:hidden; }
#version{ position:fixed; left:12px; bottom:10px; color:var(--muted); font-size:11px; opacity:.55; z-index:24; letter-spacing:.04em; user-select:none; }
