:root {
  --black: #06100f;
  --ink: #0a1817;
  --mat: #0d2422;
  --teal: #14d9c5;
  --teal-soft: #6ef5e8;
  --yellow: #f7c948;
  --chrome: #c8d2d8;
  --line: rgba(110, 245, 232, 0.28);
  --glass: rgba(6, 16, 15, 0.74);
  --shadow: rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: #e8fffb;
  background: var(--black);
  font-family: "Nunito", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

#stage,
#canvas-wrap {
  position: fixed;
  inset: 0;
}

#canvas-wrap {
  z-index: 1;
}

#canvas-wrap canvas {
  display: block;
}

.css3d-layer {
  z-index: 2;
}

.tv-feed {
  width: 930px;
  height: 528px;
  overflow: hidden;
  border-radius: 8px;
  border: 14px solid #050807;
  background: #020403;
  box-shadow: inset 0 0 80px rgba(20, 217, 197, 0.3);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.tv-feed.on {
  opacity: 1;
}

.tv-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #020403;
}

.radio-audio-player {
  position: fixed;
  left: -20px;
  bottom: -20px;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.tv-feed-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  color: var(--teal-soft);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 8px),
    linear-gradient(135deg, rgba(20, 217, 197, 0.16), rgba(247, 201, 72, 0.12)),
    #06100f;
  font-family: "Bungee", sans-serif;
  text-align: center;
  text-transform: uppercase;
}

.tv-feed-inner strong {
  font-size: 56px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(20, 217, 197, 0.85);
}

.tv-feed-inner span {
  color: var(--yellow);
  font-size: 32px;
}

.tv-feed-inner p {
  max-width: 760px;
  margin: 0;
  color: #d9fffa;
  font-family: "Nunito", sans-serif;
  font-size: 34px;
  font-weight: 1000;
  line-height: 1.08;
  text-shadow: 0 0 18px rgba(20, 217, 197, 0.45);
}

.tv-feed-inner i {
  width: 220px;
  height: 12px;
  background: var(--teal);
  box-shadow: 0 0 22px rgba(20, 217, 197, 0.9);
  animation: tv-scan 1.8s ease-in-out infinite;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background:
    linear-gradient(rgba(6, 16, 15, 0.9), rgba(6, 16, 15, 0.94)),
    repeating-linear-gradient(90deg, rgba(20, 217, 197, 0.09) 0 1px, transparent 1px 80px);
  transition: opacity 0.7s ease;
}

.scene-only .intro {
  display: none !important;
}

.scene-only .control-panel {
  opacity: 1 !important;
  transform: translateY(-50%) !important;
}

.intro img {
  width: min(220px, 44vw);
  height: auto;
  filter: drop-shadow(0 22px 40px rgba(20, 217, 197, 0.35));
  animation: mascot-bounce 2.8s ease-in-out infinite;
}

.intro h1 {
  margin: 0;
  font-family: "Bungee", sans-serif;
  font-size: clamp(2.5rem, 9vw, 7rem);
  line-height: 0.92;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 0 28px rgba(20, 217, 197, 0.45), 0 8px 0 rgba(0, 0, 0, 0.55);
}

.intro p {
  margin: 0;
  color: var(--yellow);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.loadbar {
  width: min(320px, 72vw);
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

#loadbar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--yellow));
  transition: width 0.2s ease;
}

.ticker {
  position: fixed;
  left: 0;
  width: 100%;
  height: 34px;
  z-index: 20;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-color: var(--line);
  background: rgba(3, 10, 9, 0.9);
  backdrop-filter: blur(12px);
}

.ticker-top {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.ticker-bottom {
  bottom: 0;
  border-top: 1px solid var(--line);
}

.ticker-track {
  display: flex;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
  animation: ticker 28s linear infinite;
  will-change: transform;
}

.ticker-segment {
  display: flex;
  flex: 0 0 auto;
}

.ticker-reverse {
  animation-name: ticker-reverse;
}

.ticker span {
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  color: var(--teal-soft);
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.control-panel {
  position: fixed;
  z-index: 15;
  top: 50%;
  right: clamp(18px, 2.6vw, 42px);
  width: min(286px, calc(100vw - 36px));
  transform: translateY(-50%);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(5, 15, 14, 0.9);
  box-shadow: 0 28px 70px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.panel-kicker {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.control-panel h2,
.mobile-menu h2 {
  margin: 6px 0 16px;
  font-family: "Nunito", sans-serif;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.05;
  color: #f1fffd;
}

.status-grid {
  display: grid;
  gap: 8px;
}

.status-grid div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid rgba(200, 210, 216, 0.13);
}

.status-grid span {
  color: rgba(232, 255, 251, 0.72);
}

.status-grid strong {
  color: var(--teal-soft);
}

.status-grid strong.is-off {
  color: #ef4444;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.button-grid button,
.mobile-actions button,
.mobile-menu button,
.ca-box button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid rgba(200, 210, 216, 0.2);
  color: #ecfffb;
  background: rgba(200, 210, 216, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.button-grid button:hover,
.mobile-actions button:hover,
.ca-box button:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
  background: rgba(20, 217, 197, 0.18);
}

.ca-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(20, 217, 197, 0.26);
  background: rgba(20, 217, 197, 0.08);
}

.ca-box span {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 900;
}

.ca-box code {
  overflow: hidden;
  color: var(--teal-soft);
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-box button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--black);
  background: var(--teal);
  border-color: transparent;
  font-weight: 900;
}

.twitch {
  animation: dojo-twitch 4.2s ease-in-out infinite;
  transform-origin: center;
}

#toggle-radio.twitch,
#mobile-radio.twitch {
  animation-delay: 0s;
}

#toggle-tv.twitch,
#mobile-tv.twitch {
  animation-delay: 2.1s;
}

.link-stack {
  display: grid;
  gap: 10px;
}

.link-stack a,
.mobile-menu a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 6px;
  color: var(--black);
  background: var(--teal);
  text-decoration: none;
  font-weight: 1000;
  text-transform: uppercase;
  box-shadow: 0 12px 24px rgba(20, 217, 197, 0.18);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.link-stack a + a,
.mobile-menu a + a {
  color: #ffffff;
  background: rgba(200, 210, 216, 0.12);
  box-shadow: none;
  border: 1px solid rgba(200, 210, 216, 0.18);
}

.link-stack a:hover,
.mobile-menu a:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.mobile-menu-button {
  display: none;
  position: fixed;
  z-index: 18;
  top: 46px;
  right: 18px;
  width: 46px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(6, 16, 15, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.46), 0 0 18px rgba(20, 217, 197, 0.18);
}

.mobile-menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: #ffffff;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 28px;
  background: rgba(3, 10, 9, 0.96);
  transform: translateX(100%);
  transition: transform 0.34s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

#close-mobile-menu {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 0 16px;
}

.mobile-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mobile-ca {
  margin: 0;
}

@keyframes ticker {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes ticker-reverse {
  from {
    transform: translate3d(-50%, 0, 0);
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes mascot-bounce {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

@keyframes tv-scan {
  0%,
  100% {
    transform: translateX(-150px);
  }

  50% {
    transform: translateX(150px);
  }
}

@keyframes dojo-twitch {
  0%,
  88%,
  100% {
    transform: translate(0, 0) rotate(0);
  }

  90% {
    transform: translate(-1px, 0) rotate(-1deg);
  }

  94% {
    transform: translate(1px, 0) rotate(1deg);
  }

  98% {
    transform: translate(-0.5px, 0) rotate(-0.4deg);
  }
}

@media (max-width: 760px) {
  .control-panel {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
    place-content: center;
    gap: 4px;
  }

  .mobile-menu-button span {
    margin: 0 auto;
  }

}

@media (max-width: 620px) {
  .ticker {
    height: 30px;
  }

  .ticker span {
    padding: 0 12px;
    font-size: 11px;
  }

  .intro p {
    max-width: 280px;
    text-align: center;
  }
}
