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

body {
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0d2b45;
  color: #f8fafc;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hidden {
  display: none !important;
}

/* Top HUD */
#hud-top {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}

.hud-card {
  background: rgba(10, 28, 46, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

.hud-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #38bdf8;
  margin-bottom: 6px;
}

.hud-stats {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: #cbd5e1;
}

.hud-stats strong {
  color: #fbbf24;
  font-weight: 700;
}

.hud-actions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.hud-btn {
  background: rgba(14, 116, 144, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.15s, background 0.15s;
}

.hud-btn:hover {
  background: rgba(6, 182, 212, 0.9);
  transform: translateY(-1px);
}

/* Center Prompt */
#center-prompt {
  position: fixed;
  top: 56%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 28, 46, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: #e0f2fe;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* Cast Power Bar */
#cast-bar-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: rgba(10, 28, 46, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 10;
}

.bar-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: center;
  margin-bottom: 6px;
  color: #bae6fd;
}

.bar-track {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

#cast-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
  border-radius: 999px;
}

/* Reel Minigame */
#reel-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  background: rgba(10, 28, 46, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.reel-track {
  position: relative;
  width: 100%;
  height: 28px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 10px;
  overflow: hidden;
}

#reel-zone {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 72px;
  left: 120px;
  background: rgba(34, 197, 94, 0.45);
  border: 2px solid #4ade80;
  border-radius: 6px;
}

#reel-fish {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  line-height: 1;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

#reel-progress {
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.05s linear;
}

/* Catch Popup */
#catch-popup {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 28, 46, 0.92);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 18px 32px;
  text-align: center;
  z-index: 15;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  animation: popIn 0.25s ease-out;
}

@keyframes popIn {
  from { transform: translate(-50%, -10px) scale(0.9); opacity: 0; }
  to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.catch-rarity {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fbbf24;
  margin-bottom: 4px;
}

.catch-name {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.catch-details {
  font-size: 14px;
  color: #94a3b8;
}

/* Controls Help */
#controls-help {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  background: rgba(10, 28, 46, 0.68);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 10;
}

kbd {
  background: rgba(255, 255, 255, 0.16);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal-content {
  width: min(680px, 92vw);
  max-height: 80vh;
  background: #0f2942;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 20px;
  color: #38bdf8;
}

.close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.fishbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.fish-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
}

.fish-card.locked {
  opacity: 0.45;
}

.fish-card-rarity {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.rarity-Common { color: #94a3b8; }
.rarity-Uncommon { color: #4ade80; }
.rarity-Rare { color: #38bdf8; }
.rarity-Epic { color: #c084fc; }
.rarity-Legendary { color: #fbbf24; }

.fish-card-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.fish-card-meta {
  font-size: 12px;
  color: #94a3b8;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
}

.shop-item-info h3 {
  font-size: 15px;
  margin-bottom: 3px;
}

.shop-item-info p {
  font-size: 12px;
  color: #94a3b8;
}

.shop-buy-btn {
  background: #eab308;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.shop-buy-btn:disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
}
