/* Retro-Pong, Mitte-70er-Look: scharfe Kanten, kein Anti-Aliasing, kein border-radius. */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0a0a0a;
  color: #f2f2f2;
  font-family: 'Courier New', Courier, monospace;
  overscroll-behavior: none;
  touch-action: none;
}

#app {
  height: 100dvh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen.active {
  display: flex;
}

.logo {
  font-size: clamp(40px, 15vw, 72px);
  letter-spacing: 0.3em;
  margin: 0 0 24px 0;
  text-shadow: 0 0 0 #fff;
}

.logo.small {
  font-size: clamp(20px, 8vw, 32px);
  margin-bottom: 16px;
}

.panel {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: #999;
  text-transform: uppercase;
}

.text-input {
  background: #000;
  border: 2px solid #f2f2f2;
  color: #f2f2f2;
  font-family: 'Courier New', Courier, monospace;
  font-size: 18px;
  padding: 12px;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}

.code-input {
  letter-spacing: 0.5em;
  text-align: center;
  text-transform: uppercase;
  font-size: 24px;
}

.btn {
  background: #000;
  border: 2px solid #f2f2f2;
  color: #f2f2f2;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px;
  cursor: pointer;
  border-radius: 0;
}

.btn:active {
  background: #f2f2f2;
  color: #000;
}

.btn-primary {
  background: #f2f2f2;
  color: #000;
}

.btn-primary:active {
  background: #000;
  color: #f2f2f2;
}

.btn-link {
  border: none;
  color: #999;
  text-decoration: underline;
  padding: 8px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #666;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 4px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-top: 1px dashed #444;
}
.divider span { padding: 0 12px; }

.error-text {
  color: #f2f2f2;
  background: #400;
  border: 2px solid #f2f2f2;
  padding: 8px;
  font-size: 14px;
  min-height: 1px;
}
.error-text:empty { display: none; }

.hint {
  color: #999;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.1em;
}

.blink {
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.table-code {
  font-size: clamp(40px, 20vw, 64px);
  width: 100%;
  text-align: center;
  letter-spacing: 0.15em;
  font-weight: bold;
  margin: 8px 0 20px 0;
  border: 3px solid #f2f2f2;
  padding: 16px 8px;
}

/* --- Spiel-Bildschirm --- */

#screen-game {
  padding: 0;
  justify-content: flex-start;
}

.hud {
  width: 100%;
  padding: env(safe-area-inset-top, 12px) 12px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.score-box {
  text-align: center;
  min-width: 64px;
}

.score-name {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #999;
  text-transform: uppercase;
  height: 14px;
  overflow: hidden;
  white-space: nowrap;
}

.score-digit {
  font-size: 48px;
  font-weight: bold;
  line-height: 1;
}

.score-sep {
  font-size: 32px;
  color: #666;
}

.table-code-mini {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #666;
}

.court-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  padding: 8px;
}

#court {
  background: #000;
  border: 2px solid #f2f2f2;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}

.reconnect-banner {
  position: fixed;
  top: env(safe-area-inset-top, 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  border: 2px solid #f2f2f2;
  color: #f2f2f2;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  text-transform: uppercase;
  display: none;
  z-index: 100;
  margin-top: 8px;
}
.reconnect-banner.show {
  display: block;
}

.final-score {
  font-size: 40px;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.1em;
  margin: 8px 0 20px 0;
}
