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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at center top, #2a2a3e 0%, #1a1a2e 40%, #0f0f1a 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#info {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  pointer-events: none;
  z-index: 10;
}

#credits-display {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(20, 25, 40, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 20px;
  z-index: 15;
}

#credit-count {
  color: #e8c878;
  font-size: 26px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 8px rgba(200, 160, 60, 0.3);
}

.credits-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

#income-per-sec {
  color: #88dd88;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

#day-night-icon {
  font-size: 18px;
  margin-left: auto;
  text-shadow: 0 0 6px rgba(255, 220, 100, 0.4);
}

#sound-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #ccc;
  font-size: 16px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.2s;
}

#sound-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pearls-row {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 600;
  color: #c8a0e8;
  font-family: 'Courier New', monospace;
}

.pearl-icon {
  color: #d8b0ff;
  font-size: 18px;
  text-shadow: 0 0 6px rgba(180, 120, 220, 0.5);
}

.pearl-label {
  font-size: 14px;
  color: rgba(200, 160, 232, 0.7);
}

canvas {
  display: block;
}

body:not(.sidebar-collapsed) > canvas {
  transform: translateX(-210px);
  transition: transform 0.3s ease;
}

/* ---------- Seitenleiste ---------- */
#sidebar-open {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(20, 25, 40, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  cursor: pointer;
  z-index: 19;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#sidebar-open.visible {
  display: flex;
}

#sidebar-open:hover {
  background: rgba(40, 60, 100, 0.95);
  color: #fff;
}

#sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: rgba(20, 25, 40, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.3s ease;
}

#sidebar.collapsed {
  transform: translateX(420px);
}

#sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#sidebar-header h2 {
  color: #e0e6f0;
  font-size: 18px;
  font-weight: 600;
}

#sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

#sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

#sidebar-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
  background: rgba(80, 140, 220, 0.25);
  border-color: rgba(80, 140, 220, 0.4);
  color: #a0c8ff;
}

.feed-btn {
  background: rgba(200, 140, 60, 0.15) !important;
  border-color: rgba(200, 140, 60, 0.25) !important;
  color: rgba(255, 200, 120, 0.7) !important;
  flex: 0 0 auto !important;
  padding: 8px 14px !important;
}

.feed-btn:hover {
  background: rgba(220, 160, 60, 0.3) !important;
  border-color: rgba(220, 160, 60, 0.5) !important;
  color: #ffdd88 !important;
  transform: scale(1.05);
}

.feed-btn.feeding {
  animation: feedPulse 0.5s ease-in-out infinite;
}

@keyframes feedPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 200, 100, 0); }
  50% { box-shadow: 0 0 12px rgba(255, 200, 100, 0.5); }
}

#feed-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  pointer-events: none;
}

#feed-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9944, #ffdd66);
  transition: width 0.05s linear;
}

.feed-btn {
  position: relative;
  overflow: hidden;
}

#sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.item-slot {
  background: rgba(40, 80, 120, 0.15);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 10px 6px 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.item-slot:hover {
  background: rgba(80, 140, 220, 0.2);
  border-color: rgba(80, 140, 220, 0.5);
  transform: scale(1.05);
}

.item-slot:hover .slot-label {
  color: #a0c8ff;
  font-weight: 600;
}

.item-slot.selected {
  background: rgba(80, 160, 240, 0.25);
  border: 2px solid rgba(100, 180, 255, 0.6);
  box-shadow: 0 0 12px rgba(80, 160, 240, 0.3);
}

.item-slot.selected .slot-label {
  color: #a0d0ff;
  font-weight: 600;
}

.item-slot.placeholder .slot-plus {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.2);
}

.item-slot.placeholder .slot-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

.item-slot.filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(30, 60, 100, 0.2);
}

.item-slot.filled .slot-plus {
  display: none;
}

.item-slot.filled .slot-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.item-slot .slot-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.fish-canvas {
  width: 88px;
  height: 88px;
  max-width: 100%;
  border-radius: 8px;
  flex-shrink: 0;
}

.item-slot .slot-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex-shrink: 0;
}

/* Scrollbar */
#sidebar-content::-webkit-scrollbar {
  width: 6px;
}
#sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}
#sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
#sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Slot-Ökonomie ---------- */
.slot-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  flex-shrink: 0;
}

.item-slot .slot-income {
  font-size: 13px;
  color: #88dd88;
  font-family: 'Courier New', monospace;
  flex-shrink: 0;
}

.item-slot .slot-cost {
  font-size: 13px;
  color: #e8c878;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  flex-shrink: 0;
}

.item-slot .slot-owned {
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 14px;
  color: #a0c8ff;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  background: rgba(20, 40, 80, 0.7);
  padding: 2px 8px;
  border-radius: 8px;
}

.item-slot.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.item-slot.locked {
  opacity: 0.35;
  cursor: not-allowed;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 30, 0.3);
}

.item-slot.locked .fish-canvas {
  opacity: 0.2;
}

.item-slot.locked .slot-label {
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

.item-slot.locked .slot-income {
  color: rgba(255, 200, 100, 0.5);
  font-size: 11px;
}

.item-slot.disabled .slot-cost {
  color: #aa6666;
}

.item-slot.disabled:hover {
  transform: none;
  background: rgba(40, 80, 120, 0.15);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ---------- Upgrades ---------- */
#upgrade-controls {
  margin-bottom: 12px;
}

#upgrade-filter {
  width: 100%;
  background: rgba(20, 25, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e0e6f0;
  font-size: 13px;
  padding: 8px 10px;
  cursor: pointer;
}

#upgrade-filter option {
  background: #1a1a2e;
  color: #e0e6f0;
}

#upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.upgrade-more {
  text-align: center;
  padding: 10px;
  background: rgba(80, 140, 220, 0.1);
  border: 1px dashed rgba(80, 140, 220, 0.3);
  border-radius: 8px;
  color: #a0c8ff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.upgrade-more:hover {
  background: rgba(80, 140, 220, 0.2);
  border-color: rgba(80, 140, 220, 0.5);
}

.upgrade-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(40, 80, 120, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.2s;
  position: relative;
}

.upgrade-entry.disabled {
  opacity: 0.5;
}

.upgrade-entry.owned {
  background: rgba(60, 120, 80, 0.2);
  border-color: rgba(100, 200, 120, 0.4);
}

.tab-btn.has-notification {
  position: relative;
}

.tab-btn.has-notification::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffdd44;
  box-shadow: 0 0 6px rgba(255, 221, 68, 0.8);
  animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.upg-info {
  flex: 1;
  min-width: 0;
}

.upg-name {
  color: #e0e6f0;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.upg-desc {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  line-height: 1.3;
}

.upg-buy {
  flex-shrink: 0;
  background: rgba(200, 160, 60, 0.2);
  border: 1px solid rgba(200, 160, 60, 0.4);
  color: #e8c878;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.upg-buy:hover:not(:disabled) {
  background: rgba(220, 180, 80, 0.35);
  transform: scale(1.05);
}

.upg-buy:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.upgrade-entry.owned .upg-buy {
  background: rgba(80, 160, 100, 0.25);
  border-color: rgba(100, 200, 120, 0.4);
  color: #88dd88;
}

/* ---------- Prestige ---------- */
#prestige-panel {
  background: rgba(80, 40, 120, 0.15);
  border: 1px solid rgba(180, 120, 220, 0.25);
  border-radius: 12px;
  padding: 14px;
}

.prestige-title {
  color: #d8b0ff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.prestige-info {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.prestige-info .prestige-current,
.prestige-info .prestige-gain {
  color: #d8b0ff;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.prestige-hint {
  color: rgba(200, 160, 232, 0.6);
  font-size: 11px;
  margin-top: 4px;
}

.prestige-btn {
  width: 100%;
  background: rgba(140, 80, 200, 0.3);
  border: 1px solid rgba(180, 120, 220, 0.5);
  color: #e8c8ff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.prestige-btn:hover:not(:disabled) {
  background: rgba(160, 100, 220, 0.45);
  transform: scale(1.02);
}

.prestige-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 25, 40, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 200, 100, 0.3);
  border-radius: 10px;
  color: #ffdd88;
  font-size: 14px;
  padding: 10px 20px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
