:root {
  --pond-deep: #06141b;
  --pond-mid: #0d2b33;
  --pond-shallow: #1a4f54;
  --moss: #6fa48a;
  --lily: #f4e6c8;
  --ink: #e8f3ee;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background-color: #ffffff;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--pond-deep);
  font-family: "DotGothic16", ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
}

.stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 1rem;
}

.title {
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: var(--pond-deep);
}

.canvas-frame {
  position: relative;
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 12px 32px rgba(13, 43, 51, 0.12),
    0 0 0 1px rgba(13, 43, 51, 0.06);
  background: #000;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
}

.status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 20, 27, 0.82);
  color: var(--moss);
  font-size: 1rem;
  letter-spacing: 0.08em;
  transition: opacity 0.6s ease;
  text-align: center;
  padding: 1rem;
}

.status.hidden {
  opacity: 0;
  pointer-events: none;
}

.status.error {
  color: #f4a8a8;
}

.selector {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  color: #000;
  z-index: 10;
}

.selector-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.selector-title {
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}

.selector-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.arrow {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.4rem;
  color: inherit;
  padding: 0.25rem 0.5rem;
  transition: opacity 0.15s ease;
}

.arrow:hover {
  opacity: 0.5;
}

.arrow:active {
  opacity: 0.3;
}

.selector-name {
  min-width: 5rem;
  text-align: center;
  font-size: 1.1rem;
}

.shuffle-btn {
  background: none;
  border: none;
  color: var(--pond-deep);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  margin-top: 0.25rem;
  transition: opacity 0.15s ease;
}

.shuffle-btn:hover {
  opacity: 0.6;
}

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

.info-btn {
  position: fixed;
  top: 1.5rem;
  left: 2rem;
  background: none;
  border: none;
  color: var(--pond-deep);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.1em;
  padding: 0.5rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  z-index: 50;
  transition: opacity 0.15s ease;
}

.info-btn:hover {
  opacity: 0.6;
}

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

.tutorial-card {
  background: #ffffff;
  padding: 2.25rem 2.5rem;
  border-radius: 14px;
  max-width: 480px;
  align-items: stretch !important;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.tutorial-title {
  margin: 0 0 1.25rem 0;
  font-family: inherit;
  font-weight: normal;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: var(--pond-deep);
}

.tutorial-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
  line-height: 1.65;
  color: var(--pond-deep);
  counter-reset: tutorial;
}

.tutorial-list li {
  counter-increment: tutorial;
  padding: 0.4rem 0 0.4rem 2rem;
  position: relative;
  border-bottom: 1px solid rgba(13, 43, 51, 0.08);
}

.tutorial-list li:last-child {
  border-bottom: none;
}

.tutorial-list li::before {
  content: counter(tutorial);
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 1.4rem;
  text-align: center;
  font-weight: bold;
  color: var(--moss);
}

.tutorial-close {
  align-self: center;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 2rem;
  background: #ffffff;
  border: 2px solid var(--pond-deep);
  color: var(--pond-deep);
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  transition: opacity 0.15s ease;
}

.tutorial-close:hover {
  opacity: 0.7;
}

.mute-toggle {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 50;
}

.mute-track {
  display: inline-block;
  width: 44px;
  height: 22px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 11px;
  position: relative;
  transition: background 0.18s ease;
}

.mute-toggle[aria-pressed="true"] .mute-track {
  background: var(--pond-mid);
}

.mute-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.18s ease;
}

.mute-toggle[aria-pressed="true"] .mute-knob {
  left: 24px;
}

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

@keyframes lily-glow {
  0%, 100% { filter: drop-shadow(0 4px 8px rgba(111, 164, 138, 0.25)); }
  50%      { filter: drop-shadow(0 6px 16px rgba(111, 164, 138, 0.5)); }
}

.lily-pad-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 96px;
  height: 96px;
  padding: 0;
  margin-top: 1.25rem;
  animation:
    lily-bob 3s ease-in-out infinite,
    lily-glow 4s ease-in-out infinite;
}

.lily-pad-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation-play-state: paused;
}

.lily-pad-inner {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.18s ease;
}

.lily-pad-btn:hover .lily-pad-inner {
  transform: scale(1.08);
}

.lily-pad-btn:active .lily-pad-inner {
  transform: scale(0.94);
}

.lily-pad-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11rem;
  color: #ffffff;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  z-index: 5;
  pointer-events: none;
}

.countdown.hidden {
  display: none;
}

.flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}

.flash.active {
  animation: flash 0.32s ease-out;
}

@keyframes flash {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 20, 27, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-height: 100%;
}

.modal-content img {
  max-height: 80vh;
  max-width: 100%;
  height: auto;
  width: auto;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.4);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions a,
.modal-actions button {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 1.5rem;
  background: #ffffff;
  border: 2px solid var(--pond-deep);
  color: var(--pond-deep);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  transition: opacity 0.15s ease;
}

.modal-actions a:hover,
.modal-actions button:hover {
  opacity: 0.7;
}
