:root{
  --bg:#0b1020;
  --card:#0f1724;
  --accent:#ffd27a;
  --muted:#9aa7bf;
  --glass: rgba(255,255,255,0.04);
  --glow: 0 8px 30px rgba(255,210,122,0.16), 0 2px 8px rgba(255,200,80,0.12);
  --boardW: min(860px, 92vw);
  --tileSize: 52px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: radial-gradient(1000px 400px at 10% 10%, rgba(34,40,64,0.6), transparent),
              linear-gradient(180deg,#061124 0%, #071426 50%, #02040a 100%), var(--bg);
  color:#e6eef8;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
}

.app{
  width:100%;
  max-width:1200px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-radius:14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.03);
}

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 20px;
  border-bottom:1px solid rgba(255,255,255,0.03);
  background: linear-gradient(90deg, rgba(255,255,255,0.01), transparent);
}
.title{display:flex;align-items:center;gap:12px}
.title h1{font-size:18px;margin:0}
.logo{width:40px;height:40px;border-radius:8px;object-fit:cover;box-shadow:var(--glow)}
.controls{display:flex;gap:8px;align-items:center}
.btn{background:var(--glass);border:none;color:inherit;padding:8px 12px;border-radius:8px;cursor:pointer;font-weight:600}
.btn.primary{background:linear-gradient(90deg,var(--accent), #ffb85c); color:#061226; box-shadow:var(--glow)}
.btn:active{transform:translateY(1px)}
.select{padding:8px;border-radius:8px;border:none;background:rgba(255,255,255,0.02);color:inherit}
.toggle{display:flex;align-items:center;gap:6px}

/* Main layout */
.game-wrap{display:flex; gap:16px; padding:18px}
.sidebar{width:260px; padding:12px; display:flex;flex-direction:column; gap:12px}
.panel{background:rgba(255,255,255,0.02); padding:12px;border-radius:10px; border:1px solid rgba(255,255,255,0.02)}
.meta div{display:flex;justify-content:space-between;margin:8px 0;font-size:14px}
.actions{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}

/* Board */
.board-outer{flex:1;display:flex;flex-direction:column;align-items:center;gap:10px}
.board{
  width:var(--boardW);
  height:520px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  border-radius:12px;
  display:block;
  position:relative;
  overflow:hidden;
  box-shadow: 0 8px 30px rgba(2,6,23,0.6);
  border:1px solid rgba(255,255,255,0.03);
  padding:16px;
}

/* Board svg will be appended and size sized to fill .board */
.hint-dot{fill:rgba(255,255,255,0.08);}

/* tile node */
.node{
  transition: filter 220ms ease, transform 180ms ease;
  cursor:pointer;
}
.node-circle{
  stroke:rgba(255,255,255,0.06);
  stroke-width:2;
  fill:rgba(255,255,255,0.02);
  filter:drop-shadow(0 6px 18px rgba(0,0,0,0.6));
}
.node.on .node-circle{
  fill:var(--accent);
  stroke:rgba(255,200,90,0.9);
  filter: drop-shadow(0 18px 36px rgba(255,200,90,0.12)) drop-shadow(0 0 26px rgba(255,210,110,0.18));
  transform-origin:center center;
  transform:scale(1.05);
}

/* lantern icon */
.lantern{
  pointer-events:none;
  transform-origin:center;
  transition: opacity 200ms ease, transform 200ms ease;
  opacity:0;
}
.node.on .lantern{opacity:1; transform:translateY(-6px) scale(1.05)}

/* glow ring */
.glow{
  mix-blend-mode:screen;
  opacity:0.9;
  transition:opacity 220ms ease;
}
.node.on .glow{opacity:1}

/* obstacle */
.obstacle-circle{fill: rgba(60,60,80,0.95); stroke: rgba(255,255,255,0.03);}

/* HUD and message */
.hud{position:relative;margin-top:6px;width:var(--boardW);display:flex;justify-content:center}
.message{
  background:rgba(0,0,0,0.4); padding:10px 14px;border-radius:14px;border:1px solid rgba(255,255,255,0.02);
  color:var(--accent); font-weight:700; box-shadow:var(--glow)
}

/* Footer */
.footer{display:flex;justify-content:space-between;gap:12px;padding:10px 18px;border-top:1px solid rgba(255,255,255,0.02)}

@media (max-width:980px){
  .game-wrap{flex-direction:column}
  .sidebar{width:100%}
  .board{height:420px}
}
