::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

.glass-panel {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.aspect-16-9 { aspect-ratio: 16 / 9; }
.aspect-9-16 { aspect-ratio: 9 / 16; }

#view-score {
  min-height: 0;
  flex: 1 1 0%;
}
#view-score #karaokeFrame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
}

#view-dance {
  min-height: 0;
  flex: 1 1 0%;
}
#view-dance #cds3dFrame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
}
#viewport-canvas.aspect-16-9 {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
}

#viewport-canvas.aspect-9-16 {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 1;
  min-height: 0;
  min-width: 0;
}

/* 段階2: 3Dダンス + 9:16 — iframe を親いっぱい（transport 左レイアウトは CDS3D 内） */
#viewport-shell.player-shell-dance-916 {
  align-items: stretch;
  justify-content: stretch;
}

#viewport-canvas.player-canvas-dance-916 {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  margin-left: 0;
  margin-right: 0;
  aspect-ratio: unset;
  flex: 1 1 0%;
  min-height: 0;
}

.player-view-btn.is-active {
  background: rgb(30 41 59);
  border-color: rgb(51 65 85);
  color: rgb(226 232 240);
}

.player-view-btn[data-view="dance"].is-active i { color: rgb(34 211 238); }
.player-view-btn[data-view="score"].is-active i { color: rgb(34 211 238); }
.player-view-btn[data-view="camera"].is-active i { color: rgb(244 114 182); }

/* Home: 左サイド + メイン（PoC） */
.home-shell {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0;
  min-height: calc(100dvh - 4.5rem);
}

.home-left-col {
  display: flex;
  flex-direction: column;
  width: 100%;
  shrink: 0;
  border-bottom: 1px solid rgb(30 41 59 / 0.8);
}

@media (min-width: 768px) {
  .home-left-col {
    width: 17.5rem;
    border-bottom: none;
    border-right: 1px solid rgb(30 41 59 / 0.8);
    position: sticky;
    top: 4.5rem;
    align-self: flex-start;
    max-height: calc(100dvh - 4.5rem);
    overflow: hidden;
  }
}

.home-sidebar-nav {
  padding: 1rem 0.75rem 0.75rem;
  shrink: 0;
}

.home-ranking-panel {
  flex: 1;
  min-height: 0;
  padding: 0 0.5rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .home-ranking-panel {
    overflow: hidden;
  }
}

.home-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(148 163 184);
  transition: background 0.15s, color 0.15s;
}

.home-sidebar-link:hover {
  background: rgb(30 41 59 / 0.6);
  color: rgb(226 232 240);
}

.home-sidebar-link.is-active {
  background: rgb(8 51 68 / 0.5);
  color: rgb(103 232 249);
  border: 1px solid rgb(6 182 212 / 0.25);
}

.home-sidebar-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.home-sidebar-soon {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(100 116 139);
  border: 1px dashed rgb(51 65 85 / 0.85);
  background: rgb(15 23 42 / 0.35);
  cursor: default;
}

.home-sidebar-soon > i {
  margin-top: 0.125rem;
  opacity: 0.55;
}

.home-sidebar-soon-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.home-sidebar-soon-label {
  color: rgb(148 163 184);
  line-height: 1.2;
}

.home-sidebar-soon-hint {
  font-size: 0.625rem;
  font-weight: 700;
  color: rgb(71 85 105);
  letter-spacing: 0.02em;
}

.home-main {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .home-main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .home-main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.home-mobile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .home-mobile-nav {
    display: none;
  }
}

.ranking-scroll {
  scrollbar-gutter: stable;
}

/* UI-4: Work サムネ / ホームヒーロー */
.work-thumb-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    transparent 28%,
    rgba(255, 255, 255, 0.11) 42%,
    transparent 52%
  );
  pointer-events: none;
}

.work-tieup-thumb {
  box-shadow: 0 12px 28px -10px rgb(0 0 0 / 0.55);
}

.work-hero-visual {
  box-shadow:
    0 24px 48px -16px rgb(0 0 0 / 0.65),
    0 0 0 1px rgb(255 255 255 / 0.08);
}

.home-hero-section {
  min-height: 15rem;
}

/* G4 / 共通トースト */
.muvic-toast-host {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(24rem, calc(100vw - 2rem));
}

.muvic-toast {
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translateY(0.5rem);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
  box-shadow: 0 12px 32px -8px rgb(0 0 0 / 0.55);
  border: 1px solid rgb(51 65 85 / 0.8);
  background: rgb(15 23 42 / 0.95);
  color: rgb(226 232 240);
}

.muvic-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.muvic-toast--info {
  border-color: rgb(34 211 238 / 0.35);
  color: rgb(165 243 252);
}

.muvic-toast--warn {
  border-color: rgb(251 191 36 / 0.4);
  color: rgb(253 230 138);
}

.muvic-toast--success {
  border-color: rgb(52 211 153 / 0.35);
  color: rgb(167 243 208);
}

@media (min-width: 768px) {
  .home-hero-section {
    min-height: 17.5rem;
  }
}

.home-hero-backdrop {
  position: absolute;
  inset: -8%;
  opacity: 0.42;
  filter: saturate(1.15);
  pointer-events: none;
}

.home-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgb(6 182 212 / 0.18), transparent 45%),
    radial-gradient(circle at 10% 90%, rgb(168 85 247 / 0.12), transparent 40%);
}

.home-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgb(2 6 23 / 0.92) 0%,
    rgb(2 6 23 / 0.55) 42%,
    rgb(2 6 23 / 0.35) 100%
  );
}
