:root {
  --hero-gap: 1.5em;
  --glass-background: rgba(255, 255, 255, 0.16);
  --glass-background-hover: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-strong: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 14px 38px rgba(16, 2, 37, 0.32);
}

html, body {
  margin: 0;
  padding: 0;
  font-family: comic sans, sans-serif;
  background: radial-gradient(circle at 18% 20%, rgba(155, 93, 229, 0.8), rgba(26, 5, 52, 0.85) 60%, #120025 100%),
    linear-gradient(135deg, #2f0a57, #150028 55%, #290a4d);
  background-attachment: fixed;
  color: white;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  color: white;
}

.background-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    radial-gradient(circle at 12% 25%, rgba(210, 180, 255, 0.35), transparent 58%),
    radial-gradient(circle at 85% 18%, rgba(134, 87, 210, 0.32), transparent 62%),
    radial-gradient(circle at 78% 74%, rgba(255, 168, 255, 0.25), transparent 60%),
    radial-gradient(circle at 28% 80%, rgba(177, 101, 255, 0.3), transparent 58%);
  filter: saturate(110%);
}

.background-canvas::before,
.background-canvas::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 35% 30%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 60%),
    radial-gradient(ellipse at 75% 65%, rgba(200, 162, 255, 0.35), rgba(255, 255, 255, 0) 68%),
    radial-gradient(ellipse at 50% 85%, rgba(149, 102, 226, 0.28), rgba(149, 102, 226, 0) 70%);
  opacity: 0.5;
  mix-blend-mode: screen;
  animation: nebula-shift 26s linear infinite;
}

.background-canvas::after {
  opacity: 0.35;
  filter: blur(20px);
  animation-direction: reverse;
  animation-duration: 32s;
}

@keyframes nebula-shift {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
  25% {
    transform: translate3d(2%, -4%, 0) scale(1.04);
  }
  50% {
    transform: translate3d(4%, 3%, 0) scale(1.02);
  }
  75% {
    transform: translate3d(-2%, 4%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
}

button,
.link-button,
.side-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 0.65em 1.4em;
  font-weight: 600;
  line-height: 1.2;
  color: #fdf9ff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--glass-background), rgba(255, 255, 255, 0.08));
  border: 1.5px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  text-shadow: 0 1px 3px rgba(16, 2, 37, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease,
    background 0.25s ease;
  cursor: pointer;
}

button:hover,
.link-button:hover,
.side-button:hover,
button:focus-visible,
.link-button:focus-visible,
.side-button:focus-visible {
  background: linear-gradient(135deg, var(--glass-background-hover), rgba(255, 255, 255, 0.18));
  border-color: var(--glass-border-strong);
  box-shadow: 0 18px 44px rgba(16, 2, 37, 0.4);
  transform: translateY(-2px);
}

button:focus-visible,
.link-button:focus-visible,
.side-button:focus-visible {
  outline: 3px solid rgba(230, 210, 255, 0.55);
  outline-offset: 3px;
}

.container {
  position: relative;
  max-width: 800px;
  margin: calc(var(--hero-gap) + 1em) auto 2.5em;
  padding: calc(1.75em + var(--hero-gap) / 2) 2em 2.5em;
  text-align: center;
  z-index: 1;
  background: rgba(32, 6, 63, 0.48);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(16, 2, 37, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(230, 210, 255, 0.25);
}

.background-controls {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 1.5em;
}

.next-background-button {
  padding: 0.55em 1.8em;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.hero-layer__slider {
  position: relative;
  width: min(1500px, 98vw);
  max-height: min(1125px, 95vh);
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(70, 20, 130, 0.32);
  background: linear-gradient(135deg, rgba(54, 18, 92, 0.24), rgba(101, 45, 168, 0.12));
}

.hero-layer__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20px;
  margin: 0;
  opacity: 0;
  transform: translateX(0);
  transition: transform 0.7s ease, opacity 0.7s ease;
}

.hero-layer__image--current {
  opacity: 1;
}

.hero-layer__image--incoming {
  transform: translateX(100%);
}

.hero-layer__image--slide-in {
  transform: translateX(0);
  opacity: 1;
}

.hero-layer__image--slide-out {
  transform: translateX(-100%);
  opacity: 0;
}

.textbox {
  background-color: rgba(255,255,255,0.1);
  border: 2px solid white;
  border-radius: 15px;
  padding: 1em;
  margin: 1em 0;
}

img {
  max-width: 100%;
  max-height: 60vh;
  height: auto;
  border-radius: 10px;
  margin: 1em 0;
}

.bear-cookie-button {
  background: none;
  border: none;
  padding: 0;
  margin: 1.5em auto;
  display: inline-block;
  cursor: pointer;
  position: relative;
  max-width: min(420px, 100%);
}

.bear-cookie-button:focus-visible {
  outline: 3px solid #dabfff;
  outline-offset: 4px;
  border-radius: 15px;
}

.bear-cookie-button img {
  margin: 0;
  display: block;
  width: 100%;
  border-radius: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bear-cookie-button:hover img,
.bear-cookie-button:focus-visible img {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.link-button,
#bark-test {
  margin: 0.5em;
  padding: 0.55em 1.6em;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.side-button {
  flex-direction: column;
  min-height: 118px;
  width: 30px;
  padding: 0.45em 0.28em;
  font-size: 0.75em;
  letter-spacing: 0.18em;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(16, 2, 37, 0.38);
}

.side-button--right {
  border-radius: 18px 0 0 18px;
}

#right-side-buttons {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  z-index: 1000;
}

.side-button--left {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  border-radius: 0 18px 18px 0;
  z-index: 1000;
}

.side-button--left:hover,
.side-button--left:focus-visible {
  transform: translateY(-50%) translateX(10px);
}
#paw-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: clamp(300px, 70vw, 500px);
  padding: 2em;
  background: linear-gradient(135deg, rgba(52, 24, 94, 0.86), rgba(114, 64, 174, 0.65));
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 24px 60px rgba(16, 2, 37, 0.45);
  z-index: 999;
  overflow-y: auto;
  transition: transform 0.3s ease;
  transform: translateX(-100%);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
}

#paw-panel.open { transform: translateX(0); }

#paw-name,
#paw-input {
  width: 100%;
  border-radius: 14px;
  padding: 0.65em 0.8em;
  font-size: 1em;
  margin-bottom: 1em;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(230, 210, 255, 0.05));
  color: #fdf9ff;
  box-shadow: 0 14px 32px rgba(16, 2, 37, 0.3);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
}

#paw-name::placeholder,
#paw-input::placeholder {
  color: rgba(247, 239, 255, 0.7);
}

#paw-input {
  height: 60px;
  resize: none;
}

#paw-submit {
  border-radius: 14px;
  padding: 0.6em 1.4em;
  font-weight: 700;
  letter-spacing: 0.05em;
}

#paw-feedback {
  margin-top: 0.5em;
  font-style: italic;
}

#cookie-popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(230, 210, 255, 0.08));
  color: #fdf9ff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  padding: 1.4em 2.5em 1.2em;
  z-index: 9999;
  text-align: center;
  box-shadow: 0 18px 42px rgba(16, 2, 37, 0.35);
  width: min(92vw, 360px);
  box-sizing: border-box;
  outline: none;
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}

#cookie-popup:focus-visible {
  outline: 3px solid #dabfff;
  outline-offset: 6px;
}

#cookie-popup.hidden {
  display: none !important;
}

#cookie-popup p {
  margin: 0;
}

#cookie-popup button {
  margin: 0.8em 0.6em 0 0.6em;
  padding: 0.55em 1.6em;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#cookie-popup button:hover,
#cookie-popup button:focus-visible {
  box-shadow: 0 14px 32px rgba(16, 2, 37, 0.38);
}

.cookie-popup__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 1em;
}

.cookie-info-button {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-weight: 900;
  font-size: 1.2em;
  box-shadow: 0 12px 28px rgba(16, 2, 37, 0.35);
}

.cookie-info-button:hover,
.cookie-info-button:focus-visible {
  transform: translateY(-2px) rotate(-6deg);
}

@media (max-width: 480px) {
  #cookie-popup {
    padding: 1.1em 1.4em 1em;
  }

  #cookie-popup button {
    width: 100%;
    margin: 0.6em 0 0 0;
  }

  .cookie-popup__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-info-button {
    top: -10px;
    right: -10px;
  }
}

#cookie-info-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 0, 40, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5em;
}

#cookie-info-modal.open {
  display: flex;
}

.cookie-info-card {
  background: linear-gradient(135deg, rgba(45, 7, 80, 0.78), rgba(110, 40, 170, 0.55));
  color: #fdf9ff;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  padding: 1.5em;
  max-width: min(480px, 90vw);
  box-shadow: 0 24px 50px rgba(16, 2, 37, 0.4);
  text-align: left;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.cookie-info-card h2 {
  margin-top: 0;
  text-align: center;
}

.cookie-info-card p {
  margin: 0.75em 0;
  line-height: 1.4;
}

.cookie-info-card ul {
  padding-left: 1.2em;
  margin: 0.75em 0 1em;
}

.cookie-info-card li {
  margin-bottom: 0.5em;
}

.cookie-info-close {
  display: block;
  margin: 0 auto;
  padding: 0.55em 2em;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#volume-wrapper { margin-top: 1em; }
#volume-icon { font-size: 1.5em; margin-top: 0.5em; }
#volume-control {
  width: 80%;
  margin-top: 0.3em;
  accent-color: #dabfff;
}
#volume-label { font-size: 1em; margin-top: 0.5em; display: block; }

.vertical-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.15em;
  white-space: nowrap;
  transform-origin: center;
}

.vertical-text__inner {
  display: inline-block;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.vertical-text--bottom-to-top {
  transform: rotate(-90deg);
}

.vertical-text--top-to-bottom {
  transform: rotate(90deg);
}

.ocs-gallery {
  display: grid;
  gap: 1.5em;
  margin: 1.5em auto 0;
  justify-items: center;
}

.ocs-gallery__item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  width: 100%;
  max-width: min(var(--hero-canvas-width, 640px), 100%);
  text-align: center;
}

.ocs-gallery__frame {
  width: min(var(--hero-canvas-width, 640px), 100%);
  aspect-ratio: var(--hero-canvas-aspect, 4 / 3);
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(230, 210, 255, 0.5);
  box-shadow: 0 18px 40px rgba(16, 2, 37, 0.35);
  background: linear-gradient(135deg, rgba(54, 18, 92, 0.4), rgba(101, 45, 168, 0.2));
}

.ocs-gallery__image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  display: block;
}

.ocs-gallery__caption {
  margin: 0;
  font-style: italic;
  color: #f5e6ff;
  text-shadow: 0 2px 6px rgba(16, 2, 37, 0.5);
}

body.blur .container,
body.blur #paw-panel,
body.blur .side-button,
body.blur .hero-layer__image {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 600px) {
  :root {
    --hero-gap: 1em;
  }

  .container {
    margin: calc(var(--hero-gap) + 1em) 1em 2em;
    padding: calc(1.4em + var(--hero-gap) / 2) 1.5em 2em;
  }

  .hero-layer__slider {
    width: min(640px, 96vw);
    max-height: min(85vh, 640px);
  }
}
