/* =========================================================
   四條畷学園 創立100周年 ライブ配信 視聴ページ
   ========================================================= */
:root {
  --green: #009333;
  --green-deep: #0b7a32;
  --leaf: #6fba2c;
  --lime: #abcd03;
  --yellow: #ffe100;
  --text: #3e3e3e;
  --muted: #6b6b6b;
  --bg: #ffffff;
  --panel: #f5f8f2;
  --line: #e3ecdc;
  --radius: 16px;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-en: "Josefin Sans", "Noto Sans JP", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.8;
  letter-spacing: .04em;
  overflow-x: hidden;
}

/* ---------- 背景の葉 ---------- */
.leaves { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.leaf {
  position: absolute;
  display: block;
  border-radius: 0 80% 0 80%;
  opacity: .9;
  animation: sway 9s ease-in-out infinite;
}
.leaf::after {               /* 葉脈 */
  content: "";
  position: absolute;
  left: 12%; top: 50%;
  width: 76%; height: 1px;
  background: rgba(255,255,255,.45);
  transform: rotate(-45deg);
  transform-origin: center;
}
.l1 { width: 120px; height: 120px; background: var(--leaf);  top: 8%;   left: -40px; transform: rotate(20deg); }
.l2 { width: 70px;  height: 70px;  background: var(--green); top: 22%;  left: 18%;  transform: rotate(-30deg); animation-delay: -2s; }
.l3 { width: 150px; height: 150px; background: var(--lime);  top: 40%;  right: -60px; transform: rotate(60deg); animation-delay: -4s; }
.l4 { width: 90px;  height: 90px;  background: var(--green); bottom: 18%; right: 14%; transform: rotate(10deg); animation-delay: -1s; }
.l5 { width: 130px; height: 130px; background: var(--green-deep); bottom: -40px; left: 6%; transform: rotate(-15deg); animation-delay: -6s; }
.l6 { width: 46px;  height: 46px;  background: var(--leaf);  top: 6%;   right: 22%; transform: rotate(80deg); animation-delay: -3s; }
.dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); animation: twinkle 4s ease-in-out infinite; }
.d1 { top: 14%; left: 30%; }
.d2 { top: 30%; right: 30%; animation-delay: -1s; }
.d3 { top: 62%; left: 10%; width: 14px; height: 14px; animation-delay: -2s; }
.d4 { bottom: 12%; right: 40%; animation-delay: -3s; }
.d5 { top: 48%; left: 46%; width: 7px; height: 7px; animation-delay: -1.5s; }
.d6 { top: 10%; right: 8%; width: 13px; height: 13px; animation-delay: -2.5s; }

@keyframes sway {
  0%, 100% { translate: 0 0; }
  50%      { translate: 6px -10px; }
}
@keyframes twinkle {
  0%, 100% { opacity: .9; }
  50%      { opacity: .35; }
}
/* 配信中は映像の邪魔にならないよう控えめに */
.is-live .leaf { opacity: .35; }
.is-live .dot  { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .leaf, .dot, .waiting-icon span { animation: none !important; }
}

/* ---------- プレビューバー ---------- */
.preview-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; justify-content: center;
  padding: .55rem 1rem;
  background: #222; color: #fff; font-size: .85rem; letter-spacing: .02em;
}
.preview-bar strong { background: var(--yellow); color: #222; padding: .1rem .55rem; border-radius: 4px; }
.preview-bar .on  { color: #7ee08f; }
.preview-bar .off { color: #ffb4a8; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: relative; z-index: 2;
  display: flex; align-items: center;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--green); }
.brand-logo { height: 44px; width: auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, var(--lime) 0 22%, transparent 23%),
    radial-gradient(circle at 70% 40%, var(--leaf) 0 24%, transparent 25%),
    radial-gradient(circle at 45% 72%, var(--green) 0 26%, transparent 27%),
    #eef6e6;
}
.brand-text { font-family: var(--font-en); font-weight: 600; font-size: .78rem; line-height: 1.25; letter-spacing: .08em; }
.brand-text small { font-size: .68rem; font-weight: 400; }

/* ---------- メイン ---------- */
.main {
  position: relative; z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 3rem;
}

.hero { text-align: center; padding: clamp(1rem, 4vw, 2.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.tagline {
  margin: 0 0 .6rem;
  color: var(--green);
  font-weight: 700;
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  letter-spacing: .3em;
}
.title { margin: 0; color: var(--green); line-height: 1.2; }
.title .num {
  display: block;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  letter-spacing: .02em;
  line-height: 1;
}
.title .num sup { font-size: .32em; vertical-align: top; position: relative; top: .35em; margin-left: .08em; letter-spacing: .1em; }
.title-text {
  display: block;
  margin-top: .6rem;
  font-size: clamp(1.25rem, 3.6vw, 2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: .12em;
}
.event-date {
  margin: 1rem 0 0;
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem;
  font-weight: 500;
  font-size: clamp(.95rem, 2.4vw, 1.1rem);
}
.badge {
  display: inline-block;
  padding: .15rem .8rem;
  border-radius: 999px;
  border: 1.5px solid var(--green);
  color: var(--green);
  font-family: var(--font-en);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .14em;
  line-height: 1.6;
}
.badge-live { background: #e60033; border-color: #e60033; color: #fff; position: relative; padding-left: 1.6rem; }
.badge-live::before {
  content: ""; position: absolute; left: .7rem; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: #fff; animation: twinkle 1.4s ease-in-out infinite;
}

/* ---------- プレーヤー ---------- */
.stage { display: grid; gap: 1.25rem; }
.stage.with-chat { grid-template-columns: minmax(0, 1fr) 340px; align-items: stretch; }
.stage.with-chat .player-card { align-self: start; }
.stage.with-chat .chat-card { position: relative; min-height: 0; }
.stage.with-chat .chat-card iframe { position: absolute; inset: 0; min-height: 0; }
.player-card, .chat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 80, 30, .12), 0 0 0 1px var(--line);
  overflow: hidden;
}
.player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chat-card { min-height: 420px; }
.chat-card iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }

@media (max-width: 860px) {
  .stage.with-chat { grid-template-columns: 1fr; }
  .stage.with-chat .chat-card { min-height: 380px; }
}

/* ---------- 視聴ガイド ---------- */
.help {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border-radius: var(--radius);
  font-size: .9rem;
}
.help h2 { margin: 0 0 .4rem; font-size: .95rem; color: var(--green); }
.help ul { margin: 0; padding-left: 1.2em; }
.help li + li { margin-top: .15rem; }

/* ---------- 待機画面 ---------- */
.waiting-card {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.25rem) clamp(1.25rem, 5vw, 3rem);
  text-align: center;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 80, 30, .1), 0 0 0 1px var(--line);
}
.waiting-message { margin: 0; font-size: clamp(.98rem, 2.4vw, 1.1rem); font-weight: 500; }
.waiting-note { margin: 1rem 0 0; color: #c0392b; font-size: .85rem; }
.waiting-icon { display: flex; justify-content: center; gap: .55rem; margin-bottom: 1.4rem; }
.waiting-icon span {
  width: 14px; height: 14px;
  border-radius: 0 80% 0 80%;
  background: var(--green);
  animation: bounce 1.6s ease-in-out infinite;
}
.waiting-icon span:nth-child(2) { background: var(--leaf); animation-delay: .2s; }
.waiting-icon span:nth-child(3) { background: var(--lime); animation-delay: .4s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  40%      { transform: translateY(-8px) rotate(20deg); }
}

/* ---------- フッター ---------- */
.site-footer {
  position: relative; z-index: 1;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.9);
}
.site-footer p { margin: 0; }
