:root {
  --ink: #173126;
  --muted: #4d6d63;
  --cream: #fff8db;
  --pond: #5ed3c6;
  --pond-dark: #167f83;
  --leaf: #66b84f;
  --leaf-dark: #317b3e;
  --sun: #ffd45c;
  --coral: #ff7d68;
  --white: #fffdf1;
  --shadow: 0 24px 80px rgba(20, 74, 72, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef8e5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 212, 92, 0.42), transparent 18rem),
    linear-gradient(135deg, #fff8db 0%, #c8f0dc 46%, #8fd8dd 100%);
}

body.has-fallback-fullscreen {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.pond-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(360px, 1.35fr);
  gap: 28px;
  min-height: calc(100vh - 160px);
  align-items: center;
}

.water-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.46), transparent 9rem),
    linear-gradient(158deg, rgba(255, 253, 241, 0.72), rgba(94, 211, 198, 0.46));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), var(--shadow);
}

.water-stage::before,
.water-stage::after {
  position: absolute;
  right: -9%;
  left: -9%;
  height: 170px;
  content: "";
  background:
    radial-gradient(ellipse at 12% 50%, rgba(255, 255, 255, 0.45) 0 12%, transparent 13%),
    radial-gradient(ellipse at 42% 48%, rgba(255, 255, 255, 0.34) 0 10%, transparent 11%),
    radial-gradient(ellipse at 78% 52%, rgba(255, 255, 255, 0.38) 0 12%, transparent 13%);
  opacity: 0.62;
  animation: drift 13s ease-in-out infinite alternate;
}

.water-stage::before {
  bottom: 8%;
}

.water-stage::after {
  bottom: 21%;
  animation-duration: 17s;
  animation-direction: alternate-reverse;
}

.title-block,
.stream-panel {
  position: relative;
  z-index: 1;
}

.title-block {
  padding: 56px 0 48px 46px;
}

.eyebrow {
  width: max-content;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 8px 12px;
  color: #26543e;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.62);
  border: 2px solid rgba(49, 123, 62, 0.24);
  border-radius: 999px;
}

h1 {
  max-width: 7ch;
  margin: 0;
  color: #123d34;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 7.2rem;
  line-height: 0.84;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.8);
}

.intro {
  max-width: 34rem;
  margin: 24px 0 0;
  color: #294c3f;
  font-size: 1.2rem;
  line-height: 1.55;
  background: rgba(255, 253, 241, 0.62);
  border-left: 6px solid var(--coral);
  padding: 16px 18px;
  border-radius: 0 18px 18px 0;
}

.mascot-art {
  display: block;
  width: min(430px, 88%);
  aspect-ratio: 16 / 9;
  margin: 22px 0 0;
  object-fit: cover;
  object-position: center;
  border: 8px solid rgba(255, 253, 241, 0.9);
  border-radius: 22px;
  box-shadow: 0 22px 54px rgba(17, 64, 61, 0.2);
  transform: rotate(-2deg);
}

.stream-panel {
  margin: 38px 38px 38px 0;
}

.stream-topline {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.viewer-card {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 132px;
  padding: 12px 16px;
  color: #173126;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  background: rgba(255, 253, 241, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(17, 64, 61, 0.13);
}

.viewer-card::before {
  width: 12px;
  height: 12px;
  content: "";
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 125, 104, 0.22);
}

#viewerCount {
  min-width: 1.2ch;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.viewer-card span:last-child {
  font-size: 0.9rem;
  font-weight: 800;
}

.stream-frame {
  position: relative;
  display: grid;
  min-height: 360px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent),
    #2c9ca0;
  border: 12px solid rgba(255, 253, 241, 0.92);
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(17, 64, 61, 0.28);
}

.stream-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  aspect-ratio: auto;
  background: #082f32;
  border: 0;
  border-radius: 0;
}

.stream-frame.is-fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  aspect-ratio: auto;
  background: #082f32;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.stream-frame:fullscreen .stream-image,
.stream-frame:fullscreen .offline-card,
.stream-frame.is-fallback-fullscreen .stream-image,
.stream-frame.is-fallback-fullscreen .offline-card {
  object-fit: contain;
}

@supports not (height: 100dvh) {
  .stream-frame.is-fallback-fullscreen {
    height: 100vh;
    min-height: 100vh;
  }
}

.stream-frame::before {
  position: absolute;
  inset: 10px;
  z-index: 2;
  pointer-events: none;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px;
}

.stream-image,
.offline-card {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.stream-image {
  display: block;
  object-fit: cover;
  background: #2c9ca0;
}

.fullscreen-button {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #123d34;
  cursor: pointer;
  background: rgba(255, 253, 241, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  box-shadow: 0 9px 24px rgba(17, 64, 61, 0.24);
  transition: transform 160ms ease, background 160ms ease;
}

.fullscreen-button:hover {
  transform: translateY(-2px) scale(1.04);
  background: var(--sun);
}

.fullscreen-button svg {
  width: 25px;
  height: 25px;
}

.fullscreen-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.offline-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.3), transparent 9rem),
    linear-gradient(160deg, #91dfd5, #e7f8b7);
}

.offline-card[hidden],
.stream-image[hidden] {
  display: none;
}

.offline-card h2 {
  max-width: 17rem;
  margin: 0;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 2.35rem;
  line-height: 1;
  letter-spacing: 0;
}

.offline-card p {
  max-width: 27rem;
  margin: 0;
  color: #315d50;
  font-size: 1.02rem;
  line-height: 1.5;
}

.stream-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  color: #24463a;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  background: rgba(255, 253, 241, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(17, 64, 61, 0.13);
}

.status-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.75);
}

.status-online {
  background: #39b85a;
}

.status-offline {
  background: var(--coral);
}

.status-checking {
  background: var(--sun);
  animation: pulse 1.2s ease-in-out infinite;
}

#statusText {
  min-width: 0;
  flex: 1;
}

#refreshButton {
  min-height: 42px;
  padding: 0 16px;
  color: #123d34;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 900;
  cursor: pointer;
  background: var(--sun);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 5px 0 #d99a2f;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

#refreshButton[hidden] {
  display: none;
}

#refreshButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #d99a2f;
}

#refreshButton:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d99a2f;
}

.sun {
  position: absolute;
  top: 34px;
  right: 42px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 16px rgba(255, 212, 92, 0.2);
}

.lily {
  position: absolute;
  width: 112px;
  height: 58px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(135deg, var(--leaf), var(--leaf-dark));
  box-shadow: inset 14px 8px 0 rgba(255, 255, 255, 0.18);
}

.lily::after {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 42px;
  height: 13px;
  content: "";
  background: rgba(255, 248, 219, 0.65);
  border-radius: 999px;
  transform: rotate(-20deg);
}

.lily-a {
  right: 8%;
  bottom: 7%;
  transform: rotate(-8deg);
}

.lily-b {
  left: 27%;
  bottom: 18%;
  width: 82px;
  height: 43px;
  transform: rotate(18deg);
}

.tadpole {
  position: absolute;
  width: 54px;
  height: 30px;
  border-radius: 55% 45% 45% 55%;
  background: #1f574b;
  box-shadow: inset 10px 6px 0 rgba(255, 255, 255, 0.16);
  animation: swim 8s ease-in-out infinite;
}

.tadpole span {
  position: absolute;
  top: 10px;
  left: -26px;
  width: 34px;
  height: 10px;
  content: "";
  background: #1f574b;
  border-radius: 80% 20% 80% 20%;
  transform-origin: right center;
  animation: tail 0.55s ease-in-out infinite alternate;
}

.tadpole-a {
  right: 39%;
  top: 18%;
}

.tadpole-b {
  right: 13%;
  bottom: 32%;
  scale: 0.78;
  animation-duration: 10s;
  animation-delay: -3s;
}

.bubble {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  animation: bob 5s ease-in-out infinite;
}

.bubble-a {
  left: 43%;
  top: 22%;
  width: 22px;
  height: 22px;
}

.bubble-b {
  right: 29%;
  bottom: 24%;
  width: 16px;
  height: 16px;
  animation-delay: -1.8s;
}

.bubble-c {
  left: 14%;
  bottom: 33%;
  width: 30px;
  height: 30px;
  animation-delay: -3s;
}

.reed {
  position: absolute;
  bottom: -20px;
  width: 16px;
  height: 180px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #317b3e, #8bcf57);
  transform-origin: bottom center;
}

.reed::before,
.reed::after {
  position: absolute;
  width: 75px;
  height: 18px;
  content: "";
  background: #66b84f;
  border-radius: 100% 0 100% 0;
}

.reed::before {
  top: 46px;
  left: -65px;
  transform: rotate(-35deg);
}

.reed::after {
  top: 84px;
  left: 8px;
  transform: rotate(30deg);
}

.reed-a {
  left: 28px;
  transform: rotate(-6deg);
}

.reed-b {
  right: 23px;
  height: 140px;
  transform: rotate(9deg);
}

.frog-face {
  position: absolute;
  left: 44px;
  bottom: 28px;
  width: 130px;
  height: 88px;
  border-radius: 54% 54% 46% 46%;
  background: linear-gradient(180deg, #72c94f, #3f9845);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.07);
}

.frog-face::before,
.frog-face::after {
  position: absolute;
  top: -18px;
  width: 42px;
  height: 42px;
  content: "";
  background:
    radial-gradient(circle at 50% 52%, #173126 0 5px, transparent 6px),
    #fffdf1;
  border: 8px solid #72c94f;
  border-radius: 50%;
}

.frog-face::before {
  left: 12px;
}

.frog-face::after {
  right: 12px;
}

.frog-face i,
.frog-face b {
  position: absolute;
  display: block;
}

.frog-face i {
  left: 50%;
  bottom: 22px;
  width: 42px;
  height: 18px;
  border-bottom: 4px solid #173126;
  border-radius: 0 0 42px 42px;
  transform: translateX(-50%);
}

.frog-face b {
  top: 42px;
  left: 50%;
  width: 7px;
  height: 7px;
  background: #173126;
  border-radius: 50%;
  box-shadow: 18px 0 0 #173126;
  transform: translateX(-15px);
}

.offline-frog {
  position: relative;
  width: 132px;
  height: 94px;
  border-radius: 50% 50% 44% 44%;
  background: linear-gradient(180deg, #83d85d, #4ca145);
}

.offline-frog .eye {
  position: absolute;
  top: -16px;
  width: 40px;
  height: 40px;
  background:
    radial-gradient(circle at 50% 58%, #173126 0 5px, transparent 6px),
    var(--white);
  border: 7px solid #83d85d;
  border-radius: 50%;
}

.offline-frog .left {
  left: 18px;
}

.offline-frog .right {
  right: 18px;
}

.offline-frog .mouth {
  position: absolute;
  bottom: 26px;
  left: 50%;
  width: 48px;
  height: 18px;
  border-bottom: 4px solid #173126;
  border-radius: 0 0 48px 48px;
  transform: translateX(-50%);
}

@keyframes swim {
  0%,
  100% {
    transform: translate(0, 0) rotate(8deg);
  }

  50% {
    transform: translate(-54px, 22px) rotate(-7deg);
  }
}

@keyframes tail {
  from {
    transform: rotate(-16deg);
  }

  to {
    transform: rotate(16deg);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  50% {
    transform: translateY(-22px);
    opacity: 0.9;
  }
}

@keyframes drift {
  from {
    transform: translateX(-30px);
  }

  to {
    transform: translateX(30px);
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.22);
  }
}

@media (max-width: 860px) {
  .pond-shell {
    width: min(100% - 20px, 620px);
    padding: 10px 0 24px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
  }

  .water-stage {
    border-radius: 20px;
  }

  .title-block {
    padding: 34px 18px 4px;
  }

  h1 {
    max-width: 8ch;
    font-size: 4.15rem;
  }

  .intro {
    margin-top: 18px;
    font-size: 1.04rem;
  }

  .mascot-art {
    width: min(340px, 88%);
    margin-top: 16px;
  }

  .stream-panel {
    margin: 8px 12px 22px;
  }

  .stream-frame {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-width: 8px;
    border-radius: 16px;
  }

  .stream-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #refreshButton {
    width: 100%;
  }

  .sun {
    top: 18px;
    right: 18px;
    width: 68px;
    height: 68px;
  }

  .frog-face {
    display: none;
  }

  .lily-a {
    right: -16px;
    bottom: 33%;
  }

  .lily-b,
  .reed-b {
    display: none;
  }
}

@media (max-width: 560px) {
  .pond-shell {
    width: min(100% - 12px, 420px);
    padding-top: 6px;
  }

  .water-stage {
    border-radius: 16px;
  }

  .title-block {
    padding: 28px 12px 0;
  }

  .eyebrow {
    margin-bottom: 10px;
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  h1 {
    font-size: 3.35rem;
    line-height: 0.88;
  }

  .intro {
    margin-top: 14px;
    padding: 12px 13px;
    font-size: 0.98rem;
    line-height: 1.42;
    border-left-width: 5px;
  }

  .mascot-art {
    width: min(280px, 92%);
    max-height: 150px;
    border-width: 6px;
    border-radius: 16px;
    transform: none;
  }

  .stream-panel {
    margin: 10px 8px 18px;
  }

  .stream-topline {
    justify-content: flex-start;
    margin-bottom: 8px;
  }

  .viewer-card {
    min-width: 0;
    padding: 9px 12px;
    border-radius: 13px;
  }

  #viewerCount {
    font-size: 1.2rem;
  }

  .stream-frame {
    aspect-ratio: 4 / 3;
    border-width: 6px;
    border-radius: 14px;
  }

  .stream-frame::before {
    inset: 6px;
    border-radius: 9px;
  }

  .fullscreen-button {
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
  }

  .stream-bar {
    gap: 10px;
    margin-top: 10px;
    padding: 10px 11px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .offline-card {
    gap: 9px;
    padding: 18px;
  }

  .offline-frog {
    width: 92px;
    height: 66px;
  }

  .offline-frog .eye {
    top: -12px;
    width: 31px;
    height: 31px;
    border-width: 5px;
  }

  .offline-frog .left {
    left: 12px;
  }

  .offline-frog .right {
    right: 12px;
  }

  .offline-frog .mouth {
    bottom: 17px;
    width: 34px;
    height: 13px;
  }

  .offline-card h2 {
    max-width: 14rem;
    font-size: 1.55rem;
  }

  .offline-card p {
    font-size: 0.9rem;
    line-height: 1.38;
  }

  .sun {
    width: 54px;
    height: 54px;
    box-shadow: 0 0 0 10px rgba(255, 212, 92, 0.18);
  }

  .tadpole-a {
    right: 24%;
    top: 22%;
  }

  .tadpole-b,
  .bubble-c {
    display: none;
  }
}

@media (min-width: 861px) and (max-width: 1080px) {
  h1 {
    font-size: 5.8rem;
  }

  .title-block {
    padding-left: 34px;
  }

  .stream-panel {
    margin-right: 28px;
  }
}
