/* ============================================================
   KIDS.SUMSATEC.COM — Nur-Kids Arcade: Computerspiele-Welt
   Design: Sonniges, kindgerechtes Gaming-Erlebnis (Daylight Gold & Blue)
   Vollkommen unabhängiges Stylesheet für site/games.html
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Quicksand:wght@500;600;700;800&display=swap');

:root {
  --font-display: "Cinzel", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --bg-sky: #eff6ff;
  --bg-sun: #fefce8;
  --bg-card: #ffffff;

  --gold-pure: #eab308;
  --gold-bright: #facc15;
  --gold-warm: #f59e0b;
  --gold-deep: #b45309;

  --primary-blue: #0284c7;
  --primary-blue-dark: #0369a1;
  --accent-green: #10b981;
  --accent-pink: #ec4899;
  --accent-purple: #8b5cf6;
  --accent-amber: #d97706;

  --text-title: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08), 0 0 15px rgba(250, 204, 21, 0.15);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.12), 0 0 25px rgba(245, 158, 11, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, #f0f9ff 0%, #fefce8 35%, #f0fdf4 75%, #fffbeb 100%);
  background-attachment: fixed;
  color: var(--text-body);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Friendly Sunlight Sparkle Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(2px 2px at 12% 18%, rgba(245, 158, 11, 0.4), transparent),
    radial-gradient(2.5px 2.5px at 85% 15%, rgba(234, 179, 8, 0.5), transparent),
    radial-gradient(2px 2px at 45% 35%, rgba(14, 165, 233, 0.35), transparent),
    radial-gradient(3px 3px at 72% 60%, rgba(245, 158, 11, 0.45), transparent);
  background-size: 480px 480px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

/* Safe Area Insets (Topbar) */
.arcade-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid #fef08a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  padding-bottom: 10px;
  padding-inline: max(env(safe-area-inset-left, 0px), 16px) max(env(safe-area-inset-right, 0px), 16px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-to-nurkids-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-sm);
}

.back-to-nurkids-btn:hover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0284c7;
  transform: translateY(-1px);
}

.brand-arcade-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Flag Language Switcher */
.lang-switch {
  display: flex;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.7);
}

.lang-btn.active {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: scale(1.06);
}

.star-counter {
  background: #fef3c7;
  border: 1.5px solid #facc15;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: #92400e;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  color: #334155;
  text-decoration: none;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: #facc15;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.25);
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   ARCADE HUB (Game Selection View)
   ============================================================ */
.arcade-hub-hero {
  text-align: center;
  padding: 24px 16px 36px;
}

.arcade-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fef08a;
  color: #854d0e;
  border: 1.5px solid #facc15;
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.3);
}

.arcade-title {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--text-title);
  margin-bottom: 10px;
  line-height: 1.25;
}

.arcade-title span {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.arcade-desc {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--text-body);
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2.5px solid #facc15;
  outline: 1.5px solid rgba(245, 158, 11, 0.25);
  box-shadow: var(--shadow-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--card-color, #0284c7);
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #eab308;
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.game-card-icon {
  font-size: 2.5rem;
  line-height: 1;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease;
}

.game-card:hover .game-card-icon {
  transform: scale(1.1) rotate(6deg);
}

.game-card-badge {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.game-card-badge.bonus {
  background: #fce7f3;
  color: #be185d;
  border-color: #f472b6;
}

.game-card-title {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 6px;
}

.game-card-story {
  font-size: 0.85rem;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 8px;
}

.game-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

.game-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  margin-top: 10px;
}

.game-card-highscore {
  font-size: 0.85rem;
  font-weight: 800;
  color: #059669;
  background: #ecfdf5;
  padding: 4px 10px;
  border-radius: 8px;
}

.btn-play-game {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-play-game:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

/* ============================================================
   GAME STAGE (Active Game View)
   ============================================================ */
.arcade-stage {
  display: none; /* Shown when a game is active */
  max-width: 900px;
  margin: 0 auto;
}

.arcade-stage.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-header {
  background: #ffffff;
  border: 2px solid #facc15;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 10px;
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-icon {
  font-size: 1.8rem;
}

.stage-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-title);
}

.stage-story-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 6px;
}

.stage-controls-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-stage-action {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-stage-action:hover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0284c7;
}

/* Canvas Viewport */
.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 600px;
  background: #0f172a;
  border-radius: var(--radius-lg);
  border: 3px solid #facc15;
  outline: 2px solid rgba(245, 158, 11, 0.3);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  touch-action: none; /* Disables browser scrolling on touch */
}

/* Canvas Overlay Screen (Start, Pause, GameOver, Victory) */
.canvas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #ffffff;
  z-index: 10;
}

.canvas-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.overlay-icon {
  font-size: 3.5rem;
  margin-bottom: 10px;
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.overlay-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 8px;
  color: #facc15;
}

.overlay-desc {
  font-size: 1.05rem;
  max-width: 480px;
  line-height: 1.5;
  color: #e2e8f0;
  margin-bottom: 20px;
}

.overlay-stats {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fef08a;
  margin-bottom: 24px;
}

.overlay-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-overlay-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-overlay-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.55);
}

.btn-overlay-secondary {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid #cbd5e1;
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-overlay-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #facc15;
}

/* On-Screen Mobile Touch Controller */
.touch-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 8px 12px;
  user-select: none;
  -webkit-user-select: none;
}

.touch-dpad {
  display: flex;
  gap: 12px;
}

.touch-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #0f172a;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.1s ease;
}

.touch-btn:active, .touch-btn.pressed {
  background: #fef08a;
  border-color: #f59e0b;
  transform: scale(0.92);
}

.touch-action-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: 2px solid #facc15;
  border-radius: 999px;
  height: 58px;
  padding-inline: 26px;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.touch-action-btn:active, .touch-action-btn.pressed {
  transform: scale(0.92);
  background: #b45309;
}

/* Keyboard Hints Bar */
.keyboard-hints {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 8px;
}

.kbd-tag {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Confetti Canvas */
#arcade-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .arcade-title {
    font-size: 1.7rem;
  }
  .arcade-desc {
    font-size: 0.95rem;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
  .canvas-wrapper {
    aspect-ratio: 1 / 1;
    max-height: 380px;
  }
  .touch-btn {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
  .touch-action-btn {
    height: 50px;
    padding-inline: 20px;
    font-size: 0.95rem;
  }
  .keyboard-hints {
    display: none; /* Hidden on phones where touch controls are used */
  }
}

