:root {
  color-scheme: light;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  --bg-solid: #e7e5f2;
  --accent: #69779F;
  --accent-2: #9EA1C4;
  --warm: #DCAAC0;
  --ink: #4f5d80;
  --skin: #fff2e8;
  --hair-light: #BAD6F2;
  --hair-dark: #69779F;
  --hair-shine: #eaffff;
  --ui-white: #ffffff;
  --ui-line: rgba(255, 255, 255, .72);
  --ui-faint: rgba(255, 255, 255, .16);
  --ui-soft: rgba(255, 255, 255, .08);
  --outfit-scale: 1;
  --outfit-motion-y: 0px;
  --outfit-motion-rotate: 0deg;
  --outfit-motion-scale-x: 1;
  --outfit-motion-scale-y: 1;
  --outfit-shadow-opacity: .72;
  --outfit-shadow-scale: .94;
  --beat-flash-duration: 360ms;
  --character-shadow-duration: 923ms;
  --static-outfit-beat-duration: 462ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg-solid);
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

button,
canvas,
img {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 1.5px solid var(--ui-white);
  outline-offset: 4px;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: default;
  touch-action: none;
  isolation: isolate;
  background-color: var(--bg-solid);
  transition: background-color 180ms ease-out;
}

#app::before {
  position: absolute;
  z-index: 7;
  inset: 0;
  border: 0 solid rgba(255, 255, 255, .56);
  content: "";
  opacity: 0;
  pointer-events: none;
}

#app.is-beat::before {
  animation: none;
}

#app::after {
  position: absolute;
  z-index: 6;
  inset: 0;
  background: rgba(255, 255, 255, .68);
  content: "";
  opacity: 0;
  pointer-events: none;
}

#app.is-flashing::after {
  animation: screen-flash 280ms steps(1, end);
}

#app[data-palette="0"] {
  --bg-solid: #e7e5f2;
  --ink: #4f5d80;
}

#app[data-palette="1"] {
  --bg-solid: #cad4e0;
  --ink: #4f5d80;
}

#app[data-palette="2"] {
  --bg-solid: #fde5e0;
  --ink: #4f5d80;
}

#app[data-palette="3"] {
  --bg-solid: #c4c4e2;
  --ink: #4f5d80;
}

#app[data-palette="4"] {
  --bg-solid: #d6e0ee;
  --ink: #4f5d80;
}

#app[data-palette="5"] {
  --bg-solid: #f6e8ea;
  --ink: #4f5d80;
}

#effectsCanvas {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.start-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 9;
  color: #45484f;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: opacity 420ms ease, visibility 420ms ease, transform 420ms ease;
  pointer-events: none;
}

.start-prompt span {
  display: inline-block;
  padding: 0 0 0 .22em;
  border: 0;
  color: #45484f;
  background: transparent;
  font-size: clamp(.68rem, 1.2vw, .82rem);
  font-weight: 700;
  letter-spacing: .22em;
  line-height: 1;
  white-space: nowrap;
  animation: start-prompt-pulse 1.8s ease-in-out infinite;
}

.start-prompt.is-hidden {
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.92);
}

.audio-panel {
  position: absolute;
  top: clamp(22px, 4.5vh, 52px);
  right: clamp(18px, 3vw, 52px);
  z-index: 18;
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--ui-white);
  transition: opacity 320ms ease, transform 320ms ease;
  pointer-events: auto;
}

#app.ui-idle:not(.is-panel-open) .audio-panel {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.audio-control {
  position: relative;
  display: flex;
  width: 76px;
  min-height: 29px;
  padding: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border: 0;
  border-radius: 0;
  color: var(--ui-white);
  background: transparent;
  cursor: pointer;
  opacity: .72;
  transition: transform 160ms ease, opacity 160ms ease;
}

.audio-control:hover,
.audio-toggle.is-playing,
.sound-toggle.is-enabled,
.volume-toggle.is-open,
.rhythm-toggle.is-tap {
  background: transparent;
  opacity: 1;
}

.audio-control:active {
  transform: scale(.94);
}

.audio-control-label {
  width: 46px;
  padding-left: .16em;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1;
  text-align: left;
}

#bgmVolumeLabel {
  letter-spacing: .08em;
  white-space: nowrap;
}

.audio-icon {
  position: relative;
  display: block;
  width: 15px;
  height: 16px;
}

.audio-control-svg {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: currentColor;
}

.volume-control {
  display: grid;
  width: 76px;
  justify-items: end;
}

.volume-bar {
  opacity: 1;
  transition: opacity 140ms ease;
}

.volume-toggle[data-level="0"] .volume-bar,
.volume-toggle[data-level="1"] .volume-bar-2,
.volume-toggle[data-level="1"] .volume-bar-3,
.volume-toggle[data-level="1"] .volume-bar-4,
.volume-toggle[data-level="2"] .volume-bar-3,
.volume-toggle[data-level="2"] .volume-bar-4,
.volume-toggle[data-level="3"] .volume-bar-4 {
  opacity: .18;
}

.volume-panel {
  display: flex;
  width: 76px;
  height: 18px;
  align-items: center;
  justify-content: flex-end;
  border: 0;
  background: transparent;
}

.volume-panel[hidden] {
  display: none;
}

.volume-range {
  width: 68px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.volume-range::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(255, 255, 255, .48);
}

.volume-range::-webkit-slider-thumb {
  width: 8px;
  height: 12px;
  margin-top: -5px;
  border: 0;
  border-radius: 0;
  background: var(--ui-white);
  box-shadow: 0 0 8px rgba(255, 255, 255, .42);
  appearance: none;
  -webkit-appearance: none;
}

.volume-range::-moz-range-track {
  height: 2px;
  border: 0;
  background: rgba(255, 255, 255, .48);
}

.volume-range::-moz-range-progress {
  height: 2px;
  background: var(--ui-white);
}

.volume-range::-moz-range-thumb {
  width: 8px;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: var(--ui-white);
  box-shadow: 0 0 8px rgba(255, 255, 255, .42);
}

.volume-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .34), 0 0 10px rgba(255, 255, 255, .72);
}

.sound-slash,
.rhythm-tap-glyph {
  display: none;
}

.sound-toggle:not(.is-enabled) .sound-waves {
  display: none;
}

.sound-toggle:not(.is-enabled) .sound-slash,
.rhythm-toggle.is-tap .rhythm-tap-glyph {
  display: block;
}

.rhythm-toggle.is-tap .rhythm-sync-glyph {
  display: none;
}

.audio-toggle:not(.is-playing) .audio-icon::before {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  content: "";
}

.audio-toggle.is-playing .audio-icon::before,
.audio-toggle.is-playing .audio-icon::after {
  position: absolute;
  top: 1px;
  width: 3px;
  height: 14px;
  background: currentColor;
  content: "";
}

.audio-toggle.is-playing .audio-icon::before {
  left: 2px;
}

.audio-toggle.is-playing .audio-icon::after {
  right: 2px;
}

#stage {
  position: absolute;
  z-index: 4;
  display: grid;
  inset: 0;
  padding-top: 0;
  place-items: center;
  transform: translateX(0);
  transition: transform 520ms cubic-bezier(.2, .82, .2, 1);
  pointer-events: none;
}

#app.is-panel-open #stage {
  transform: translateX(min(15vw, 220px));
}

.character-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(82vw, 780px);
  height: min(72vh, 650px);
}

.character-shell {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  min-width: 0;
  min-height: 0;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}

#app.is-hazel-fallback .character-shell {
  transform: scale(1.42);
}

#hazelCanvas {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
}

#app.is-hazel-rendered #hazelCanvas {
  visibility: visible;
  opacity: 1;
}

#app.is-hazel-rendered .character-animation,
#app.is-hazel-rendered .placeholder-character { display: none; }

.character-shell::after {
  position: absolute;
  z-index: 0;
  bottom: 2.5%;
  left: 50%;
  width: min(38%, 260px);
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(45, 40, 53, .3), rgba(45, 40, 53, 0) 70%);
  content: "";
  filter: blur(5px);
  transform: translateX(-50%) scaleX(.94);
  transform-origin: center;
}

.character-animation,
.placeholder-character {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 100%;
}

.character-animation {
  position: relative;
  z-index: 1;
  display: none;
  width: auto;
  height: min(72vh, 650px);
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 24px 30px rgba(31, 62, 92, .23));
  image-rendering: auto;
  transform:
    translate3d(var(--outfit-center-x, 0px), calc(var(--outfit-motion-y) + var(--outfit-center-y, 0px)), 0)
    rotate(var(--outfit-motion-rotate))
    scale(var(--outfit-scale))
    scaleX(var(--outfit-motion-scale-x))
    scaleY(var(--outfit-motion-scale-y));
  transform-origin: calc(50% + var(--outfit-origin-x, 0px)) calc(50% + var(--outfit-origin-y, 0px));
  pointer-events: none;
}

.character-animation.is-loaded {
  display: block;
}

#app.is-character-animated .character-shell::after,
#app.is-static-outfit-active .character-shell::after {
  animation: none;
}

#app.is-static-outfit-active .character-animation {
  will-change: transform;
}

#app.is-static-outfit-active .character-shell::after {
  opacity: var(--outfit-shadow-opacity);
  animation: none;
  transform: translateX(-50%) scaleX(var(--outfit-shadow-scale));
}

.placeholder-character {
  position: relative;
  width: min(100%, 440px);
  height: 100%;
  text-align: center;
  transform: scale(1);
}

.placeholder-character.is-hidden {
  display: none;
}

.placeholder-character svg {
  width: 100%;
  height: calc(100% - 28px);
  overflow: visible;
}

.face-state {
  display: none;
  transform-origin: 180px 235px;
}

.placeholder-character[data-mood="normal"] .face-normal,
.placeholder-character[data-mood="happy"] .face-happy,
.placeholder-character[data-mood="surprised"] .face-surprised,
.placeholder-character[data-mood="sleepy"] .face-sleepy,
.placeholder-character[data-mood="blush"] .face-blush,
.placeholder-character[data-mood="excited"] .face-excited {
  display: block;
  animation: face-pop 220ms ease-out;
}

.tail-left {
  transform-origin: 98px 142px;
  animation: tail-left 2.7s ease-in-out infinite alternate;
}

.tail-right {
  transform-origin: 262px 142px;
  animation: tail-right 2.7s ease-in-out infinite alternate;
}

.placeholder-note {
  display: inline-block;
  padding: 7px 10px 6px 12px;
  border: 1px solid var(--ui-line);
  color: var(--ui-white);
  background: var(--ui-soft);
  font-size: clamp(.55rem, 1vw, .66rem);
  font-weight: 700;
  letter-spacing: .16em;
}

.status {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vh, 42px);
  z-index: 8;
  display: flex;
  align-items: center;
  width: auto;
  max-width: min(88vw, 460px);
  min-width: 0;
  justify-content: center;
  padding: 10px 17px 9px 19px;
  border: 1px solid var(--ui-line);
  color: var(--ui-white);
  background: var(--ui-soft);
  font-size: clamp(.62rem, 1.2vw, .74rem);
  font-weight: 700;
  letter-spacing: .18em;
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 280ms ease, visibility 280ms ease, transform 280ms ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: none;
}

.beat-label,
.counter {
  display: none;
}

#effectLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-ui,
.library-ui * {
  text-transform: uppercase;
}

.library-ui {
  position: absolute;
  z-index: 20;
  inset: 0;
  color: var(--ui-white);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  letter-spacing: .18em;
  pointer-events: none;
}

.layout-toggle {
  position: absolute;
  right: clamp(18px, 3vw, 52px);
  bottom: clamp(20px, 4vh, 44px);
  z-index: 24;
  display: flex;
  height: 46px;
  padding: 0 13px 0 11px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--ui-line);
  border-radius: 0;
  color: var(--ui-white);
  background: transparent;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, opacity 260ms ease, transform 260ms ease;
  pointer-events: auto;
}

.layout-toggle:hover,
.layout-toggle:focus-visible {
  border-color: var(--ui-white);
  background: var(--ui-faint);
}

.layout-toggle:active {
  transform: translateY(1px);
}

.layout-toggle-glyph {
  display: grid;
  width: 24px;
  height: 20px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
}

.layout-toggle-glyph i {
  display: block;
  border: 1px solid currentColor;
  background: transparent;
}

.layout-toggle.is-32 .layout-toggle-glyph i {
  background: linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(50% - .5px),
    currentColor calc(50% - .5px),
    currentColor calc(50% + .5px),
    transparent calc(50% + .5px)
  );
}

.layout-toggle-label {
  padding-left: .18em;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1;
  white-space: nowrap;
}

#app.is-panel-open .layout-toggle {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.library-handle {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 24;
  width: 32px;
  height: 128px;
  padding: 0;
  border: 0;
  color: var(--ui-white);
  background: transparent;
  opacity: .68;
  transform: translateY(-50%);
  transition: opacity 220ms ease;
  cursor: pointer;
  pointer-events: auto;
}

.library-handle:hover {
  opacity: 1;
}

.library-handle:focus-visible {
  outline: 0;
}

.library-handle:focus-visible .library-handle-line {
  box-shadow: 0 0 12px rgba(255, 255, 255, .8);
  transform: scaleY(1.12);
}

.library-handle-line {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 14px;
  width: 2px;
  background: var(--ui-white);
  transform-origin: center;
  transition: transform 260ms ease, opacity 220ms ease;
}

#app.is-ui-near .library-handle-line,
#app.is-panel-open .library-handle-line {
  opacity: 0;
  transform: scaleY(.35);
}

.library-dock {
  position: absolute;
  top: 50%;
  left: 28px;
  z-index: 24;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 20px);
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translate(-18px, -50%);
  transition: opacity 260ms ease, transform 380ms cubic-bezier(.2, .82, .2, 1), visibility 260ms;
  pointer-events: none;
}

#app.is-ui-near .library-dock,
#app.is-panel-open .library-dock,
.library-dock:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  pointer-events: auto;
}

.dock-item {
  position: relative;
  display: flex;
  width: 76px;
  min-height: 68px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  color: var(--ui-white);
  background: transparent;
  cursor: pointer;
}

.dock-icon-ring {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, .76);
  border-radius: 50%;
  background: transparent;
  transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.dock-icon-ring svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: currentColor;
  stroke: none;
}

.dock-label {
  padding-left: .18em;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  opacity: .82;
  transition: opacity 220ms ease;
}

.dock-item:hover .dock-icon-ring,
.dock-item.is-active .dock-icon-ring {
  border-color: var(--ui-white);
  background: rgba(255, 255, 255, .2);
  transform: translateX(5px);
}

.dock-item:hover .dock-label,
.dock-item.is-active .dock-label {
  opacity: 1;
}

.panel-wrapper {
  position: fixed;
  top: 70px;
  bottom: 70px;
  left: 144px;
  z-index: 23;
  width: 500px;
  min-height: 360px;
  border: 1.5px solid var(--ui-white);
  background: rgba(255, 255, 255, .16);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-22px);
  transition: opacity 260ms ease, transform 460ms cubic-bezier(.2, .82, .2, 1), visibility 260ms;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  pointer-events: none;
}

.panel-wrapper::before,
.panel-wrapper::after {
  position: absolute;
  left: 18px;
  width: 42px;
  height: 1.5px;
  background: var(--ui-white);
  content: "";
}

.panel-wrapper::before {
  top: -9px;
}

.panel-wrapper::after {
  bottom: -9px;
}

#app.is-panel-open .panel-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.panel-body {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.panel-header {
  display: flex;
  min-height: 86px;
  padding: 21px 22px 18px 28px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .38);
}

.panel-heading {
  min-width: 0;
}

.panel-kicker {
  display: block;
  margin-bottom: 8px;
  padding-left: .2em;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  opacity: .62;
}

.panel-heading h2 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.panel-count {
  display: inline-grid;
  min-width: 70px;
  height: 24px;
  padding: 0 7px 0 9px;
  place-items: center;
  border: 1px solid var(--ui-line);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.panel-close {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--ui-line);
  color: var(--ui-white);
  background: transparent;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.panel-close:hover {
  border-color: var(--ui-white);
  background: var(--ui-faint);
}

.panel-close span::before,
.panel-close span::after {
  position: absolute;
  top: 10.5px;
  left: 5px;
  width: 12px;
  height: 1px;
  background: currentColor;
  content: "";
}

.panel-close span::before {
  transform: rotate(45deg);
}

.panel-close span::after {
  transform: rotate(-45deg);
}

.panel-scroll {
  min-height: 0;
  padding: 24px 26px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.panel-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.panel-content {
  min-height: 100%;
}

.panel-footer {
  display: flex;
  min-height: 43px;
  padding: 0 23px 0 28px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, .38);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  opacity: .68;
}

.panel-footer span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scroll-rail {
  position: absolute;
  top: 105px;
  right: -22px;
  bottom: 58px;
  width: 2px;
  background: rgba(255, 255, 255, .34);
  opacity: 0;
  transition: opacity 180ms ease;
}

.scroll-rail.is-active {
  opacity: 1;
}

.scroll-thumb {
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  min-height: 42px;
  background: var(--ui-white);
  box-shadow: 0 0 16px rgba(255, 255, 255, .72);
  transform: translateX(-50%);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .68);
  background: var(--ui-soft);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.card:hover,
.card.is-active {
  border-color: var(--ui-white);
  background: rgba(255, 255, 255, .18);
}

.card.is-active::before {
  position: absolute;
  top: -1px;
  left: -1px;
  z-index: 2;
  width: 28px;
  height: 3px;
  background: var(--ui-white);
  content: "";
}

.card-select {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 0;
  color: var(--ui-white);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.card-select:active {
  transform: translateY(1px);
}

.card-thumb {
  position: relative;
  display: grid;
  height: 132px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .42);
  background: var(--ui-soft);
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.format-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  min-width: 38px;
  padding: 3px 4px 2px 6px;
  border: 1px solid var(--ui-line);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.card-copy {
  display: block;
  min-width: 0;
}

.card-title,
.card-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title {
  padding-left: .18em;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.2;
}

.card-subtitle {
  margin-top: 5px;
  padding-left: .16em;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.2;
  opacity: .65;
}

.card-remove {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--ui-line);
  color: var(--ui-white);
  background: rgba(255, 255, 255, .12);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.card-remove:hover {
  background: rgba(255, 255, 255, .28);
}

.card-upload {
  display: grid;
  min-height: 202px;
  padding: 18px;
  place-items: center;
  align-content: center;
  gap: 13px;
  border: 1.5px dashed rgba(255, 255, 255, .8);
  color: var(--ui-white);
  background: transparent;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.card-upload:hover {
  border-color: var(--ui-white);
  background: var(--ui-soft);
}

.upload-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ui-line);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
}

.upload-label {
  padding-left: .18em;
  font-size: 9px;
  font-weight: 700;
}

.upload-note {
  max-width: 150px;
  padding-left: .14em;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .13em;
  line-height: 1.5;
  text-align: center;
  opacity: .56;
}

.outfit-collection {
  display: grid;
  gap: 18px;
}

.keymap-mode { display: flex; gap: 8px; margin: 12px 0; }
.outfit-card .card-title { text-transform: none; }
.keymap-mode button { border: 1px solid var(--ui-line); color: inherit; background: transparent; padding: 8px 12px; cursor: pointer; }
.keymap-mode button[aria-pressed="true"] { background: rgba(255, 255, 255, .18); }
.keymap-editor { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.keymap-editor label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.keymap-editor label span { font-size: 10px; opacity: .75; }
.keymap-editor input { width: 100%; min-width: 0; text-align: center; border: 1px solid var(--ui-line); color: inherit; background: rgba(255, 255, 255, .08); padding: 8px 0; font: inherit; cursor: pointer; }
.keymap-editor input:focus { outline: 2px solid var(--ui-white); }
.share-only-icons .social-share { min-height: 90px; }

.outfit-scale-editor {
  padding: 15px 17px 14px;
  border: 1px solid var(--ui-line);
  background: var(--ui-soft);
}

.control-heading,
.sync-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.control-heading {
  margin-bottom: 13px;
  font-size: 9px;
  font-weight: 700;
}

.control-heading output {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.outfit-scale-editor input[type="range"],
.sync-offset-field input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: var(--ui-white);
  cursor: ew-resize;
}

.scale-ticks {
  display: flex;
  margin-top: 2px;
  justify-content: space-between;
  font-size: 6px;
  font-weight: 700;
  opacity: .58;
}

.scale-reset {
  width: 100%;
  margin-top: 11px;
  border: 1px solid rgba(255, 255, 255, .34);
}

.palette-card .card-select {
  padding: 12px;
}

.palette-swatch-grid {
  display: grid;
  height: 118px;
  margin-bottom: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .58);
  overflow: hidden;
}

.palette-color-grid {
  display: flex;
  height: 118px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-content: stretch;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .58);
  overflow: hidden;
}

.palette-swatch-grid.is-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.palette-swatch-grid.is-5 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.palette-swatch-grid.is-5 .palette-swatch:nth-child(-n + 3) {
  grid-column: span 2;
}

.palette-swatch-grid.is-5 .palette-swatch:nth-child(n + 4) {
  grid-column: span 3;
}

.palette-swatch-grid.is-7 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.palette-swatch-grid.is-7 .palette-swatch:nth-child(-n + 4) {
  grid-column: span 3;
}

.palette-swatch-grid.is-7 .palette-swatch:nth-child(n + 5) {
  grid-column: span 4;
}

.palette-swatch-grid.is-grid-5x5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
}

.palette-swatch-grid.is-strip-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.palette-swatch-grid.is-grid-6x3 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.palette-swatch-grid.is-grid-5x2 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.palette-swatch-grid.is-grid-4x2 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.thanks-collection {
  display: grid;
  min-height: 100%;
  padding: clamp(34px, 9vh, 82px) 24px;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.thanks-heart {
  color: var(--ui-white);
  font-family: "Segoe UI Symbol", sans-serif;
  font-size: clamp(54px, 9vw, 82px);
  line-height: 1;
}

.thanks-name {
  color: var(--ui-white);
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 600;
  letter-spacing: .16em;
}

.palette-swatch {
  display: block;
  min-width: 0;
  background: var(--swatch-color);
}

.palette-editor-body {
  padding: 12px;
}

.palette-color-control {
  position: relative;
  min-width: calc(33.333% - 1px);
  flex: 1 1 calc(33.333% - 1px);
  overflow: hidden;
  background: var(--ui-soft);
  cursor: pointer;
}

.palette-color-control label {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.palette-color-control span {
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 2;
  padding-left: .12em;
  color: var(--ui-white);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .12em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .22);
  pointer-events: none;
}

.palette-color-control input {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.palette-color-control input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.palette-color-control input::-webkit-color-swatch {
  border: 0;
  border-radius: 0;
}

.palette-color-control input::-moz-color-swatch {
  border: 0;
  border-radius: 0;
}

.palette-color-control > button {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 3;
  display: grid;
  width: 17px;
  height: 17px;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--ui-white);
  background: rgba(24, 26, 31, .3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.palette-color-control > button:hover {
  background: rgba(24, 26, 31, .58);
}

.sound-pack-collection {
  display: grid;
  gap: 18px;
}

.sound-pack-guide {
  padding: 15px 17px 14px;
  border: 1px solid var(--ui-line);
  background: var(--ui-soft);
}

.sound-pack-guide-heading,
.sound-pack-guide-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sound-pack-guide-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .34);
}

.sound-pack-guide-heading strong {
  font-size: 10px;
  letter-spacing: .17em;
}

.sound-pack-guide-heading span,
.sound-pack-guide-row span {
  font-size: 7px;
  font-weight: 700;
  opacity: .64;
}

.sound-pack-guide-row {
  min-height: 31px;
  border-bottom: 1px solid rgba(255, 255, 255, .2);
}

.sound-pack-guide-row code {
  color: var(--ui-white);
  font-family: inherit;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
}

.keyboard-map-guide .sound-pack-guide-row {
  padding: 7px 0;
  align-items: flex-start;
}

.keyboard-map-guide .sound-pack-guide-row code {
  max-width: 68%;
  line-height: 1.55;
  text-align: right;
  overflow-wrap: anywhere;
}

.sound-pack-guide p {
  margin: 12px 0 0;
  font-size: 6px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.65;
  opacity: .62;
}

.sound-pack-grid {
  align-items: stretch;
}

.sound-pack-card .card-select {
  padding-bottom: 11px;
}

.sound-pack-preview {
  position: relative;
  display: block;
  height: 118px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
}

.sound-pack-size {
  position: absolute;
  top: 17px;
  left: 16px;
  padding-left: .14em;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1;
}

.sound-pack-size::after {
  display: block;
  margin-top: 10px;
  content: "SOUND PACK";
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .18em;
  opacity: .66;
}

.sound-pack-cells {
  position: absolute;
  top: 15px;
  right: 16px;
  bottom: 15px;
  display: grid;
  width: 70px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.sound-pack-cells.is-16 {
  grid-template-rows: repeat(4, minmax(0, 1fr));
}

.sound-pack-cells.is-32 {
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 2px 3px;
}

.sound-pack-cells i {
  display: block;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .1);
}

.sound-pack-card.is-active .sound-pack-cells i:nth-child(4n + 1) {
  background: rgba(255, 255, 255, .76);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(255, 255, 255, .34);
}

.card-actions.is-single {
  grid-template-columns: 1fr;
}

.card-actions.is-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-action {
  min-height: 30px;
  padding: 4px 7px 3px 9px;
  border: 0;
  color: var(--ui-white);
  background: transparent;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .15em;
  cursor: pointer;
}

.mini-action + .mini-action {
  border-left: 1px solid rgba(255, 255, 255, .34);
}

.mini-action:hover {
  background: var(--ui-faint);
}

.bgm-preview {
  position: relative;
  display: block;
  height: 120px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
}

.bgm-card .card-remove {
  right: 18px;
  left: auto;
}

.track-lines {
  position: absolute;
  right: 18px;
  bottom: 19px;
  left: 18px;
  display: flex;
  height: 58px;
  align-items: end;
  justify-content: space-between;
  gap: 5px;
}

.track-lines i {
  display: block;
  width: 3px;
  height: 25%;
  background: var(--ui-white);
}

.track-lines i:nth-child(2n) {
  height: 70%;
}

.track-lines i:nth-child(3n) {
  height: 42%;
}

.track-lines i:nth-child(5n) {
  height: 92%;
}

.bgm-play-mark {
  position: absolute;
  top: 12px;
  left: 13px;
  width: 20px;
  height: 20px;
}

.bgm-play-mark::after {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--ui-white);
  content: "";
}

.bgm-sync-editor {
  min-width: 0;
  padding: 16px 17px 14px;
  grid-column: 1 / -1;
  border: 1px solid var(--ui-line);
  background: var(--ui-soft);
}

.sync-heading {
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .34);
}

.sync-heading > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.sync-heading span,
.sync-number-field span,
.sync-offset-field > span {
  font-size: 7px;
  font-weight: 700;
  opacity: .62;
}

.sync-heading strong {
  overflow: hidden;
  font-size: 10px;
  letter-spacing: .16em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-source {
  flex: 0 0 auto;
  padding: 5px 7px 4px 9px;
  border: 1px solid var(--ui-line);
  opacity: 1 !important;
}

.sync-fields {
  display: grid;
  padding: 14px 0;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px 12px;
}

.sync-number-field {
  display: grid;
  gap: 7px;
}

.sync-number-field input {
  width: 100%;
  height: 32px;
  padding: 2px 7px 1px 9px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 0;
  color: var(--ui-white);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.sync-bpm-options {
  display: grid;
  padding-top: 18px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sync-bpm-options button,
.sync-actions button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, .45);
  color: var(--ui-white);
  background: transparent;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .14em;
  cursor: pointer;
}

.sync-bpm-options button:hover,
.sync-actions button:hover {
  background: var(--ui-faint);
}

.sync-offset-field {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px 12px;
}

.sync-offset-field output {
  font-size: 8px;
  font-weight: 700;
}

.sync-offset-field input {
  grid-column: 1 / -1;
}

.sync-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bgm-sync-editor p {
  margin: 11px 0 0;
  font-size: 6px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.6;
  opacity: .58;
}

.share-stack {
  display: grid;
  gap: 18px;
}

.share-summary {
  border: 1px solid var(--ui-line);
  background: var(--ui-soft);
}

.share-summary-title {
  padding: 15px 17px 13px 19px;
  border-bottom: 1px solid rgba(255, 255, 255, .36);
  font-size: 10px;
  font-weight: 700;
}

.summary-row {
  display: grid;
  min-height: 38px;
  padding: 0 17px 0 19px;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  font-size: 8px;
  font-weight: 700;
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row span:first-child {
  opacity: .6;
}

.summary-row strong {
  overflow: hidden;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-share-section {
  border: 1px solid var(--ui-line);
  background: var(--ui-soft);
}

.social-share-title {
  padding: 13px 15px 11px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, .36);
  font-size: 9px;
  font-weight: 700;
}

.social-share-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.social-share {
  display: grid;
  min-width: 0;
  min-height: 92px;
  padding: 12px 7px 10px;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .3);
  color: var(--ui-white);
  background: transparent;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.social-share:last-child {
  border-right: 0;
}

.social-share:hover {
  background: var(--ui-faint);
}

.social-share-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 50%;
}

.social-share-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: none;
  vector-effect: non-scaling-stroke;
}

.social-share strong {
  max-width: 100%;
  overflow: hidden;
  padding-left: .15em;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .15em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.share-action {
  display: grid;
  min-height: 102px;
  padding: 15px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--ui-line);
  color: var(--ui-white);
  background: var(--ui-soft);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.share-action:hover {
  border-color: var(--ui-white);
  background: rgba(255, 255, 255, .18);
}

.share-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ui-line);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
}

.share-action strong {
  padding-left: .18em;
  font-size: 8px;
  font-weight: 700;
}

.share-action small {
  padding-left: .14em;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .12em;
  opacity: .55;
}

.share-note {
  margin: 0;
  padding: 13px 15px 12px 17px;
  border-left: 2px solid var(--ui-white);
  background: rgba(255, 255, 255, .06);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.7;
  opacity: .72;
}

.panel-loading,
.panel-empty {
  display: grid;
  min-height: 280px;
  padding: 30px;
  place-items: center;
  border: 1px dashed var(--ui-line);
  font-size: 9px;
  font-weight: 700;
}

.library-toast {
  position: absolute;
  right: clamp(132px, 11vw, 164px);
  bottom: clamp(22px, 4vh, 46px);
  z-index: 26;
  max-width: min(390px, calc(100vw - 96px));
  padding: 11px 14px 10px 17px;
  border: 1px solid var(--ui-line);
  color: var(--ui-white);
  background: rgba(255, 255, 255, .14);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: none;
}

.library-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.library-file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes start-prompt-pulse {
  0%, 100% { opacity: .62; transform: scale(.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes face-pop {
  0% { opacity: .2; transform: scale(.72); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes character-shadow-pulse {
  0%, 100% { opacity: .72; transform: translateX(-50%) scaleX(.94); }
  50% { opacity: .62; transform: translateX(-50%) scaleX(.88); }
}

@keyframes screen-flash {
  0%, 48% { opacity: .62; }
  24%, 76%, 100% { opacity: 0; }
}

@keyframes beat-frame {
  0% { opacity: .3; border-width: 0; }
  35% { opacity: .24; border-width: 12px; }
  100% { opacity: 0; border-width: 0; }
}

@keyframes tail-left {
  from { transform: rotate(2deg); }
  to { transform: rotate(-5deg); }
}

@keyframes tail-right {
  from { transform: rotate(-2deg); }
  to { transform: rotate(5deg); }
}

@media (max-width: 900px) {
  .panel-wrapper {
    top: 42px;
    bottom: 42px;
    left: 108px;
    width: min(500px, calc(100vw - 140px));
  }

  .library-dock {
    left: 16px;
  }

  .scroll-rail {
    right: -16px;
  }

  #app.is-panel-open #stage {
    transform: translateX(min(20vw, 170px));
  }

  .character-frame {
    width: min(96vw, 700px);
    height: min(64vh, 560px);
  }

  .character-animation {
    height: min(64vh, 560px);
  }
}

@media (max-width: 620px), (orientation: portrait) {
  .audio-panel {
    top: 14px;
    right: 14px;
  }

  .audio-control {
    width: 68px;
    min-height: 27px;
  }

  .volume-control,
  .volume-panel {
    width: 68px;
  }

  .volume-range {
    width: 60px;
  }

  .layout-toggle {
    right: 14px;
    bottom: 14px;
    height: 40px;
    padding: 0 10px 0 9px;
    gap: 8px;
  }

  .layout-toggle-glyph {
    width: 20px;
    height: 17px;
  }

  .layout-toggle-label {
    font-size: 7px;
  }

  .library-dock {
    left: 7px;
    gap: 10px;
  }

  .dock-item {
    width: 48px;
    min-height: 44px;
    gap: 0;
  }

  .dock-icon-ring {
    width: 42px;
    height: 42px;
  }

  .dock-icon-ring svg {
    width: 18px;
    height: 18px;
  }

  .dock-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .dock-item:hover .dock-icon-ring,
  .dock-item.is-active .dock-icon-ring {
    transform: translateX(2px);
  }

  .panel-wrapper {
    top: 66px;
    right: 10px;
    bottom: 22px;
    left: 64px;
    width: auto;
    min-height: 320px;
  }

  .panel-header {
    min-height: 72px;
    padding: 15px 12px 13px 16px;
    gap: 8px;
  }

  .panel-kicker {
    margin-bottom: 6px;
    font-size: 7px;
  }

  .panel-heading h2 {
    font-size: 11px;
    letter-spacing: .16em;
  }

  .panel-tools {
    gap: 7px;
  }

  .panel-count {
    min-width: 54px;
    height: 22px;
    font-size: 7px;
  }

  .panel-close {
    width: 22px;
    height: 22px;
  }

  .panel-scroll {
    padding: 14px 12px 18px;
  }

  .panel-footer {
    min-height: 38px;
    padding: 0 12px 0 16px;
    font-size: 6px;
  }

  .scroll-rail {
    top: 86px;
    right: -7px;
    bottom: 48px;
  }

  .card-grid {
    gap: 10px;
  }

  .card-select {
    padding: 8px;
  }

  .card-thumb,
  .palette-swatch-grid,
  .palette-color-grid,
  .sound-pack-preview,
  .bgm-preview {
    height: 96px;
    margin-bottom: 9px;
  }

  .palette-editor-body {
    padding: 8px;
  }

  .sound-pack-size {
    top: 15px;
    left: 10px;
    font-size: 26px;
  }

  .sound-pack-cells {
    top: 12px;
    right: 9px;
    bottom: 12px;
    width: 48px;
  }

  .card-title {
    font-size: 8px;
    letter-spacing: .13em;
  }

  .card-subtitle {
    font-size: 6px;
    letter-spacing: .1em;
  }

  .card-upload {
    min-height: 158px;
    padding: 10px;
  }

  .upload-mark {
    width: 32px;
    height: 32px;
  }

  .mini-action {
    min-height: 28px;
    font-size: 6px;
  }

  .share-actions {
    gap: 9px;
  }

  .social-share-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .social-share {
    min-height: 76px;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
  }

  .social-share:nth-child(2n) {
    border-right: 0;
  }

  .social-share:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .social-share-icon {
    width: 32px;
    height: 32px;
  }

  .social-share-icon svg {
    width: 21px;
    height: 21px;
  }

  .share-action {
    min-height: 92px;
    padding: 10px;
  }

  .summary-row {
    padding: 0 10px 0 12px;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 7px;
    font-size: 6px;
  }

  .summary-row strong {
    font-size: 7px;
  }

  #app.is-panel-open #stage {
    transform: translateX(0);
  }

  .character-frame {
    width: min(108vw, 620px);
    height: min(56vh, 480px);
  }

  .character-animation {
    height: min(56vh, 480px);
  }

  .status {
    bottom: 19px;
    max-width: calc(100% - 24px);
  }

  .library-toast {
    right: 112px;
    bottom: 16px;
    max-width: calc(100vw - 126px);
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .library-dock {
    gap: 7px;
  }

  .dock-item {
    min-height: 54px;
    gap: 4px;
  }

  .dock-icon-ring {
    width: 42px;
    height: 42px;
  }

  .dock-label {
    font-size: 7px;
  }

  .panel-wrapper {
    top: 24px;
    bottom: 24px;
  }

  .panel-header {
    min-height: 70px;
    padding-top: 14px;
    padding-bottom: 12px;
  }
}

@media (hover: none) {
  .library-handle {
    width: 44px;
  }

  .library-handle-line {
    left: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
