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

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #1a1a2e;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#game-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(20,20,40,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  z-index: 10;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}

#hud span {
  display: flex;
  align-items: center;
  gap: 4px;
}

#game-canvas {
  display: block;
  cursor: pointer;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
}

#action-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(20,20,40,0.85);
  border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 10;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.action-btn, .menu-btn {
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.action-btn {
  background: linear-gradient(180deg, #4CAF50, #388E3C);
  color: #fff;
  font-weight: bold;
  min-width: 120px;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76,175,80,0.4);
}

.action-btn:disabled {
  background: linear-gradient(180deg, #888, #666);
  cursor: default;
  transform: none;
  box-shadow: none;
}

.menu-btn {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.menu-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* Overlay common */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background: linear-gradient(180deg, #2c3e50, #1a252f);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.overlay-content h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 22px;
  color: #e0f7fa;
}

.close-btn {
  display: block;
  margin: 20px auto 0;
  padding: 10px 32px;
  background: linear-gradient(180deg, #e74c3c, #c0392b);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}

.close-btn:hover {
  background: linear-gradient(180deg, #c0392b, #a93226);
}

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  animation: slideDown 0.3s ease, fadeOut 0.5s ease 2s forwards;
  border: 1px solid rgba(255,255,255,0.2);
  text-align: center;
}

.toast.success {
  border-color: #4CAF50;
  color: #a5d6a7;
}

.toast.warning {
  border-color: #ff9800;
  color: #ffe0b2;
}

.toast.info {
  border-color: #2196F3;
  color: #bbdefb;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Responsive */
@media (max-width: 1024px) {
  #game-container { max-width: 100%; }
  .overlay-content { width: 95%; max-height: 90vh; }
  #collection-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 800px) {
  #hud { font-size: 12px; padding: 6px 10px; }
  .action-btn, .menu-btn { padding: 8px 14px; font-size: 13px; }
  .overlay-content { padding: 16px; }
}

@media (max-width: 600px) {
  #hud { font-size: 11px; padding: 4px 8px; }
  #hud span { font-size: 11px; }
  .action-btn, .menu-btn { padding: 12px 16px; font-size: 16px; min-width: 70px; }
  #action-bar { gap: 10px; padding: 12px; }
  .fish-card { min-height: 100px; padding: 10px; }
  .fish-card .fish-icon { font-size: 24px; }
  .fish-card .fish-name { font-size: 12px; }
  .achievement-item { padding: 10px; flex-direction: column; align-items: flex-start; gap: 6px; }
}
