
:root {
  --bg-color: #050508;
  --text-color: #ffffff;
  --accent-blue: #00f2ff;
  --accent-pink: #ff00ff;
  --accent-red: #ff3333;
  --container-border: rgba(0, 242, 255, 0.3);
  --container-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
  --overlay-bg: rgba(5, 5, 8, 0.9);
  --rink-line: rgba(255, 255, 255, 0.2);
  --timer-color: #00f2ff;
  --button-hover-bg: #ffffff;
}

body.light-mode {
  --bg-color: #f5f7fa;
  --text-color: #2d3436;
  --accent-blue: #0984e3;
  --accent-pink: #e84393;
  --accent-red: #d63031;
  --container-border: rgba(0, 0, 0, 0.1);
  --container-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --overlay-bg: rgba(255, 255, 255, 0.9);
  --rink-line: rgba(0, 0, 0, 0.1);
  --timer-color: #2d3436;
  --button-hover-bg: #2d3436;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-tap-highlight-color: transparent;
}

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

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

h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

@media (max-width: 768px) {
  header { padding: 0.5rem 1rem; }
  nav { display: none; } 
  h1 { font-size: 1.2rem; }
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: all 0.3s;
}

nav a:hover {
  opacity: 1;
  color: var(--accent-blue);
}

#theme-toggle {
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  border: 2px 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: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

#game-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 3rem;
  min-height: 50vh;
}

#game-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--container-border);
  border-radius: 12px;
  box-shadow: var(--container-shadow);
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 2px 2px, var(--rink-line) 1px, transparent 0);
  background-size: 30px 30px;
  overflow: hidden;
  touch-action: none;
}

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

.scoreboard {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 25px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  border: 1px solid var(--rink-line);
  pointer-events: none;
  z-index: 5;
}

#player-score, #ai-score {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Monaco', monospace;
}

#player-score {
  color: var(--accent-blue);
  text-shadow: 0 0 15px var(--accent-blue);
}

#ai-score {
  color: var(--accent-pink);
  text-shadow: 0 0 15px var(--accent-pink);
}

.score-divider {
  margin: 0 15px;
  color: var(--text-color);
  opacity: 0.5;
  font-size: 1.5rem;
}

#timer-display {
  position: absolute;
  top: 25px;
  right: 30px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Monaco', monospace;
  color: var(--timer-color);
  background: rgba(0, 0, 0, 0.2);
  padding: 5px 15px;
  border-radius: 10px;
  pointer-events: none;
}

.overlay {
  position: absolute;
  inset: 0;
  background-color: var(--overlay-bg);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: all 0.5s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay h1 {
  font-size: 4.5rem;
  font-weight: 900;
  margin-bottom: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 30px var(--accent-blue);
}

#start-button, #restart-button {
  padding: 1.2rem 3.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: 100px;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#start-button {
  background: var(--accent-blue);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

#start-button:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 255, 255, 0.6);
}

#restart-button {
  background: var(--accent-pink);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
}

#restart-button:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 0, 255, 0.6);
}

#goal-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 40px var(--accent-red);
  z-index: 50;
  pointer-events: none;
  animation: goal-bounce 1.5s ease-out forwards;
}

@keyframes goal-bounce {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.content-section {
  margin-bottom: 6rem;
}

.content-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 15px;
}

.content-section h2::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--rink-line);
}

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

.content-card {
  background: rgba(128, 128, 128, 0.05);
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid var(--rink-line);
  transition: transform 0.3s ease;
}

.content-card:hover {
  transform: translateY(-5px);
}

.content-card h3 {
  margin-bottom: 1rem;
  color: var(--accent-blue);
  font-size: 1.3rem;
}

footer {
  padding: 4rem 2rem;
  border-top: 1px solid var(--rink-line);
  opacity: 0.7;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}

@media (max-width: 900px) and (orientation: landscape) {
  header { display: none; }
  main { padding: 0; }
  #game-section { min-height: 100vh; margin: 0; }
  #game-container { 
    max-width: 100vw; 
    height: 100vh; 
    border-radius: 0; 
    border: none;
  }
}

.hidden {
  display: none !important;
}

/* Game Focus Mode */
body.focus-mode {
  overflow: hidden;
}

body.focus-mode header,
body.focus-mode #how-to-play,
body.focus-mode #about,
body.focus-mode #policy,
body.focus-mode #ads-section,
body.focus-mode footer {
  display: none !important;
}

body.focus-mode main {
  padding: 0;
  max-width: 100vw;
  margin: 0;
}

body.focus-mode #game-section {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100vw;
}

body.focus-mode #game-container {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

/* Tabs and Policy Section */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  background: rgba(128, 128, 128, 0.1);
  border: 1px solid var(--rink-line);
  color: var(--text-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: var(--accent-blue);
  color: #000;
  border-color: var(--accent-blue);
}

.tab-content {
  display: none;
  padding: 20px;
  background: rgba(128, 128, 128, 0.05);
  border-radius: 12px;
  border: 1px solid var(--rink-line);
}

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

.tab-content h3 {
  margin-bottom: 15px;
  color: var(--accent-blue);
}

.tab-content ul {
  margin-left: 20px;
  margin-top: 10px;
}

.tab-content li {
  margin-bottom: 8px;
}

/* Timer Low Time State */
#timer-display.low-time {
  color: var(--accent-red);
  text-shadow: 0 0 10px var(--accent-red);
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0.5; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.4rem; }
  nav { gap: 1rem; }
  .overlay h1 { font-size: 2.5rem; }
  #goal-notification { font-size: 3rem; }
}
