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

body {
  font-family: 'Press Start 2P', monospace;
  background: #0a0e1a;
  color: #c8d8f0;
  min-height: 100vh;
  font-size: 10px;
  overflow-x: hidden;
}

/* SCREENS */
.screen { display: none; min-height: 100vh; padding: 16px; }
.screen.active { display: flex; flex-direction: column; }

/* LOGIN */
#screen-login { align-items: center; justify-content: center; }
.login-box {
  background: #1a2030;
  border: 2px solid #2a3a50;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 212, 170, 0.15);
}
.game-logo .logo-fish { font-size: 48px; margin-bottom: 8px; }
.game-logo h1 { color: #00d4aa; font-size: 28px; letter-spacing: 4px; margin-bottom: 8px; }
.logo-sub { color: #5a7a9a; font-size: 8px; margin-bottom: 16px; }

/* AUTH TABS */
.auth-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.auth-tab { flex: 1; background: #0a0e1a; border: 2px solid #2a3a50; color: #5a7a9a; padding: 8px 4px; font-family: inherit; font-size: 7px; cursor: pointer; transition: all 0.15s; min-height: 44px; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.auth-tab.active { border-color: #00d4aa; color: #00d4aa; background: #0d1520; }
.auth-tab:hover:not(.active) { border-color: #3a5a70; color: #7a9ab0; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-divider { text-align: center; color: #5a7a9a; font-size: 7px; margin: 12px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: #2a3a50; }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.btn-oauth { width: 100%; padding: 10px; font-size: 8px; margin-bottom: 8px; }
.btn-google { background: #2a1a30; color: #e0a0ff; border: 2px solid #7a3aaa; box-shadow: 0 4px 0 #3a0a6a; }
.btn-google:hover { background: #3a2a40; }
.btn-vk { background: #1a2a3a; color: #7abaff; border: 2px solid #3a6aaa; box-shadow: 0 4px 0 #0a2a5a; }
.btn-vk:hover { background: #2a3a4a; }
.auth-guest-note { color: #e08030; font-size: 11px; font-weight: bold; margin-top: 12px; text-align: center; }

/* FORMS */
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; color: #7a9ab0; font-size: 8px; margin-bottom: 8px; }
.form-group input {
  width: 100%;
  background: #0a0e1a;
  border: 2px solid #2a3a50;
  color: #c8d8f0;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 10px;
  outline: none;
}
.form-group input:focus { border-color: #00d4aa; }

/* BUTTONS */
.btn {
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  border: none;
  padding: 10px 16px;
  font-size: 8px;
  letter-spacing: 1px;
  transition: all 0.1s;
  position: relative;
}
.btn:active { transform: translateY(2px); }
.btn-primary { background: #00d4aa; color: #0a0e1a; box-shadow: 0 4px 0 #007a62; }
.btn-primary:hover { background: #00e8bb; }
.btn-primary:active { box-shadow: 0 2px 0 #007a62; }
.btn-secondary { background: #1a3a50; color: #00d4aa; border: 2px solid #00d4aa; box-shadow: 0 4px 0 #003a28; }
.btn-secondary:hover { background: #1a4a60; }
.btn-danger { background: #3a1010; color: #ff6644; border: 2px solid #ff6644; box-shadow: 0 4px 0 #6a1010; }
.btn-danger:hover { background: #4a1818; }
.btn-large { width: 100%; padding: 14px; font-size: 10px; }
.btn-small { padding: 6px 10px; font-size: 8px; }
.btn-back { background: #1a2030; color: #7a9ab0; border: 2px solid #2a3a50; }
.btn-back:hover { color: #c8d8f0; }
.btn-close { background: #3a1a1a; color: #ff4444; border: 2px solid #ff4444; }
.btn-cast {
  background: #ffd700;
  color: #0a0e1a;
  font-size: 12px;
  padding: 16px 40px;
  box-shadow: 0 6px 0 #aa8800;
  min-width: 200px;
}
.btn-cast:hover { background: #ffe840; }
.btn-cast:active { box-shadow: 0 2px 0 #aa8800; transform: translateY(4px); }
.btn-cast:disabled { background: #3a3a3a; color: #666; box-shadow: 0 4px 0 #1a1a1a; cursor: not-allowed; }
.btn-sell { background: #1a3020; color: #44ff88; border: 2px solid #44ff88; font-size: 7px; padding: 5px 8px; }
.btn-sell:hover { background: #1a4030; }
.btn-sell-all { background: #44ff88; color: #0a1a10; font-size: 7px; padding: 6px 10px; box-shadow: 0 3px 0 #228844; }
.btn-use { background: #1a2040; color: #00d4aa; border: 2px solid #00d4aa; font-size: 7px; padding: 5px 8px; }

/* HEADER */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #2a3a50;
  margin-bottom: 16px;
}
.screen-header h2 { color: #00d4aa; font-size: 14px; }
.player-info-bar { display: flex; gap: 12px; align-items: center; }
.currency-display { color: #ffd700; font-size: 10px; }

/* DAILY EVENT BANNER */
.daily-event-banner {
  margin: 0 auto 16px;
  max-width: 700px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid #2a4a6a;
  background: linear-gradient(135deg, #0a1a2a 0%, #0d2035 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Press Start 2P', monospace;
}
.daily-event-banner .de-icon { font-size: 24px; flex-shrink: 0; }
.daily-event-banner .de-body { display: flex; flex-direction: column; gap: 4px; }
.daily-event-banner .de-name { font-size: 9px; font-weight: bold; color: #00d4aa; }
.daily-event-banner .de-desc { font-size: 7px; color: #7a9ab0; }

.daily-event-banner.event-feast        { border-color: #ff5500; background: linear-gradient(135deg, #1a0a00, #2a1000); }
.daily-event-banner.event-feast        .de-name { color: #ff7733; }
.daily-event-banner.event-calm         { border-color: #2a6aaa; background: linear-gradient(135deg, #000a1a, #001a35); }
.daily-event-banner.event-calm         .de-name { color: #4a9aff; }
.daily-event-banner.event-bear_invasion{ border-color: #8b4513; background: linear-gradient(135deg, #1a0a00, #2a1500); }
.daily-event-banner.event-bear_invasion .de-name { color: #cd853f; }
.daily-event-banner.event-golden_water { border-color: #b8860b; background: linear-gradient(135deg, #1a1500, #2a2000); }
.daily-event-banner.event-golden_water .de-name { color: #ffd700; }

/* SEASONAL FISH BANNER */
.seasonal-fish-banner {
  margin: 0 auto 12px;
  max-width: 700px;
  background: linear-gradient(135deg, #001a0a, #002a15);
  border: 1px solid #00aa55;
  border-radius: 6px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Press Start 2P', monospace;
}
.seasonal-fish-banner .sf-icon { font-size: 20px; flex-shrink: 0; }
.seasonal-fish-banner .sf-body { display: flex; flex-direction: column; gap: 3px; }
.seasonal-fish-banner .sf-title { font-size: 7px; color: #44ff88; font-weight: bold; }
.seasonal-fish-banner .sf-name  { font-size: 9px; color: #00ee66; }
.seasonal-fish-banner .sf-lakes { font-size: 6px; color: #5a9a70; }
.seasonal-fish-banner .sf-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 6px; color: #00aa55;
  border: 1px solid #00aa55;
  border-radius: 3px; padding: 2px 5px;
}

/* DIARY seasonal marker */
.record-seasonal { color: #44ff88; }

/* LOBBY */
.lakes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  flex: 1;
}
.lake-card {
  background: #1a2030;
  border: 2px solid #2a3a50;
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.lake-card:hover { border-color: #00d4aa; box-shadow: 0 0 15px rgba(0,212,170,0.2); }
.lake-card.full { opacity: 0.5; cursor: not-allowed; }
.lake-card-name { color: #00d4aa; font-size: 11px; margin-bottom: 8px; }
.lake-card-desc { color: #7a9ab0; font-size: 7px; margin-bottom: 12px; line-height: 1.6; }
.lake-card-players { color: #ffd700; font-size: 8px; }
.lobby-actions { display: flex; gap: 12px; margin-top: 16px; }

/* ── Daily top-3 panel ─────────────────────────────────────────── */
.daily-top3-panel {
  background: #0e1a26;
  border: 1px solid #1e3a50;
  border-radius: 4px;
  padding: 10px 14px;
  margin-top: 14px;
}
.top3-title {
  color: #ffd700;
  font-size: 9px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.top3-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #1a2a3a;
  font-size: 8px;
}
.top3-row:last-child { border-bottom: none; }
.top3-medal  { font-size: 11px; flex-shrink: 0; }
.top3-fish   { flex: 1; font-weight: bold; }
.top3-player { color: #7ab0d4; flex-shrink: 0; }
.top3-lake   { color: #4a7a6a; font-size: 7px; flex-shrink: 0; }
.top3-empty  { color: #3a5a70; font-size: 8px; font-style: italic; }

/* LAKE SCREEN - fullscreen */
#screen-lake {
  position: relative;
  overflow: hidden;
  height: 100dvh;
  padding: 0;
  display: none;
}
#screen-lake.active { display: block; }

#lake-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  will-change: transform;
  contain: strict;
}

/* HUD elements */
.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(10,14,26,0.85);
  border-bottom: 1px solid #2a3a50;
  gap: 8px;
}
.hud-left { display: flex; align-items: center; gap: 8px; }
.hud-right { display: flex; align-items: center; gap: 8px; }

/* LEVEL BLOCK */
.hud-level-block {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #0a1520; border: 1px solid #2a3a50; border-radius: 4px;
  padding: 4px 8px; min-width: 70px;
}
.hud-level-label { font-size: 9px; font-weight: bold; color: #4a8aff; line-height: 1; }
.hud-rank-label  { font-size: 6px; color: #7a9ab0; line-height: 1; }
.hud-xp-wrap     { display: flex; align-items: center; gap: 4px; width: 100%; margin-top: 2px; }
.hud-xp-bg       { flex: 1; height: 4px; background: #1a2a3a; border-radius: 2px; overflow: hidden; }
.hud-xp-bar      { height: 100%; width: 0%; background: linear-gradient(90deg, #2a5aff, #00d4aa); border-radius: 2px; transition: width 0.5s; }
.hud-xp-text     { font-size: 5px; color: #5a7a9a; white-space: nowrap; }
.hud-daily-event {
  display: flex; align-items: center; gap: 4px;
  background: #0a1520; border: 1px solid #2a3a50; border-radius: 4px;
  padding: 3px 7px; font-size: 7px; color: #00d4aa; white-space: nowrap;
}
.hud-daily-event.event-feast         { border-color: #ff5500; color: #ff7733; }
.hud-daily-event.event-calm          { border-color: #2a6aaa; color: #4a9aff; }
.hud-daily-event.event-bear_invasion { border-color: #8b4513; color: #cd853f; }
.hud-daily-event.event-golden_water  { border-color: #b8860b; color: #ffd700; }

/* ── Day/night time HUD ─────────────────────────────────────────── */
.hud-time {
  font-size: 7px;
  color: #c8d8e8;
  background: rgba(0,0,10,0.55);
  border: 1px solid rgba(100,130,180,0.3);
  border-radius: 4px;
  padding: 3px 7px;
  white-space: nowrap;
}

.hud-lake-info { display: flex; flex-direction: column; gap: 2px; }
.hud-lake-name { color: #00d4aa; font-size: 12px; }
.hud-player-count { color: #7a9ab0; font-size: 7px; }

.hud-cast {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.buffs-bar-hud { display: flex; gap: 6px; justify-content: center; }

.hud-event-log {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 10;
  width: 300px;
  max-height: 90px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 4px 6px;
  border-radius: 2px;
}

/* ── Chat window ─────────────────────────────────────────────────── */
.chat-window {
  position: absolute;
  bottom: 106px;
  left: 8px;
  width: 300px;
  z-index: 20;
  background: rgba(5, 10, 20, 0.88);
  border: 1px solid #1a2a40;
  border-radius: 4px;
  font-family: 'Press Start 2P', monospace;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 1px solid #1a2a40;
  font-size: 7px;
  color: #4a8aff;
  cursor: default;
}
.btn-chat-toggle {
  background: none;
  border: 1px solid #2a3a50;
  color: #4a8aff;
  font-size: 8px;
  padding: 1px 5px;
  cursor: pointer;
  border-radius: 2px;
  font-family: 'Press Start 2P', monospace;
  line-height: 1;
}
.btn-chat-toggle:hover { background: #1a2a40; }
.chat-body { display: flex; flex-direction: column; }
.chat-body.collapsed { display: none; }
.chat-messages {
  max-height: 110px;
  overflow-y: auto;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: #2a3a50 transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: #2a3a50; border-radius: 2px; }
.chat-entry {
  font-size: 7px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-entry .chat-name { font-weight: bold; }
.chat-entry.own .chat-name  { color: #4a8aff; }
.chat-entry.other .chat-name { color: #88ccff; }
.chat-entry.own  .chat-text { color: #c8d8f0; }
.chat-entry.other .chat-text { color: #a8c0d0; }
.chat-input-row {
  display: flex;
  gap: 4px;
  padding: 5px 6px;
  border-top: 1px solid #1a2a40;
  align-items: center;
}
.chat-input {
  flex: 1;
  background: rgba(0,0,0,0.6);
  border: 1px solid #2a3a50;
  border-radius: 2px;
  color: #c8d8f0;
  font-size: 7px;
  padding: 3px 5px;
  font-family: 'Press Start 2P', monospace;
  outline: none;
  min-width: 0;
}
.chat-input:focus { border-color: #4a8aff; background: rgba(0,10,30,0.9); }
.chat-input::placeholder { color: #3a4a60; }
.btn-chat-send {
  background: #0d1a26;
  border: 1px solid #2a3a50;
  color: #4a8aff;
  font-size: 8px;
  padding: 3px 7px;
  cursor: pointer;
  border-radius: 2px;
  font-family: 'Press Start 2P', monospace;
  flex-shrink: 0;
}
.btn-chat-send:hover { background: #1a2a40; border-color: #4a8aff; }

/* PLAYERS PANEL BUTTON */
.hud-player-count-btn {
  background: rgba(10,20,40,0.85);
  border: 1px solid #2a4a6a;
  color: #7ab8d4;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.15s, color 0.15s;
}
.hud-player-count-btn:hover { border-color: #00d4aa; color: #00d4aa; }

/* PLAYERS PANEL */
.players-panel {
  position: absolute;
  top: 50px;
  left: 10px;
  width: 340px;
  max-height: 70vh;
  background: rgba(8,14,26,0.97);
  border: 1px solid #2a4a6a;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7);
}
.players-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #1a3050;
  font-size: 7px;
  color: #00d4aa;
  font-family: 'Press Start 2P', monospace;
}
.players-panel-close {
  background: none;
  border: none;
  color: #5a7a9a;
  cursor: pointer;
  font-size: 10px;
  padding: 0 4px;
}
.players-panel-close:hover { color: #ff6644; }
.players-panel-list {
  overflow-y: auto;
  flex: 1;
}
.players-panel-list::-webkit-scrollbar { width: 4px; }
.players-panel-list::-webkit-scrollbar-thumb { background: #2a4a6a; }
.player-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid #0d1a28;
  font-family: 'Press Start 2P', monospace;
}
.player-row:hover { background: rgba(0,212,170,0.04); }
.player-row.me { background: rgba(0,212,170,0.07); }
.player-row-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.player-row-info { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.player-row-name { font-size: 6px; color: #c8d8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-row-name.me { color: #00d4aa; }
.player-row-rank { font-size: 5px; }
.player-row-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.player-row-level { font-size: 5px; color: #ffd700; }
.player-row-weight { font-size: 5px; color: #88aacc; }

/* Legacy lake-related classes kept for compatibility */
.lake-title-area { flex: 1; }
.player-count { color: #7a9ab0; font-size: 7px; }

/* BUFFS */
.buffs-bar { display: flex; gap: 8px; min-height: 24px; }
.buff-tag {
  background: #0a2028;
  border: 1px solid #00d4aa;
  color: #00d4aa;
  padding: 4px 8px;
  font-size: 6px;
}
.buff-tag.buff-warn {
  border-color: #ff4444;
  color: #ff4444;
  animation: hint-pulse 0.8s infinite;
}

/* CAST AREA */
.cast-area { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cast-cooldown { color: #5a7a9a; font-size: 7px; min-height: 16px; }

/* EVENT LOG */
.event-log {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.log-entry { font-size: 7px; padding: 2px 0; border-bottom: 1px solid rgba(26,32,48,0.5); line-height: 1.5; }
.log-entry.caught { color: #44ff88; }
.log-entry.escaped { color: #ff8844; }
.log-entry.no-bite { color: #5a7a9a; }
.log-entry.rare { color: #ffd700; }
.log-entry.news { color: #ff88ff; }
.log-entry.info { color: #7a9ab0; }

/* Legacy player-tag (unused, kept for compatibility) */
#lake-players-list { display: none; }
.player-tag { display: none; }

/* MODALS */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.open { display: flex; }
.modal-content {
  background: #1a2030;
  border: 2px solid #2a3a50;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,212,170,0.1);
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 2px solid #2a3a50;
}
.modal-header h2 { flex: 1; color: #00d4aa; font-size: 12px; }
.modal-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* INVENTORY */
.inv-section { }
.inv-section h3 { color: #5a7a9a; font-size: 8px; margin-bottom: 10px; }
.inv-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.inv-header-row h3 { margin-bottom: 0; }
#equipment-display { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.equip-slot {
  background: #0a0e1a;
  border: 2px solid #2a3a50;
  padding: 10px;
  text-align: center;
}
.equip-slot-label { color: #5a7a9a; font-size: 6px; margin-bottom: 6px; }
.equip-slot-name { color: #c8d8f0; font-size: 7px; }
.equip-slot-effect { color: #00d4aa; font-size: 6px; margin-top: 4px; }
.equip-slot-dur { color: #88ccff; font-size: 6px; margin-top: 2px; }
.equip-slot-dur.dur-low { color: #ff4444; animation: hint-pulse 1s infinite; }

#fish-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.fish-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0e1a;
  border: 1px solid #1a2a3a;
  padding: 8px 10px;
}
.fish-name { font-size: 8px; color: #c8d8f0; }
.fish-name.rare { color: #ffd700; }
.fish-tier { font-size: 7px; }
.fish-tier.S { color: #7a9ab0; }
.fish-tier.M { color: #c8d8f0; }
.fish-tier.L { color: #44ff88; }
.fish-tier.XL { color: #ffd700; }
.fish-tier.XXL { color: #ff88ff; }
.fish-value { color: #ffd700; font-size: 7px; }
.price-tag  { font-size: 6px; font-weight: bold; padding: 1px 3px; border-radius: 2px; }
.price-up   { background: #1a3a1a; color: #44ff88; }
.price-down { background: #2a2a00; color: #e0c040; }
.price-low  { background: #2a0a00; color: #e05040; }

#consumables-list { display: flex; gap: 8px; flex-wrap: wrap; }
.consumable-entry {
  background: #0a0e1a;
  border: 2px solid #2a3a50;
  padding: 10px;
  text-align: center;
  min-width: 100px;
}
.consumable-name { font-size: 7px; color: #c8d8f0; margin-bottom: 6px; }
.consumable-qty { color: #ffd700; font-size: 8px; margin-bottom: 8px; }

#records-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.record-entry {
  background: #0a0e1a;
  border: 1px solid #2a3a50;
  padding: 8px;
  text-align: center;
}
.record-species { font-size: 6px; color: #7a9ab0; margin-bottom: 4px; }
.record-tier { font-size: 9px; font-weight: bold; }

/* SHOP */
.shop-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.shop-tab {
  background: #0a0e1a;
  border: 2px solid #2a3a50;
  color: #7a9ab0;
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 7px;
  transition: all 0.1s;
}
.shop-tab.active { border-color: #00d4aa; color: #00d4aa; }
.shop-items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.shop-item {
  background: #0a0e1a;
  border: 2px solid #2a3a50;
  padding: 12px;
}
.shop-item-name { color: #c8d8f0; font-size: 8px; margin-bottom: 6px; }
.shop-item-desc { color: #5a7a9a; font-size: 6px; margin-bottom: 10px; line-height: 1.6; }
.shop-item-price { color: #ffd700; font-size: 8px; margin-bottom: 8px; }
.shop-item-price.free { color: #44ff88; }
.shop-item-owned { color: #44ff88; font-size: 7px; }

/* TOAST */
.toast {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #1a3030;
  border: 2px solid #00d4aa;
  color: #c8d8f0;
  padding: 10px 20px;
  font-size: 8px;
  z-index: 200;
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  max-width: 420px;
  text-align: center;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.rare-catch { border-color: #ffd700; color: #ffd700; background: #1a1a00; }
.toast.error { border-color: #ff4444; color: #ff4444; background: #1a0a0a; }
.toast.warn  { border-color: #ff9800; color: #ff9800; background: #1a0e00; }

/* ── WEAR BARS ─────────────────────────────────────────────────────── */
.wear-row { display: flex; align-items: center; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.wear-bar {
  flex: 1; min-width: 40px; max-width: 80px; height: 4px;
  background: #1a2a3a; border-radius: 2px; overflow: hidden;
}
.wear-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.wear-fill-green  { background: #44ff88; }
.wear-fill-yellow { background: #ffd700; }
.wear-fill-red    { background: #ff4444; }
.wear-broken-badge {
  background: #ff4444; color: #fff; font-size: 6px; font-weight: bold;
  padding: 1px 4px; border-radius: 2px; letter-spacing: 0.5px;
}
.wear-repair-btn { font-size: 6px !important; padding: 2px 5px !important; margin-left: 2px; }

/* ── BUYER ORDERS ──────────────────────────────────────────────────── */
.buyer-orders-section { margin-bottom: 10px; }
.buyer-orders-title {
  color: #00d4aa; font-size: 8px; font-weight: bold;
  margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid #2a3a50;
}
.buyer-order-card {
  background: #0a1520; border: 1px solid #1a3050;
  padding: 6px 8px; margin-bottom: 4px; border-radius: 3px;
}
.buyer-order-card.buyer-order-done {
  border-color: #44ff88; opacity: 0.7;
}
.buyer-order-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.buyer-order-name { color: #c8d8f0; font-size: 7px; }
.buyer-order-name-done { text-decoration: line-through; color: #44ff88; }
.buyer-order-mult {
  background: #1a3a10; color: #44ff88; font-size: 7px; font-weight: bold;
  padding: 1px 5px; border-radius: 3px; border: 1px solid #44ff88;
}
.buyer-order-progress-wrap {
  background: #1a2a3a; height: 5px; border-radius: 3px; overflow: hidden; margin-bottom: 3px;
}
.buyer-order-progress-bar {
  height: 100%; background: #00d4aa; border-radius: 3px; transition: width 0.3s;
}
.buyer-order-done .buyer-order-progress-bar { background: #44ff88; }
.buyer-order-qty { color: #5a7a9a; font-size: 6px; text-align: right; }

/* ═══ ПОДСАК ════════════════════════════════════════════════════════ */
.btn-podsak-hud { position: relative; }
.fish-count-badge {
  display: inline-block;
  background: #44ff88;
  color: #0a1a10;
  border-radius: 3px;
  font-size: 6px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
  font-family: 'Press Start 2P', monospace;
}
.fish-count-badge.full {
  background: #ff4444;
  color: #fff;
  animation: badge-pulse 0.8s ease infinite alternate;
}
@keyframes badge-pulse { to { opacity: 0.5; } }

.podsak-modal-content {
  width: min(480px, 96vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.podsak-cap-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  margin: 0 10px;
}
#podsak-count-label { font-size: 7px; color: #7a9ab0; }
.podsak-cap-track {
  width: 80px;
  height: 5px;
  background: #1a2a3a;
  border-radius: 2px;
  overflow: hidden;
}
#podsak-cap-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, #44ff88, #00d4aa);
  transition: width 0.3s, background 0.3s;
}
#podsak-cap-fill.warn { background: linear-gradient(90deg, #ffd700, #ff8844); }
#podsak-cap-fill.full { background: #ff4444; }

.podsak-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #1a2a3a;
  flex-shrink: 0;
}
.podsak-sort-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.podsak-sort-btn {
  background: #0d1a26;
  color: #5a7a9a;
  border: 1px solid #2a3a50;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.1s;
}
.podsak-sort-btn:hover { color: #c8d8f0; border-color: #4a6a90; }
.podsak-sort-btn.active-desc { color: #ffd700; border-color: #ffd700; }
.podsak-sort-btn.active-desc::after { content: ' ↓'; }
.podsak-sort-btn.active-asc  { color: #44ff88; border-color: #44ff88; }
.podsak-sort-btn.active-asc::after  { content: ' ↑'; }

.podsak-fish-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}
.podsak-fish-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-bottom: 1px solid #0d1a26;
}
.podsak-fish-row:nth-child(even) { background: #0d1822; }
.podsak-fish-row:hover { background: #1a2a3a; }
.podsak-fish-dot {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  flex-shrink: 0;
}
.podsak-fish-name {
  flex: 1;
  font-size: 7px;
  color: #c8d8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.podsak-fish-name.rare { color: #ffd700; }
.podsak-fish-weight { font-size: 7px; color: #7a9ab0; white-space: nowrap; flex-shrink: 0; }
.podsak-fish-list .btn-sell { font-size: 6px; padding: 5px 7px; white-space: nowrap; flex-shrink: 0; }

.podsak-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid #1a2a3a;
  flex-shrink: 0;
  background: #151f2e;
  gap: 8px;
}
#podsak-total { font-size: 7px; color: #ffd700; }

/* ═══ EXCHANGER ══════════════════════════════════════════════════════ */
.exchanger-modal-content {
  width: min(480px, 96vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.exchanger-subtitle {
  font-size: 7px;
  color: #00c8a0;
  margin: 0 8px;
  white-space: nowrap;
}
.exchanger-hint {
  font-size: 6px;
  color: #5a8a7a;
  padding: 6px 14px;
  background: #091510;
  border-bottom: 1px solid #0a2a20;
  flex-shrink: 0;
}
.exchanger-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #1a2a3a;
  flex-shrink: 0;
  gap: 8px;
}
#exchanger-xp-total-label { font-size: 7px; color: #a0ffd8; }
.btn-exchanger-all {
  font-size: 6px;
  padding: 6px 10px;
  background: #0a3a30;
  color: #a0ffd8;
  border: 1px solid #00c8a0;
  white-space: nowrap;
}
.btn-exchanger-all:hover { background: #1a5a40; }
.exchanger-fish-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}
.exchanger-fish-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-bottom: 1px solid #0d1a26;
}
.exchanger-fish-row:nth-child(even) { background: #0d1822; }
.exchanger-fish-row:hover { background: #0d2020; }
.exchanger-xp-val {
  font-size: 7px;
  color: #a0ffd8;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
}
.exchanger-fish-list .btn-exchange-one {
  font-size: 6px;
  padding: 5px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  background: #0a3a30;
  color: #a0ffd8;
  border-color: #00c8a0;
}
.exchanger-fish-list .btn-exchange-one:hover { background: #1a5a40; }

@media (hover: none) and (pointer: coarse) {
  .exchanger-modal-content {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100% !important; max-width: 100% !important;
    max-height: 72vh;
    border-radius: 14px 14px 0 0;
    margin: 0;
  }
  #modal-exchanger.open { align-items: flex-end; }
  .exchanger-toolbar { padding-bottom: 8px; }
}

@media (hover: none) and (pointer: coarse) {
  .podsak-modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 72vh;
    border-radius: 14px 14px 0 0;
    margin: 0;
  }
  #modal-podsak.open { align-items: flex-end; }
  .podsak-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* ═══ BOTTOM CENTER HUD ════════════════════════════════════════════ */
.hud-bottom-center {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 320px;
  max-width: 480px;
  width: 50vw;
}

/* ── Fishing timer ─────────────────────────────────────────────── */
.fishing-timer-wrap {
  width: 100%;
  background: rgba(10,14,26,0.85);
  border: 1px solid #2a3a50;
  padding: 6px 10px;
}
.fishing-timer-label { color: #7a9ab0; font-size: 6px; margin-bottom: 4px; }
.fishing-timer-track {
  width: 100%;
  height: 6px;
  background: #0a0e1a;
  border: 1px solid #2a3a50;
  border-radius: 3px;
  overflow: hidden;
}
.fishing-timer-fill {
  height: 100%;
  width: 100%;
  background: #00d4aa;
  transition: width 0.1s linear, background 0.3s;
  border-radius: 3px;
}

/* ── Mini-game ─────────────────────────────────────────────────── */
.minigame-panel {
  width: 100%;
  background: rgba(10,14,26,0.95);
  border: 2px solid #ffd700;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(255,215,0,0.3);
  animation: minigame-appear 0.2s ease-out;
}
@keyframes minigame-appear {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.minigame-label {
  color: #ffd700;
  font-size: 8px;
  text-align: center;
}
.key-hint {
  background: #2a3a50;
  border: 1px solid #7a9ab0;
  padding: 1px 5px;
  color: #fff;
  border-radius: 2px;
}
.minigame-bar-wrap { width: 100%; }
.minigame-bar {
  width: 100%;
  height: 28px;
  background: #1a2030;
  border: 2px solid #2a3a50;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  cursor: pointer;
}
.minigame-slider {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 6px;
  left: 50%;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255,255,255,0.8);
  transform: translateX(-50%);
  pointer-events: none;
}
.minigame-timer-bar {
  width: 100%;
  height: 3px;
  background: #0a0e1a;
  margin-top: 4px;
  border-radius: 2px;
  overflow: hidden;
}
.minigame-timer-fill {
  height: 100%;
  width: 100%;
  background: #ff4444;
  transition: width 0.1s linear;
}
.minigame-tension {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, #ff4444, #44ff88, #ff4444);
  width: 6px;
  border-radius: 3px;
  transform: translateX(-50%);
  transition: left 0.05s linear;
}

/* ── Cast power bar ────────────────────────────────────────────── */
.cast-power-wrap {
  width: 100%;
  background: rgba(10,14,26,0.85);
  border: 2px solid #ffd700;
  padding: 8px 12px;
  box-shadow: 0 0 12px rgba(255,215,0,0.2);
}
.cast-power-label {
  color: #ffd700;
  font-size: 7px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}
.cast-power-track {
  width: 100%;
  height: 10px;
  background: #0a0e1a;
  border: 1px solid #2a3a50;
  border-radius: 5px;
  overflow: hidden;
}
.cast-power-fill {
  height: 100%;
  width: 0%;
  background: #44ff88;
  transition: none;
  border-radius: 5px;
}
.cast-dir-hint { color: #5a7a9a; font-size: 6px; margin-top: 4px; text-align: center; }

/* ── Bait selector ─────────────────────────────────────────────── */
.bait-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,14,26,0.85);
  border: 1px solid #2a3a50;
  padding: 6px 10px;
}
.bait-arrow { padding: 4px 8px; font-size: 8px; min-width: 28px; }
.bait-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}
.bait-info span:first-child { color: #c8d8f0; font-size: 8px; }
.bait-qty { color: #ffd700; font-size: 7px; }
.bait-qty.empty { color: #ff4444; }
.worms-info { color: #88ff44; font-size: 7px; margin-left: 6px; }

/* ── Cast hint ─────────────────────────────────────────────────── */
.cast-hint {
  color: #00d4aa;
  font-size: 7px;
  opacity: 0.8;
  text-align: center;
  animation: hint-pulse 2s infinite;
}
@keyframes hint-pulse { 0%,100% { opacity:0.5; } 50% { opacity:1; } }

/* ── Bear throw hint ────────────────────────────────────────────── */
.bear-hint {
  color: #ff6633;
  font-size: 7px;
  text-align: center;
  animation: bear-hint-pulse 0.6s infinite;
  margin-top: 4px;
}
@keyframes bear-hint-pulse { 0%,100% { opacity:0.7; } 50% { opacity:1; } }

/* ── Shared campfire hint ───────────────────────────────────────── */
.shared-campfire-hint {
  color: #ffd700;
  font-size: 7px;
  text-align: center;
  animation: shared-fire-pulse 1.2s infinite;
  margin-top: 4px;
  text-shadow: 0 0 6px rgba(255,200,0,0.8);
}
@keyframes shared-fire-pulse { 0%,100% { opacity:0.6; } 50% { opacity:1; } }

/* ── Equipment display: 5-slot grid ───────────────────────────── */
#equipment-display { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 6px; }

/* ── Fish weight label ─────────────────────────────────────────── */
.fish-weight { font-size: 7px; color: #88ccff; }

/* ── Side leaderboards ─────────────────────────────────────────── */
.hud-sideboards {
  position: absolute;
  top: 60px;
  right: 8px;
  z-index: 10;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hud-top-catches {
  background: rgba(10,14,26,0.85);
  border: 1px solid #1a3a50;
  padding: 6px 8px;
}
.top-catches-title {
  font-size: 7px;
  color: #ffd700;
  margin-bottom: 6px;
  border-bottom: 1px solid #2a3a50;
  padding-bottom: 4px;
}
#top-catches-list,
#big-fish-list { display: flex; flex-direction: column; gap: 3px; }
.top-catch-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 6px;
  color: #c8d8f0;
  white-space: nowrap;
  overflow: hidden;
}
.top-catch-row.rare { color: #ffd700; }
.top-catch-row.total { gap: 6px; }
.tc-rank { min-width: 18px; color: #7a9ab0; }
.tc-name { min-width: 42px; color: #88aacc; overflow: hidden; text-overflow: ellipsis; max-width: 42px; }
.tc-species { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tc-species.rare { color: #ffd700; }
.tc-weight { color: #44ff88; min-width: 46px; text-align: right; }
.tc-tier { min-width: 22px; text-align: right; }
.tc-total { color: #44ff88; min-width: 58px; text-align: right; }
.tc-count { color: #7a9ab0; min-width: 38px; text-align: right; }
.tc-tier.S { color: #7a9ab0; }
.tc-tier.M { color: #c8d8f0; }
.tc-tier.L { color: #44ff88; }
.tc-tier.XL { color: #ffd700; }
.tc-tier.XXL { color: #ff88ff; }
.top-catch-empty { font-size: 6px; color: #3a5a7a; text-align: center; padding: 4px; }
.hud-big-fish .tc-name { min-width: 36px; max-width: 36px; }

/* ── Tools bar (flashlight, etc.) ─────────────────────────────── */
.tools-bar {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.tools-slot {
  background: rgba(8,12,22,0.85);
  border: 1px solid #2a3a22;
  padding: 3px 7px;
  min-width: 54px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.1s;
}
.tools-slot:hover { border-color: #00d4aa; }
.tools-slot.empty { border-color: #151f15; opacity: 0.4; }
.tools-slot.active { border-color: #ffe066; background: rgba(30,24,0,0.88); }
.tools-slot.active .action-slot-name { color: #ffe066; }
.tools-slot-key {
  position: absolute;
  top: 2px;
  left: 3px;
  background: #1e2e10;
  color: #88ff44;
  font-size: 5px;
  padding: 1px 2px;
  line-height: 1;
}
.tools-slot-name { font-size: 6px; color: #c8d8f0; margin-top: 6px; line-height: 1.3; }
.tools-slot-qty  { font-size: 6px; color: #ffd700; margin-top: 1px; }
.tools-slot-empty { font-size: 6px; color: #2a3a2a; margin-top: 6px; }

/* ── Action bar (keys 1/2/3) ───────────────────────────────────── */
.action-bar {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.action-slot {
  background: rgba(10,14,26,0.88);
  border: 1px solid #2a4a30;
  padding: 5px 8px;
  min-width: 72px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.1s;
}
.action-slot:hover { border-color: #00d4aa; }
.action-slot.empty { border-color: #1a2a1a; opacity: 0.5; }
.action-slot.vehicle-slot { border-color: #4466aa; }
.action-slot.vehicle-slot.active { border-color: #44aaff; background: rgba(20,40,80,0.9); }
.action-slot.vehicle-slot.active .action-slot-name { color: #44aaff; }
.action-slot-key {
  position: absolute;
  top: 2px;
  left: 3px;
  background: #2a4a20;
  color: #88ff44;
  font-size: 6px;
  padding: 1px 3px;
  line-height: 1;
}
.action-slot-name { font-size: 6px; color: #c8d8f0; margin-top: 8px; line-height: 1.4; }
.action-slot-qty  { font-size: 7px; color: #ffd700; margin-top: 2px; }
.action-slot-empty { font-size: 6px; color: #3a5a3a; margin-top: 8px; }


/* ── Global tooltip ────────────────────────────────────────────── */
.game-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: none;
  background: rgba(5,10,20,0.97);
  border: 1px solid #2a4a6a;
  border-radius: 4px;
  color: #c8d8f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  line-height: 1.8;
  padding: 6px 10px;
  max-width: 220px;
  white-space: pre-line;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7);
}

/* ══ NEW INVENTORY REDESIGN ══════════════════════════════════════ */
.inv-modal-content {
  max-width: 680px;
  width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.inv-layout {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  flex: 0 0 auto;
}
.inv-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}
.inv-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inv-slots-title {
  font-size: 6px;
  color: #5a7a9a;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.inv-slots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
}
.inv-slot {
  background: rgba(10,20,40,0.85);
  border: 2px solid #2a4a6a;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
  transition: border-color 0.15s;
  min-height: 68px;
  position: relative;
}
.inv-slot.drag-over {
  border-color: #00d4aa;
  background: rgba(0,212,170,0.08);
}
.inv-slot.equipped {
  border-color: #4a8aff;
}
.inv-slot-icon {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}
.inv-slot-label {
  font-size: 4px;
  color: #5a7a9a;
  text-align: center;
  letter-spacing: 0.5px;
}
.inv-slot-name {
  font-size: 4px;
  color: #c8d8f0;
  text-align: center;
  line-height: 1.2;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-drag-hint {
  font-size: 4px;
  color: #3a5a7a;
  text-align: center;
  margin-top: 2px;
  font-style: italic;
}
/* Stats panel */
.inv-stats-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inv-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  background: rgba(10,20,40,0.6);
  border-left: 2px solid #2a4a6a;
}
.inv-stat-label {
  font-size: 5px;
  color: #7a9ab0;
}
.inv-stat-value {
  font-size: 5px;
  color: #c8d8f0;
  font-weight: bold;
}
.inv-stat-value.bonus { color: #44ff88; }
.inv-stat-value.penalty { color: #ff6644; }
/* Owned items section */
.inv-owned-section {
  border-top: 1px solid #1a3050;
  padding: 8px 12px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.inv-owned-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.inv-filter-btns {
  display: flex;
  gap: 3px;
}
.inv-filter-btn {
  background: rgba(10,20,40,0.8);
  border: 1px solid #2a4a6a;
  color: #5a7a9a;
  font-family: 'Press Start 2P', monospace;
  font-size: 4px;
  padding: 2px 5px;
  cursor: pointer;
}
.inv-filter-btn.active { border-color: #00d4aa; color: #00d4aa; }
.inv-owned-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-y: auto;
  max-height: 140px;
}
.inv-owned-grid::-webkit-scrollbar { height: 4px; width: 4px; }
.inv-owned-grid::-webkit-scrollbar-thumb { background: #2a4a6a; }
/* Item cards in owned grid */
.inv-item-card {
  width: 60px;
  background: rgba(10,20,40,0.9);
  border: 2px solid #2a4a6a;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: grab;
  transition: border-color 0.15s, transform 0.1s;
  position: relative;
}
.inv-item-card:hover { border-color: #4a8aff; transform: translateY(-2px); }
.inv-item-card.equipped-card { border-color: #00d4aa; }
.inv-item-card:active { cursor: grabbing; }
.inv-item-card-icon {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}
.inv-item-card-name {
  font-size: 4px;
  color: #c8d8f0;
  text-align: center;
  line-height: 1.2;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inv-item-equipped-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #00d4aa;
  border-radius: 50%;
}
.inv-item-tier-bar {
  width: 100%;
  height: 2px;
  border-radius: 1px;
  margin-top: 1px;
}

/* ── Repair Modal ─────────────────────────────────────────────── */
.repair-modal-content { max-width: 460px; width: 90vw; }
.repair-header-npc {
  display: flex;
  align-items: center;
  gap: 10px;
}
.repair-npc-icon { font-size: 24px; }
.repair-npc-title {
  font-size: 6px;
  color: #5a7a9a;
  letter-spacing: 1px;
}
.repair-npc-name {
  font-size: 9px;
  color: #ff6644;
  margin-top: 2px;
}
.repair-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: rgba(10,20,40,0.7);
  border: 1px solid #2a4a6a;
  margin-bottom: 8px;
}
.repair-row-info { flex: 1; }
.repair-row-name { font-size: 7px; color: #c8d8f0; margin-bottom: 5px; }
.repair-dur-bar-wrap {
  width: 100%;
  height: 5px;
  background: #0a1520;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 3px;
}
.repair-dur-bar { height: 100%; border-radius: 2px; transition: width 0.3s; }
.repair-dur-text { font-size: 5px; color: #7a9ab0; }
.repair-row-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 70px;
}
.repair-cost { font-size: 7px; color: #ffd700; }
.repair-ok { font-size: 7px; color: #44dd88; }
.repair-btn { font-size: 6px; padding: 4px 8px; }
.repair-empty {
  font-size: 7px;
  color: #5a7a9a;
  text-align: center;
  padding: 20px;
}

/* ── Guide Modal ──────────────────────────────────────────────── */
.guide-modal { }
.guide-modal-content {
  max-width: 560px;
  width: 95vw;
  background: #0d1a12;
  border: 2px solid #2a5a30;
  box-shadow: 0 0 40px rgba(0,200,80,0.12);
  display: flex;
  flex-direction: column;
}
.guide-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #1a3a20;
}
.guide-title {
  flex: 1;
  color: #88ffaa;
  font-size: 10px;
  letter-spacing: 1px;
}
.guide-counter {
  font-size: 7px;
  color: #5a8a5a;
  white-space: nowrap;
}
.guide-text {
  min-height: 120px;
  max-height: 55vh;
  padding: 16px 20px;
  font-size: 9px;
  color: #a0c8a0;
  line-height: 2;
  border-bottom: 1px solid #1a3a20;
  overflow-y: auto;
}
.guide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 8px;
}
.guide-dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.guide-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a4a2a;
  cursor: pointer;
  transition: background 0.2s;
}
.guide-dot.active { background: #44ff88; }

/* HUD guide button */
.btn-guide-hud {
  background: #0d2a14 !important;
  border-color: #44aa44 !important;
  color: #88ff88 !important;
}
.btn-guide-hud:hover {
  background: #1a4a20 !important;
}

/* Board proximity hint */
.board-hint {
  color: #88ffaa;
  font-size: 7px;
  text-align: center;
  animation: bear-hint-pulse 1s infinite;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE CONTROLS
   ═══════════════════════════════════════════════════════════════ */

.mobile-controls {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 50;
  /* JS overrides top/bottom/height via visualViewport tracking */
}

/* ── Joystick zone: RIGHT half ────────────────────────────────── */
.joystick-zone {
  position: absolute;
  right: 0; top: 54px; bottom: 0;
  left: auto;
  width: 50%;
  pointer-events: auto;
}

.joystick-base {
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.joystick-stick {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: 2px solid rgba(255,255,255,0.7);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ── Hamburger menu: 50px lower than top ──────────────────────── */
.btn-mobile-menu {
  position: absolute;
  top: calc(62px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  width: 48px; height: 48px;
  background: rgba(10,14,26,0.88);
  border: 2px solid #00d4aa;
  color: #00d4aa;
  font-size: 18px;
  border-radius: 8px;
  pointer-events: auto;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-panel {
  position: absolute;
  top: calc(118px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  background: rgba(10,14,26,0.96);
  border: 2px solid #00d4aa;
  border-radius: 8px;
  padding: 8px;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  min-width: 140px;
}

.mobile-menu-panel .btn {
  text-align: left;
  font-size: 7px;
  min-height: 44px;
  padding: 0 10px;
}

/* ── Action sphere toggle button (left side) ─────────────────── */
.btn-mobile-actions {
  position: absolute;
  left: calc(12px + env(safe-area-inset-left, 0px));
  top: calc(148px + env(safe-area-inset-top, 0px));
  width: 46px; height: 46px;
  background: rgba(10,14,26,0.88);
  border: 2px solid #ff9900;
  color: #ff9900;
  font-size: 18px;
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-actions-panel {
  position: absolute;
  left: calc(66px + env(safe-area-inset-left, 0px));
  top: calc(148px + env(safe-area-inset-top, 0px));
  background: rgba(10,14,26,0.92);
  border: 2px solid #ff9900;
  border-radius: 10px;
  padding: 6px;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  pointer-events: auto;
  max-width: min(180px, 45vw);
}

.mobile-actions-panel .action-bar {
  display: flex !important;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  max-width: 160px;
}

/* ── Bait row: center-bottom, above minimap ───────────────────── */
.mobile-bait-row {
  position: absolute;
  bottom: calc(135px + env(safe-area-inset-bottom, 0px) + var(--vv-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.btn-mobile-bait {
  width: 44px; height: 44px;
  background: rgba(10,14,26,0.85);
  border: 2px solid #00d4aa;
  color: #00d4aa;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-bait-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #fff;
  text-align: center;
  max-width: 80px;
  line-height: 1.8;
  background: rgba(10,14,26,0.82);
  border: 1px solid rgba(0,212,170,0.3);
  border-radius: 6px;
  padding: 4px 6px;
}

/* ── Fan container: bottom-left corner ───────────────────────── */
.mobile-fan-btns {
  position: absolute;
  left: 0; bottom: 0;
  width: 220px; height: 240px;
  pointer-events: none;
}

/* Shared fan button base */
.btn-fan-item {
  position: absolute;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  pointer-events: auto;
  transition: transform 0.08s, opacity 0.08s;
}
.btn-fan-item:active { transform: scale(0.92); opacity: 0.85; }

/* Cast — bottom-left corner, 70px */
.btn-fan-cast {
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--vv-bottom, 0px));
  width: 70px; height: 70px;
  background: rgba(220,185,0,0.82);
  border: 3px solid #ffd700;
  color: #1a0a00;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(255,215,0,0.5);
}
.btn-fan-cast:active { background: rgba(255,215,0,0.95); }

/* E (Interact) — above cast, offset right, 56px */
.btn-fan-e {
  left: calc(90px + env(safe-area-inset-left, 0px));
  bottom: calc(60px + env(safe-area-inset-bottom, 0px) + var(--vv-bottom, 0px));
  width: 56px; height: 56px;
  background: rgba(0,200,160,0.75);
  border: 3px solid #00d4aa;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 0 12px rgba(0,212,170,0.4);
}

/* Chat — highest, left side, 46px */
.btn-fan-chat {
  left: calc(10px + env(safe-area-inset-left, 0px));
  bottom: calc(100px + env(safe-area-inset-bottom, 0px) + var(--vv-bottom, 0px));
  width: 46px; height: 46px;
  background: rgba(10,14,26,0.88);
  border: 2px solid #4477cc;
  color: #fff;
  font-size: 18px;
}

/* Keep legacy classes for JS toggle (.near-npc etc.) */
.btn-mobile-act {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-mobile-interact.near-npc {
  background: rgba(0,212,170,0.9) !important;
  box-shadow: 0 0 20px rgba(0,212,170,0.7) !important;
}

/* ── Strike button: full-screen tap overlay ───────────────────── */
.mobile-strike-btn {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  height: auto;
  background: rgba(255,80,0,0.12);
  border: 3px solid #ff6600;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #ff9900;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
  animation: mobile-strike-pulse 0.45s infinite alternate;
  -webkit-tap-highlight-color: transparent;
}

@keyframes mobile-strike-pulse {
  from { background: rgba(255,80,0,0.15); box-shadow: 0 0 10px rgba(255,100,0,0.3); }
  to   { background: rgba(255,80,0,0.38); box-shadow: 0 0 28px rgba(255,100,0,0.7); }
}

/* ── QTE arrow buttons: centered, right side ──────────────────── */
.mobile-qte {
  position: absolute;
  right: calc(8px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px) + var(--vv-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.qte-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.qte-center { width: 72px; height: 72px; }

.btn-qte {
  width: 72px; height: 72px;
  background: rgba(10,14,26,0.85);
  border: 3px solid #4488ff;
  color: #6699ff;
  font-size: 20px;
  border-radius: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.08s, transform 0.08s;
  user-select: none;
}

.btn-qte:active { transform: scale(0.9); }

.btn-qte.qte-active {
  background: rgba(68,136,255,0.45);
  border-color: #aabbff;
  color: #fff;
  box-shadow: 0 0 16px rgba(100,150,255,0.6);
  transform: scale(1.08);
}

/* ── Chat button: part of fan (see .btn-fan-chat) ─────────────── */

/* ═══════════════════════════════════════════════════════════════
   MOBILE HUD ADJUSTMENTS  (touch devices only)
   ═══════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {

  /* ── Top HUD: compact, hide secondary buttons (behind ☰ menu) ── */
  #btn-open-quests,
  #btn-open-diary,
  #btn-open-inventory,
  #btn-open-guide,
  #btn-open-podsak,
  #btn-debug-money { display: none !important; }

  .hud-top { padding: 4px 8px; gap: 6px; flex-wrap: nowrap; min-height: 44px; }
  .hud-right { gap: 4px; flex-wrap: nowrap; }

  /* Статус-блоки скрыты ТОЛЬКО в .hud-right
     После переноса JS в .mobile-menu-panel — эти правила не применяются */
  .hud-right #hud-level-block      { display: none !important; }
  .hud-right .currency-display     { display: none !important; }
  .hud-right #hud-time             { display: none !important; }

  /* Бонус-ивент ("золотая вода" и т.п.) — виден в верхней панели */
  #hud-daily-event {
    font-size: 10px;
    padding: 2px 5px;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Стили после перемещения в бургер-панель */
  .mobile-menu-panel .hud-level-block {
    display: flex !important;
    width: 100%;
    margin-bottom: 4px;
    min-width: unset;
    border-radius: 6px;
  }
  .mobile-menu-panel .currency-display {
    display: block !important;
    font-size: 9px;
    padding: 6px 10px;
    border-bottom: 1px solid #1a3a50;
    margin-bottom: 4px;
    width: 100%;
    box-sizing: border-box;
  }

  /* ── Leaderboards: hidden on phone ── */
  .hud-sideboards { display: none !important; }

  /* ── Chat: hidden on phone (use chat icon button) ── */
  #chat-window { display: none; }

  /* ── Event log: top-left, below top HUD bar, small ── */
  .hud-event-log {
    bottom: auto;
    top: 52px;
    left: 4px;
    max-width: 148px;
    max-height: 84px;
    overflow: hidden;
  }

  /* ── Desktop bait selector: hidden — mobile bait row used instead ── */
  .bait-selector { display: none !important; }

  /* ── Tools / buffs bars: hide to avoid phantom height ── */
  /* #action-bar is moved to mobile-actions-panel by JS */
  #tools-bar, #buffs-bar { display: none !important; }

  /* ── Keyboard hint texts: hidden on mobile ── */
  .cast-dir-hint  { display: none !important; }
  .cast-hint      { display: none !important; }
  .bear-hint      { font-size: 7px; }
  .board-hint     { font-size: 7px; }

  /* ── Bottom-center HUD: 50px ниже персонажа, поверх strike-оверлея ── */
  .hud-bottom-center {
    bottom: auto;
    top: calc(50% + 50px);
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 320px);
    padding: 4px 8px;
    gap: 4px;
    background: rgba(5,10,20,0.0);
    z-index: 100 !important;
    position: absolute;
  }

  /* Минигра-панель — тёмный фон чтобы читалась поверх flash */
  #minigame-panel {
    background: rgba(5,10,20,0.97) !important;
    border: 2px solid #ffd700;
    border-radius: 8px;
  }
  #fishing-timer-wrap {
    background: rgba(5,10,20,0.97) !important;
    border-radius: 8px;
    padding: 4px 8px;
  }
  #cast-power-bar-wrap {
    background: rgba(5,10,20,0.97) !important;
    border-radius: 8px;
    padding: 4px 8px;
  }

  /* ── Minigame / fishing timer text: readable on phone ── */
  .minigame-label      { font-size: 9px; line-height: 1.8; }
  .fishing-timer-label { font-size: 7px; }

  /* ── Joystick zone: don't cover top HUD ── */
  .joystick-zone { top: 54px; }

  /* ── Modals ── */
  .btn-close { min-width: 44px; min-height: 44px; font-size: 14px; }
  .modal-content { max-height: 92vh; }
  #guide-prev, #guide-next { min-height: 44px; min-width: 80px; }

  /* ── Inventory: stack layout vertically on narrow screens ── */
  .inv-layout { flex-direction: column; }
  .inv-left { min-width: unset; }

  /* ── Login: bigger padding for auth tabs ── */
  .login-box { padding: 20px 16px; }

  /* ── QTE: ensure display when shown via JS ── */
  .mobile-qte .btn-qte { min-width: 60px; min-height: 60px; }
}
