/*
 * Neon Tetris – Ultimate Edition stylesheet
 *
 * This file defines all of the visual styling for the Neon Tetris game.
 * The goal is to evoke the look and feel of glowing neon lights on a dark
 * background.  Animations are used sparingly to enhance immersion without
 * distracting from the gameplay.  Colours are chosen to contrast sharply
 * against the black backdrop, and text shadows create a luminous halo.
 */

* {
  box-sizing: border-box;
}

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

/* Animated gradient background behind everything */
#background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(45deg, #210d34, #1a074b, #002d4f, #01394a, #0d114d);
  background-size: 800% 800%;
  animation: gradientShift 20s ease infinite;
  filter: blur(30px);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

header {
  text-align: center;
  margin-top: 10px;
}

header h1 {
  margin: 0;
  font-size: 3rem;
  color: #0ff;
  letter-spacing: 1px;
  text-shadow: 0 0 5px #0ff, 0 0 10px #0ff, 0 0 20px #0ff,
               0 0 30px #0af, 0 0 40px #0af;
}

header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #f0f;
  text-shadow: 0 0 5px #f0f, 0 0 10px #f0f, 0 0 20px #c0f,
               0 0 30px #90f;
}

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

/* Left panel containing the main game canvas */
#left-panel {
  position: relative;
}

#game {
  display: block;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  box-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 30px #00f inset;
}

/* Message overlay shown when paused or game over */
#message {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #fff;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.4;
  cursor: pointer;
  padding: 20px;
}

/* Ensure the message overlay is not visible when the hidden attribute is set */
#message[hidden] {
  display: none !important;
}

/* Right panel containing stats, preview and controls */
#right-panel {
  width: 230px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#stats, #preview, #controls {
  background: rgba(0, 0, 0, 0.5);
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 0 10px #0ff, 0 0 20px #00f inset;
}

#stats h3, #preview h3, #controls h3 {
  margin-top: 0;
  margin-bottom: 5px;
  color: #0ff;
  text-shadow: 0 0 10px #0ff, 0 0 20px #0af;
  font-size: 1.2rem;
  font-weight: normal;
}

#stats div {
  margin-bottom: 10px;
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 5px #fff, 0 0 10px #0ff;
}

#preview canvas {
  display: block;
  margin: 0 auto 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  box-shadow: 0 0 10px #f0f, 0 0 20px #c0f inset;
}

#controls ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.8rem;
}

#controls li {
  margin-bottom: 5px;
}

#controls kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 2px 5px;
  box-shadow: 0 0 5px #0ff;
  font-family: 'Consolas', monospace;
}

footer {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  margin: 20px 0;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
  main {
    flex-direction: column;
    align-items: center;
  }
  #right-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
  }
  #stats, #preview, #controls {
    margin-bottom: 10px;
    flex: 1 1 30%;
  }
}