.home-diver {
  position: absolute;
  left: 52%;
  bottom: 5%;
  padding: 12px 17px;
  gap: 8px;
  transform: rotate(2deg);
  z-index: 4;
}
.home-diver > span {
  font-size: 34px;
}
.home-diver b {
  font-size: 18px;
}
.home-diver small {
  display: block;
  font-size: 11px;
  color: #798f72;
}
.diver-game {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.diver-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.diver-toolbar h1 {
  font-size: 23px;
  margin: 0;
  flex: 1;
}
.diver-toolbar small {
  font-size: 12px;
  background: #e9d4a2;
  padding: 5px 10px;
  border-radius: 10px;
  vertical-align: middle;
}
.camera-switch {
  padding: 12px 17px;
  border-radius: 16px;
  background: #fff9e5;
  border: 2px solid #d7cda7;
  color: #466450;
  font-size: 15px;
  font-weight: 700;
}
.diver-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 4px solid #fef5d9;
  border-radius: 32px;
  background: linear-gradient(#61c9db, #288eaf 52%, #146987);
  isolation: isolate;
  box-shadow: 0 5px 0 #c8d3b6;
}
.ocean-rays {
  position: absolute;
  inset: -50% -10%;
  background: repeating-conic-gradient(
    from -12deg at 50% 0,
    transparent 0deg 12deg,
    #e0ffff16 12deg 18deg
  );
  pointer-events: none;
}
.diver-mission {
  position: absolute;
  left: 22px;
  top: 18px;
  color: #fff8d5;
  font-size: 21px;
  font-weight: 800;
}
.diver-mission > div {
  font-size: 29px;
  letter-spacing: 8px;
  color: #ffe397;
  margin-top: 4px;
}
.diver-floor {
  position: absolute;
  bottom: -20px;
  height: 20%;
  width: 120%;
  left: -10%;
  border-radius: 50% 50% 0 0;
  background: #e2d99b;
  border-top: 10px solid #f9e9b7;
}
.ocean-fishes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ocean-fishes span {
  position: absolute;
  font-size: 52px;
  left: 57%;
  top: 17%;
  animation: fish-float 4s ease-in-out infinite;
}
.ocean-fishes span:nth-child(2) {
  left: 77%;
  top: 41%;
  font-size: 42px;
  animation-delay: -2s;
}
.ocean-fishes span:nth-child(3) {
  left: 43%;
  top: 44%;
  font-size: 36px;
  animation-delay: -1s;
}
.diver-reef {
  position: absolute;
  font-size: 120px;
  bottom: 5%;
  left: 1%;
  filter: drop-shadow(0 8px 0 #164a6144);
}
.reef-right {
  left: auto;
  right: 1%;
  font-size: 145px;
}
.diver-traveler {
  position: absolute;
  left: 10%;
  bottom: 12%;
  height: 70%;
  max-height: 340px;
  aspect-ratio: 240/340;
  transition: left 0.4s ease-out;
}
.diver-character {
  height: 100%;
  position: relative;
  animation: diver-float 3.5s ease-in-out infinite;
}
.diver-helmet {
  position: absolute;
  top: 0;
  left: 4%;
  width: 92%;
  aspect-ratio: 1;
  background: #eab85c;
  border: 8px solid #ffe4a1;
  border-radius: 46%;
  box-shadow:
    0 8px 0 #a66b37,
    inset 0 0 0 5px #bf873f;
  z-index: 3;
}
.helmet-window {
  position: absolute;
  inset: 12%;
  border: 6px solid #ac7b42;
  background: #d3f6f2;
  overflow: hidden;
  border-radius: 50%;
}
.helmet-window video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  transform: scaleX(-1);
  display: none;
}
.camera-live .helmet-window video {
  display: block;
}
.diver-cartoon {
  position: absolute;
  inset: 0;
}
.diver-cartoon svg {
  height: 140%;
  width: 140%;
  margin-left: -20%;
  margin-top: -5%;
}
.camera-live .diver-cartoon {
  display: none;
}
.helmet-shine {
  position: absolute;
  left: 24%;
  top: 19%;
  width: 25%;
  height: 8%;
  border-radius: 50%;
  background: #ffffff77;
  transform: rotate(-30deg);
  pointer-events: none;
}
.helmet-light {
  position: absolute;
  top: -9%;
  left: 40%;
  width: 23%;
  height: 19%;
  background: #fff1a3;
  border: 5px solid #c39b4d;
  border-radius: 12px;
  box-shadow: 0 -5px 25px #ffffbbaa;
}
.helmet-bolt {
  position: absolute;
  top: 44%;
  width: 15%;
  height: 19%;
  border-radius: 7px;
  background: #f8dc86;
  border: 4px solid #b98642;
  left: -13%;
}
.bolt-right {
  left: auto;
  right: -13%;
}
.diver-suit {
  position: absolute;
  top: 52%;
  left: 24%;
  width: 53%;
  height: 37%;
  border-radius: 30%;
  border: 6px solid #f6ce81;
  background: #e88e59;
  display: grid;
  place-items: center;
  color: #ffef9f;
  font-size: 35px;
  z-index: 2;
}
.diver-arm {
  position: absolute;
  top: 61%;
  height: 30%;
  width: 20%;
  border-radius: 45%;
  background: #eab75e;
  border: 5px solid #ffdb8a;
  transform-origin: 50% 15%;
}
.arm-left {
  left: 9%;
  transform: rotate(33deg);
}
.arm-right {
  right: 8%;
  transform: rotate(-33deg);
}
.diver-boot {
  position: absolute;
  bottom: 0;
  height: 23%;
  width: 22%;
  border-radius: 15px;
  background: #dfad52;
  border: 5px solid #ffda85;
  transform: rotate(18deg);
}
.boot-left {
  left: 25%;
}
.boot-right {
  right: 24%;
  transform: rotate(-18deg);
}
.diver-friend {
  position: absolute;
  right: 14%;
  bottom: 12%;
  height: 36%;
  width: 14%;
  transform: rotate(-10deg);
}
.diver-friend svg {
  width: 100%;
  height: 100%;
}
.diver-friend > span {
  position: absolute;
  top: -28%;
  right: 0;
  font-size: 40px;
}
.diver-chest {
  position: absolute;
  right: 6%;
  bottom: 10%;
  font-size: 78px;
  opacity: 0.25;
  transition: opacity 0.4s;
}
.diver-goal {
  position: absolute;
  right: 12%;
  top: 9%;
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
  font-size: 18px;
  font-weight: 700;
}
.diver-goal b {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border: 6px solid #fff9d6;
  border-radius: 28px;
  background: #ffe085;
  color: #2f6c7c;
  font-size: 64px;
  box-shadow: 0 7px 0 #d89c4a;
}
.diver-bottom {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 85px;
  flex-shrink: 0;
}
.diver-keycaps {
  display: flex;
  gap: 9px;
}
.diver-keycaps > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #efe9ce;
  border: 3px solid #d7d0b0;
  border-radius: 16px;
  min-width: 83px;
  height: 76px;
  font-size: 30px;
  font-weight: 800;
}
.diver-keycaps small {
  font-size: 11px;
  font-weight: 500;
}
.diver-keycaps .lit {
  border-color: #58aa87;
  background: #cff0d1;
  box-shadow: 0 4px 0 #78a878;
}
.diver-bottom p {
  font-size: 13px;
  line-height: 1.7;
  color: #627d64;
  max-width: 570px;
}
.diver-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.diver-bubbles i {
  position: absolute;
  width: var(--bubble-size);
  height: var(--bubble-size);
  border: 3px solid #c8ffffbb;
  border-radius: 50%;
  box-shadow: inset 3px 3px 0 #ffffff55;
  animation: diver-bubble 1.5s ease-out both;
}
.diver-finish {
  position: absolute;
  inset: 0;
  background: #07394cbf;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffecaa;
  backdrop-filter: blur(3px);
}
.diver-finish[hidden] {
  display: none;
}
.diver-finish > span {
  font-size: 90px;
}
.diver-finish h2 {
  font-size: 35px;
  margin: 5px 0 25px;
}
.diver-finish > div {
  display: flex;
  gap: 16px;
}
.swim-left .arm-left {
  animation: paddle-left 0.4s ease-out;
}
.swim-right .arm-right {
  animation: paddle-right 0.4s ease-out;
}
.swim-up {
  animation: diver-jump 0.5s ease-out !important;
}
.treasure-found .diver-chest {
  opacity: 1 !important;
}
@keyframes fish-float {
  50% {
    transform: translate(-35px, 12px) rotate(-6deg);
  }
}
@keyframes diver-float {
  50% {
    transform: translateY(-10px) rotate(3deg);
  }
}
@keyframes paddle-left {
  50% {
    transform: rotate(115deg);
  }
}
@keyframes paddle-right {
  50% {
    transform: rotate(-115deg);
  }
}
@keyframes diver-jump {
  50% {
    transform: translateY(-40px) rotate(-7deg);
  }
}
@keyframes diver-bubble {
  to {
    transform: translate(var(--drift), -260px);
    opacity: 0;
  }
}
@media (max-width: 800px) {
  .home-diver {
    left: 44%;
    bottom: 21%;
    padding: 8px 10px;
  }
  .home-diver b {
    font-size: 13px;
  }
  .home-diver > span {
    font-size: 25px;
  }
  .home-diver small {
    font-size: 9px;
  }
  .diver-toolbar {
    gap: 8px;
  }
  .diver-toolbar h1 {
    font-size: 16px;
  }
  .diver-toolbar small {
    display: none;
  }
  .camera-switch {
    font-size: 11px;
    padding: 10px;
  }
  .diver-mission {
    font-size: 16px;
    left: 12px;
    top: 12px;
  }
  .diver-goal {
    right: 7%;
    top: 10%;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
  }
  .diver-goal b {
    height: 70px;
    width: 70px;
    font-size: 42px;
  }
  .diver-traveler {
    height: 52%;
    bottom: 17%;
  }
  .diver-chest {
    font-size: 50px;
  }
  .diver-reef {
    font-size: 80px;
  }
  .diver-bottom {
    flex-direction: column;
    gap: 5px;
    min-height: 110px;
  }
  .diver-keycaps > span {
    height: 62px;
    min-width: 75px;
    font-size: 27px;
  }
  .diver-bottom p {
    font-size: 11px;
    margin: 0;
    text-align: center;
  }
  .diver-finish h2 {
    font-size: 26px;
  }
  .diver-finish > div {
    gap: 8px;
  }
  .diver-finish button {
    padding: 10px;
    font-size: 13px;
  }
}
.reduced .diver-character,
.reduced .ocean-fishes span,
.reduced .diver-bubbles i {
  animation: none;
}
.reduced .diver-traveler {
  transition: none;
}

/* Larger head and live face crop for young children. */
.diver-traveler {
  height: 76%;
  max-height: 380px;
  aspect-ratio: 270/380;
}
.diver-helmet {
  width: 104%;
  left: -2%;
  border-width: 7px;
}
.helmet-window {
  inset: 9%;
  border-width: 5px;
}
.helmet-window video,
.camera-live .helmet-window video {
  display: none;
}
.helmet-window canvas {
  display: none;
  width: 100%;
  height: 100%;
}
.camera-live .helmet-window canvas {
  display: block;
}
.diver-suit {
  top: 60%;
  height: 28%;
}
.diver-arm {
  top: 67%;
  height: 24%;
}
.face-size-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}
.face-size-controls button {
  height: 38px;
  width: 38px;
  background: #e4efd2;
  border: 2px solid #b8c9a5;
  border-radius: 12px;
  font-size: 24px;
}
.face-size-controls span {
  font-size: 23px;
}
.diver-bottom {
  gap: 14px;
}
.diver-bottom p {
  max-width: 470px;
}
@media (max-width: 800px) {
  .diver-traveler {
    height: 58%;
    bottom: 13%;
  }
  .face-size-controls {
    position: absolute;
    right: 25px;
    bottom: 145px;
    z-index: 5;
  }
  .face-size-controls button {
    height: 32px;
    width: 32px;
  }
  .face-size-controls span {
    display: none;
  }
}
