/* ============================================================
   JUGEND SNS DOCK（index.html / PRO.html 共通）
   ヘッダ右上の「＋」。クリックで下方向にアイコンが飛び出す。
   ============================================================ */
.ju-dock-slot {
  --ju-dock-size: 34px;
  position: relative;
  flex-shrink: 0;
  width: var(--ju-dock-size, 34px);
  height: var(--ju-dock-size, 34px);
  z-index: 1100;
}

.ju-dock {
  --ju-orb: 34px;
  --ju-pad: 0px;
  --ju-base: var(--ju-orb);
  --ju-item: 34px;
  --ju-gap: 8px;
  --ju-slot: calc(var(--ju-item) + var(--ju-gap));
  --ju-n: 4;
  --ju-dock-size: var(--ju-orb);
  /* fixed so open panel escapes the header stacking context */
  position: fixed;
  top: var(--ju-dock-top, max(12px, env(safe-area-inset-top)));
  right: var(--ju-dock-right, max(10px, env(safe-area-inset-right)));
  z-index: 2000;
  width: var(--ju-base);
  height: var(--ju-base);
  -webkit-tap-highlight-color: transparent;
}

html.yt-modal-open .ju-dock {
  display: none !important;
}

/* 円や帯は描かず、アイコンだけを浮かせる */
.ju-dock__bg {
  position: absolute;
  right: 0;
  top: 0;
  box-sizing: border-box;
  width: var(--ju-base);
  height: var(--ju-base);
  border-radius: calc(var(--ju-base) / 2);
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}
.ju-dock.is-open .ju-dock__bg {
  height: calc(var(--ju-base) + 8px + (var(--ju-n) - 1) * var(--ju-slot) + var(--ju-item));
}

.ju-dock__bg::before {
  content: none;
}

/* 玉（＋ ⇄ ×） */
.ju-dock__orb {
  position: absolute;
  left: var(--ju-pad);
  top: var(--ju-pad);
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--ju-orb);
  height: var(--ju-orb);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ju-dock__orb i {
  position: absolute;
  width: 13px;
  height: 1.6px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.ju-dock__orb i:nth-child(2) {
  transform: rotate(90deg);
}
.ju-dock.is-open .ju-dock__orb i:nth-child(1) {
  transform: rotate(45deg);
}
.ju-dock.is-open .ju-dock__orb i:nth-child(2) {
  transform: rotate(135deg);
}
.ju-dock__orb:focus-visible {
  outline: 2px solid rgba(245, 242, 233, 0.9);
  outline-offset: 1px;
}

/* アイコン（玉から下へ飛び出す） */
.ju-dock__item {
  --ty: calc(-1 * (var(--ju-base) / 2 + 2px + var(--ju-item) / 2 + var(--slot) * var(--ju-slot)));
  --cs: 0.3;
  position: absolute;
  left: calc((var(--ju-base) - var(--ju-item)) / 2);
  top: calc(var(--ju-base) + 2px + var(--slot) * var(--ju-slot));
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--ju-item);
  height: var(--ju-item);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(var(--ty)) scale(var(--cs));
  scale: var(--s, 1);
  transition:
    transform 0.4s cubic-bezier(0.5, 0, 0.75, 0),
    scale 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    visibility 0s linear 0.4s;
}
.ju-dock.is-open .ju-dock__item {
  --ty: 0px;
  --cs: 1;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--slot) * 45ms),
    scale 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease calc(var(--slot) * 45ms),
    background-color 0.2s ease,
    color 0.2s ease,
    visibility 0s linear 0s;
}
.ju-dock__item svg {
  display: block;
  pointer-events: none;
}
.ju-dock__yt svg { width: 22px; height: 16px; }
.ju-dock__sc svg { width: 19px; height: 19px; }
.ju-dock__ig svg { width: 16px; height: 16px; }
.ju-dock__kg svg { width: 21px; height: 23px; }
.ju-dock__item:hover,
.ju-dock__item.is-hot,
.ju-dock__item:focus-visible,
.ju-dock__item:active {
  background: rgba(245, 242, 233, 0.97);
  color: #0b0b0b;
  outline: none;
}
html.theme-invert .ju-dock__item:hover,
html.theme-invert .ju-dock__item.is-hot,
html.theme-invert .ju-dock__item:focus-visible,
html.theme-invert .ju-dock__item:active {
  background: #111111;
  color: #f5f5f5;
  outline: none;
}
html.theme-invert .ju-dock__item:focus-visible {
  box-shadow: 0 0 0 2px #111111, 0 0 0 4px rgba(255, 255, 255, 0.8);
}
.ju-dock__item:focus-visible {
  box-shadow: 0 0 0 2px rgba(245, 242, 233, 0.9), 0 0 0 4px rgba(0, 0, 0, 0.5);
}
.ju-dock__item:active {
  scale: calc(var(--s, 1) * 0.9);
}

.ju-eq {
  display: none;
  align-items: flex-end;
  gap: 2.5px;
  height: 15px;
}
.ju-eq i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom;
  animation: ju-eq 0.9s ease-in-out infinite;
}
.ju-eq i:nth-child(2) { animation-delay: -0.3s; }
.ju-eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes ju-eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
.ju-dock__sc.is-playing .ju-eq { display: flex; }
.ju-dock__sc.is-playing .ju-sc-glyph { display: none; }
/* 段階式 SoundCloud: 呼び出し後は三角、再生中はイコライザ。
   再生中にホバー/フォーカスすると II（停止）に切り替わる。 */
.ju-dock__sc .ju-sc-play,
.ju-dock__sc .ju-sc-pause {
  display: none;
}
.ju-dock__sc.is-armed:not(.is-playing) .ju-sc-logo { display: none; }
.ju-dock__sc.is-armed:not(.is-playing) .ju-sc-play { display: block; }
.ju-dock__sc.is-playing:hover .ju-eq,
.ju-dock__sc.is-playing:focus-visible .ju-eq { display: none; }
.ju-dock__sc.is-playing:hover .ju-sc-pause,
.ju-dock__sc.is-playing:focus-visible .ju-sc-pause { display: block; }
.ju-dock__sc.is-loading .ju-sc-glyph {
  animation: ju-sc-wait 0.9s ease-in-out infinite;
}
@keyframes ju-sc-wait {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.92); }
}

.ju-sc-stage {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  opacity: 0.001;
  pointer-events: none;
  overflow: hidden;
  z-index: 2100;
}
.ju-sc-stage.is-hit-active {
  pointer-events: auto;
  cursor: pointer;
}
.ju-sc-stage iframe {
  position: absolute;
  left: calc(50% - 29.5px);
  top: calc(50% - 32.5px);
  width: 300px;
  height: 166px;
  border: 0;
  display: block;
}
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  .ju-dock,
  .ju-dock-slot {
    --ju-orb: 30px;
    --ju-item: 30px;
    --ju-gap: 7px;
    --ju-dock-size: 30px;
  }
  .ju-dock__kg svg { width: 18px; height: 20px; }
  .ju-dock__yt svg { width: 19px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .ju-eq i { animation: none; }
  .ju-dock__item,
  .ju-dock.is-open .ju-dock__item,
  .ju-dock__bg {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}

/* PRO EDITION など別ページを「重ね表示」する層（ドックと音を止めずにページを切り替える） */
.ju-pro-layer {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: #0a0a0a;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ju-pro-layer.is-in {
  opacity: 1;
}
.ju-pro-layer__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}
html.pro-open,
html.pro-open body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
html.pro-open #main-content {
  visibility: hidden;
}
html.pro-open #cursor3d {
  display: none !important;
}
/* 重ね表示中は PRO 側ヘッダの＋を使う（音は親ページで鳴り続ける） */
html.pro-open .ju-dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#ju-pro-print-root {
  display: none;
}

@media print {
  html.pro-open,
  html.pro-open body {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: #000000 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  html.pro-open body > *:not(#ju-pro-print-root) {
    display: none !important;
  }
  html.pro-open #ju-pro-print-root {
    display: block !important;
  }
}

/* ============================================================
   CENTERED YOUTUBE PLAYER MODAL
   ============================================================ */
html.yt-modal-open,
html.yt-modal-open body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.ju-yt-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overscroll-behavior: none;
  touch-action: none;
}

.ju-yt-modal[hidden] {
  display: none;
}

.ju-yt-modal__frame {
  position: relative;
  width: min(1080px, 88vw, calc(82svh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000000;
  border: 0;
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.ju-yt-modal__close {
  position: absolute;
  top: -36px;
  right: 0;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.65);
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ju-yt-modal__close:hover,
.ju-yt-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  outline: none;
}

.ju-yt-modal__stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
}

.ju-yt-modal__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  display: block;
}

@media (max-width: 480px) {
  .ju-yt-modal {
    padding: 12px;
  }
  .ju-yt-modal__frame {
    width: calc(100vw - 24px);
  }
}

@media (max-height: 500px) {
  .ju-yt-modal__frame {
    width: min(84vw, calc(74svh * 16 / 9));
  }
}
