/* =====================================================================
   components.css : カード・チームパネル・ルーレット・NEWS・スケジュール・
                    メンバー・プレイヤー・OBS URL発行ページ
   ===================================================================== */

/* ---------- 状態バナー（エラー / 古い可能性） ---------- */
.status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 22px;
  padding: 12px 16px;
  border-left: 3px solid var(--c-error);
  background: rgba(var(--c-error-rgb), 0.09);
  color: #ffd3d9;
  font-size: 0.95rem;
}

.status-banner.is-stale {
  border-left-color: #e0a030;
  background: rgba(224, 160, 48, 0.09);
  color: #f3dcae;
}

.status-banner .btn {
  margin-left: auto;
}

.live-dot {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  background: var(--gold-sheen);
  box-shadow: 0 0 10px var(--c-primary);
  animation: pulse 1.4s ease-in-out infinite;
}

.live-dot.is-off {
  background: var(--c-offline);
  box-shadow: none;
  animation: none;
}

/* ---------- 配信者カード ---------- */
.card {
  --cut: 14px;
}

.card--live {
  filter: drop-shadow(0 0 10px rgba(var(--c-primary-rgb), 0.32));
}

.card--live:hover,
.card:hover {
  filter: drop-shadow(0 0 16px rgba(var(--c-primary-rgb), 0.6));
  transform: translateY(-3px);
}

.card--live .cut-edge {
  background: linear-gradient(135deg, var(--c-primary), rgba(var(--c-primary-rgb), 0.3) 50%, var(--c-primary-bright));
}

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #050507;
  overflow: hidden;
}

.card-media-inner {
  position: absolute;
  inset: 0;
  display: block;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%; /* サムネイルが無くて縦長のメンバー画像を使うとき、顔が入りやすい位置 */
  transition: transform 0.5s ease;
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, var(--c-panel) 100%);
  pointer-events: none;
}

.card-media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.4rem;
  color: rgba(var(--c-primary-rgb), 0.55);
  background:
    linear-gradient(120deg, transparent 40%, rgba(var(--c-primary-rgb), 0.18) 41%, transparent 60%),
    linear-gradient(135deg, #2a0b12, #0d0d14);
}

.card-media .badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
}

.chip-viewers {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.card-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px 18px;
}

.card-id {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: -30px;
  position: relative;
  z-index: 3;
}

.card-id .avatar {
  width: 60px;
  height: 60px;
}

.card-id-text {
  min-width: 0;
  padding-top: 34px;
}

.card-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-name a:hover {
  color: var(--c-primary-bright);
}

.card-handle {
  font-size: 0.8rem;
  color: var(--c-muted);
  line-height: 1.3;
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  font-variant-numeric: tabular-nums;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  white-space: nowrap;
}

.stat small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--c-muted);
  letter-spacing: 0.04em;
}

.stat .icon {
  color: var(--c-primary-bright);
}

.card-title {
  font-size: 0.95rem;
  line-height: 1.55;
  min-height: 3.1em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.card-category {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--c-muted);
}

.card-category b {
  flex: none;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--c-primary-bright);
}

.card-category span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 4px;
}

/* オフライン（コンパクト） */
.card--offline {
  filter: none;
}

.card--offline .cut-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.card--offline .avatar {
  width: 52px;
  height: 52px;
  box-shadow: 0 0 0 2px rgba(var(--c-offline-rgb), 0.6);
}

.card--offline .avatar img {
  filter: grayscale(0.85) brightness(0.8);
}

.card--offline .avatar-initial {
  color: var(--c-offline);
}

.card--offline .cut-edge {
  background: linear-gradient(135deg, rgba(var(--c-offline-rgb), 0.55), rgba(var(--c-offline-rgb), 0.12));
}

.card--offline:hover {
  filter: drop-shadow(0 0 10px rgba(var(--c-offline-rgb), 0.35));
}

.offline-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.offline-text .card-name {
  max-width: 100%;
  font-size: 0.95rem;
  color: #d0d0da;
}

.offline-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--c-muted);
}

.offline-link:hover {
  color: #fff;
}

.group-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 18px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--c-muted);
}

.group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--c-primary-rgb), 0.5), transparent);
}

.empty-note {
  padding: 26px 20px;
  text-align: center;
  color: var(--c-muted);
  border: 1px dashed rgba(var(--c-primary-rgb), 0.35);
}

/* ---------- スケルトン（読み込み中） ---------- */
.skeleton {
  min-height: 300px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.03) 30%, rgba(var(--c-primary-rgb), 0.1) 50%, rgba(255, 255, 255, 0.03) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- ルーレット ---------- */
.roulette-box .cut-wrap,
.roulette-box {
  --cut: 20px;
}

.roulette-inner {
  padding: 28px;
}

.roulette-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 20px;
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.4);
}

.mode-btn {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--c-muted);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
  transition: background 0.2s ease, color 0.2s ease;
}

.mode-btn[aria-checked="true"] {
  background: var(--gold-sheen);
  color: #1c1204;
}

.mode-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.roulette-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 24px 12px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(var(--c-primary-rgb), 0.18), transparent 70%),
    #08080c;
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.3);
}

.roulette-stage::before,
.roulette-stage::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 34%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--c-primary), var(--c-glow));
  box-shadow: 0 0 14px rgba(var(--c-primary-rgb), 0.9);
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.roulette-stage::before {
  left: 0;
}

.roulette-stage::after {
  right: 0;
  transform: none;
}

.roulette-stage.is-spinning::before,
.roulette-stage.is-spinning::after {
  opacity: 1;
  animation: streak 0.32s linear infinite;
}

.roulette-stage.is-winner::before,
.roulette-stage.is-winner::after {
  opacity: 0.9;
}

@keyframes streak {
  from {
    width: 10%;
  }
  to {
    width: 40%;
  }
}

.reel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.reel .avatar {
  width: 104px;
  height: 104px;
}

.reel .avatar-initial {
  font-size: 2.6rem;
}

.reel-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 6.4vw, 2.7rem);
  letter-spacing: 0.1em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.reel.is-tick {
  animation: tick 0.16s ease-out;
}

@keyframes tick {
  from {
    transform: translateY(-16px);
    opacity: 0.25;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.roulette-stage.is-spinning .reel-name {
  filter: blur(0.6px);
}

.roulette-stage.is-winner .reel .avatar {
  width: 128px;
  height: 128px;
  box-shadow: 0 0 0 3px var(--c-glow), 0 0 30px rgba(var(--c-primary-rgb), 0.95);
}

.roulette-stage.is-winner .reel-name {
  color: var(--c-glow);
  font-size: clamp(2rem, 8vw, 3.4rem);
  text-shadow: 0 0 22px rgba(var(--c-primary-rgb), 1), 0 0 60px rgba(var(--c-primary-rgb), 0.7);
  animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.winner-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  color: var(--c-primary-bright);
}

.confetti {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 9px;
  height: 16px;
  background: var(--c-primary);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  pointer-events: none;
  animation: burst 1.4s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}

.confetti:nth-child(3n) {
  background: var(--c-glow);
}

.confetti:nth-child(3n + 1) {
  background: var(--c-primary-bright);
}

@keyframes burst {
  from {
    transform: translate(-50%, -50%) rotate(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(0.5);
    opacity: 0;
  }
}

.roulette-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.roulette-actions:empty {
  display: none;
}

/* 当選者のアカウント名（URLではなく名前のみ）とコピーボタン */
.roulette-account {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}

.account-label {
  color: var(--c-muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.account-name {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.45);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  word-break: break-all;
  user-select: all;
}

.account-copy.is-done {
  color: #1c1204;
  background: var(--gold-sheen);
}

.btn-start {
  min-width: 200px;
  min-height: 56px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.24em;
}

.roulette-msg {
  min-height: 1.6em;
  margin-top: 14px;
  text-align: center;
  color: var(--c-muted);
  font-size: 0.95rem;
}

.roulette-msg.is-warn {
  color: #ffd3d9;
}

/* ---------- 死神ルーレット ----------
   魂（配信中のメンバー）が並び、死神が上を飛び回って、鎌で 1 人を刈り取る。
   死神の絵は js/roulette.js の REAPER_SVG（オリジナルのイラスト） */
.roulette-stage.has-arena {
  display: block;
  min-height: 0;
  padding: 18px 12px 14px;
}

.reaper-arena {
  position: relative;
  z-index: 1;
}

.reaper-arena.is-shake {
  animation: arena-shake 0.34s ease-out;
}

@keyframes arena-shake {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: translate(-5px, 3px);
  }
  40% {
    transform: translate(5px, -3px);
  }
  60% {
    transform: translate(-3px, 2px);
  }
  80% {
    transform: translate(3px, -1px);
  }
}

/* 死神が動く帯。鎌の先が、すぐ下の魂に届く高さ */
.reaper-lane {
  position: relative;
  height: 122px;
}

.reaper {
  --move: 0ms;
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  z-index: 3;
  pointer-events: none;
  transition: transform var(--move) cubic-bezier(0.3, 0.8, 0.4, 1);
  filter: drop-shadow(0 0 14px rgba(var(--air-rgb, 255, 42, 61), 0.45)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.7));
}

.reaper-flip {
  transition: transform 0.12s ease-out;
}

.reaper-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  animation: reaper-float 2.4s ease-in-out infinite;
}

@keyframes reaper-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.reaper.is-summon {
  animation: reaper-summon 0.7s ease-out both;
}

@keyframes reaper-summon {
  from {
    opacity: 0;
    margin-top: 40px;
    filter: blur(8px);
  }
  to {
    opacity: 1;
    margin-top: 0;
  }
}

.rp-eye {
  animation: rp-eye 1.6s ease-in-out infinite;
}

@keyframes rp-eye {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

/* 鎌：手の位置（150, 148）を中心に回る */
.scythe {
  transform-box: view-box;
  transform-origin: 150px 148px;
  transform: rotate(6deg);
  transition: transform 0.3s ease-out;
}

.reaper[data-pose="windup"] .scythe {
  transform: rotate(38deg);
  transition: transform 0.55s cubic-bezier(0.3, 0.1, 0.3, 1);
}

.reaper[data-pose="swing"] .scythe {
  transform: rotate(-58deg);
  transition: transform 0.15s cubic-bezier(0.7, 0, 1, 0.5);
}

/* 動画の死神（reaper-spin.webm / reaper-swing.webm）。2 本を同じ場所に重ね、止まる瞬間に SWING に切り替える。
   動画は 1442×919（横長）。魂（真ん中のカード）の右側に、舞台の高さいっぱいに大きく置く（動画の元の向きのまま）。
   --rv-h＝死神の高さ、--rv-cx＝真ん中から死神の身体の中心までの横のずれ、--rv-top＝上のずれ
   （左右を反転したいときは、.reaper.is-video .reaper-flip の transform を scaleX(-1) にし、margin-left の -0.405 を -0.595 にする） */
.reaper-arena.has-video .reaper-lane {
  height: 0;
}

.reaper-arena.has-video .reel-stack {
  margin-top: 0;
  min-height: 330px;
}

.reaper.is-video {
  --rv-h: 420px;
  --rv-cx: 95px;
  --rv-top: -30px;
  --rv-w: calc(var(--rv-h) * 1442 / 919);
  top: var(--rv-top);
  width: var(--rv-w);
  height: var(--rv-h);
  left: 50%;
  margin-left: calc(var(--rv-w) * -0.405 + var(--rv-cx));
  filter: drop-shadow(0 0 14px rgba(var(--air-rgb, 255, 42, 61), 0.35));
}

.reaper.is-video .reaper-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform: none;
}

.reaper-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
}

/* iPhone / Safari 用（色と透明度を並べた MP4 を WebGL で合成した死神）。中身は <img>（仮の画像）と <canvas> */
.reaper-stack .reaper-stack-poster,
.reaper-stack canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* 注意：子要素に visibility: visible を直接書くと、親（.is-swing など）の visibility: hidden が効かなくなり、
   SPIN と SWING の 2 つの死神が同時に見えてしまう。そのため、出し入れは visibility ではなく opacity で行い、
   visibility は親から受け継ぐ（初期値のまま）ようにしている */
.reaper-stack canvas {
  opacity: 0;
}

.reaper-stack.has-frame canvas {
  opacity: 1;
}

.reaper-stack.has-frame .reaper-stack-poster {
  opacity: 0;
}

.reaper-video.is-swing {
  visibility: hidden;
}

.reaper-video.is-swing.is-on {
  visibility: visible;
}

.reaper-video.is-spin.is-off {
  visibility: hidden;
}

/* 1 人ずつの表示：回っている間は当初のルーレットの見た目（.reel）のまま。全員分を同じ場所に重ね、「いま出ている 1 枚」だけを見せる */
.reel-stack {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 210px;
  margin-top: 44px;
}

.reel-stack .reel-card {
  grid-area: 1 / 1;
}

.reel-stack .reel-card:not(.is-current) {
  visibility: hidden;
}

.reel-card.is-unknown .avatar {
  display: grid;
  place-items: center;
  opacity: 0.6;
}

.reel-card.is-unknown .reel-name {
  color: var(--c-muted);
  font-size: clamp(1.1rem, 4.6vw, 1.5rem);
  letter-spacing: 0.3em;
}

/* 刈り取られる：白くひらめいて、赤く染まり、散っていく */
.reel-card.is-slain {
  animation: soul-slain 0.95s ease-in forwards;
}

.reel-card.is-slain::after {
  content: "";
  position: absolute;
  left: -20%;
  top: 50px;
  width: 140%;
  height: 4px;
  background: linear-gradient(90deg, transparent, #fff 20%, #fff 55%, #ff2a3d 85%, transparent);
  box-shadow: 0 0 14px 2px rgba(255, 255, 255, 0.9), 0 0 24px rgba(var(--air-rgb, 255, 42, 61), 0.9);
  transform: rotate(-32deg) scaleX(0);
  animation: slash 0.38s ease-out forwards;
}

@keyframes slash {
  0% {
    transform: rotate(-32deg) scaleX(0);
    opacity: 1;
  }
  60% {
    transform: rotate(-32deg) scaleX(1);
    opacity: 1;
  }
  100% {
    transform: rotate(-32deg) scaleX(1);
    opacity: 0;
  }
}

@keyframes soul-slain {
  0% {
    filter: brightness(1);
  }
  18% {
    filter: brightness(3.2);
    transform: scale(1.1);
  }
  45% {
    filter: brightness(1) sepia(1) saturate(6) hue-rotate(-30deg);
    transform: scale(1.04);
  }
  100% {
    filter: blur(6px) brightness(0.4);
    transform: translateY(-28px) scale(1.25);
    opacity: 0;
  }
}

.arena-caption {
  margin-top: 12px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--c-primary-bright);
}

@media (max-width: 640px) {
  .reaper.is-video {
    --rv-h: 290px;
    --rv-cx: 22px;
    --rv-top: -10px;
  }
  .reaper:not(.is-video) {
    width: 112px;
  }
  .reaper-lane {
    height: 92px;
  }
  .reel-stack {
    min-height: 196px;
    margin-top: 52px;
  }
  .reel-card.is-slain::after {
    top: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reaper-svg,
  .rp-eye,
  .reaper.is-summon,
  .reaper-arena.is-shake {
    animation: none;
  }
}

@media (max-width: 640px) {
  .roulette-inner {
    padding: 18px 14px;
  }
  .mode-switch {
    width: 100%;
  }
  .mode-btn {
    flex: 1;
    padding: 0 8px;
    font-size: 0.68rem;
  }
  .btn-start {
    width: 100%;
  }
}

/* ---------- NEWS ---------- */
.news-list {
  border-top: 1px solid rgba(var(--c-primary-rgb), 0.3);
}

.news-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.news-row {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding: 16px 4px;
  list-style: none;
  cursor: default;
}

summary.news-row {
  cursor: pointer;
}

summary.news-row::-webkit-details-marker {
  display: none;
}

.news-date {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--c-primary-bright);
}

.news-title {
  font-weight: 700;
}

.news-toggle {
  color: var(--c-muted);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

details[open] > summary .news-toggle {
  transform: rotate(180deg);
}

.news-body {
  padding: 0 4px 20px 142px;
  color: #d3d3dc;
  white-space: pre-line;
}

@media (max-width: 640px) {
  .news-row {
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
  }
  .news-date {
    grid-column: 1 / -1;
  }
  .news-body {
    padding-left: 4px;
  }
}

/* ---------- メンバーカード（MEMBERS） ---------- */
/* 金の枠つきメンバーカード。枠の画像は 3:4（assets/frame/member-frame.webp）。
   写真は枠の内側の形（member-frame-mask.png）で切り抜いて、枠の下に敷く */
.member-card--framed {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.member-card--framed:hover {
  filter: drop-shadow(0 0 14px rgba(var(--c-primary-rgb), 0.5));
}

.member-card--framed > .cut-wrap {
  flex: 1;
}

.member-card .cut-body {
  display: flex;
  flex-direction: column;
}

.member-frame {
  position: relative;
  display: block;
  aspect-ratio: 1086 / 1448;
}

.member-frame-stack {
  position: absolute;
  inset: 0;
  display: block;
}

.member-frame-clip {
  position: absolute;
  inset: 0;
  display: block;
  /* 切り抜きの型は枠全体と同じ大きさ・位置で当てる（写真の箱ではなく、この全体に） */
  -webkit-mask-image: url("../assets/frame/member-frame-mask.png");
  mask-image: url("../assets/frame/member-frame-mask.png");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.member-frame-photo {
  position: absolute;
  /* 枠の内側（穴）より少し大きめに置いて、枠の下に潜り込ませる */
  left: 11%;
  top: 13.3%;
  width: 78%;
  height: 72.7%;
  display: block;
  overflow: hidden;
  background: #08080c;
}

.member-frame-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 90%; /* 下の名前の文字が枠のドクロに隠れにくいよう、少し下寄せ */
  transform: scale(1.02);
  transition: transform 0.5s ease;
}

.member-card:hover .member-frame-photo img,
.profile-frame:hover .member-frame-photo img {
  transform: scale(1.08);
}

.member-frame-ring {
  position: absolute;
  inset: 0;
  display: block;
  background: url("../assets/frame/member-frame.webp") center / 100% 100% no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}

/* LIVE / OFFLINE バッジは枠の内側（左上）に置く */
.member-frame .badge {
  position: absolute;
  left: 18%;
  top: 19%;
  z-index: 2;
}

.member-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 4px 16px 16px;
}

.member-info .card-name {
  font-size: 1rem;
}

.member-desc {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #cfcfd9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pill-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
  background: rgba(var(--c-primary-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.55);
  transition: background 0.2s ease;
}

.pill:hover {
  background: rgba(var(--c-primary-rgb), 0.4);
}

.pill .icon {
  width: 13px;
  height: 13px;
}

/* SNS のアイコンボタン（X / YouTube / Instagram / HP）。タップで新しいタブが開く */
.pill-links {
  align-items: center;
}

.social-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(var(--c-primary-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.55);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-btn:hover,
.social-btn:focus-visible {
  color: #0b0b0e;
  background: var(--c-glow);
  transform: translateY(-2px);
}

.social-btn .social-svg {
  display: block;
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .member-info {
    padding: 2px 12px 14px;
  }
  /* 2 列表示の LIVE カードでも、ボタンが枠からはみ出ないようにする */
  .member-info .card-actions {
    gap: 6px;
  }
  .member-info .card-actions .btn {
    padding-left: 8px;
    padding-right: 8px;
    min-width: 0;
    letter-spacing: 0;
    font-size: 0.78rem;
    justify-content: center;
  }
  .member-info .card-actions .btn-primary .icon {
    display: none;
  }
  .member-desc {
    font-size: 0.82rem;
    -webkit-line-clamp: 2;
  }
  .pill {
    min-height: 40px;
    padding: 0 12px;
  }
}

/* ---------- メンバー詳細 ---------- */
.profile {
  display: grid;
  /* 写真（金の枠）は大きく見せる。広い画面では最大 580px */
  grid-template-columns: minmax(280px, 580px) 1fr;
  gap: 44px;
  align-items: start;
}

.profile .pill-links {
  margin-bottom: 24px;
}

.profile-frame {
  width: 100%;
}

.profile-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow: 0 0 22px rgba(var(--c-primary-rgb), 0.55);
  overflow-wrap: anywhere;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 10px 0 18px;
  color: var(--c-muted);
}

.profile-desc {
  margin-bottom: 22px;
  white-space: pre-line;
  color: #dadae3;
}

.info-panel .cut-wrap {
  --cut: 16px;
}

.info-panel-inner {
  padding: 22px 24px 24px;
}

.info-panel h3 {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  color: var(--c-primary-bright);
}

.info-title {
  margin-bottom: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.info-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-bottom: 16px;
}

.info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 24px;
}

@media (max-width: 760px) {
  .profile {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .profile-frame {
    max-width: 520px;
    margin-inline: auto;
  }
  .info-panel-inner {
    padding: 18px 16px 20px;
  }
  .info-actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- 配信プレイヤー ---------- */
.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 0 1px rgba(var(--c-primary-rgb), 0.55), 0 0 40px rgba(var(--c-primary-rgb), 0.25);
}

.player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.member-chip[aria-current="true"] {
  background: rgba(var(--c-primary-rgb), 0.22);
  box-shadow: inset 0 0 0 1px var(--c-primary);
}

.member-chip:hover {
  background: rgba(var(--c-primary-rgb), 0.16);
}

.watch-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.note {
  margin-top: 14px;
  color: var(--c-muted);
  font-size: 0.85rem;
}

/* ---------- SCHEDULE ---------- */
.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.day {
  --cut: 12px;
}

.day-inner {
  min-height: 200px;
  padding: 14px 12px 16px;
}

.day-head {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(var(--c-primary-rgb), 0.35);
}

.day-head b {
  font-weight: 800;
  font-size: 1.05rem;
}

.day-head span {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--c-muted);
}

.day.is-today .cut-edge {
  background: linear-gradient(135deg, var(--c-primary), rgba(var(--c-primary-rgb), 0.4), var(--c-primary-bright));
}

.day.is-today {
  filter: drop-shadow(0 0 12px rgba(var(--c-primary-rgb), 0.45));
}

.day.is-today .day-head b::after {
  content: " TODAY";
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--c-primary-bright);
}

.slot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}

.slot + .slot {
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.slot-time {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-primary-bright);
  font-variant-numeric: tabular-nums;
}

.slot-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.slot-name:hover {
  color: var(--c-primary-bright);
}

.slot-note {
  font-size: 0.78rem;
  color: var(--c-muted);
}

.slot-empty {
  font-size: 0.82rem;
  color: rgba(163, 163, 178, 0.6);
}

@media (max-width: 1080px) {
  .week {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .week {
    grid-template-columns: 1fr;
  }
  .day-inner {
    min-height: 0;
  }
}

/* ---------- ABOUT ---------- */
.about-lead {
  max-width: 40em;
  margin-bottom: 18px;
  font-size: 1.15rem;
  font-weight: 700;
}

.about-text {
  max-width: 42em;
  display: grid;
  gap: 14px;
  color: #d6d6df;
}

.activity-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.activity {
  padding: 22px 22px 24px;
}

.activity h3 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--c-glow);
}

.activity p {
  color: #cfcfd9;
  font-size: 0.93rem;
}

.about-members {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
}

.about-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 92px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.about-member .avatar {
  width: 72px;
  height: 72px;
}

/* ---------- OBS URL 発行ページ ---------- */
.obs-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.obs-form {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.obs-form fieldset,
.obs-form .field,
.preview-wrap {
  min-width: 0;
}

.range-row input[type="range"] {
  min-width: 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field > label,
.field > legend,
.field-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--c-muted);
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.select,
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: #0b0b10;
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.5);
  color: var(--c-text);
}

.select:focus,
.input:focus {
  outline: 2px solid var(--c-primary-bright);
  outline-offset: 1px;
}

.select option {
  background: #0b0b10;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  font-size: 0.92rem;
}

.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--c-primary);
}

.choice-mt {
  margin-top: 12px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--c-primary);
}

.range-row output {
  min-width: 3.5em;
  text-align: right;
  font-family: var(--font-num);
  font-size: 1.1rem;
}

.url-box {
  display: grid;
  gap: 10px;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.url-row .input {
  min-width: 0;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.preview-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.preview-stage {
  position: relative;
  overflow: hidden;
  padding: 0;
  /* OBS の配信画面（1920 × 1080）と同じ 16:9 の横長の画面。中のプレビューは、この幅に合わせて縮小して表示する */
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    repeating-conic-gradient(#2a2a33 0% 25%, #1d1d24 0% 50%) 50% / 24px 24px;
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.4);
}

/* OBS と同じ 1920 × 1080 の大きさで描いて、左上を基準に縮小する（縮小の倍率は js/pages/obs.js が画面の幅から計算） */
.preview-stage iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  border: 0;
  background: transparent;
  max-width: none;
  transform-origin: 0 0;
}

.size-hint {
  font-size: 0.9rem;
  color: #d3d3dc;
}

.size-hint b {
  font-family: var(--font-num);
  font-size: 1.1rem;
  color: var(--c-glow);
}

#schedule-note {
  margin-top: 24px;
}

.steps {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.steps li {
  position: relative;
  padding-left: 44px;
  min-height: 32px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--gold-sheen);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

@media (max-width: 960px) {
  .obs-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .url-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.info-panel .card-category {
  margin-bottom: 18px;
}

/* 画像の上に載るOFFLINEバッジは、明るい画像でも読めるように暗い背景にする */
.member-frame .badge-offline {
  background: rgba(0, 0, 0, 0.72);
  color: #d4d4de;
}

/* ---------- メンバーページの左右の縦書き文字（js/side-text.js） ----------
   明朝体の縦書き。本文の後ろに薄く敷く飾りで、クリックの邪魔はしない。
   画面が狭いと本文に隠れたり端で切れたりするが、それでよい */
.side-text {
  position: fixed;
  top: 50%;
  z-index: -1;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: "Shippori Mincho", "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "MS PMincho", serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 4.4rem); /* 実際の大きさ・位置は js/side-text.js が画面に合わせて決める */
  line-height: 1.12;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: rgba(var(--c-primary-rgb), 0.55);
  text-shadow: 0 0 18px rgba(var(--c-primary-rgb), 0.35), 0 2px 6px rgba(0, 0, 0, 0.8);
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
  animation: side-text-in 1.4s ease both;
}

.side-text--left {
  left: 0.5em;
}

.side-text--right {
  right: 0.5em;
}

@keyframes side-text-in {
  from {
    opacity: 0;
    transform: translateY(calc(-50% + 18px));
  }
  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@media (max-width: 760px) {
  /* 狭い画面では本文と重なるので、少し薄くして読みやすさを守る */
  .side-text {
    color: rgba(var(--c-primary-rgb), 0.36);
    text-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .side-text {
    animation: none;
  }
}

/* ---------- メンバーページの「配信履歴（直近 1 か月）」（js/history.js） ----------
   色は文字とセットで使う（OK＝緑／あり＝赤／疑い＝橙／要確認＝黄）。
   スマホでは、表を 1 件ずつのカード形式に切り替える */
.hist-host {
  --h-ok: 92, 214, 140;
  --h-bad: 255, 59, 77;
  --h-warn: 255, 150, 60;
  --h-check: 240, 210, 80;
  --h-idle: 143, 149, 163;
  margin-top: 40px;
}

.hist-inner {
  padding: 22px 24px 20px;
}

.hist-inner h3 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  color: var(--c-primary-bright);
}

.hist-inner h3 small {
  font-family: var(--font-body, inherit);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--c-muted);
}

.hist-scroll {
  max-height: 520px;
  overflow: auto;
}

.hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.hist-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: var(--c-muted);
  background: #141318;
  border-bottom: 1px solid rgba(var(--c-primary-rgb), 0.45);
}

.hist-table td {
  padding: 11px 12px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-variant-numeric: tabular-nums;
}

.hist-row.state-violation td {
  background: rgba(var(--h-bad), 0.09);
}

.hist-row.state-violation td:first-child {
  box-shadow: inset 4px 0 0 rgb(var(--h-bad));
}

.hist-dim {
  color: var(--c-muted);
}

.hist-bad {
  color: rgb(var(--h-bad));
  font-weight: 700;
}

.hist-link {
  color: var(--c-text);
  font-weight: 700;
}

.hist-link:hover {
  text-decoration: underline;
}

.hist-src {
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  box-shadow: inset 0 0 0 1px rgba(var(--h-idle), 0.6);
}

.hist-src.is-host {
  color: var(--c-primary-bright);
  box-shadow: inset 0 0 0 1px rgba(var(--c-primary-rgb), 0.75);
}

.hist-src.is-confirmed {
  color: #1a1204;
  background: var(--gold-sheen);
  box-shadow: none;
  font-weight: 700;
}

.hist-badge {
  display: inline-block;
  min-width: 4.6em;
  padding: 0.15em 0.9em;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.hist-badge--ok {
  color: #06210f;
  background: rgb(var(--h-ok));
}
.hist-badge--bad {
  color: #fff;
  background: rgb(var(--h-bad));
}
.hist-badge--warn {
  color: #2a1200;
  background: rgb(var(--h-warn));
}
.hist-badge--check {
  color: #2a2200;
  background: rgb(var(--h-check));
}
.hist-badge--idle {
  color: var(--c-text);
  background: rgba(var(--h-idle), 0.3);
}

.hist-note {
  margin: 8px 0 4px;
  color: var(--c-muted);
}

.hist-foot {
  margin: 14px 0 0;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--c-muted);
}

@media (max-width: 720px) {
  .hist-host {
    margin-top: 28px;
  }
  .hist-inner {
    padding: 18px 14px 16px;
  }
  .hist-scroll {
    max-height: none;
  }
  .hist-table thead {
    display: none;
  }
  .hist-table,
  .hist-table tbody {
    display: block;
  }
  .hist-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .hist-table td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    white-space: normal;
    background: none !important;
    box-shadow: none !important;
  }
  .hist-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--c-muted);
  }
  .hist-badge {
    align-self: flex-start;
    min-width: 5.5em;
  }
  .hist-table td:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    font-size: 1.05rem;
  }
  .hist-table td:first-child::before {
    display: none;
  }
  .hist-row.state-violation {
    box-shadow: inset 4px 0 0 rgb(var(--h-bad));
    background: rgba(var(--h-bad), 0.09);
  }
}

/* ---------- メンバーページ：配信中は、メンバーの画像 → 配信画面のサムネイルに切り替え（js/pages/member.js） ----------
   サムネイル（横長）は、同じ画像をぼかして敷いた上に、そのままの比率で重ねる */
.member-frame .member-frame-photo .thumb-layer {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  background: #08080c;
  transition: opacity 0.9s ease;
  pointer-events: none;
}

.member-frame .member-frame-photo .thumb-layer.is-on {
  opacity: 1;
}

.member-frame .member-frame-photo .thumb-layer .thumb-bg {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: blur(16px) brightness(0.55);
  transform: none;
}

/* 配信画面は、枠の内側いっぱいに広げる（横長の画像の左右を切って、上下を見切れさせない）。
   枠の外には出ない（枠の形の切り抜き .member-frame-clip の内側に収まる） */
.member-frame .member-frame-photo .thumb-layer .thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: none;
}

/* テスト用のサンプル映像：枠いっぱいに広げ（上下が切れない）、再生できたら静止画の上に重ねる */
.member-frame .member-frame-photo .thumb-layer .thumb-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  background: #08080c;
  transition: opacity 0.3s ease;
}

.member-frame .member-frame-photo .thumb-layer.has-video .thumb-video {
  opacity: 1;
}

.member-frame .member-frame-photo .thumb-layer .thumb-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
}

.member-frame .member-frame-photo .thumb-layer .thumb-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b4d;
}

/* MEMBERS 一覧のカード：マウスを載せたとき・スマホで中央に来たとき、すっと切り替わる */
.member-card .member-frame .member-frame-photo .thumb-layer {
  transition-duration: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .member-frame .member-frame-photo .thumb-layer {
    transition: none;
  }
}

/* ---------- 配信分析（js/analytics.js） ----------
   配信履歴（.hist-*）と同じ、ゴールド × ブラックの枠。月ごとのまとめはタイル、配信ごとの情報は表。
   スマホでは、表を 1 件ずつのカード形式に切り替える */
.ana-host {
  margin-top: 40px;
}

.ana-inner {
  padding: 22px 24px 22px;
}

.ana-inner h3 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  color: var(--c-primary-bright);
}

.ana-inner h3 small {
  font-family: var(--font-body, inherit);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-text);
}

.ana-tabs {
  margin-bottom: 18px;
  max-width: 100%;
  overflow-x: auto;
}

.ana-body.is-loading {
  opacity: 0.55;
  transition: opacity 0.2s;
}

.ana-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.ana-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 13px;
  background: linear-gradient(160deg, rgba(var(--c-primary-rgb), 0.12), rgba(255, 255, 255, 0.025) 60%);
  border: 1px solid rgba(var(--c-primary-rgb), 0.38);
  border-left: 3px solid var(--c-primary-bright);
}

.ana-tile.is-wide {
  grid-column: span 2;
}

.ana-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--c-muted);
}

.ana-main {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--c-glow);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ana-main small {
  font-family: var(--font-body, inherit);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-muted);
}

.ana-sub {
  font-size: 0.86rem;
  color: var(--c-silver-bright);
  font-variant-numeric: tabular-nums;
}

.ana-sub-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 26px 0 10px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  color: var(--c-primary-bright);
}

.ana-sub-head small {
  font-family: var(--font-body, inherit);
  letter-spacing: 0.08em;
  color: var(--c-muted);
}

.ana-scroll {
  max-height: 620px;
  overflow: auto;
}

.ana-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ana-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--c-muted);
  background: #141318;
  border-bottom: 1px solid rgba(var(--c-primary-rgb), 0.45);
}

.ana-table td {
  padding: 11px 12px;
  white-space: nowrap;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-variant-numeric: tabular-nums;
}

.ana-table td:nth-child(2) {
  min-width: 260px;
  max-width: 340px;
  white-space: normal;
}

.ana-title {
  display: block;
  line-height: 1.5;
}

.ana-cat {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--c-primary-bright);
  border: 1px solid rgba(var(--c-primary-rgb), 0.5);
}

.ana-note {
  margin: 8px 0 4px;
  color: var(--c-muted);
}

@media (max-width: 720px) {
  .ana-host {
    margin-top: 28px;
  }
  .ana-inner {
    padding: 18px 14px 16px;
  }
  .ana-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .ana-tile {
    padding: 12px 12px 11px;
  }
  .ana-tile.is-wide {
    grid-column: 1 / -1;
  }
  .ana-main {
    font-size: 1.25rem;
  }
  .ana-scroll {
    max-height: none;
  }
  .ana-table thead {
    display: none;
  }
  .ana-table,
  .ana-table tbody {
    display: block;
  }
  .ana-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .ana-table td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    white-space: normal;
    min-width: 0;
    max-width: none;
  }
  .ana-table td::before {
    content: attr(data-label);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    color: var(--c-muted);
  }
  .ana-table td:nth-child(1),
  .ana-table td:nth-child(2) {
    grid-column: 1 / -1;
  }
  .ana-table td:nth-child(1) {
    flex-direction: row;
    align-items: baseline;
    font-size: 1.02rem;
  }
  .ana-table td:nth-child(1)::before,
  .ana-table td:nth-child(2)::before {
    display: none;
  }
}

.ana-tabs .mode-btn {
  white-space: nowrap;
  flex: none;
}

/* ---------- TEAM ページ（js/pages/team.js） ----------
   配信分析（.ana-*）と同じタイル・表のスタイルを使い、アイコン・ハイライト・並べ替えを足したもの */
.tm-host .ana-inner {
  padding: 22px 24px 24px;
}

.tm-first {
  margin-top: 6px;
}

.tm-hl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.tm-hl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  min-width: 0;
  background: linear-gradient(160deg, rgba(var(--c-silver-rgb), 0.12), rgba(255, 255, 255, 0.02) 60%);
  border: 1px solid rgba(var(--c-silver-rgb), 0.35);
  border-left: 3px solid var(--c-silver-bright);
}

.tm-hl-who,
.tm-who,
.tm-idle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tm-hl-title {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--c-silver-bright);
  overflow-wrap: anywhere;
}

.tm-av.avatar,
.tm-hl .avatar,
.tm-who .avatar,
.tm-idle-item .avatar {
  flex: none;
  width: 38px;
  height: 38px;
}

.tm-name {
  font-weight: 700;
  color: var(--c-text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.tm-name:hover {
  color: var(--c-primary-bright);
  text-decoration: underline;
}

.tm-sorts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tm-sort {
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--c-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--c-primary-rgb), 0.35);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tm-sort[aria-checked="true"] {
  color: #1c1204;
  background: var(--gold-sheen);
  border-color: transparent;
}

.tm-scroll {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.tm-table th,
.tm-table td {
  padding-left: 9px;
  padding-right: 9px;
}

.tm-table th {
  position: static;
}

.tm-table td {
  vertical-align: middle;
}

.tm-table td:nth-child(2) {
  min-width: 200px;
  max-width: none;
  white-space: nowrap;
}

.tm-rank {
  font-family: var(--font-display);
  color: var(--c-primary-bright);
}

.tm-dim {
  display: block;
  font-size: 0.78rem;
  color: var(--c-muted);
}

.tm-idle {
  margin-top: 18px;
}

.tm-idle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
}

.tm-idle-item .tm-name {
  font-weight: 500;
  color: var(--c-muted);
}

@media (max-width: 720px) {
  .tm-host .ana-inner {
    padding: 18px 14px 16px;
  }
  .tm-hl-grid {
    grid-template-columns: 1fr;
  }
  .tm-table td:nth-child(2) {
    min-width: 0;
    white-space: normal;
  }
  .tm-table td:nth-child(1),
  .tm-table td:nth-child(2) {
    grid-column: auto;
  }
  .tm-table tr {
    position: relative;
    grid-template-columns: 1fr 1fr;
  }
  .tm-table td:nth-child(1) {
    position: absolute;
    top: 22px;
    left: 10px;
    padding: 0;
    font-size: 1.05rem;
  }
  .tm-table td:nth-child(2) {
    grid-column: 1 / -1;
    margin-left: 42px;
  }
}
