:root {
  --water-top: #0ea4c8;
  --water-mid: #08587a;
  --water-deep: #042a42;
  --aqua-ink: #dff6ff;
  --gutter: clamp(14px, 3vw, 32px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --fast: 180ms;
  --cursor-koi: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%3E%20%3Cg%20transform='translate(15%2015)%20rotate(45)'%3E%20%3Cpath%20d='M-2,-3.5%20C-1,-8.5%203.5,-9.5%205.5,-7%20C3.5,-5.5%201.5,-4%200.5,-3%20Z'%20fill='%23bff6ff'%20fill-opacity='.92'%20stroke='%23032136'%20stroke-width='.9'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M-2,3.5%20C-1,8.5%203.5,9.5%205.5,7%20C3.5,5.5%201.5,4%200.5,3%20Z'%20fill='%23bff6ff'%20fill-opacity='.92'%20stroke='%23032136'%20stroke-width='.9'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M6.5,-1.5%20C9.5,-4.5%2013,-7.2%2015.2,-5.6%20C13,-2.3%2012,-0.7%2011,0%20C12,0.7%2013,2.3%2015.2,5.6%20C13,7.2%209.5,4.5%206.5,1.5%20Z'%20fill='%23ff7b47'%20stroke='%23032136'%20stroke-width='.9'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M-14.2,0%20C-13.2,-3%20-9.3,-5.1%20-4.5,-4.7%20C0.5,-4.3%204.5,-2.4%207.4,-1.2%20L7.4,1.2%20C4.5,2.4%200.5,4.3%20-4.5,4.7%20C-9.3,5.1%20-13.2,3%20-14.2,0%20Z'%20fill='%23f6fcff'%20stroke='%23032136'%20stroke-width='1.15'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M-10.3,-1.7%20C-8.4,-3.5%20-5,-3.3%20-4.1,-1.1%20C-3.3,0.8%20-5.6,2.3%20-8.2,1.6%20C-10,1%20-11.2,-0.5%20-10.3,-1.7%20Z'%20fill='%23ff562e'/%3E%20%3Cpath%20d='M-1.5,-2.9%20C1,-3.3%203.7,-1.9%203.9,0%20C3.9,1.5%201.5,2.5%20-0.8,1.7%20C-2.7,1%20-3.1,-2.1%20-1.5,-2.9%20Z'%20fill='%23ff562e'/%3E%20%3Ccircle%20cx='-10.6'%20cy='-2.1'%20r='.9'%20fill='%23042136'/%3E%20%3Ccircle%20cx='-10.6'%20cy='2.1'%20r='.9'%20fill='%23042136'/%3E%20%3C/g%3E%20%3Ccircle%20cx='26.5'%20cy='18.5'%20r='1.9'%20fill='%238ff4ff'%20fill-opacity='.45'%20stroke='%23e0fcff'%20stroke-width='.85'/%3E%20%3Ccircle%20cx='28.5'%20cy='13.8'%20r='1.2'%20fill='%238ff4ff'%20fill-opacity='.45'%20stroke='%23e0fcff'%20stroke-width='.75'/%3E%20%3C/svg%3E") 5 5, pointer;
  --cursor-koi-active: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%3E%20%3Cg%20transform='translate(15%2015)%20rotate(45)'%3E%20%3Cpath%20d='M-2,-3.5%20C-1,-8.5%203.5,-9.5%205.5,-7%20C3.5,-5.5%201.5,-4%200.5,-3%20Z'%20fill='%23bff6ff'%20fill-opacity='.92'%20stroke='%23032136'%20stroke-width='.9'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M-2,3.5%20C-1,8.5%203.5,9.5%205.5,7%20C3.5,5.5%201.5,4%200.5,3%20Z'%20fill='%23bff6ff'%20fill-opacity='.92'%20stroke='%23032136'%20stroke-width='.9'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M6.5,-1.5%20C9.5,-4.5%2013,-7.2%2015.2,-5.6%20C13,-2.3%2012,-0.7%2011,0%20C12,0.7%2013,2.3%2015.2,5.6%20C13,7.2%209.5,4.5%206.5,1.5%20Z'%20fill='%23ff7b47'%20stroke='%23032136'%20stroke-width='.9'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M-14.2,0%20C-13.2,-3%20-9.3,-5.1%20-4.5,-4.7%20C0.5,-4.3%204.5,-2.4%207.4,-1.2%20L7.4,1.2%20C4.5,2.4%200.5,4.3%20-4.5,4.7%20C-9.3,5.1%20-13.2,3%20-14.2,0%20Z'%20fill='%23f6fcff'%20stroke='%23032136'%20stroke-width='1.15'%20stroke-linejoin='round'/%3E%20%3Cpath%20d='M-10.3,-1.7%20C-8.4,-3.5%20-5,-3.3%20-4.1,-1.1%20C-3.3,0.8%20-5.6,2.3%20-8.2,1.6%20C-10,1%20-11.2,-0.5%20-10.3,-1.7%20Z'%20fill='%23ff562e'/%3E%20%3Cpath%20d='M-1.5,-2.9%20C1,-3.3%203.7,-1.9%203.9,0%20C3.9,1.5%201.5,2.5%20-0.8,1.7%20C-2.7,1%20-3.1,-2.1%20-1.5,-2.9%20Z'%20fill='%23ff562e'/%3E%20%3Ccircle%20cx='-10.6'%20cy='-2.1'%20r='.9'%20fill='%23042136'/%3E%20%3Ccircle%20cx='-10.6'%20cy='2.1'%20r='.9'%20fill='%23042136'/%3E%20%3C/g%3E%20%3Ccircle%20cx='26.5'%20cy='18.5'%20r='1.9'%20fill='%238ff4ff'%20fill-opacity='.45'%20stroke='%23e0fcff'%20stroke-width='.85'/%3E%20%3Ccircle%20cx='28.5'%20cy='13.8'%20r='1.2'%20fill='%238ff4ff'%20fill-opacity='.45'%20stroke='%23e0fcff'%20stroke-width='.75'/%3E%20%3Ccircle%20cx='5'%20cy='5'%20r='3.6'%20fill='none'%20stroke='%239ef6ff'%20stroke-width='1.2'%20stroke-opacity='.9'/%3E%20%3C/svg%3E") 5 5, pointer;
  --cursor-aqua: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%3E%20%3Cpath%20d='M6,4%20L21,15.5%20L14.2,16.8%20L11.2,23.2%20Z'%20fill='%23c6f8ff'%20stroke='%23032136'%20stroke-width='1.4'%20stroke-linejoin='round'/%3E%20%3Ccircle%20cx='23.5'%20cy='21.5'%20r='2.3'%20fill='%238ff4ff'%20fill-opacity='.45'%20stroke='%23e0fcff'%20stroke-width='.9'/%3E%20%3Ccircle%20cx='26.8'%20cy='16.8'%20r='1.3'%20fill='%238ff4ff'%20fill-opacity='.45'%20stroke='%23e0fcff'%20stroke-width='.8'/%3E%20%3C/svg%3E") 6 4, pointer;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
canvas, button, svg, img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}
body {
  background: var(--water-deep);
  color: var(--aqua-ink);
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: var(--cursor-aqua);
}

:focus-visible {
  outline: 2px solid rgba(220, 248, 255, .85);
  outline-offset: 4px;
  border-radius: 50%;
}

/* ---------- Aquarium ---------- */
.pond {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: var(--cursor-koi);
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background:
    url("images/aquarium-bg.webp") center center / cover no-repeat,
    linear-gradient(180deg, var(--water-top) 0%, var(--water-mid) 52%, var(--water-deep) 100%);
}

.pond:active {
  cursor: var(--cursor-koi-active);
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.layer-shadow {
  filter: blur(8px);
  opacity: .8;
}

/* ---------- Icon-only sound toggle ---------- */
.sound {
  position: fixed;
  left: max(var(--gutter), calc(12px + env(safe-area-inset-left)));
  bottom: max(var(--gutter), calc(12px + env(safe-area-inset-bottom)));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(220, 248, 255, .26);
  background: transparent;
  color: rgba(235, 250, 255, .86);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.sound:hover {
  border-color: rgba(220, 248, 255, .58);
  background: transparent;
  color: #ffffff;
}

.sound:active {
  transform: scale(.94);
  cursor: var(--cursor-aqua);
}

.sound[aria-pressed="true"] {
  border-color: rgba(155, 240, 255, .78);
  background: transparent;
  color: #ffffff;
}

.sound svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 4px rgba(0, 14, 26, .58));
}

.sound .icon-on { display: none; }
.sound[aria-pressed="true"] .icon-off { display: none; }
.sound[aria-pressed="true"] .icon-on { display: block; }

@media (max-width: 640px) {
  .layer-shadow { filter: blur(5px); }
}

@media (pointer: coarse) {
  .sound { width: 48px; height: 48px; }
  .sound svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .sound { transition-duration: .01s; }
}
