:root {
  --game-bg: radial-gradient(circle at 50% 15%, #26c6da 0%, #0097a7 45%, #006064 100%);
}

.top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 16px;
  box-sizing: border-box;
  gap: 12px;
  z-index: 30;
}

.top-controls .instruction-banner {
  flex: 1;
  margin: 0;
}

.feed-btn {
  background: linear-gradient(135deg, #ff7043 0%, #e64a19 100%);
  color: #ffffff;
  border: 2px solid #ffab91;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 16px;
  min-height: 44px;
  border-radius: 22px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(230, 74, 25, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  outline: none;
}

.feed-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(230, 74, 25, 0.5);
}

.feed-btn:active {
  transform: scale(0.95);
}

.feed-btn:focus-visible {
  outline: 3px solid #ffee58;
  outline-offset: 3px;
}

.fish-field {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.fish-field:focus-visible {
  outline: 4px solid #ffb300;
  outline-offset: -4px;
}

/* Water Caustics Shimmer */
.caustics-layer {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
  pointer-events: none;
  animation: caustics-pulse 4s infinite ease-in-out alternate;
  z-index: 1;
}

@keyframes caustics-pulse {
  0% { opacity: 0.4; transform: scaleY(0.95); }
  100% { opacity: 0.8; transform: scaleY(1.05); }
}

.aquarium-tank {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Seabed with Sand, Shell & Kelp */
.seabed {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(180deg, #ffe082 0%, #ffca28 40%, #ffb300 100%);
  border-radius: 50% 50% 0 0 / 25px 25px 0 0;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 20px;
  z-index: 10;
}

.tank-kelp {
  position: absolute;
  bottom: 55px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 64px;
  line-height: 1;
  pointer-events: none;
  z-index: 8;
  opacity: 0.85;
}

.kelp-item {
  display: inline-block;
  animation: kelp-sway 3.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.k1 { animation-duration: 3s; }
.k2 { animation-duration: 2.5s; font-size: 52px; }
.k3 { animation-duration: 3.5s; }
.k4 { animation-duration: 2.8s; font-size: 54px; }

@keyframes kelp-sway {
  0% { transform: rotate(-6deg); }
  100% { transform: rotate(6deg); }
}

.pearl-shell-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 4px;
  min-width: 52px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  pointer-events: auto;
}

.pearl-shell-btn:hover,
.pearl-shell-btn:active {
  transform: scale(1.25) translateY(-6px);
}

.pearl-shell-btn:focus-visible {
  outline: 3px solid #ffffff;
  border-radius: 50%;
}

.shell-icon {
  font-size: 48px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.pearl-shine {
  position: absolute;
  top: -8px;
  right: -6px;
  font-size: 26px;
  animation: pearl-glint 1.2s infinite ease-in-out;
}

@keyframes pearl-glint {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.25); opacity: 1; }
}

.seabed-friend {
  font-size: 38px;
  line-height: 1;
  background: none;
  border: none;
  padding: 4px;
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  border-radius: 50%;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.seabed-friend:focus-visible {
  outline: 3px solid #ffffff;
}

.crab:hover,
.crab:active,
.crab.friend-active {
  transform: scale(1.25) translateY(-4px) rotate(12deg);
}

.starfish:hover,
.starfish:active,
.starfish.friend-active {
  transform: scale(1.25) translateY(-4px) rotate(-12deg);
}

/* Fish School */
.fish-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.aquarium-fish {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 60px;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
  will-change: transform;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 56px;
}

.aquarium-fish:focus-visible {
  outline: 3px solid #ffee58;
  border-radius: 50%;
}

.fish-eating {
  animation: fish-munch 0.35s ease-in-out;
}

@keyframes fish-munch {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(8deg); }
}

/* Food Flakes */
.food-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 11;
}

.food-flake {
  position: absolute;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Bubbles Container */
.bubbles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 14;
}

.tank-bubble {
  position: absolute;
  font-size: 30px;
  line-height: 1;
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.6));
  animation: bubble-float 3.5s ease-out forwards;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
}

.tank-bubble:focus-visible {
  outline: 3px solid #ffee58;
  outline-offset: 2px;
}

@keyframes bubble-float {
  0% { transform: translateY(0) scale(0.5); opacity: 0.9; }
  100% { transform: translateY(var(--float-dist, -400px)) translateX(var(--drift, 10px)) scale(1.2); opacity: 0; }
}

/* Sparkles Container */
.sparks-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.fish-spark {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  animation: spark-drift 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes spark-drift {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--tx, 0px), var(--ty, -60px)) scale(1.2) rotate(var(--rot, 30deg)); opacity: 0; }
}

/* Emoji cross-platform consistency */
.aquarium-fish,
.tank-bubble,
.food-flake,
.fish-spark,
.seabed-friend,
.kelp-item,
.shell-icon,
.pearl-shine {
  font-family: var(--font-emoji);
  font-variant-emoji: emoji;
}

@media (max-width: 480px) {
  .top-controls {
    padding: 4px 8px;
    gap: 8px;
  }
  .top-controls .instruction-banner {
    font-size: 0.92rem;
    padding: 4px 8px;
  }
  .feed-btn {
    font-size: 14px;
    padding: 6px 12px;
    gap: 4px;
  }
}

@media (max-width: 360px) {
  .top-controls .instruction-banner {
    font-size: 0.84rem;
  }
  .feed-btn {
    font-size: 13px;
    padding: 6px 10px;
  }
}

@media (max-height: 600px) {
  .seabed { height: 70px; }
  .tank-kelp { font-size: 48px; bottom: 45px; }
  .aquarium-fish { font-size: 48px; }
  .shell-icon { font-size: 38px; }
  .feed-btn { font-size: 14px; padding: 5px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .caustics-layer,
  .kelp-item,
  .pearl-shine {
    animation: none !important;
  }
  .tank-bubble {
    animation-duration: 5s !important;
  }
  .fish-spark {
    animation-duration: 1.4s !important;
  }
}
