* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Courier New', monospace;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 20px;
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  height: 60px;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #00ff88;
}

#headerLinks {
  display: flex;
  align-items: center;
  gap: 20px;
}

#rootLink,
#rulesLink {
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 5px 6px;
  border-radius: 5px;
  box-shadow: 0 0 6px #00ff88;
  text-decoration: none;
  color: #00ff88;
}

#rootLink:hover,
#rulesLink:hover {
  background: rgba(0, 0, 0, 0.9);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  text-align: left;
  width: 80%;
  max-width: 400px;
  line-height: 1.8;
}

.modal-content h2 {
  margin-top: 0;
  text-align: center;
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
}

#gameContainer {
  position: relative;
  border: 2px solid #00ff8844;
  box-shadow: 0 0 40px #00ff8822, inset 0 0 40px #00000066;
}

canvas {
  display: block;
  touch-action: none;
}

#info {
  color: #448866;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  margin-top: 10px;
  text-align: center;
}

@media (min-width: 768px) {
  #gameCanvas {
    width: 720px;
    height: 900px;
  }
}