* { box-sizing: border-box; }

body {
  margin: 0; padding: 0; overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
  background: #0a0a0a;
}

/* Lava-like animated background */
#background-animation {
  position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(1200px 600px at 10% 10%, #2b0000, #000000 60%),
              radial-gradient(900px 500px at 80% 20%, #3a0a00, #000000 60%),
              radial-gradient(800px 600px at 40% 90%, #220000, #000000 60%);
  filter: blur(30px) saturate(120%);
  animation: simmer 20s ease-in-out infinite alternate;
}
@keyframes simmer {
  0% { transform: scale(1) translate(0,0); opacity: 0.9; }
  50% { transform: scale(1.04) translate(1%, -1%); opacity: 1; }
  100% { transform: scale(1) translate(-1%, 1%); opacity: 0.9; }
}

header { text-align: center; margin: 10px 0 0; }
header h1 {
  margin: 0; font-size: 2.6rem; letter-spacing: 1px; color: #ffae00;
  text-shadow: 0 0 6px rgba(255,174,0,.9), 0 0 16px rgba(255,68,0,.5);
}
header h2 {
  margin: 0; font-size: 1.4rem; color: #ff4300;
  text-shadow: 0 0 6px rgba(255,67,0,.9), 0 0 16px rgba(255,0,0,.5);
}

main { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; padding: 20px; }

#left-panel { position: relative; }

#game {
  display: block; background: rgba(0,0,0,.65); border-radius: 8px;
  box-shadow: 0 0 12px rgba(255,80,0,.5), 0 0 22px rgba(255,0,0,.4) inset;
}

#message {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; text-align: center; padding: 18px; cursor: pointer;
  background: rgba(0,0,0,.78); font-size: 1.4rem; line-height: 1.4;
}
#message[hidden] { display: none !important; }

#right-panel { width: 230px; display: flex; flex-direction: column; gap: 20px; }

#stats, #preview, #controls {
  background: rgba(0,0,0,.5); padding: 12px 14px; border-radius: 8px;
  box-shadow: 0 0 12px rgba(255,120,0,.35), 0 0 20px rgba(255,0,0,.25) inset;
}

#stats h3, #preview h3, #controls h3 {
  margin: 0 0 6px; font-weight: 500; font-size: 1.1rem; color:#ffc800;
  text-shadow: 0 0 10px rgba(255,200,0,.8);
}

#stats div { margin-bottom: 8px; font-size: 1.3rem; font-weight: 700; }

#preview canvas { display:block; margin:0 auto 8px; background: rgba(0,0,0,.5); border-radius: 4px; }

#controls ul { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
#controls li { margin-bottom: 6px; }
#controls kbd {
  background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25); border-radius: 4px;
  padding: 2px 5px; font-family: Consolas, monospace; box-shadow: 0 0 6px rgba(255,100,0,.6);
}

footer { text-align:center; color:#bbb; font-size:.9rem; margin:18px 0; }

/* Explosion particles (drawn on canvas) use additive blend look */
.particle { mix-blend-mode: screen; }

@media (max-width: 768px){
  #right-panel { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-around; }
  #stats, #preview, #controls { flex:1 1 30%; }
}

