:root{
  --bg:#06060a;
  --panel:#0f0f13;
  --accent:#ff2aac;
  --accent-2:#ff74d1;
  --muted:#aeb0b6;
  --glow: 0 10px 40px rgba(255,42,172,0.12);
  --glass: rgba(255,255,255,0.02);
  --radius:12px;
  --trans-dur:200ms;
}

/* Reset & basics */
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter, 'Segoe UI', Roboto, Arial, sans-serif;background:
  radial-gradient(1200px 600px at 10% 10%, rgba(255,42,172,0.03), transparent),
  linear-gradient(180deg,#020203 0%, #0b0b0e 100%);color:#fff; -webkit-font-smoothing:antialiased;}
body { display:flex; justify-content:center; align-items:flex-start; padding:18px; }

/* Mariko fixed panel (LEFT) */
.mariko-fixed{
  position:fixed;
  left:18px;
  top:12%;
  width:170px;
  z-index:1300;
  pointer-events:none;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
.mariko-bubble{
  position:relative;
  left:0;
  width:240px;
  margin-left:10px;
  padding:8px 10px;
  background:linear-gradient(180deg, rgba(20,16,22,0.98), rgba(10,8,12,0.95));
  border:1px solid rgba(255,42,172,0.08);
  border-radius:10px;
  color:#ffdff0;
  font-size:13px;
  display:none;
  pointer-events:auto;
  box-shadow:0 8px 30px rgba(0,0,0,0.6);
}

/* Root container */
#root{ width:100%; max-width:1200px; text-align:center; display:flex; flex-direction:column; gap:8px; align-items:center; }

/* Header & logo */
.site-head{ display:flex; flex-direction:column; gap:6px; align-items:center; text-align:center; margin-bottom:6px; }
#bbLogo { width:520px; max-width:92%; height:auto; display:block; margin-bottom:2px; }
.logo-main { letter-spacing:2px; font-size:54px; }
.logo-sub { opacity:0.92; font-size:14px; }
#logoBlocks .lb { fill: url(#g1); opacity:0.95; transform-origin:center; animation:logoBlock 1200ms linear infinite; }
#logoBlocks .lb:nth-child(1){ animation-delay:0ms }
#logoBlocks .lb:nth-child(2){ animation-delay:220ms }
#logoBlocks .lb:nth-child(3){ animation-delay:440ms }
@keyframes logoBlock {
  0% { transform: translateY(-2px) scale(0.92); opacity:0.6 }
  40% { transform: translateY(6px) scale(1.02); opacity:1 }
  100% { transform: translateY(-2px) scale(0.92); opacity:0.6 }
}
.subtitle { color:var(--muted); font-size:13px; }

/* Layout */
main{ width:100%; display:flex; flex-direction:column; align-items:center; gap:14px; }
#layout{ display:flex; gap:20px; width:100%; align-items:flex-start; justify-content:center; }

/* Left column (canvas) */
#leftCol{ display:flex; align-items:flex-start; justify-content:center; }
.canvas-wrap{ position:relative; border-radius:8px; padding:8px; transition:transform .36s cubic-bezier(.2,.9,.2,1), opacity .28s; }
.canvas-wrap .board-glow{ position:absolute; inset:0; pointer-events:none; border-radius:8px; box-shadow:var(--glow); mix-blend-mode:screen; opacity:0.45; }

/* board sizing & visual */
#board{
  background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border:4px solid var(--accent); box-shadow:0 0 40px rgba(255,42,172,0.12);
  image-rendering:pixelated;
  width: calc(10 * 30px); height: calc(20 * 30px);
  border-radius:6px; display:block;
}

/* Right column (hud & extras) */
#rightCol{ display:flex; flex-direction:column; gap:12px; width:320px; align-items:stretch; }

/* Panels */
.panel{ background: linear-gradient(180deg,#121217,#0b0b0e); padding:12px; border-radius:var(--radius); border:1px solid rgba(255,255,255,0.03); box-shadow:var(--glow); }
.panel.small{ padding:10px }
.panel.tiny{ padding:8px }
.panel.center{ text-align:center; }
.panel-title{ font-size:11px; color:var(--muted); margin-bottom:8px; }

/* HUD details */
#hud{ display:flex; flex-direction:column; gap:10px; }
.hud-row{ margin-bottom:6px; text-align:left }
.center .hud-row{ text-align:center }
.ability{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px }
.ability-name{ font-size:13px }
.ability-meta{ font-size:12px; color:var(--muted) }
.ready{ color:#7efc8d } .cooldown{ color:#ffb86b }

/* Build bar visual */
.build-bar{ height:200px; width:44px; background:var(--glass); border-radius:10px; padding:8px; display:flex; flex-direction:column-reverse; gap:8px; align-items:center; overflow:hidden; border:1px solid rgba(255,255,255,0.02); }
.build-seg{ width:100%; height:18px; background:linear-gradient(90deg,var(--accent-2),var(--accent)); border-radius:6px; box-shadow:0 8px 20px rgba(255,42,172,0.12); transform-origin:center; }

/* queue */
.next-queue{ display:flex; flex-direction:column; gap:8px; align-items:center; }
.next-piece{ display:grid; grid-template-columns:repeat(4,14px); gap:2px; padding:6px; background:rgba(255,255,255,0.02); border-radius:6px }
.next-square{ width:14px; height:14px; border-radius:2px; box-shadow:inset 0 -3px 6px rgba(0,0,0,0.25) }

/* shop items */
.shop-item{ display:flex; justify-content:space-between; align-items:center; padding:12px; border-radius:10px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); margin-bottom:10px; }

/* overlay style & animations */
.overlay{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:none; opacity:0; transition:opacity .18s ease; z-index:1200; }
.overlay.visible{ pointer-events:auto; opacity:1; }
.overlay-panel{ width:520px; max-width:94%; background:linear-gradient(180deg,#121217,#0b0b0e); padding:18px; border-radius:14px; border:2px solid rgba(255,42,172,0.12); box-shadow:0 20px 70px rgba(0,0,0,0.7); text-align:left; transform-origin:center; }
.menu-buttons{ display:flex; gap:10px; justify-content:center; margin-top:16px; }
button{ background:linear-gradient(180deg,var(--accent),var(--accent-2)); color:#111; padding:10px 14px; border-radius:10px; border:none; cursor:pointer; font-weight:800; box-shadow:0 8px 24px rgba(255,42,172,0.12); }
button.small-btn{ padding:8px 10px; border-radius:8px; font-weight:700; }

/* subtle muted text */
.small.muted, .muted{ color:var(--muted); font-size:13px }

/* appearance / entrance animations for side content */
.appear-up{ transform:translateY(8px); opacity:0; animation:enterUp .42s cubic-bezier(.2,.9,.2,1) forwards; animation-delay:160ms; }
.appear-right{ transform:translateX(8px); opacity:0; animation:enterRight .42s cubic-bezier(.2,.9,.2,1) forwards; }
@keyframes enterUp { to { transform:none; opacity:1; } }
@keyframes enterRight { to { transform:none; opacity:1; } }

.slide-in{ transform:translateY(10px) scale(.99); opacity:0; animation:popIn .28s ease forwards; }
@keyframes popIn { to { transform:none; opacity:1; } }
.slide-in-left{ transform:translateX(-18px); opacity:0; animation:popInLeft .36s cubic-bezier(.2,.8,.24,1) forwards; }
@keyframes popInLeft { to { transform:none; opacity:1; } }
.slide-in-up{ transform:translateY(18px); opacity:0; animation:popInUp .36s cubic-bezier(.2,.8,.24,1) forwards; }
@keyframes popInUp { to { transform:none; opacity:1; } }

/* small helpers */
.small{ font-size:13px }
.tiny{ font-size:12px }

/* pop animation for new build-seg entries (JS can add class .animate-pop) */
.build-seg.animate-pop{ animation:pop .36s cubic-bezier(.2,.9,.2,1) }
@keyframes pop{ 0%{ transform:scale(.9); opacity:0 } 60%{ transform:scale(1.06); opacity:1 } 100%{ transform:none } }

/* responsive */
@media(max-width:920px){
  .mariko-fixed{ left:12px; top:6%; width:150px }
  #layout{ flex-direction:column; align-items:center; gap:12px; }
  #rightCol{ width:92%; max-width:480px; }
  #bbLogo { width:92%; height:auto }
  #marikoCanvas{ width:150px; height:230px }
  .overlay-panel{ width:92% }
}
