:root {
  --paper: #f7f2df;
  --lilac: #c783ff;
  --sky: #62c7ff;
  --mint: #d9ffcf;
  --ink: #f5f5f1;
  --dim: #a8a8a2;
  --black: #080808;
  --panel: #121212;
  --chip: #242424;
  --line: rgba(255, 255, 255, 0.12);
  --codex-blue: #294cff;
  --codex-violet: #805dff;
  --codex-light: #f5f7ff;
  --green: #78c44d;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, var(--paper), transparent 26rem),
    radial-gradient(circle at 45% 10%, var(--mint), transparent 20rem),
    radial-gradient(circle at 82% 22%, #f0c6ff, transparent 26rem),
    radial-gradient(circle at 73% 93%, var(--sky), transparent 24rem),
    radial-gradient(circle at 15% 85%, var(--lilac), transparent 22rem),
    #0a0a0a;
  background-size: 130% 130%;
  animation: ambientShift 12s ease-in-out infinite alternate;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255, 255, 255, 0.18) 45%, transparent 56%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2), transparent 20rem);
  mix-blend-mode: screen;
  opacity: 0.52;
  animation: glowSweep 9s ease-in-out infinite alternate;
}

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vh, 18px) clamp(14px, 4vw, 42px);
}

.youtube-shell {
  width: min(1180px, 88vw);
  max-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr) auto;
  border-radius: 22px;
  background: var(--black);
  box-shadow: 0 30px 82px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.topbar {
  min-height: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.hamburger {
  display: grid;
  gap: 5px;
  width: 24px;
}

.hamburger span {
  height: 3px;
  border-radius: 10px;
  background: #d8d8d8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  margin-left: 28px;
  font-size: 1.08rem;
  font-weight: 800;
}

.play-dot {
  width: 26px;
  height: 19px;
  display: inline-block;
  border-radius: 6px;
  background: #ff0033;
  position: relative;
}

.play-dot::after {
  position: absolute;
  top: 5px;
  left: 10px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid white;
  content: "";
}

.mic {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background:
    linear-gradient(#dcdcdc, #dcdcdc) center 13px / 8px 18px no-repeat,
    linear-gradient(#dcdcdc, #dcdcdc) center 31px / 20px 3px no-repeat,
    #282828;
}

.stage {
  position: relative;
  height: min(61vh, 590px);
  min-height: 390px;
  margin: 0 16px;
  border-radius: 4px;
  background: #141414;
  overflow: hidden;
}

.stage::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image: radial-gradient(circle, rgba(240, 240, 232, 0.76) 1.25px, transparent 1.45px);
  background-size: 8px 8px;
  opacity: 0.86;
  mask-image:
    linear-gradient(#000 0 0),
    radial-gradient(circle at 50% 53%, transparent 0 10rem, #000 10.2rem);
  animation: shimmer 2.4s steps(2, end) infinite, dotDrift 5.6s linear infinite;
}

.stage::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 4px, 4px 100%;
  mix-blend-mode: screen;
  opacity: 0.44;
  animation: scanlines 3.8s linear infinite, screenGlow 6s ease-in-out infinite;
}

.dot-scene > * {
  position: absolute;
  z-index: 1;
  opacity: 0.9;
  animation: pixelBreathe 4.8s steps(3, end) infinite;
}

.dot-scene > *:nth-child(2n) {
  animation-delay: -1.6s;
}

.dot-scene > *:nth-child(3n) {
  animation-delay: -3.1s;
}

.dot-frame,
.dot-plant,
.dot-lamp,
.dot-radio {
  background-image: radial-gradient(circle, rgba(245, 245, 241, 0.86) 1.1px, transparent 1.3px);
  background-size: 7px 7px;
}

.frame-left {
  top: 9%;
  left: 4%;
  width: 15%;
  height: 18%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, 13% 13%, 13% 87%, 87% 87%, 87% 13%, 13% 13%);
  animation: pixelBreathe 4.8s steps(3, end) infinite, frameJitter 3.2s steps(2, end) infinite;
}

.frame-center {
  top: 8%;
  left: 25%;
  width: 32%;
  height: 33%;
  clip-path: polygon(0 0, 43% 0, 43% 75%, 50% 75%, 50% 0, 100% 0, 100% 100%, 0 100%);
  animation: pixelBreathe 4.2s steps(3, end) infinite, frameSlide 7s steps(5, end) infinite;
}

.frame-right {
  top: 9%;
  right: 5%;
  width: 23%;
  height: 34%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, 18% 14%, 18% 78%, 82% 78%, 82% 14%, 18% 14%);
  animation: pixelBreathe 5.4s steps(3, end) infinite, frameJitter 3.6s steps(2, end) infinite reverse;
}

.shelf-a {
  left: 4%;
  bottom: 10%;
  width: 24%;
  height: 30%;
  clip-path: polygon(0 0, 86% 0, 86% 13%, 14% 13%, 14% 80%, 100% 80%, 100% 100%, 0 100%);
  animation: pixelBreathe 4.8s steps(3, end) infinite, shelfMarch 2.8s steps(3, end) infinite;
}

.shelf-b {
  right: 6%;
  bottom: 13%;
  width: 25%;
  height: 30%;
  clip-path: polygon(0 0, 100% 0, 100% 14%, 0 14%, 0 0, 4% 22%, 96% 22%, 96% 100%, 4% 100%, 4% 22%);
  animation: pixelBreathe 4.8s steps(3, end) infinite, shelfMarch 3.1s steps(3, end) infinite reverse;
}

.desk-left {
  left: 2%;
  bottom: 29%;
  width: 20%;
  height: 6%;
  animation: deskBlink 1.6s steps(2, end) infinite;
}

.desk-right {
  right: 13%;
  bottom: 37%;
  width: 15%;
  height: 10%;
  clip-path: ellipse(50% 42% at 50% 50%);
  animation: steamPulse 2.2s steps(4, end) infinite;
}

.dot-plant {
  top: 27%;
  right: 28%;
  width: 17%;
  height: 31%;
  clip-path: polygon(0 6%, 42% 6%, 42% 0, 100% 0, 100% 14%, 80% 14%, 80% 100%, 14% 100%, 14% 14%, 0 14%);
  animation: plantSway 2.4s steps(3, end) infinite;
}

.dot-lamp {
  left: 68%;
  bottom: 30%;
  width: 11%;
  height: 24%;
  clip-path: polygon(38% 0, 62% 0, 62% 62%, 88% 62%, 88% 76%, 12% 76%, 12% 62%, 38% 62%);
  animation: lampFlicker 1.4s steps(2, end) infinite;
}

.dot-radio {
  left: 3%;
  top: 62%;
  width: 20%;
  height: 9%;
  animation: radioBars 0.8s steps(2, end) infinite;
}

.dot-radio::before,
.dot-radio::after,
.desk-left::before,
.desk-left::after {
  position: absolute;
  content: "";
  background-image: radial-gradient(circle, rgba(245, 245, 241, 0.94) 1.1px, transparent 1.3px);
  background-size: 7px 7px;
}

.dot-radio::before {
  left: 72%;
  top: -90%;
  width: 12%;
  height: 84%;
  animation: radioWave 0.8s steps(2, end) infinite;
}

.dot-radio::after {
  left: 86%;
  top: -128%;
  width: 12%;
  height: 118%;
  animation: radioWave 0.8s steps(2, end) infinite reverse;
}

.desk-left::before {
  left: 16%;
  top: -185%;
  width: 16%;
  height: 150%;
  animation: monitorType 1s steps(2, end) infinite;
}

.desk-left::after {
  left: 38%;
  top: -125%;
  width: 28%;
  height: 90%;
  animation: monitorType 1.25s steps(2, end) infinite reverse;
}

.codex-character {
  position: absolute;
  left: 52%;
  top: 48%;
  z-index: 3;
  width: 240px;
  height: 258px;
  transform: translate(-50%, -50%) scale(0.52);
  transform-origin: center;
  image-rendering: pixelated;
  animation: bounceAround 18s linear infinite;
}

.focus-timer {
  position: absolute;
  left: 34px;
  top: 24px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(245, 247, 255, 0.14);
  min-width: 64px;
  justify-content: center;
  padding: 8px 11px;
  background: rgba(8, 8, 8, 0.68);
  color: #f5f7ff;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.68rem, 1.15vw, 0.88rem);
  box-shadow: inset 0 -2px 0 rgba(41, 76, 255, 0.22);
}

.focus-timer b {
  color: #8fa0ff;
  font-size: 0.68em;
  text-transform: uppercase;
}

.codex-character > * {
  animation-play-state: inherit;
}

.bot-shadow {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 210px;
  height: 24px;
  transform: translateX(-50%);
  background-image: radial-gradient(circle, rgba(245, 245, 241, 0.55) 1.1px, transparent 1.3px);
  background-size: 7px 7px;
  opacity: 0.64;
  animation: shadowPulse 1.15s steps(2, end) infinite;
}

.codex-cloud {
  position: absolute;
  top: 0;
  left: 50%;
  width: 172px;
  height: 128px;
  transform: translateX(-50%);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(180deg, var(--codex-violet), var(--codex-blue));
  box-shadow:
    0 0 0 12px rgba(245, 247, 255, 0.92),
    0 18px 36px rgba(41, 76, 255, 0.34);
  animation: cloudPulse 2.6s steps(3, end) infinite;
}

.cloud-lobe {
  position: absolute;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(180deg, var(--codex-violet), var(--codex-blue));
}

.lobe-a {
  left: -20px;
  top: 36px;
  width: 58px;
  height: 58px;
}

.lobe-b {
  left: 28px;
  top: -24px;
  width: 70px;
  height: 70px;
}

.lobe-c {
  right: -22px;
  top: 28px;
  width: 64px;
  height: 64px;
}

.lobe-d {
  left: 44px;
  bottom: -22px;
  width: 78px;
  height: 50px;
}

.terminal-mark {
  position: absolute;
  z-index: 2;
  color: var(--codex-light);
  font-family: "JetBrains Mono", monospace;
}

.cloud-lobe {
  animation: cloudPulse 2.6s steps(3, end) infinite;
}

.prompt {
  left: 42px;
  top: 37px;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.cursor-line {
  right: 36px;
  top: 70px;
  width: 54px;
  height: 13px;
  background: var(--codex-light);
  animation: blink 1.2s steps(2, jump-none) infinite;
}

.antenna {
  position: absolute;
  left: 50%;
  top: 124px;
  width: 18px;
  height: 32px;
  transform: translateX(-50%);
  background: var(--codex-light);
}

.antenna::before {
  position: absolute;
  left: 50%;
  top: -15px;
  width: 24px;
  height: 24px;
  transform: translateX(-50%);
  background: var(--codex-violet);
  content: "";
}

.bot-arm {
  position: absolute;
  top: 158px;
  width: 50px;
  height: 30px;
  background: linear-gradient(180deg, #7e95ff, #294cff);
  box-shadow: inset 0 -7px 0 rgba(8, 8, 8, 0.14);
  animation: armSwing 1.15s steps(2, end) infinite;
}

.arm-left {
  left: 8px;
  transform-origin: right top;
}

.arm-right {
  right: 8px;
  transform-origin: left top;
  animation-delay: -0.58s;
}

.bot-body {
  position: absolute;
  top: 142px;
  left: 50%;
  width: 126px;
  height: 70px;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(255, 255, 255, 0.24) 42% 58%, transparent 58%),
    linear-gradient(180deg, #f8f8f4, #dfe6ff);
  box-shadow: inset 0 -10px 0 rgba(41, 76, 255, 0.16);
}

.status-light {
  position: absolute;
  left: 24px;
  top: 22px;
  width: 16px;
  height: 16px;
  background: var(--green);
  animation: statusBlink 1.4s steps(2, end) infinite;
}

.body-line {
  position: absolute;
  right: 22px;
  top: 27px;
  width: 42px;
  height: 8px;
  background: #294cff;
}

.bot-leg {
  position: absolute;
  bottom: 24px;
  width: 30px;
  height: 42px;
  background: linear-gradient(180deg, #dfe6ff, #8398ff);
  animation: legStep 1.15s steps(2, end) infinite;
  transform-origin: top center;
}

.bot-leg.left {
  left: 76px;
}

.bot-leg.right {
  right: 76px;
  animation-delay: -0.58s;
}

.keyboard {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 210px;
  height: 26px;
  transform: translateX(-50%);
  background-image: radial-gradient(circle, rgba(245, 245, 241, 0.86) 1.1px, transparent 1.3px);
  background-size: 7px 7px;
  animation: keyFlicker 0.9s steps(2, end) infinite;
}

.video-meta {
  padding: 12px 16px 14px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(0.84rem, 1.2vw, 0.98rem);
  line-height: 1.25;
  letter-spacing: 0;
}

h1 span {
  color: #a694ff;
}

.channel-row,
.channel,
.controls {
  display: flex;
  align-items: center;
}

.channel-row {
  justify-content: space-between;
  gap: 18px;
}

.channel {
  min-width: 230px;
  gap: 11px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f6f7ff;
  box-shadow: inset 0 -3px 0 rgba(41, 76, 255, 0.08);
}

.avatar-cloud {
  position: relative;
  width: 22px;
  height: 16px;
  display: block;
  background: linear-gradient(180deg, var(--codex-violet), var(--codex-blue));
  box-shadow:
    -6px 4px 0 var(--codex-blue),
    6px 4px 0 var(--codex-blue),
    0 7px 0 var(--codex-blue),
    0 -5px 0 #8f83ff;
}

.avatar-cloud i {
  position: absolute;
  left: 4px;
  top: 0;
  color: white;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.avatar-cloud b {
  position: absolute;
  right: 3px;
  top: 9px;
  width: 9px;
  height: 3px;
  background: white;
}

.channel strong,
.channel span {
  display: block;
}

.channel span {
  margin-top: 2px;
  color: var(--dim);
  font-size: 0.68rem;
  line-height: 1.15;
}

.channel strong {
  font-size: 0.88rem;
  line-height: 1.1;
}

.controls {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.play-button,
.pill,
.volume-control,
.track-chip {
  min-height: 34px;
  border: 1px solid rgba(144, 151, 255, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(135deg, rgba(41, 76, 255, 0.86), rgba(128, 93, 255, 0.72));
  color: var(--ink);
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    0 8px 18px rgba(41, 76, 255, 0.16);
}

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px 0 10px;
  font-weight: 800;
  cursor: pointer;
}

.play-button:focus-visible,
.pill:focus-visible,
.volume-control input:focus-visible {
  outline: 3px solid rgba(120, 196, 77, 0.78);
  outline-offset: 3px;
}

.play-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(246, 247, 255, 0.18);
}

.play-icon::before {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid white;
  content: "";
}

.is-playing .play-icon::before {
  width: 11px;
  height: 13px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, #fff 0 35%, transparent 35% 65%, #fff 65% 100%);
}

.volume-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
}

.volume-control span {
  color: #f5f7ff;
  font-size: 0.86rem;
  font-weight: 800;
}

.volume-control input {
  width: 96px;
  accent-color: var(--codex-light);
}

.volume-control input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(246, 247, 255, 0.26);
}

.volume-control input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 5px;
  background: #f5f7ff;
  box-shadow: 0 0 0 3px rgba(41, 76, 255, 0.36);
  appearance: none;
}

.volume-control input::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(246, 247, 255, 0.26);
}

.volume-control input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 5px;
  background: #f5f7ff;
  box-shadow: 0 0 0 3px rgba(41, 76, 255, 0.36);
}

.pill {
  padding: 0 15px;
  font-weight: 800;
}

.track-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  color: #f5f7ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  white-space: nowrap;
}

@keyframes shimmer {
  50% {
    opacity: 0.7;
  }
}

@keyframes bounceAround {
  0%,
  100% {
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%) scale(0.52);
  }
  14% {
    left: 25%;
    top: 32%;
    transform: translate(-50%, -50%) scale(0.52) rotate(-2deg);
  }
  28% {
    left: 17%;
    top: 58%;
    transform: translate(-50%, -50%) scale(0.52) rotate(2deg);
  }
  42% {
    left: 38%;
    top: 70%;
    transform: translate(-50%, -50%) scale(0.52) rotate(-1deg);
  }
  56% {
    left: 69%;
    top: 62%;
    transform: translate(-50%, -50%) scale(0.52) rotate(2deg);
  }
  70% {
    left: 75%;
    top: 35%;
    transform: translate(-50%, -50%) scale(0.52) rotate(-2deg);
  }
  84% {
    left: 58%;
    top: 25%;
    transform: translate(-50%, -50%) scale(0.52) rotate(1deg);
  }
}

@keyframes cloudPulse {
  50% {
    filter: brightness(1.16) saturate(1.12);
  }
}

@keyframes armSwing {
  50% {
    transform: translateY(8px) rotate(8deg);
  }
}

@keyframes legStep {
  50% {
    transform: translateY(10px) translateX(7px);
  }
}

@keyframes shadowPulse {
  50% {
    opacity: 0.36;
    transform: translateX(-50%) scaleX(0.82);
  }
}

@keyframes statusBlink {
  50% {
    background: #f4f8ff;
  }
}

@keyframes keyFlicker {
  50% {
    opacity: 0.62;
    background-position: 7px 0;
  }
}

@keyframes pixelBreathe {
  50% {
    opacity: 0.58;
    transform: translateY(3px);
  }
}

@keyframes frameJitter {
  50% {
    transform: translate(4px, -3px);
    background-position: 7px 0;
  }
}

@keyframes frameSlide {
  40% {
    transform: translateX(-5px);
    background-position: 14px 0;
  }
  80% {
    transform: translateX(5px);
    background-position: -7px 7px;
  }
}

@keyframes shelfMarch {
  50% {
    transform: translateY(-5px);
    background-position: 14px 7px;
  }
}

@keyframes deskBlink {
  50% {
    opacity: 0.48;
    background-position: 14px 0;
  }
}

@keyframes steamPulse {
  50% {
    transform: translateY(-9px) scaleY(1.12);
    opacity: 0.56;
  }
}

@keyframes plantSway {
  50% {
    transform: translateX(7px) skewX(-3deg);
    background-position: 7px 0;
  }
}

@keyframes lampFlicker {
  50% {
    opacity: 0.42;
    filter: brightness(1.8);
  }
}

@keyframes radioBars {
  50% {
    transform: translateY(-4px);
    background-position: 7px 0;
  }
}

@keyframes radioWave {
  50% {
    height: 42%;
    top: -48%;
    opacity: 0.48;
  }
}

@keyframes monitorType {
  50% {
    width: 42%;
    opacity: 0.46;
  }
}

@keyframes dotDrift {
  to {
    background-position: 24px 16px;
  }
}

@keyframes scanlines {
  to {
    background-position: 0 12px, 8px 0;
  }
}

@keyframes screenGlow {
  50% {
    opacity: 0.72;
  }
}

@keyframes ambientShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes glowSweep {
  0% {
    transform: translateX(-10%) translateY(-4%) rotate(0deg);
  }
  100% {
    transform: translateX(8%) translateY(5%) rotate(5deg);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 860px) {
  .page {
    align-items: start;
    padding: 10px;
  }

  .youtube-shell {
    width: 100%;
    max-height: none;
    border-radius: 18px;
  }

  .topbar {
    height: 60px;
    padding: 0 18px;
  }

  .stage {
    margin: 0 12px;
    height: min(58vh, 520px);
    min-height: 360px;
  }

  .focus-timer {
    left: 18px;
    top: 16px;
  }

  .codex-character {
    width: 184px;
    height: 220px;
    animation-name: bounceAroundMobile;
  }

  .codex-cloud {
    width: 132px;
    height: 100px;
  }

  .prompt {
    left: 28px;
    top: 30px;
    font-size: 3.1rem;
  }

  .cursor-line {
    right: 24px;
    top: 55px;
    width: 42px;
    height: 10px;
  }

  .bot-body {
    top: 126px;
    width: 104px;
  }

  .arm-left {
    left: 2px;
  }

  .arm-right {
    right: 2px;
  }

  .bot-leg.left {
    left: 54px;
  }

  .bot-leg.right {
    right: 54px;
  }

  .keyboard {
    width: 170px;
  }

  .channel-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    justify-content: flex-start;
  }
}

@keyframes bounceAroundMobile {
  0%,
  100% {
    left: 45%;
    top: 34%;
    transform: translate(-50%, -50%) scale(0.5);
  }
  25% {
    left: 24%;
    top: 52%;
    transform: translate(-50%, -50%) scale(0.5) rotate(2deg);
  }
  50% {
    left: 60%;
    top: 66%;
    transform: translate(-50%, -50%) scale(0.5) rotate(-2deg);
  }
  75% {
    left: 73%;
    top: 38%;
    transform: translate(-50%, -50%) scale(0.5) rotate(2deg);
  }
}

@media (max-width: 520px) {
  .brand {
    margin-left: 18px;
    font-size: 1.05rem;
  }

  .mic,
  .hamburger {
    transform: scale(0.86);
  }

  .stage::before {
    background-size: 6px 6px;
  }

  .play-button,
  .volume-control {
    width: 100%;
    justify-content: center;
  }

  .volume-control input {
    width: min(48vw, 150px);
  }
}

@media (max-height: 820px) and (min-width: 861px) {
  .page {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .youtube-shell {
    width: min(1100px, 84vw);
    grid-template-rows: 44px minmax(0, 1fr) auto;
  }

  .topbar {
    min-height: 44px;
    height: 44px;
    padding: 0 22px;
  }

  .brand {
    font-size: 0.98rem;
  }

  .mic {
    width: 34px;
    height: 34px;
  }

  .stage {
    height: min(56vh, 500px);
    min-height: 330px;
    margin: 0 14px;
  }

  .video-meta {
    padding: 9px 14px 11px;
  }

  h1 {
    margin-bottom: 8px;
    font-size: 0.86rem;
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .avatar-cloud {
    transform: scale(0.82);
  }

  .channel strong {
    font-size: 0.82rem;
  }

  .channel span {
    font-size: 0.62rem;
  }

  .play-button,
  .pill,
  .volume-control,
  .track-chip {
    min-height: 30px;
    font-size: 0.82rem;
  }

  .play-icon {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
