:root {
  --primary: #8BD1CB;
  --secondary: #2E9DF7;
  --accent: #159A48;
  --deep-blue: #0A4A6E;
  --ink: #07324B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Proxima Nova", "Avenir", Georgia, "Times New Roman", serif;
  font-weight: 700;
}

body {
  position: relative;
  min-height: 100vh;
  padding: 20px 16px 30px;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.28), transparent 28%),
    linear-gradient(180deg, #a9e6df 0%, var(--primary) 28%, #64c9f0 58%, var(--secondary) 78%, #0c5277 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 55%);
}

main {
  max-width: 1120px;
  margin: 0 auto;
}

header.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto 18px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 32px rgba(7, 50, 75, 0.12);
}

.brand-logo {
  width: auto;
  height: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  overflow: visible;
}

.brand-logo img {
  display: block;
  width: auto;
  max-width: 260px;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.brand-logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1 {
  font-size: clamp(2rem, 2.5vw, 3rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.donation-note {
  margin-top: 8px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(46, 157, 247, 0.22));
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75), 0 6px 14px rgba(7, 50, 75, 0.12);
}

.dashboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 14px;
  max-width: 960px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(2, 49, 79, 0.12);
  font-size: 1rem;
  color: #00334d;
}

.dashboard div {
  min-width: 110px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 12px auto 8px;
}

.difficulty-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 16px;
  flex-wrap: wrap;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--secondary) 0%, #176fbb 100%);
  color: white;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(12, 82, 119, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 24px rgba(12, 82, 119, 0.3);
  filter: brightness(1.04);
  background: linear-gradient(135deg, var(--accent) 0%, #0f7f41 100%);
}

button:disabled {
  background: linear-gradient(135deg, #a8dfe9 0%, #7fc3ef 100%);
  box-shadow: none;
  cursor: not-allowed;
}

.difficulty-btn {
  padding: 10px 14px;
  border: 2px solid rgba(46, 157, 247, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: var(--deep-blue);
  box-shadow: none;
  font-size: 0.95rem;
}

.difficulty-btn.active {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  color: white;
  border-color: transparent;
}

.difficulty-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(12, 82, 119, 0.18);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

#message {
  margin: 0 auto 14px;
  max-width: 820px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  font-size: 1rem;
  color: #013049;
}

#cleanMeter {
  width: 90%;
  max-width: 760px;
  height: 18px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

#cleanBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 55%, var(--accent) 100%);
  transition: width 0.25s ease;
}

#gameArea {
  position: relative;
  width: min(90%, 1080px);
  min-height: 480px;
  margin: 0 auto 24px;
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  background: linear-gradient(180deg, #bff2eb 0%, var(--primary) 30%, #5ec9ef 62%, #0f5b72 100%);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 44, 83, 0.22);
}

#gameArea::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.95) 0 2%, transparent 3%),
    radial-gradient(circle at 80% 16%, rgba(255, 255, 255, 0.68) 0 1.8%, transparent 2.8%),
    linear-gradient(180deg, transparent 0 68%, rgba(255, 207, 95, 0.78) 68% 100%);
  pointer-events: none;
}

#gameArea::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 45%, rgba(7,50,75,0.06));
  pointer-events: none;
}

#oceanOverlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.28) 0%, transparent 15%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.16) 0%, transparent 10%),
    radial-gradient(circle at 50% 70%, rgba(255,255,255,0.08) 0%, transparent 15%);
  pointer-events: none;
}

.beach-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sun {
  position: absolute;
  top: 24px;
  right: 30px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c5 0%, #ffd166 52%, #ffb703 100%);
  box-shadow: 0 0 54px rgba(255, 214, 102, 0.8);
}

.wave {
  position: absolute;
  left: -8%;
  width: 116%;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  opacity: 0.8;
}

.wave-one {
  bottom: 96px;
  animation: sway 8s ease-in-out infinite;
}

.wave-two {
  bottom: 70px;
  animation: sway 11s ease-in-out infinite reverse;
}

.sandbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, #ffd87d 0%, #f6bb4d 100%);
  clip-path: polygon(0 100%, 0 40%, 7% 48%, 16% 38%, 24% 52%, 35% 36%, 46% 56%, 58% 38%, 71% 54%, 82% 36%, 95% 50%, 100% 36%, 100% 100%);
}

.shell {
  position: absolute;
  bottom: 92px;
  font-size: 1.35rem;
  opacity: 0.75;
  animation: bob 3s ease-in-out infinite;
}

.shell-one { left: 10%; }
.shell-two { right: 16%; animation-delay: 1.2s; }

.starfish {
  position: absolute;
  left: 48%;
  bottom: 84px;
  font-size: 1.4rem;
  animation: bob 2.4s ease-in-out infinite;
}

#trashBin {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  font-size: 0.95rem;
  font-weight: 800;
  z-index: 15;
  box-shadow: 0 18px 36px rgba(0, 87, 135, 0.3);
}

#trashBin::before {
  content: "🌊";
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.charity-footer {
  margin: 0 auto 24px;
  padding: 16px 20px;
  max-width: 760px;
  background: rgba(7, 50, 75, 0.92);
  color: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(7, 50, 75, 0.18);
  text-align: center;
}

.charity-footer p {
  margin-bottom: 10px;
  font-size: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #8BD1CB;
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.item {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  border-radius: 50%;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.95);
  transform: translateZ(0);
  transition: transform 0.12s ease, opacity 0.25s ease;
  touch-action: none;
  z-index: 5;
}

.item:active {
  cursor: grabbing;
  transform: scale(1.06);
}

.item.dragging {
  animation: none;
  transform: none;
  z-index: 20;
}

.trash {
  border: 2px solid #ffab91;
}

.fish {
  border: 2px solid #81d4fa;
}

.jellyfish,
.seaweed,
.crab {
  border: 2px solid #ff7a59;
  background: rgba(255, 244, 238, 0.96);
}

.item span,
.item::before {
  font-size: 1.1em;
}

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

@keyframes sway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(20px); }
}

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

.item {
  animation: float 4.5s ease-in-out infinite;
}

.confetti {
  position: fixed;
  top: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.95;
  border-radius: 2px;
  animation: confetti-fall 4s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -100vh, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--x), 110vh, 0) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 650px) {
  .dashboard {
    font-size: 0.95rem;
  }

  #trashBin {
    width: 90px;
    height: 90px;
    font-size: 0.85rem;
  }
}

