/* ═══════════════════════════════════════════════════════════════
   style.css — Hook & Catch Fishing Game
   Mobile-first, no external dependencies
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --sky-top:      #87CEEB;
  --sky-bottom:   #B0E0FF;
  --water-top:    #1E90FF;
  --water-mid:    #1565C0;
  --water-deep:   #0D47A1;
  --water-dark:   #0A2A6E;
  --surface-line: #42A5F5;
  --boat-color:   #8B4513;
  --boat-cabin:   #D2691E;
  --hook-color:   #C0C0C0;
  --line-color:   #888;
  --sand:         #F4D03F;
  --accent:       #FF6B35;
  --accent2:      #FFD700;
  --green:        #27AE60;
  --red:          #E74C3C;
  --white:        #FFFFFF;
  --text-dark:    #1A1A2E;
  --text-mid:     #2C3E50;
  --card-bg:      rgba(255,255,255,0.92);
  --shadow:       0 4px 24px rgba(0,0,0,0.18);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.12);
  --radius:       16px;
  --radius-sm:    10px;
  --font:         'Segoe UI', 'Arial', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--sky-top);
  color: var(--text-dark);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── Layout wrapper ───────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ── Navigation bar ───────────────────────────────────────────── */
#navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0D47A1 0%, #1565C0 60%, #1976D2 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 8px;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent2);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}

.lang-switcher {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.lang-btn {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.75);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.22);
  color: var(--white);
}

.lang-btn.active {
  background: var(--accent2);
  border-color: var(--accent2);
  color: var(--text-dark);
}

/* ── Main content area ────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════
   START SCREEN
   ══════════════════════════════════════════════════════════════ */
#screen-start {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  background: linear-gradient(180deg,
    #87CEEB 0%,
    #B0E0FF 35%,
    #64B5F6 50%,
    #1E90FF 65%,
    #1565C0 80%,
    #0D47A1 100%
  );
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}

/* Animated waves on start screen */
.wave-decoration {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent 0%, rgba(13,71,161,0.6) 100%);
  pointer-events: none;
}

.wave-decoration::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 300%;
  height: 60px;
  background: radial-gradient(ellipse 50px 20px at 50% 100%, rgba(255,255,255,0.15) 0%, transparent 70%);
  animation: wave 4s linear infinite;
}

@keyframes wave {
  0%   { transform: translateX(0); }
  100% { transform: translateX(33.33%); }
}

/* Floating fish decorations */
.deco-fish {
  position: absolute;
  font-size: 2rem;
  opacity: 0.35;
  animation: floatFish 6s ease-in-out infinite;
  pointer-events: none;
}
.deco-fish:nth-child(1) { top: 58%; left: 8%;  animation-delay: 0s;   font-size: 1.6rem; }
.deco-fish:nth-child(2) { top: 65%; right: 10%; animation-delay: 1.5s; font-size: 2.2rem; }
.deco-fish:nth-child(3) { top: 72%; left: 30%; animation-delay: 3s;   font-size: 1.4rem; }
.deco-fish:nth-child(4) { top: 80%; right: 25%; animation-delay: 0.8s; font-size: 1.8rem; }

@keyframes floatFish {
  0%, 100% { transform: translateX(0) translateY(0); }
  25%       { transform: translateX(8px) translateY(-6px); }
  75%       { transform: translateX(-6px) translateY(4px); }
}

.start-icon {
  font-size: 5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  animation: bobIcon 2.5s ease-in-out infinite;
}

@keyframes bobIcon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.start-title {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 3px 16px rgba(0,0,0,0.4), 0 1px 0 rgba(0,0,0,0.2);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: center;
}

.start-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
  margin-bottom: 32px;
  text-align: center;
}

.btn-start {
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C00 100%);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 18px 48px;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255,107,53,0.5), 0 2px 0 rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}

.btn-start:active {
  transform: scale(0.96) translateY(2px);
  box-shadow: 0 2px 10px rgba(255,107,53,0.4);
}

.start-hint {
  margin-top: 20px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
  position: relative;
  z-index: 2;
}

/* ══════════════════════════════════════════════════════════════
   GAME SCREEN
   ══════════════════════════════════════════════════════════════ */
#screen-game {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #87CEEB 0%, #B0E0FF 30%);
  min-height: calc(100vh - 56px);
}

/* ── HUD ──────────────────────────────────────────────────────── */
#hud {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 12px 8px;
  background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  gap: 8px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  min-width: 72px;
  border: 1px solid rgba(255,255,255,0.15);
}

.hud-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.hud-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent2);
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

#hud-time.warning .hud-value {
  color: #FF6B6B;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 1; }
  to   { opacity: 0.5; }
}

/* ── Game canvas area ─────────────────────────────────────────── */
#game-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,
    #87CEEB 0%,
    #B0E0FF 28%,
    #64B5F6 42%,
    #1E90FF 55%,
    #1565C0 72%,
    #0D47A1 88%,
    #0A2A6E 100%
  );
  min-height: 300px;
}

/* Sky clouds */
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.75);
  border-radius: 50px;
  pointer-events: none;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.75);
  border-radius: 50%;
}
.cloud-1 { width: 80px; height: 22px; top: 18px; left: 8%;  animation: cloudDrift 18s linear infinite; }
.cloud-1::before { width: 36px; height: 36px; top: -18px; left: 12px; }
.cloud-1::after  { width: 28px; height: 28px; top: -12px; left: 36px; }
.cloud-2 { width: 60px; height: 18px; top: 30px; left: 55%; animation: cloudDrift 24s linear infinite 6s; }
.cloud-2::before { width: 28px; height: 28px; top: -14px; left: 8px; }
.cloud-2::after  { width: 22px; height: 22px; top: -10px; left: 28px; }
.cloud-3 { width: 50px; height: 16px; top: 12px; left: 75%; animation: cloudDrift 20s linear infinite 3s; }
.cloud-3::before { width: 24px; height: 24px; top: -12px; left: 6px; }
.cloud-3::after  { width: 18px; height: 18px; top: -8px; left: 24px; }

@keyframes cloudDrift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-120vw); }
}

/* Water surface shimmer line */
#water-surface {
  position: absolute;
  left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.5) 20%,
    rgba(255,255,255,0.8) 50%,
    rgba(255,255,255,0.5) 80%,
    transparent 100%
  );
  animation: shimmer 2s ease-in-out infinite alternate;
}

@keyframes shimmer {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* Water ripple lines */
.water-ripple {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.15) 30%,
    rgba(255,255,255,0.25) 50%,
    rgba(255,255,255,0.15) 70%,
    transparent 100%
  );
  pointer-events: none;
}

/* ── Boat ─────────────────────────────────────────────────────── */
#boat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 0.12s ease-out;
  z-index: 10;
  pointer-events: none;
}

.boat-body {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.35));
}

/* ── Fishing line ─────────────────────────────────────────────── */
#fishing-line {
  position: absolute;
  width: 2px;
  background: linear-gradient(180deg, rgba(136,136,136,0.8) 0%, rgba(136,136,136,0.4) 100%);
  transform-origin: top center;
  z-index: 8;
  pointer-events: none;
  display: none;
}

/* ── Hook ─────────────────────────────────────────────────────── */
#hook {
  position: absolute;
  font-size: 1.4rem;
  z-index: 9;
  pointer-events: none;
  display: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* ── Fish entities ────────────────────────────────────────────── */
.fish {
  position: absolute;
  font-size: 2rem;
  z-index: 7;
  pointer-events: none;
  transition: opacity 0.3s;
  animation: swimFish 3s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}

.fish.shark {
  font-size: 2.4rem;
  animation: swimShark 4s ease-in-out infinite;
}

.fish.caught {
  animation: catchAnim 0.5s ease-out forwards;
}

@keyframes swimFish {
  0%, 100% { transform: translateX(0) translateY(0) scaleX(1); }
  25%       { transform: translateX(12px) translateY(-5px) scaleX(1); }
  50%       { transform: translateX(20px) translateY(0) scaleX(-1); }
  75%       { transform: translateX(8px) translateY(5px) scaleX(-1); }
}

@keyframes swimShark {
  0%, 100% { transform: translateX(0) translateY(0) scaleX(1); }
  33%       { transform: translateX(18px) translateY(-8px) scaleX(1); }
  66%       { transform: translateX(-10px) translateY(6px) scaleX(-1); }
}

@keyframes catchAnim {
  0%   { transform: scale(1) translateY(0); opacity: 1; }
  50%  { transform: scale(1.5) translateY(-20px); opacity: 0.8; }
  100% { transform: scale(0) translateY(-40px); opacity: 0; }
}

/* ── Catch zone indicator ─────────────────────────────────────── */
#catch-zone {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px dashed rgba(255,255,255,0.4);
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  display: none;
  z-index: 6;
}

/* ── Floating message ─────────────────────────────────────────── */
#float-msg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: var(--white);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s;
}

#float-msg.show {
  opacity: 1;
  animation: floatUp 1.8s ease-out forwards;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-30px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-50px); }
}

/* ── Controls ─────────────────────────────────────────────────── */
#controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 16px;
  background: linear-gradient(180deg, #0D47A1 0%, #0A2A6E 100%);
  gap: 10px;
}

.btn-move {
  background: linear-gradient(135deg, #1565C0 0%, #1976D2 100%);
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  width: 72px;
  height: 72px;
  font-size: 1.8rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.1) inset;
  transition: transform 0.1s, box-shadow 0.1s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-move:active {
  transform: scale(0.92) translateY(2px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.btn-catch {
  flex: 1;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C00 60%, #FFD700 100%);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 0 20px;
  height: 72px;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,107,53,0.5), 0 2px 0 rgba(0,0,0,0.15);
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-catch:active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 2px 8px rgba(255,107,53,0.4);
}

.btn-catch:disabled {
  background: linear-gradient(135deg, #78909C 0%, #546E7A 100%);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════
   END SCREEN (WIN / LOSE)
   ══════════════════════════════════════════════════════════════ */
#screen-end {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}

#screen-end.win-bg {
  background: linear-gradient(180deg, #1B5E20 0%, #2E7D32 40%, #388E3C 70%, #43A047 100%);
}

#screen-end.lose-bg {
  background: linear-gradient(180deg, #4A148C 0%, #6A1B9A 40%, #7B1FA2 70%, #8E24AA 100%);
}

.end-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  max-width: 340px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.end-icon {
  font-size: 4rem;
  margin-bottom: 8px;
  display: block;
}

.end-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.end-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 24px;
}

.end-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.stat-box {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 100px;
  border: 1px solid rgba(21,101,192,0.15);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #1565C0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-dark);
}

.btn-again {
  background: linear-gradient(135deg, #1565C0 0%, #1976D2 100%);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(21,101,192,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
}

.btn-again:active {
  transform: scale(0.96) translateY(2px);
  box-shadow: 0 2px 8px rgba(21,101,192,0.3);
}

/* Confetti particles (win screen) */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   ABOUT & PRIVACY PAGES
   ══════════════════════════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 24px 20px 40px;
  background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 40%, #E3F2FD 100%);
  min-height: calc(100vh - 56px);
}

.page-hero {
  text-align: center;
  padding: 28px 0 20px;
  margin-bottom: 20px;
}

.page-hero-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 10px;
}

.page-hero h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0D47A1;
  margin-bottom: 4px;
}

.page-hero .page-date {
  font-size: 0.8rem;
  color: #78909C;
}

.page-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(21,101,192,0.08);
}

.page-card h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1565C0;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-card h2 .card-icon {
  font-size: 1.2rem;
}

.page-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.page-card p:last-child {
  margin-bottom: 0;
}

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

.page-card ul li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-mid);
  padding: 4px 0 4px 20px;
  position: relative;
}

.page-card ul li::before {
  content: '🎯';
  position: absolute;
  left: 0;
  font-size: 0.75rem;
}

.scoring-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.scoring-table td {
  padding: 8px 10px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(21,101,192,0.1);
  color: var(--text-mid);
}

.scoring-table td:first-child {
  font-size: 1.1rem;
}

.scoring-table td:last-child {
  font-weight: 700;
  text-align: right;
  color: #1565C0;
}

.scoring-table tr:last-child td {
  border-bottom: none;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border: 1px solid #A5D6A7;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2E7D32;
  margin-bottom: 12px;
}

/* ── Utility: hidden ──────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — larger screens
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 480px) {
  #app {
    box-shadow: 0 0 60px rgba(0,0,0,0.25);
  }
}

@media (min-width: 768px) {
  .start-title { font-size: 3rem; }
  .btn-start   { font-size: 1.4rem; padding: 20px 56px; }
  #game-area   { min-height: 380px; }
}

/* ── Touch feedback ───────────────────────────────────────────── */
@media (hover: none) {
  .btn-move:hover,
  .btn-catch:hover,
  .btn-start:hover,
  .btn-again:hover { transform: none; }
}

/* ── Scrollbar styling ────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(21,101,192,0.3); border-radius: 4px; }
