/* =========================================================
   PizzaSchuß – Styles
   Retro-Look mit warmen Pizzeria-Farben
   ========================================================= */

:root {
  --ps-bg:       #1a0800;
  --ps-bg2:      #2a1208;
  --ps-primary:  #ff6b35;
  --ps-gold:     #ffc857;
  --ps-green:    #2d9b3a;
  --ps-red:      #d62828;
  --ps-cream:    #fff5e6;
  --ps-paper:    #f5e6c8;
  --ps-brown:    #8b5e3c;
  --ps-dark:     #0d0604;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ps-bg);
  font-family: 'Courier New', monospace;
  color: var(--ps-cream);
  user-select: none;
  -webkit-user-select: none;
}

/* ── Bildschirme ────────────────────────────────────────── */
.ps-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ps-screen.active {
  display: flex;
}

/* ── Start-Screen ───────────────────────────────────────── */
#screen-start {
  background: linear-gradient(180deg, var(--ps-bg) 0%, var(--ps-bg2) 60%, var(--ps-dark) 100%);
  gap: 12px;
}

.ps-title {
  font-size: clamp(28px, 8vw, 52px);
  font-weight: bold;
  color: var(--ps-gold);
  text-shadow:
    0 0 20px rgba(255,200,87,0.5),
    0 2px 0 #b8860b,
    0 4px 0 #8b6508;
  letter-spacing: 2px;
  margin-bottom: 4px;
  animation: ps-title-pulse 2s ease-in-out infinite;
}

@keyframes ps-title-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.ps-title-sup {
  font-size: 0.4em;
  vertical-align: super;
  color: var(--ps-primary);
  text-shadow: none;
  letter-spacing: 0;
}

.ps-subtitle {
  font-size: clamp(11px, 3vw, 15px);
  color: var(--ps-primary);
  margin-bottom: 24px;
  text-align: center;
  opacity: 0.9;
}

.ps-pizza-logo {
  margin-bottom: 10px;
  animation: ps-float 3s ease-in-out infinite;
}

.ps-pizza-logo-img {
  width: clamp(60px, 18vw, 110px);
  height: auto;
  display: block;
}

@keyframes ps-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

/* ── Buttons ────────────────────────────────────────────── */
.ps-btn {
  display: block;
  width: 220px;
  padding: 12px 20px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: bold;
  color: var(--ps-cream);
  background: linear-gradient(180deg, var(--ps-primary) 0%, #cc4a18 100%);
  border: 2px solid var(--ps-gold);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s, box-shadow 0.1s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ps-btn:hover, .ps-btn:focus, .ps-btn.focused {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255,107,53,0.5);
  outline: none;
}

.ps-btn.focused {
  box-shadow: 0 0 20px rgba(255,200,87,0.7), 0 0 5px rgba(255,200,87,0.5) inset;
  border-color: var(--ps-gold);
}

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

.ps-btn.secondary {
  background: linear-gradient(180deg, var(--ps-brown) 0%, #5a3a22 100%);
  border-color: var(--ps-primary);
  font-size: 13px;
  padding: 10px 16px;
}

/* ── Game-Screen ────────────────────────────────────────── */
#screen-game {
  background: #000;
  padding: 0;
}

#screen-game.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-game-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ps-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: none;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  color: var(--ps-gold);
  z-index: 10;
  pointer-events: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  max-width: 500px;
  max-height: 775px;
  min-width: 300px;
  min-height: 400px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #1a0800;
}

/* ── Touch-Steuerung ────────────────────────────────────── */
.ps-touch-controls {
  display: none;
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0 8px;
}

@media (pointer: coarse) {
  .ps-touch-controls { display: flex; }
}

.ps-touch-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.ps-touch-btn {
  flex: 1;
  max-width: 70px;
  height: 50px;
  font-size: 22px;
  border: 2px solid var(--ps-gold);
  border-radius: 8px;
  background: rgba(255,107,53,0.3);
  color: var(--ps-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ps-touch-btn:active {
  background: rgba(255,107,53,0.7);
}

.ps-touch-btn.fire {
  background: rgba(214,40,40,0.4);
  max-width: 90px;
  font-size: 14px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.ps-touch-btn.box-btn {
  background: rgba(139,94,60,0.4);
  max-width: 90px;
  font-size: 12px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

/* ── Guide-Screen ───────────────────────────────────────── */
#screen-guide, #screen-settings, #screen-highscore {
  background: linear-gradient(180deg, var(--ps-bg) 0%, var(--ps-bg2) 100%);
  padding: 20px;
  gap: 12px;
  overflow-y: auto;
}

.ps-card {
  background: rgba(42,18,8,0.8);
  border: 1px solid var(--ps-brown);
  border-radius: 8px;
  padding: 16px 20px;
  max-width: 420px;
  width: 100%;
}

.ps-card h2 {
  color: var(--ps-gold);
  font-size: 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ps-brown);
  padding-bottom: 6px;
}

.ps-card p, .ps-card li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ps-cream);
  opacity: 0.9;
}

.ps-card ul {
  list-style: none;
  padding-left: 0;
}

.ps-card li::before {
  content: '• ';
  color: var(--ps-primary);
}

.ps-key {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,200,87,0.15);
  border: 1px solid var(--ps-gold);
  border-radius: 3px;
  font-size: 11px;
  color: var(--ps-gold);
  font-family: 'Courier New', monospace;
}

/* ── Highscore-Tabelle ──────────────────────────────────── */
.ps-hs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.ps-hs-table th {
  color: var(--ps-gold);
  border-bottom: 1px solid var(--ps-brown);
  padding: 6px 8px;
  text-align: left;
}

.ps-hs-table td {
  padding: 5px 8px;
  color: var(--ps-cream);
  border-bottom: 1px solid rgba(139,94,60,0.3);
}

.ps-hs-table tr:first-child td {
  color: var(--ps-gold);
  font-weight: bold;
}

/* ── Settings ───────────────────────────────────────────── */
.ps-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}

.ps-setting-row label {
  font-size: 13px;
  color: var(--ps-cream);
}

.ps-setting-row input[type="range"] {
  width: 140px;
  accent-color: var(--ps-primary);
}

/* ── Footer ─────────────────────────────────────────────── */
.ps-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  font-size: 10px;
  color: rgba(255,245,230,0.4);
}

#app-version {
  font-size: 11px;
  color: rgba(255,245,230,0.3);
  margin-bottom: 4px;
}

.ps-footer-logo {
  height: 30px;
  width: auto;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.ps-footer-logo:hover {
  opacity: 0.8;
}

.ps-footer-copy a {
  color: rgba(255,245,230,0.4);
  text-decoration: none;
  transition: color 0.2s;
}

.ps-footer-copy a:hover {
  color: var(--ps-gold);
}

.ps-footer-idea {
  font-size: 10px;
  color: rgba(255,245,230,0.3);
}

.ps-footer-legal {
  display: flex;
  gap: 6px;
  font-size: 9px;
  margin-top: 6px;
}

.ps-footer-legal a {
  color: rgba(255,245,230,0.35);
  text-decoration: none;
  transition: color 0.2s;
}

.ps-footer-legal a:hover {
  color: var(--ps-gold);
}

.ps-footer-legal span {
  color: rgba(255,245,230,0.2);
}

/* ── Game Footer ───────────────────────────────────────── */
.ps-game-footer {
  margin-top: 4px;
  text-align: center;
  font-size: 9px;
  font-family: 'Courier New', monospace;
  color: rgba(255,245,230,0.35);
  flex-shrink: 0;
}

.ps-game-footer a {
  color: rgba(255,245,230,0.45);
  text-decoration: none;
  transition: color 0.2s;
}

.ps-game-footer a:hover {
  color: var(--ps-gold);
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ps-bg); }
::-webkit-scrollbar-thumb { background: var(--ps-brown); border-radius: 3px; }
