
:root {
  --bg-color: #111;
  --text-color: #fff;
  --container-border: #fff;
  --container-shadow: 0 0 20px #fff, 0 0 30px #0ff, 0 0 40px #0ff;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --rink-line: rgba(255, 255, 255, 0.3);
  --timer-color: #fff;
  --button-hover-bg: #111;
}

body.light-mode {
  --bg-color: #f0f0f0;
  --text-color: #222;
  --container-border: #222;
  --container-shadow: 0 0 15px rgba(0,0,0,0.2);
  --overlay-bg: rgba(255, 255, 255, 0.8);
  --rink-line: rgba(0, 0, 0, 0.15);
  --timer-color: #222;
  --button-hover-bg: #fff;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Arial', sans-serif;
  display: block; /* Change from flex to allow scrolling */
  margin: 0;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  background: var(--bg-color);
  padding: 1rem 2rem;
  border-bottom: 2px solid var(--rink-line);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

nav a:hover {
  color: #0ff;
}

#theme-toggle {
  /* Positioned within nav, no absolute positioning needed */
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 15px;
  border: 1px solid var(--text-color);
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

#theme-toggle:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

#game-section {
  display: flex;
  justify-content: center;
  margin-bottom: 4rem;
}

#game-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 2 / 1;
  border: 3px solid var(--container-border);
  border-radius: 10px;
  box-shadow: var(--container-shadow);
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/%3E%3C/svg%3E');
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.content-section {
  margin-bottom: 4rem;
  line-height: 1.6;
}

.content-section h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  border-left: 5px solid #0ff;
  padding-left: 1rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.content-card {
  background: rgba(128, 128, 128, 0.1);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--rink-line);
}

.content-card h3 {
  margin-bottom: 1rem;
  color: #0ff;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--text-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 5px;
}

.tab-btn.active {
  background: #0ff;
  color: #111;
  border-color: #0ff;
}

.tab-content {
  display: none;
  background: rgba(128, 128, 128, 0.05);
  padding: 2rem;
  border-radius: 10px;
}

.tab-content.active {
  display: block;
}

footer {
  border-top: 1px solid var(--rink-line);
  padding: 2rem;
  background: var(--bg-color);
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--rink-line);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--rink-line);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scoreboard {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  font-size: 2rem;
  font-weight: bold;
  pointer-events: none;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-bg);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 7px;
  transition: background-color 0.3s ease;
}

.overlay.hidden {
  display: none;
}

.overlay h1 {
  font-size: 4rem;
  letter-spacing: 10px;
  margin-bottom: 2rem;
  color: var(--text-color);
  text-shadow: 0 0 15px #0ff, 0 0 25px #0ff;
}

#start-button, #restart-button {
  padding: 1rem 3rem;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 2px;
}

#start-button {
  color: #0ff;
  background: transparent;
  border: 2px solid #0ff;
  box-shadow: 0 0 10px #0ff;
}

#start-button:hover {
  background-color: #0ff;
  color: var(--button-hover-bg);
  box-shadow: 0 0 30px #0ff, 0 0 50px #0ff;
  transform: scale(1.05);
}

#restart-button {
  color: #f0f;
  background: transparent;
  border: 2px solid #f0f;
  box-shadow: 0 0 10px #f0f;
}

#restart-button:hover {
  background-color: #f0f;
  color: var(--button-hover-bg);
  box-shadow: 0 0 30px #f0f, 0 0 50px #f0f;
  transform: scale(1.05);
}


#player-score {
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
  margin-right: 20px;
}

#ai-score {
  color: #f0f;
  text-shadow: 0 0 10px #f0f;
  margin-left: 20px;
}

#timer-display {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--timer-color);
  text-shadow: 0 0 10px var(--timer-color);
  pointer-events: none;
  transition: color 0.3s ease;
}

#timer-display.low-time {
  color: #ff4444;
  text-shadow: 0 0 15px #ff4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

#goal-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  font-weight: bold;
  color: var(--text-color);
  text-shadow: 0 0 20px var(--text-color);
  animation: goal-animation 1.5s ease-out forwards;
}

#goal-notification.hidden {
    display: none;
}

@keyframes goal-animation {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

