/* ===========================
   Mini Venue Preview (Ad Cards)
   =========================== */
/* design-allow-start: color-literal */
/* mini venue は live event カードのプレビュー領域。固定ダーク前提でテーマ非依存。
   ⚠️ バッジの地に --color-danger / --lh-success のような**テーマで反転するトークン**を使うと、
   文字色が #fff 固定なのでダーク 5 テーマで沈む（計画書 182 Phase 2 で実測 1.61〜3.22）。
   この面はユーザーの会場画像の上なので、地の色もテーマ非依存の固定値にすること。 */

.mini-venue {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

/* ステージ背景 */
.mini-venue-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0e1a 0%, #141a2e 40%, #1a1228 100%);
}
.mini-venue-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse at 50% 30%, rgba(var(--warning-soft-bg-rgb), 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* スクリーン（サムネイル） */
.mini-venue-screen {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 45%;
  max-width: 130px;
  aspect-ratio: 16 / 9;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(var(--warning-soft-bg-rgb), 0.3);
  box-shadow: 0 0 12px rgba(var(--warning-soft-bg-rgb), 0.15), 0 0 30px rgba(var(--warning-soft-bg-rgb), 0.05);
  z-index: 1;
}
.mini-venue-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85) saturate(1.1);
}
.mini-venue-screen picture {
  display: block;
  width: 100%;
  height: 100%;
}
.mini-venue-screen-fallback {
  width: 100%;
  height: 100%;
  background: #2d2d44;
  display: flex;
  align-items: center;
  justify-content: center;
  /* ⚠️ 0.4 だと #2d2d44 の上で 2.52 で、非テキスト 3:1 にも届いていなかった */
  color: rgba(var(--warning-soft-bg-rgb), 0.75);
  font-size: 1rem;
}

/* リアクションデコレーション散布 */
.mini-venue-decos {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.mini-venue-icon {
  position: absolute;
  font-size: 0.6rem;
  filter: drop-shadow(0 0 3px currentColor);
  visibility: hidden;
  opacity: 0.8;
  animation: mini-venue-twinkle 2.5s ease-in-out infinite;
}
.mini-venue-icon.mini-venue-placed {
  visibility: visible;
}
.mini-venue-icon:nth-child(2n) { animation-delay: 0.8s; }
.mini-venue-icon:nth-child(3n) { animation-delay: 1.6s; }
.mini-venue-icon:nth-child(5n) { animation-delay: 0.4s; }

.mini-venue-pixel {
  position: absolute;
  display: inline-flex;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.3));
  visibility: hidden;
  opacity: 0.85;
  animation: mini-venue-twinkle 3s ease-in-out infinite;
}
.mini-venue-pixel.mini-venue-placed {
  visibility: visible;
}
.mini-venue-pixel:nth-child(2n) { animation-delay: 1s; }
.mini-venue-pixel:nth-child(3n) { animation-delay: 2s; }

@keyframes mini-venue-twinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* タイマー */
.mini-venue-timer {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  z-index: 3;
}

/* LIVEバッジ。地は light テーマの --color-danger と同値の固定赤。
   テーマ追従のままだとダーク 5 テーマで #fff on 明赤 = 2.51 だった（→ 5.58） */
.mini-venue-live-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(185, 28, 28, 0.9);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  z-index: 3;
  letter-spacing: 0.5px;
}

/* --- Mini Venue Compact (play_typing recommend) --- */
.mini-venue-compact {
  position: relative;
  width: 56px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(180deg, #0a0e1a 0%, #1a1228 100%);
  flex-shrink: 0;
}
.mini-venue-compact-bg {
  position: absolute;
  inset: 0;
  opacity: 0.4;
}
.mini-venue-compact-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mini-venue-compact-icon {
  position: absolute;
  font-size: 0.45rem;
  bottom: 4px;
  filter: drop-shadow(0 0 2px currentColor);
  opacity: 0.9;
  animation: mini-venue-twinkle 2.5s ease-in-out infinite;
}
.mini-venue-compact-icon:nth-child(2) { left: 8px; bottom: 6px; animation-delay: 0.5s; }
.mini-venue-compact-icon:nth-child(3) { left: 24px; bottom: 3px; animation-delay: 1.2s; }
.mini-venue-compact-icon:nth-child(4) { right: 8px; bottom: 7px; animation-delay: 0.8s; }
.mini-venue-compact-pixel {
  position: absolute;
  bottom: 3px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.3));
  opacity: 0.85;
}
.mini-venue-compact-pixel:nth-child(2) { left: 6px; }
.mini-venue-compact-pixel:nth-child(3) { left: 22px; }
.mini-venue-compact-pixel:nth-child(4) { right: 6px; }
/* 開催中を示す装飾ドット（テキストなし・周囲の情報と重複）。
   地は .mini-venue-compact の暗グラデにユーザー画像が opacity .4 で重なるため、
   どの単色でも非テキスト 3:1 を保証できない（達成できるのは #ffc9c9 級の淡色だけで
   「開催中の赤」に見えなくなる）。世界だけダーク固定に揃え、視認は glow で担保する。 */
.mini-venue-compact-live {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.45rem;
  color: #ef4444; /* design-allow: contrast-context — 会場画像の上の装飾ドット。単色では面が決まらない */
  filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.6));
}

/* ===========================
   Host Event History Cards
   =========================== */

.my-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.my-event-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.my-event-card:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: var(--card-shadow-hover);
  text-decoration: none;
  color: inherit;
}

/* ミニ会場プレビュー（カード用） */
.mini-venue-compact-card {
  position: relative;
  height: 100px;
  overflow: hidden;
  background: linear-gradient(180deg, #0a0e1a 0%, #141a2e 60%, #1a1228 100%);
}
.mini-venue-compact-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.25;
}
.mini-venue-compact-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(2px);
}
.mini-venue-compact-card-stage {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 40%;
  background: radial-gradient(ellipse at 50% 20%, rgba(var(--warning-soft-bg-rgb), 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* リアクションアイコン散布 */
.mini-venue-compact-card-icon {
  position: absolute;
  font-size: 0.55rem;
  filter: drop-shadow(0 0 3px currentColor);
  opacity: 0.85;
  animation: mini-venue-twinkle 2.5s ease-in-out infinite;
}
.mini-venue-compact-card-icon:nth-of-type(1) { bottom: 20px; left: 12%; animation-delay: 0s; }
.mini-venue-compact-card-icon:nth-of-type(2) { bottom: 28px; left: 30%; animation-delay: 0.7s; }
.mini-venue-compact-card-icon:nth-of-type(3) { bottom: 16px; left: 50%; animation-delay: 1.4s; }
.mini-venue-compact-card-icon:nth-of-type(4) { bottom: 24px; left: 65%; animation-delay: 0.3s; }
.mini-venue-compact-card-icon:nth-of-type(5) { bottom: 30px; left: 80%; animation-delay: 1.1s; }
.mini-venue-compact-card-icon:nth-of-type(6) { bottom: 18px; right: 8%; animation-delay: 0.5s; }

.mini-venue-compact-card-pixel {
  position: absolute;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.3));
  opacity: 0.85;
  animation: mini-venue-twinkle 3s ease-in-out infinite;
}
.mini-venue-compact-card-pixel:nth-of-type(1) { bottom: 20px; left: 15%; animation-delay: 0.2s; }
.mini-venue-compact-card-pixel:nth-of-type(2) { bottom: 26px; left: 35%; animation-delay: 1s; }
.mini-venue-compact-card-pixel:nth-of-type(3) { bottom: 14px; left: 55%; animation-delay: 1.8s; }
.mini-venue-compact-card-pixel:nth-of-type(4) { bottom: 22px; left: 72%; animation-delay: 0.6s; }
.mini-venue-compact-card-pixel:nth-of-type(5) { bottom: 30px; right: 10%; animation-delay: 1.3s; }
.mini-venue-compact-card-pixel:nth-of-type(6) { bottom: 18px; right: 25%; animation-delay: 0.8s; }

/* ステータスバッジ */
.my-event-status-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
/* .mini-venue-compact-card（暗グラデ + 画像 opacity .25）の上に載るバッジ。
   地はテーマ非依存の固定値。テーマ追従だと #fff との組が反転して割れる。
   実測（10 テーマ × グラデ 3 停止 × 画像の明暗端）: success 7.26 / failed 7.05 /
   settling 7.71 / open 6.93。修正前は 1.61 / 3.22 / 7.71 / 3.12 だった */
.my-event-status-success { background: rgba(22, 101, 52, 0.9); color: #fff; }
.my-event-status-failed  { background: rgba(185, 28, 28, 0.85); color: #fff; }
.my-event-status-settling { background: rgba(var(--warning-soft-bg-rgb), 0.9); color: #212529; }
.my-event-status-open { background: rgba(29, 78, 216, 0.9); color: #fff; }

/* 充填率バー */
.my-event-fill-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
}
.my-event-fill-bar-inner {
  height: 100%;
  border-radius: 0 1px 0 0;
  transition: width 0.3s;
}

/* カード下部テキスト */
.my-event-card-body {
  padding: 0.5rem 0.6rem;
}
.my-event-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-event-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.my-event-card-meta i {
  font-size: 0.65rem;
  margin-right: 0.1rem;
}
.my-event-card-beat {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lh-success);
}
.my-event-card-beat i {
  /* ⚠️ .my-event-card はテーマ追従面（会場アートの上ではない）。#d4a017 は light で 1.79 */
  color: var(--color-warning);
  font-size: 0.7rem;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .mini-venue-icon,
  .mini-venue-pixel,
  .mini-venue-compact-icon,
  .mini-venue-compact-card-icon,
  .mini-venue-compact-card-pixel {
    animation: none;
    opacity: 0.8;
  }
}

/* design-allow-end: color-literal */
