/* ============================================================
   Fishing Rhythm — Global Styles
   ============================================================ */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Georgia', serif;
  color: #f0e8d0;
}

/* Full-screen canvas */
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

/* ============================================================
   Pointer Lock Overlay
   ============================================================ */

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#overlay-content {
  text-align: center;
  user-select: none;
}

#overlay-content h1 {
  font-size: 3rem;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

#overlay-content p {
  font-size: 1.1rem;
  opacity: 0.75;
  letter-spacing: 0.06em;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1.0;  }
}

/* ============================================================
   Crosshair
   ============================================================ */

#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#crosshair.visible {
  opacity: 1;
}

#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
}

/* Horizontal bar */
#crosshair::before {
  width: 100%;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

/* Vertical bar */
#crosshair::after {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

/* ============================================================
   HUD
   ============================================================ */

#hud {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#hud.visible {
  opacity: 1;
}

#hud-state {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.3rem 0.9rem;
  border-radius: 4px;
  color: #d4c89a;
}

#fish-count {
  position: fixed;
  top: 1rem;
  left: 1rem;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 80;
}

/* ============================================================
   Spot Name Announcement
   ============================================================ */

#spot-name {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}

#spot-name.visible {
  opacity: 1;
}

/* ============================================================
   Fade Overlay (teleport transitions)
   ============================================================ */

#fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  transition: opacity 0.3s ease;
}

/* ============================================================
   Power Meter (casting charge bar)
   ============================================================ */

#power-meter {
  position: fixed;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 120px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column-reverse; /* bar grows upward */
  z-index: 60;
  pointer-events: none;
}

#power-meter.hidden {
  display: none;
}

#power-bar {
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #ff6600, #ffcc00);
  transition: none;
}

#power-label {
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* ============================================================
   Fight Canvas (Phase 4 — radial duel)
   ============================================================ */

#fight-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  z-index: 80;
}

/* Fight result text (CATCH_ANIM / FAIL_ANIM) */
#fight-result {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-family: 'Georgia', serif;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 90;
  display: none;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 1rem 2rem;
  border-radius: 8px;
}

/* Catch continue prompt */
#catch-continue {
  position: fixed;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  font-family: 'Georgia', serif;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.1em;
  pointer-events: none;
  z-index: 90;
  display: none;
  animation: catchContinuePulse 1.2s ease-in-out infinite;
}

@keyframes catchContinuePulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1;   }
}

/* ============================================================
   Journal Overlay (Phase 6)
   ============================================================ */

#journal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.95);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

#journal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

#journal-header {
  text-align: center;
  margin-bottom: 2rem;
}

#journal-header h1 {
  font-size: 2rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#journal-header p {
  font-size: 0.9rem;
  opacity: 0.6;
  letter-spacing: 0.1em;
  margin-top: 0.4rem;
}

#journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  width: 100%;
}

/* ── Fish Card ── */

.fish-card {
  perspective: 600px;
  height: 200px;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.fish-card.flip .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-front {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-back {
  background: rgba(0, 100, 150, 0.3);
  border: 1px solid rgba(0, 200, 255, 0.4);
  transform: rotateY(180deg);
}

/* Undiscovered: darken the front face */
.fish-card.undiscovered .card-front {
  filter: brightness(0.3);
}

.fish-silhouette {
  font-size: 3.5rem;
  color: #334;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.fish-unknown {
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  color: #556;
}

/* Discovered card content */
.fish-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
  text-align: center;
}

.difficulty-stars {
  color: #ffcc00;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.fish-habitat {
  font-size: 0.8rem;
  color: #aaddff;
  margin-bottom: 0.3rem;
}

.fish-fact {
  font-size: 0.72rem;
  color: #cccccc;
  text-align: center;
  margin-bottom: 0.5rem;
  font-style: italic;
  line-height: 1.4;
}

.fish-count {
  font-size: 0.85rem;
  color: #00ffcc;
}

/* ============================================================
   Catch Flash (Phase 7)
   ============================================================ */

#catch-flash {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
  z-index: 300;
}

/* ============================================================
   Muskie Phase Cue (Phase 7)
   ============================================================ */

#phase-cue {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  color: #ff4444;
  font-size: 2rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 100;
}

/* ============================================================
   Spot Hover Tooltip (Phase 7)
   ============================================================ */

#spot-tooltip {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 70;
}

/* ============================================================
   Main Menu (Phase 7)
   ============================================================ */

#main-menu {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 40, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  transition: opacity 0.4s ease;
}

.menu-content {
  text-align: center;
  color: white;
}

.menu-content h1 {
  font-size: 3rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(0, 200, 255, 0.8);
  margin-bottom: 0.5rem;
}

.menu-content .subtitle {
  font-size: 1rem;
  color: #aaddff;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

#start-btn {
  background: rgba(0, 200, 255, 0.2);
  border: 2px solid rgba(0, 200, 255, 0.8);
  color: white;
  font-size: 1.2rem;
  padding: 0.8rem 3rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.2s, box-shadow 0.2s;
}

#start-btn:hover {
  background: rgba(0, 200, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
}

.menu-content .hint {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}
