* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #0a0a0a;
  height: 100dvh;
  font-family: 'Courier New', monospace;
  color: #fff;
  overflow: hidden;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 3px, rgba(0,0,0,0) 4px);
  pointer-events: none;
  z-index: 100;
}

/* ── Screen-System ─────────────────────────────────────── */
.screen { display: none; height: 100dvh; }
.screen.active { display: flex; }

/* ── Boot ──────────────────────────────────────────────── */
#boot {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  background: #000;
  padding: clamp(20px, 4vw, 48px);
}
#boot-terminal {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.t-line {
  font-size: clamp(0.6rem, 1.6vw, 0.8rem);
  letter-spacing: 0.05rem;
  color: #4fc3f7;
  opacity: 0;
  transition: opacity 0.1s;
  white-space: pre;
}
.t-line.show { opacity: 1; }
#boot-cursor { display: none; }
@keyframes cblink { 0%,100%{opacity:1} 50%{opacity:0} }

#boot-press-key {
  margin-top: 12px;
  font-size: clamp(0.6rem, 1.6vw, 0.8rem);
  letter-spacing: 0.05rem;
  color: #4fc3f7;
  opacity: 0;
  white-space: pre;
}
#boot-press-key.show {
  opacity: 1;
  animation: pblink 0.9s step-end infinite;
}
@keyframes pblink { 0%,100%{opacity:1} 50%{opacity:0} }

.letter {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(1.8rem, 7vw, 4.5rem);
  letter-spacing: 0.05em;
  color: #4fc3f7;
  opacity: 0;
  text-shadow: 0 0 40px rgba(79,195,247,0.9), 0 0 80px rgba(79,195,247,0.4);
}
.letter.pop { animation: appear 0.14s forwards; }
@keyframes appear {
  0%   { opacity: 0; filter: brightness(8) blur(4px); }
  60%  { opacity: 1; filter: brightness(2) blur(0); }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}

/* ── Row-Navigation ────────────────────────────────────── */
#menu-rows {
  flex: 1;
  width: 100%;
  overflow: hidden;
  min-height: 0;
}

#menu-rows-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.3, 0.8, 0.2, 1);
  will-change: transform;
}

.menu-row {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(24px, 5vw, 64px);
  gap: 20px;
}

#row-logo {
  align-items: center;
  justify-content: center;
}

.slide-title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  color: #4fc3f7;
  letter-spacing: 0.08rem;
  text-shadow: 0 0 30px rgba(79,195,247,0.7);
}

.slide-title--logo {
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: 0.12rem;
  text-shadow: 0 0 40px rgba(79,195,247,0.9), 0 0 80px rgba(79,195,247,0.4);
}

.slide-placeholder {
  font-size: 0.65rem;
  letter-spacing: 0.5rem;
  color: #555;
}

.slide-hint {
  font-size: 0.65rem;
  letter-spacing: 0.25rem;
  color: #888;
  text-align: center;
  line-height: 1.8;
}

#row-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0 0;
  min-height: 56px;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}
#row-top:has(.row-arrow.visible) { cursor: pointer; }

#row-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 0 18px;
  min-height: 56px;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}
#row-bottom:has(.row-arrow.visible) { cursor: pointer; }

#row-label-up,
#row-label-down {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.35rem;
  color: #1a2a30;
  transition: color 0.2s;
  min-height: 1em;
}
#row-label-up.visible,
#row-label-down.visible { color: #7ecfea; }

.row-arrow {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-right: 3px solid #111;
  border-top: 3px solid #111;
  border-radius: 3px;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
#row-arrow-up   { transform: rotate(-45deg); margin-top: 4px; }
#row-arrow-down { transform: rotate(135deg); margin-bottom: 4px; }
.row-arrow.visible { border-color: #7ecfea; }

/* ── Controller-Row ────────────────────────────────────── */
#qr-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  position: relative;
}
#qr-row::after {
  content: 'VS';
  position: absolute;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  letter-spacing: 0.3rem;
  color: #1e1e1e;
}

.player-card {
  flex-shrink: 0;
  width: clamp(200px, 28vw, 300px);
  background: #0a0a0a;
  border: 2px solid #222;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.player-card.connected {
  border-color: #4caf50;
  box-shadow: 0 0 32px rgba(76,175,80,0.35), inset 0 0 20px rgba(76,175,80,0.05);
}

.qr-art {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid #222;
  overflow: hidden;
  padding: 12px;
}
.player-card.connected .qr-art { border-bottom-color: #4caf50; }
.qr-art canvas, .qr-art img { width: 100% !important; height: auto !important; display: block; }

.player-card .meta {
  padding: 12px 16px 14px;
  text-align: center;
}
.player-card .label {
  font-size: 0.7rem;
  letter-spacing: 0.35rem;
  color: #e0e0e0;
  margin-bottom: 8px;
}
.player-card.connected .label { color: #4caf50; }

.status-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.55rem;
  letter-spacing: 0.15rem;
  color: #777;
}
.status-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
}
.status-dot.connected { color: #4caf50; }
.status-dot.connected::before { background: #4caf50; box-shadow: 0 0 6px #4caf50; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Hauptmenü ─────────────────────────────────────────── */
#main-menu {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

/* ── Karussell ─────────────────────────────────────────── */
#carousel {
  position: relative;
  width: min(900px, 92vw);
  height: clamp(260px, 42vh, 400px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#carousel-track {
  display: flex;
  align-items: center;
  gap: 40px;
  transition: transform 0.35s cubic-bezier(0.3, 0.8, 0.2, 1);
  will-change: transform;
}

.game-card {
  flex-shrink: 0;
  width: clamp(240px, 32vw, 340px);
  background: #0a0a0a;
  border: 2px solid #222;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0.35;
  transform: scale(0.82);
  transition: all 0.3s ease;
  cursor: pointer;
}
.game-card.selected {
  opacity: 1;
  transform: scale(1);
  border-color: #4fc3f7;
  box-shadow: 0 0 32px rgba(79,195,247,0.35), inset 0 0 20px rgba(79,195,247,0.05);
}

.game-card .art {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-bottom: 1px solid #222;
  overflow: hidden;
}
.game-card.selected .art { border-bottom-color: #4fc3f7; }
.game-card .art svg { width: 100%; height: 100%; display: block; }

.game-card .meta {
  padding: 14px 18px 16px;
  text-align: center;
}
.game-card .title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 0.1rem;
  margin-bottom: 10px;
}
.game-card.selected .title {
  color: #4fc3f7;
  text-shadow: 0 0 16px rgba(79,195,247,0.5);
}
.game-card .tagline {
  color: #666;
  font-size: 0.65rem;
  letter-spacing: 0.2rem;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-right: 3px solid #7ecfea;
  border-top: 3px solid #7ecfea;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  filter: drop-shadow(0 0 6px rgba(79,195,247,0.6));
  z-index: 2;
  cursor: pointer;
  user-select: none;
}
.carousel-arrow.left  { left: 16px;  transform: translateY(-50%) rotate(-135deg); }
.carousel-arrow.right { right: 16px; transform: translateY(-50%) rotate(45deg); }
#carousel.has-prev .carousel-arrow.left  { opacity: 0.8; pointer-events: auto; }
#carousel.has-next .carousel-arrow.right { opacity: 0.8; pointer-events: auto; }
.carousel-arrow:hover { opacity: 1 !important; }
.carousel-arrow.left  { left: 8px; }
.carousel-arrow.right { right: 8px; }


.room-badge {
  position: fixed;
  top: 16px; right: 20px;
  font-size: 0.65rem;
  letter-spacing: 0.2rem;
  color: #666;
  z-index: 10;
}
.room-badge span { color: #4fc3f7; }

.menu-section {
  color: #777;
  font-size: 0.65rem;
  letter-spacing: 0.4rem;
  align-self: flex-start;
  margin-top: 10px;
}
.menu-section:first-child { margin-top: 0; }

.menu-item {
  background: #111;
  border: 2px solid #333;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.15rem;
  padding: 18px 28px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  width: min(90vw, 380px);
  transition: all 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-item.selected {
  border-color: #4fc3f7;
  background: #0e1a20;
  box-shadow: 0 0 16px rgba(79,195,247,0.3);
}
.menu-item .badge {
  color: #777;
  font-size: 0.7rem;
}

/* ── Einstellungen ─────────────────────────────────────── */
#settings {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px;
}
#settings h2 {
  font-size: 0.8rem;
  letter-spacing: 0.4rem;
  font-weight: normal;
  color: #888;
}

/* ── Game-View ─────────────────────────────────────────── */
#game-view {
  position: fixed; inset: 0;
  background: #000;
}
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── In-Game-Overlay ───────────────────────────────────── */
#ingame-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  flex-direction: column;
  z-index: 150;
}
#ingame-overlay.visible { display: flex; }

#ig-nav-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0 0;
  min-height: 56px;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}
#ig-nav-top:has(.row-arrow.visible) { cursor: pointer; }

#ig-nav-label {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.35rem;
  color: #1a2a30;
  transition: color 0.2s;
  min-height: 1em;
}
#ig-nav-label.visible { color: #7ecfea; }

#ig-nav-arrow {
  transform: rotate(-45deg);
  margin-top: 4px;
}

#ig-slides {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#ig-slides-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.3, 0.8, 0.2, 1);
  will-change: transform;
}

.ig-slide {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ig-item {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.2rem;
  color: #888;
  padding: 14px 40px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  min-width: 280px;
  text-align: center;
  user-select: none;
}
.ig-item.selected {
  color: #4fc3f7;
  border-color: rgba(79,195,247,0.4);
  background: rgba(79,195,247,0.05);
}
.ig-item:hover { color: #c0e8f8; }

.ig-help-blocks {
  display: flex;
  gap: clamp(24px, 5vw, 64px);
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.ig-help-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 160px;
}

.ig-help-block-title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(0.55rem, 1.4vw, 0.75rem);
  letter-spacing: 0.2rem;
  color: #4fc3f7;
  text-shadow: 0 0 16px rgba(79,195,247,0.4);
}

#game-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.35rem;
  color: #4fc3f7;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(79,195,247,0.3);
  border-radius: 6px;
  padding: 10px 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 200;
  white-space: nowrap;
}
#game-toast.visible { opacity: 1; }

#footer {
  position: fixed; bottom: 12px; right: 14px;
  color: #222; font-size: 0.6rem; letter-spacing: 0.1rem;
  z-index: 101; pointer-events: none;
}
