/* ==========================================================================
   vhs Future-Pong – Style (Phase 1 MVP)
   Alle Farben über CSS Custom Properties gemäß vhs Corporate Design.
   ========================================================================== */

:root {
  /* Spielfeld & Hintergrund */
  --bg-primary: #00285A;          /* vhs Blau – Spielfeld-Hintergrund */
  --bg-secondary: #375578;        /* vhs Blau 80 % – Paddle-Füllung */

  /* Abstufungen der Primärfarbe */
  --bg-60: #69829B;               /* vhs Blau 60 % */
  --bg-40: #9BAABE;               /* vhs Blau 40 % */
  --bg-20: #CDD7DC;               /* vhs Blau 20 % */
  --bg-10: #E6EBF0;               /* vhs Blau 10 % */

  /* Spielobjekte */
  --obj-primary: #FFFFFF;          /* Weiß – Ball, Text, Konturen */
  --obj-accent: #FAB90F;           /* vhs Gelb A – Ball-Highlight, Score */

  /* Spielfeld-Struktur */
  --field-border: #CDD7DC;         /* vhs Blau 20 % – Mittellinie, Ränder */
  --field-subtle: #E6EBF0;         /* vhs Blau 10 % – dezente Elemente */

  /* Power-Up-Farben (Phase 2) */
  --pu-grundbildung: #FAB90F;
  --pu-beruf: #64B9E6;
  --pu-sprachen: #7D5AA5;
  --pu-gesundheit: #AFC805;
  --pu-kultur: #E1000F;
  --pu-gesellschaft: #EB640F;

  /* Power-Up Schatten (B-Varianten) */
  --pu-grundbildung-b: #FF9100;
  --pu-beruf-b: #1E73AF;
  --pu-sprachen-b: #371964;

  /* Typografie */
  --font-primary: Arial, Calibri, Helvetica, sans-serif;
}

/* ---------- Reset & Base ---------- */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  font-family: var(--font-primary);
  color: var(--obj-primary);
}

/* ---------- Game Container ---------- */

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  display: block;
  /* Actual size set via JS; CSS keeps aspect ratio */
  image-rendering: auto;
  border: 2px solid var(--field-border);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 40, 90, 0.8);
}

/* ---------- Global UI Elements ---------- */

#ui-container {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20; /* Above game, above overlays */
}

.icon-btn {
  background: rgba(0, 40, 90, 0.7);
  border: 2px solid var(--bg-60);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--obj-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-primary);
  border-color: var(--obj-primary);
  transform: scale(1.1);
}

/* ---------- Overlays (Start / End) ---------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 10;
  gap: 1.5rem;
  transition: opacity 0.4s ease;
}

.overlay.hidden {
  display: none;
}

.overlay__logo {
  max-width: 260px;
  height: auto;
  margin-bottom: 0.5rem;
}

.overlay__title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: bold;
  color: var(--obj-primary);
  text-align: center;
  letter-spacing: 0.04em;
}

.overlay__subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--obj-accent);
  text-align: center;
}

.overlay__credit {
  font-size: 0.85rem;
  color: var(--bg-20);
  text-align: center;
  letter-spacing: 0.02em;
  margin-top: -0.8rem;
}

/* ---------- Start Menu Settings ---------- */

.game-settings {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1rem 0;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.settings-group h3 {
  font-size: 1rem;
  color: var(--bg-20);
  border-bottom: 1px solid var(--bg-60);
  padding-bottom: 0.3rem;
  margin-bottom: 0.2rem;
}

.settings-group label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
}

.settings-group input[type="radio"],
.settings-group input[type="checkbox"] {
  accent-color: var(--obj-accent);
  width: 18px;
  height: 18px;
}

.settings-group select {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--bg-60);
  background: var(--bg-primary);
  color: var(--obj-primary);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
}

.settings-group select:focus {
  outline: 2px solid var(--obj-accent);
}

.overlay__score {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: bold;
  color: var(--obj-accent);
  margin: 0.5rem 0;
}

/* Instructions Screen & Content */
.instructions-content {
  max-width: 800px;
  width: 90%;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-60) transparent;
}

.instructions-section {
  margin-bottom: 2rem;
}

.instructions-section h3 {
  color: var(--obj-accent);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--bg-60);
  padding-bottom: 0.3rem;
  display: inline-block;
}

.instructions-section p {
  color: var(--obj-primary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.instructions-section code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: var(--obj-accent);
  font-family: inherit;
  font-weight: bold;
}

.pu-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.pu-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--pu-col, var(--bg-60));
}

.pu-item img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

.pu-info {
  display: flex;
  flex-direction: column;
}

.pu-info h4 {
  font-weight: bold;
  color: var(--obj-primary);
  font-size: 1.1rem;
  margin: 0 0 0.2rem 0;
}

.pu-info p {
  font-size: 0.9rem;
  color: var(--bg-20);
  margin: 0;
}

.overlay__buttons,
.pause-menu__buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.overlay__result-text {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--obj-primary);
}

.btn {
  font-family: var(--font-primary);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: bold;
  padding: 0.8em 2.5em;
  border: 2px solid var(--obj-primary);
  border-radius: 50px;
  background: transparent;
  color: var(--obj-primary);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
  text-transform: none;
  letter-spacing: 0.02em;
}

.btn--secondary {
  border-color: var(--bg-60);
  background: rgba(0, 40, 90, 0.5);
  font-size: 1rem;
  padding: 0.6em 2em;
}

.btn:hover,
.btn:focus-visible {
  background: var(--obj-primary);
  color: var(--bg-primary);
  transform: scale(1.05);
  outline: none;
}

.btn:active {
  transform: scale(0.97);
}

/* ---------- Landscape Hint (< 768 px) ---------- */

#landscape-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-primary);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  text-align: center;
  padding: 2rem;
}

#landscape-hint .hint-icon {
  font-size: 3rem;
}

#landscape-hint .hint-text {
  font-size: 1.1rem;
  color: var(--obj-primary);
  max-width: 280px;
  line-height: 1.5;
}

/* Show landscape hint on small or portrait screens */
@media (max-width: 767px) {
  #landscape-hint {
    display: flex;
  }
  #game-container {
    display: none;
  }
}

@media (max-height: 400px) and (max-width: 767px) {
  #landscape-hint {
    display: flex;
  }
  #game-container {
    display: none;
  }
}
