/* 会場出力（1920×1080 固定で設計し、画面サイズに合わせて縮尺する） */
:root {
  --navy: #0b0d24;
  --navy-2: #151832;
  --ink: #ffffff;
  --muted: #9ea3d6;
  --red: #ff3b47;
  --teal: #2ec5e0;
  --yellow: #f5e500;
  --term: #6dffb0;
  --heavy: "Dela Gothic One", "Hiragino Kaku Gothic StdN", sans-serif;
  --dot: "DotGothic16", monospace;
  --neon: "Train One", "Dela Gothic One", sans-serif;
  --body: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; color: var(--ink); font-family: var(--body); }

#stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform: translate(-50%, -50%) scale(var(--s, .5)); background: var(--navy); overflow: hidden; }

/* 背景（display.css と同じ世界観） */
.bg { position: absolute; inset: 0; }
.blob { position: absolute; width: 900px; height: 900px; border-radius: 50%; filter: blur(140px); opacity: .45; mix-blend-mode: screen; }
.b1 { background: var(--teal); left: -200px; top: -300px; animation: drift1 18s ease-in-out infinite alternate; }
.b2 { background: var(--red); right: -250px; top: 150px; animation: drift2 22s ease-in-out infinite alternate; }
.b3 { background: #5b3cff; left: 500px; bottom: -500px; animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(400px, 250px) scale(1.2); } }
@keyframes drift2 { to { transform: translate(-350px, -200px) scale(.85); } }
@keyframes drift3 { to { transform: translate(300px, -250px) scale(1.15); } }
.grid { position: absolute; inset: -100px; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 60px 60px; animation: gridmove 8s linear infinite; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%); }
@keyframes gridmove { to { transform: translate(60px, 60px); } }
.crt { position: absolute; inset: 0; pointer-events: none; z-index: 40; background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 2px, transparent 2px 4px), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.5) 100%); transition: opacity .4s; }
body[data-type="slides"] .crt, body[data-type="video"] .crt, body[data-type="vote"] .crt, body[data-type="black"] .crt { opacity: 0; }

/* レイヤー（素材ごとに1枚。切り替えは opacity のフェード） */
#layers { position: absolute; inset: 0; }
.layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.layer.on { opacity: 1; visibility: visible; }
.layer.solid { background: #000; }
.layer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.layer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 20px; background: var(--navy-2); }
.placeholder b { font-family: var(--heavy); font-weight: 400; font-size: 72px; }
.placeholder span { font-size: 32px; color: var(--muted); }
.yt, .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* マウスが乗ると YouTube のタイトルや操作ボタンが出るので、マウス操作を受け付けない */
.yt iframe, .np-player iframe { pointer-events: none; }
body:not(.mirror) { cursor: none; }
.yt-cover { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .4s; pointer-events: none; }
.yt-cover.on { opacity: 1; }
#dip { position: absolute; inset: 0; background: #000; opacity: 0; z-index: 30; pointer-events: none; }

/* オンライン視聴者数 */
.counters { position: absolute; right: 40px; bottom: 34px; z-index: 45; display: flex; gap: 14px; align-items: center; }
.viewers, .venue { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-radius: 999px; background: rgba(11, 13, 36, .78); border: 2px solid rgba(255,255,255,.25); font-size: 28px; font-weight: 700; opacity: 0; transform: translateY(20px); transition: .5s; backdrop-filter: blur(6px); }
.viewers.on, .venue.on { opacity: 1; transform: none; }
.viewers:not(.on), .venue:not(.on) { display: none; }
.viewers i { width: 16px; height: 16px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); animation: blink 1.2s steps(2) infinite; }
.venue i { width: 16px; height: 16px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }
.viewers b, .venue b { font-family: var(--heavy); font-weight: 400; font-size: 40px; color: var(--yellow); font-variant-numeric: tabular-nums; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- テンプレート共通 ---------- */
.tpl { position: absolute; inset: 0; }
/* 日本語の見出しを文節で折り返す（Chrome 119+） */
.tpl h1, .tpl .sub, .card, .t-qa .theme, .t-flow li { word-break: auto-phrase; text-wrap: balance; }
.logo { filter: drop-shadow(0 0 24px rgba(255,59,71,.45)); }
.kicker { font-family: var(--dot); color: var(--muted); letter-spacing: .14em; }
.heavy { font-family: var(--heavy); font-weight: 400; }
.neon { font-family: var(--neon); color: #fff; text-shadow: 0 0 10px #fff, 0 0 30px var(--c, var(--teal)), 0 0 70px var(--c, var(--teal)); }
.corner-logo { position: absolute; left: 60px; top: 46px; width: 130px; }
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; }
.glitch::before { color: var(--teal); clip-path: inset(0 0 60% 0); animation: g1 2.4s infinite steps(1); mix-blend-mode: screen; }
.glitch::after { color: var(--red); clip-path: inset(55% 0 0 0); animation: g2 1.9s infinite steps(1); mix-blend-mode: screen; }
@keyframes g1 { 0%, 100% { clip-path: inset(0 0 60% 0); transform: translate(-4px); } 20% { clip-path: inset(20% 0 50% 0); transform: translate(-10px, 2px); } 40% { clip-path: inset(70% 0 5% 0); transform: translate(6px); } 60% { clip-path: inset(40% 0 30% 0); transform: translate(-3px, -2px); } }
@keyframes g2 { 0%, 100% { clip-path: inset(55% 0 0 0); transform: translate(4px); } 25% { clip-path: inset(10% 0 75% 0); transform: translate(10px, -2px); } 50% { clip-path: inset(80% 0 2% 0); transform: translate(-6px); } 75% { clip-path: inset(30% 0 45% 0); transform: translate(3px, 2px); } }

/* レイヤーが表示された瞬間に要素をふわっと入れる */
.layer.on .in { animation: rise .9s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--d, 0) * 120ms + 150ms); }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.97); } }

/* 待機画面 */
.t-standby { display: grid; grid-template-columns: 560px 1fr; align-items: center; gap: 70px; padding: 0 130px 220px; }
.t-standby .logo { width: 520px; }
.t-standby .kicker { font-size: 34px; }
.t-standby h1 { font-family: var(--heavy); font-weight: 400; font-size: 150px; line-height: 1.1; margin-top: 10px; }
.t-standby .soon { display: inline-block; margin-top: 30px; font-family: var(--dot); font-size: 40px; color: var(--term); border: 3px solid var(--term); border-radius: 10px; padding: 8px 26px; letter-spacing: .2em; animation: blink 1.4s steps(2) infinite; }
.t-standby .when { font-size: 36px; margin-top: 26px; color: #dfe2ff; line-height: 1.5; }
.notices { position: absolute; left: 130px; right: 130px; bottom: 130px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.notices div { padding: 22px 28px; border-radius: 22px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.18); font-size: 30px; line-height: 1.45; }
.notices b { display: block; font-family: var(--heavy); font-weight: 400; font-size: 34px; color: var(--yellow); }

/* イベントタイトル */
.t-title { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.t-title .logo { width: 470px; }
.t-title .kicker { font-size: 40px; margin-top: 10px; }
.t-title h1 { font-family: var(--heavy); font-weight: 400; font-size: 170px; line-height: 1.1; margin-top: 6px; }
.t-title .date { font-family: var(--dot); font-size: 36px; color: var(--muted); margin-top: 22px; letter-spacing: .1em; }

/* セクションタイトル */
.t-section { display: flex; flex-direction: column; justify-content: center; padding: 0 170px; }
.t-section .kicker { font-size: 38px; }
.t-section h1 { font-family: var(--heavy); font-weight: 400; font-size: 150px; line-height: 1.15; margin-top: 18px; }
.t-section .line { width: 520px; height: 10px; margin-top: 46px; border-radius: 5px; background: linear-gradient(90deg, var(--red), var(--yellow), var(--teal)); }
.t-section .sub { font-size: 46px; margin-top: 40px; color: #dfe2ff; font-weight: 700; }

/* テーマタイトル */
.t-theme { display: flex; flex-direction: column; justify-content: center; padding: 0 150px; }
.t-theme .no { font-size: 190px; line-height: 1; }
.t-theme .label { font-family: var(--dot); font-size: 36px; color: var(--muted); margin-top: 40px; letter-spacing: .1em; }
.t-theme h1 { font-family: var(--heavy); font-weight: 400; font-size: 100px; line-height: 1.25; margin-top: 12px; }
.t-theme .co { display: inline-flex; gap: 18px; align-items: baseline; margin-top: 50px; font-size: 44px; font-weight: 700; padding: 16px 34px; border-radius: 18px; border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); align-self: flex-start; }
.t-theme .co small { font-family: var(--dot); font-size: 30px; color: var(--muted); font-weight: 400; }

/* 質疑応答 */
.t-qa { display: grid; grid-template-columns: 1fr 640px; align-items: center; gap: 80px; padding: 0 140px; }
.t-qa .big { font-family: var(--neon); font-size: 300px; line-height: 1; --c: var(--yellow); }
.t-qa h1 { font-family: var(--heavy); font-weight: 400; font-size: 110px; margin-top: 10px; }
.t-qa .theme { margin-top: 40px; font-size: 40px; font-weight: 700; line-height: 1.5; padding-left: 26px; border-left: 12px solid var(--c); }
.t-qa .theme span { display: block; font-family: var(--heavy); font-weight: 400; color: var(--c); font-size: 46px; }
.t-qa ol { list-style: none; display: grid; gap: 26px; }
.t-qa li { padding: 30px 34px; border-radius: 24px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.2); font-size: 40px; font-weight: 700; }
.t-qa li small { display: block; font-family: var(--dot); font-weight: 400; font-size: 28px; color: var(--muted); }

/* 協賛企業 */
.t-sponsors { padding: 46px 120px; }
.t-sponsors .head { display: flex; align-items: baseline; gap: 34px; }
.t-sponsors .head .neon { font-size: 100px; }
.t-sponsors .head span { font-family: var(--heavy); font-size: 50px; }
.tiers { display: grid; gap: 26px; margin-top: 34px; }
.tier .tname { font-family: var(--dot); font-size: 30px; color: var(--muted); letter-spacing: .12em; margin-bottom: 14px; }
.tier .cards { display: grid; gap: 22px; }
.tier[data-t="0"] .cards { grid-template-columns: 1fr; }
.tier[data-t="1"] .cards { grid-template-columns: repeat(3, 1fr); }
.tier[data-t="2"] .cards { grid-template-columns: repeat(5, 1fr); }
.card { display: grid; place-items: center; text-align: center; border-radius: 22px; background: #fff; color: var(--navy-2); font-weight: 800; overflow: hidden; }
.card img { max-width: 82%; max-height: 72%; object-fit: contain; }
.card.dark { background: var(--navy-2); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.tier[data-t="0"] .card { height: 190px; font-size: 76px; }
.tier[data-t="1"] .card { height: 150px; font-size: 52px; }
.tier[data-t="2"] .card { height: 120px; font-size: 34px; padding: 0 10px; }

/* 本日の流れ＋QR */
.t-flow { display: grid; grid-template-columns: 1fr 560px; gap: 90px; align-items: center; padding: 0 130px; }
.t-flow .neon { font-size: 92px; }
.t-flow h1 { font-family: var(--heavy); font-weight: 400; font-size: 64px; margin-top: 4px; }
.t-flow ol { list-style: none; margin-top: 40px; display: grid; gap: 16px; }
.t-flow li { display: grid; grid-template-columns: 170px 1fr; align-items: center; font-size: 40px; font-weight: 700; padding: 14px 0; border-bottom: 2px dashed rgba(255,255,255,.18); }
.t-flow li span { font-family: var(--dot); font-weight: 400; color: var(--term); }
.t-flow li.hl { color: var(--yellow); }
.qr-card { padding: 40px; border-radius: 36px; background: #fff; color: var(--navy-2); text-align: center; box-shadow: 0 0 0 10px rgba(255,255,255,.12), 0 0 80px rgba(46,197,224,.6); }
.qr-card .h { font-family: var(--heavy); font-size: 44px; }
.qr-card .qr { margin: 20px auto; width: 420px; }
.qr-card .qr svg { display: block; width: 100%; height: auto; }
.qr-card p { font-size: 28px; font-weight: 700; line-height: 1.5; }
.qr-card p b { color: var(--red); }

/* 集合写真 */
.t-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.t-photo .logo { width: 300px; }
.t-photo h1 { font-family: var(--heavy); font-weight: 400; font-size: 170px; line-height: 1.15; margin-top: 20px; }
.t-photo .tags { font-family: var(--dot); font-size: 44px; color: var(--term); margin-top: 34px; letter-spacing: .06em; }

/* 起動ボタン */
.boot { position: absolute; inset: 0; z-index: 100; border: 0; background: rgba(0,0,0,.82); color: #fff; display: grid; place-content: center; gap: 18px; cursor: pointer; font-family: var(--body); }
.boot b { font-family: var(--heavy); font-weight: 400; font-size: 90px; }
.boot span { font-size: 32px; color: var(--muted); }
.boot.gone { display: none; }

/* BGM：プレーヤーはステージの外に置いて音だけ流す。曲名の表示（NOW PLAYING）は管理画面で出し分け */
.np { position: absolute; left: 34px; bottom: 34px; z-index: 46; display: flex; align-items: center; gap: 20px; padding: 16px 28px; border-radius: 26px; background: rgba(11, 13, 36, .88); border: 2px solid rgba(255,255,255,.22); box-shadow: 0 16px 50px rgba(0,0,0,.5); opacity: 0; transform: translateY(30px) scale(.96); transition: opacity .6s, transform .6s cubic-bezier(.34, 1.56, .64, 1); pointer-events: none; }
.np.on { opacity: 1; transform: none; }
/* 画面外に置くと Chrome が「見えないミュート動画」として止めてしまうので、画面内の背景の後ろに隠す */
.np-player { position: absolute; left: 0; top: 0; width: 200px; height: 200px; overflow: hidden; z-index: -1; opacity: .01; pointer-events: none; }
.np-player iframe { position: absolute; inset: 0; width: 200px; height: 200px; border: 0; }
.np-meta { display: grid; gap: 6px; max-width: 420px; }
.np-k { font-family: var(--dot); font-size: 22px; color: var(--term); letter-spacing: .12em; display: flex; align-items: flex-end; gap: 4px; }
.np-k i { width: 5px; height: 18px; background: var(--term); border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.np-k i:nth-child(2) { animation-delay: -.3s; }
.np-k i:nth-child(3) { animation-delay: -.6s; margin-right: 8px; }
@keyframes eq { 0%, 100% { height: 6px; } 50% { height: 20px; } }
.np-meta b { font-family: var(--heavy); font-weight: 400; font-size: 34px; line-height: 1.15; }
.np-meta small { display: none !important; font-size: 20px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 投票画面の結果発表では左下が4位の行と重なるので、空いている右上に置く */
body[data-src="vote"] .np { left: auto; right: 34px; bottom: auto; top: 30px; }

/* テーマタイトルの企業ロゴ */
.t-theme .co img { height: 56px; max-width: 260px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px 12px; align-self: center; }


/* 協賛①テーマ提供企業 */
.t-themeco { padding: 50px 120px; }
.t-themeco .head { display: flex; align-items: baseline; gap: 34px; }
.t-themeco .head .neon { font-size: 92px; }
.t-themeco .head span:last-child { font-family: var(--heavy); font-size: 50px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; }
.tc { height: 340px; border-radius: 28px; background: #fff; color: var(--navy-2); display: grid; grid-template-rows: 1fr auto auto; padding: 26px 34px 24px; box-shadow: 0 0 0 6px var(--c), 0 0 50px color-mix(in srgb, var(--c) 45%, transparent); }
.tc-logo { display: grid; place-items: center; min-height: 0; }
.tc-logo img { max-width: 80%; max-height: 150px; object-fit: contain; }
.tc-name { font-size: 36px; font-weight: 800; text-align: center; margin-top: 10px; }
.tc-theme { font-size: 22px; color: #555a80; text-align: center; margin-top: 8px; word-break: auto-phrase; }
.tc-theme span { font-family: var(--heavy); color: var(--c); margin-right: 10px; filter: brightness(.75); }

/* 暗転（ロゴだけ） */
.t-logo { display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(11,13,36,.6), #05060f 75%); }
.t-logo .logo { width: 520px; }

/* ジャケット風：BGMのプレーヤーを左下のカードに出す（200×200、何も重ねない） */
body.np-visible .np { padding-left: 242px; min-height: 232px; }
body.np-visible .np-player { left: 50px; top: 830px; opacity: 1; z-index: 47; border-radius: 16px; transition: opacity .5s; }
