/* style.css - Original Design mit Anpassungen */
:root {
  --bg1: #6dd5ed;
  --bg2: #2193b0;
  --panel: rgba(255,255,255,0.95);
  --accent: #ffd166;
  --accent-dark: #e6b800;
  --text-color: #222;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow: hidden;
  touch-action: manipulation;
}

#playfield {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #a8dadc, #457b9d);
  overflow: hidden;
}

/* Header - 3-spaltig: Links Mission, Mitte Level, Rechts Stats */
header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  z-index: 5;
}

/* Mission Links - nur Zahlen und Emojis */
.mission {
  background: var(--panel);
  color: var(--text-color);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-self: start;
}

.mission > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Level Mitte */
.level-display-game {
  background: var(--panel);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 18px;
  text-align: center;
  justify-self: center;
}

/* Rechts: Lives und Coins gestapelt */
.right-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-self: end;
}

.coins-display, .lives-display {
  font-weight: 700;
  color: var(--text-color);
  font-size: 18px;
  background: var(--panel);
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Timer unter Lives */
#timerDisplay {
  position: absolute;
  top: 90px;
  right: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
  background: var(--panel);
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 5;
}

/* Startscreen */
.start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  z-index: 10;
  gap: 16px;
}

.start-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.start-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.play-btn {
  font-size: 28px;
  padding: 20px 40px;
  border-radius: 12px;
  cursor: pointer;
  background-color: var(--accent);
  border: none;
  font-weight: 700;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  min-width: 120px;
  min-height: 60px;
}

.play-btn:hover {
  background-color: var(--accent-dark);
}

.shop-btn {
  font-size: 20px;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  background-color: var(--accent);
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  min-width: 80px;
  min-height: 40px;
}

.shop-btn:hover {
  background-color: var(--accent-dark);
}

.level-display {
  color: white;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.life-timer-display {
  color: white;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Fish - runde Hitbox */
.fish {
  position: absolute;
  user-select: none;
  cursor: pointer;
  font-size: 70px;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
  will-change: transform;
  transform-origin: center center;
  transition: transform 0.1s ease;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  z-index: 50;
}

.fish:hover {
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.1);
}

.fish:active {
  transform: scale(0.95);
}

@media (max-width: 400px) {
  .fish { 
    font-size: 60px; 
    width: 55px; 
    height: 55px; 
  }
}

/* Ambient Fische im Startscreen */
.ambient-fish {
  position: absolute;
  font-size: 60px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

/* Toast Messages */
.toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 120px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.8);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  display: none;
  z-index: 15;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  font-size: 14px;
  max-width: 90%;
  text-align: center;
}

/* Shop Panel */
.shop-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 360px;
  max-height: 80%;
  background: var(--panel);
  display: none;
  flex-direction: column;
  padding: 16px;
  z-index: 20;
  gap: 10px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.shop {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.shop-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
  margin: 8px 0 4px;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 14px;
}

.buy-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  min-width: 70px;
  min-height: 36px;
}

.buy-btn:hover {
  background: var(--accent-dark);
  transform: scale(1.05);
}

.close-btn {
  align-self: flex-start;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  min-width: 36px;
  min-height: 36px;
}

.close-btn:hover {
  background: var(--accent-dark);
  transform: scale(1.05);
}

/* Powerups unten */
#powerupBar {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 12;
}

#powerupBar button {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  min-height: 40px;
  min-width: 60px;
}

#powerupBar button:hover {
  background: var(--accent-dark);
}

/* Ad Banner */
.ad-banner {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--text-color);
  background: rgba(255,255,255,0.8);
  padding: 8px;
}

/* Mission Info in Panels */
.mission-info {
  background: #f0f0f0;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mission-info > div {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* Shop Header - Coins/Lives rechts */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e0e0;
}

.shop-stats {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Result Buttons - Primary schwarz */
.result-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.result-btn.primary {
  background: var(--success);
  color: #000;
}

.result-btn.primary:hover {
  background: #29b889;
  transform: translateY(-2px);
}

.result-btn.secondary {
  background: #e0e0e0;
  color: #000;
}

.result-btn.secondary:hover {
  background: #d0d0d0;
  transform: translateY(-2px);
}

/* Ambient Fish - weniger und immer im Hintergrund */
#ambientFishContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ambient-fish {
  position: absolute;
  font-size: 60px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* Responsive */
@media (max-width: 400px) {
  .fish { font-size: 76px; min-width: 100px; min-height: 100px; }
  .ambient-fish { font-size: 50px; }
  .play-btn { font-size: 24px; padding: 16px 32px; min-height: 50px; }
  .shop-btn { font-size: 18px; padding: 10px 20px; min-height: 36px; }
  .level-display { font-size: 20px; }
  .level-display-game { font-size: 16px; padding: 6px 12px; }
  .coins-display, .lives-display { font-size: 16px; padding: 6px 12px; }
  .mission { font-size: 16px; padding: 6px 10px; }
  #timerDisplay { top: 82px; font-size: 16px; padding: 6px 12px; }
}

@media (min-width: 401px) and (max-width: 500px) {
  .fish { font-size: 80px; }
  .ambient-fish { font-size: 55px; }
}


/* Result Panels - kleiner */
.result-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 340px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  gap: 12px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 700;
  text-align: center;
}

.panel-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 4px;
}

.panel-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 4px;
}

.mission-info {
  background: #f0f0f0;
  padding: 12px;
  border-radius: 10px;
  margin: 4px 0;
  font-size: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* Timer - mehr Abstand von Coins */
#timerDisplay {
  position: absolute;
  top: 100px;
  right: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
  background: var(--panel);
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 5;
}

/* Debug Buttons */
.debug-controls {
  position: fixed;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
}

.debug-btn {
  background: rgba(255, 0, 0, 0.7);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.debug-btn:hover {
  background: rgba(255, 0, 0, 0.9);
}

@media (max-width: 400px) {
  #timerDisplay { top: 92px; font-size: 16px; padding: 6px 12px; }
}