:root {
  --bg: #04050d;
  --bg2: #0a0d1f;
  --panel: rgba(18, 22, 48, 0.72);
  --line: rgba(120, 160, 255, 0.18);
  --text: #eef2ff;
  --muted: #8d97c2;
  --energy: #5ef2ff;
  --energy2: #ffd34d;
  --hot: #ff4fd8;
  --ok: #6dffa8;
  --danger: #ff6b6b;
  --accent: var(--energy);
  --radius: 16px;
  --font-head: 'Dela Gothic One', 'Hiragino Kaku Gothic StdN', sans-serif;
  --font-body: 'M PLUS 1p', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(ellipse at 50% -10%, #17205a 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--energy); }
button { font-family: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- ヘッダー ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0;
}
.logo {
  font-family: var(--font-head); font-size: 20px; letter-spacing: 0.04em; text-decoration: none;
  color: var(--text); white-space: nowrap;
}
.logo .k { color: var(--energy); text-shadow: 0 0 12px rgba(94, 242, 255, 0.7); }
.me-chip {
  font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; background: rgba(255, 255, 255, 0.03); cursor: pointer; white-space: nowrap;
}
.me-chip b { color: var(--text); }

.lang-sel { width: auto; font-size: 13px; padding: 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); }
/* 選択欄の中の項目（白い背景に白い文字で見えなくならないように） */
select { color-scheme: dark; }
select option, select optgroup { background: #0a0d1f; color: #eef2ff; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.demo-row { text-align: center; margin: -4px 0 6px; }
.demo-row:empty { display: none; }
.me-chip { overflow: hidden; text-overflow: ellipsis; max-width: 55vw; min-width: 0; flex: 0 1 auto; }
@media (max-width: 600px) { .me-chip { max-width: 34vw; } } /* スマホで右上の名前が長いと、ページ全体が横にはみ出すのを防ぐ */
/* スマホで上の帯（ロゴ・言語・名前）が画面より広くなり、ページ全体が右にずれていたのを直す（2026-11-30 オーナー指摘） */
.topbar > .logo { flex: none; }
.topbar-right { flex: 0 1 auto; justify-content: flex-end; }
/* スマホでは上の帯を2行に：1行目にロゴ、2行目に言語と自分の名前（2026-11-30 オーナー「見にくい」） */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 0 8px; }
  .topbar > .logo { width: 100%; text-align: center; font-size: 20px; }
  .topbar-right { width: 100%; justify-content: center; }
  .topbar > .lang-sel { margin: 0 auto; }
  .lang-sel { flex: none; padding: 4px 8px; font-size: 12px; }
  .me-chip { max-width: none; flex: 0 1 auto; padding: 4px 10px; font-size: 12px; }
}
/* 念のため、何かがはみ出してもページが横にずれないようにする */
html, body { overflow-x: clip; }
/* ボット判定の小窓（怪しいときだけ出る。ふだんは高さ0） */
.ts-box { display: flex; justify-content: center; margin-top: 6px; }
.ts-box:empty { display: none; }
/* 長い英字の名前や呼びかけでも、画面の外にはみ出さない */
.grid2 > * { min-width: 0; }
.sname, .scall, #sName, .s-call, .s-name, .rank-name, td { overflow-wrap: anywhere; }
/* 小窓が画面より高いときは、小窓ごとスクロールできる */
.overlay { overflow-y: auto; align-items: flex-start; }
.overlay > .modal, .overlay > .panel { margin: auto; }
/* 小窓の×は、どの小窓も枠の右上の外に出す（文字と重ならない） */
.modal { position: relative; }
.modal .modal-x { top: -15px; inset-inline-end: -15px; background: #161b36; border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); z-index: 1; }
.modal .modal-x:hover { background: #242a4d; }
/* 動きを減らす設定の人には、ふわっとした動きを止める */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
.consent { margin: 10px 0 0; line-height: 1.6; }
.consent a { color: var(--accent, #8ce8ff); }
/* 送り方を選ぶ小窓 */
.how-modal { position: relative; max-width: 420px; }
/* 見出しは日本語で1行に収まる大きさ。×は枠の右上の外に出して、文字と重ならないようにする（2026-11-30 オーナー） */
.modal.how-modal h2 { margin: 0 0 12px; font-size: 16px; line-height: 1.4; }
.modal.how-modal .modal-x { top: -15px; inset-inline-end: -15px; background: #161b36; border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); z-index: 1; }
.modal.how-modal .modal-x:hover { background: #242a4d; }
.how-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; margin: 10px 0 0; padding: 14px 12px;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); cursor: pointer; font: inherit; }
.how-btn b { font-size: 16px; font-weight: 800; }
.how-btn span { font-size: 12px; opacity: 0.8; }
.how-btn.primary { background: var(--accent); color: #001318; border-color: transparent; box-shadow: 0 0 20px rgba(140, 232, 255, 0.35); }
.how-btn:disabled { opacity: 0.45; cursor: default; }
/* TAKE MY ENERGY のあとの顔文字は次の行に */
.cta .cta-kao { display: block; margin-top: 2px; }
/* ありがとう画面のボタン：「もう一回送る」の下に（広告を見る）、「閉じる」は小さく1行で */
#again .sub { display: block; font-size: 0.82em; font-weight: 700; opacity: 0.85; margin-top: 1px; }
#again { line-height: 1.3; flex-direction: column; align-items: center; }
#close { white-space: nowrap; font-size: 13px; flex: none; }
.live-pill { white-space: nowrap; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #1a1300; background: var(--energy2); border-radius: 999px; padding: 2px 10px; font-weight: 700;
}

/* ---------- 共通パーツ ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(8px);
}
/* 枠の見出しは読みやすい本文の字（太字）。飾りの字（Dela Gothic One）はロゴ・大きな数字・呼びかけ・ボタンだけ（2026-11-30 オーナー「マジで見にくい」） */
.panel h2, .panel h3 { margin: 0 0 12px; font-family: var(--font-body); font-weight: 800; letter-spacing: 0.02em; }
.panel h2 { font-size: 20px; }
.panel h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 15px; cursor: pointer; font-weight: 700;
  transition: transform 0.08s, background 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--energy); color: #001318; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.1); }

input, select, textarea {
  width: 100%; background: rgba(0, 0, 0, 0.35); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 16px; font-family: inherit;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; margin-top: 8px; }

/* ---------- トップページ ---------- */
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 {
  font-family: var(--font-head); font-weight: 400; font-size: clamp(38px, 9vw, 84px); line-height: 1.05; margin: 0;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 0%, var(--energy) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(94, 242, 255, 0.45));
}
.hero .kao { font-size: clamp(22px, 5vw, 40px); margin-top: 6px; color: var(--energy2); }
.hero .tagline { font-size: clamp(18px, 3.4vw, 26px); font-weight: 800; margin: 18px 0 6px; }
.hero .sub { color: var(--muted); margin: 0 auto; max-width: 640px; }
.hero-stats { display: flex; justify-content: center; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div { text-align: center; }
.hero-stats .v { font-family: var(--font-head); font-size: 30px; color: var(--energy); }
.hero-stats .l { font-size: 12px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; }
.step .n { font-family: var(--font-head); color: var(--energy2); font-size: 22px; }
.step p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 40px; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rank th { text-align: left; color: var(--muted); font-weight: 400; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.rank td { padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
table.rank tr { cursor: pointer; }
table.rank tr:hover td { background: rgba(94, 242, 255, 0.05); }
.rk { font-family: var(--font-head); font-size: 18px; color: var(--muted); width: 36px; }
tr:nth-child(1) .rk { color: var(--energy2); }
.sname { font-weight: 800; }
.scall { font-size: 12px; color: var(--muted); }
.big { font-family: var(--font-head); font-size: 18px; color: var(--energy); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); margin-right: 4px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors label { margin: 0; cursor: pointer; }
.colors input { display: none; }
.colors span { display: block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; }
.colors input:checked + span { border-color: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }

footer { color: var(--muted); font-size: 12px; text-align: center; padding: 30px 0 40px; }
.legal-links { margin-top: 10px; }
.legal-links a, footer#legalLinks a { color: var(--muted); }
.doc { max-width: 760px; margin: 16px auto; line-height: 1.8; }
.doc h1 { font-size: 26px; margin-top: 0; }
.doc h2 { font-size: 17px; margin: 22px 0 6px; }
.doc ul { padding-left: 1.4em; margin: 6px 0; }
.doc a { color: var(--accent, #8ce8ff); }
.ct-tip { background: rgba(140, 232, 255, 0.08); border: 1px solid rgba(140, 232, 255, 0.25); border-radius: 10px; padding: 8px 12px; }
.ct-id { display: flex; align-items: center; gap: 6px; }
.ct-id span { color: var(--muted); font-weight: 800; }
.doc textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.you-del { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.btn.danger { border-color: #ff6b6b; color: #ff9b9b; }
.owner-chip { font-size: 12px; color: #04121a; background: var(--accent, #8ce8ff); border-radius: 999px; padding: 2px 10px; margin-left: 4px; vertical-align: middle; }
.owner-tools { margin-top: 18px; }
.owner-tools h3 { margin: 0 0 4px; text-align: center; }
.owner-tools .owner-note { text-align: center; }
.owner-note { margin-bottom: 4px; }
.set-sec { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.set-sec h3 { font-size: 15px; margin: 0 0 4px; }
.danger-zone h3 { color: #ff9b9b; }
/* トップのデモ（玉と世界地図が育っていく様子） */
.hero-demo { margin-top: 18px; }
.hero-demo #stage { height: min(70vh, 640px); min-height: 420px; }
.hd-note { text-align: end; font-size: 11px; color: var(--muted); margin: 4px 4px 0; opacity: 0.8; }
.i18n-sorry { margin-top: 8px; font-size: 11px; opacity: 0.8; }
/* 右から左の言語のとき：利用者が入れた文字（名前・呼びかけ・ニックネーム）は、その文字の向きのまま表示する
   （日本語や英語の呼びかけの「！」が先頭に飛んだりしないように） */
.s-call, #sName, .sname, .scall, .who, .spot-item .nm, .obs-call, #me, .rep-page b { unicode-bidi: plaintext; }
.who, .tag, .spot-item .nm small { unicode-bidi: isolate; }
/* URL・ロゴ・TAKE MY ENERGY と顔文字は、どの言語でも左から右 */
.url-bar input, .logo, .kao, .cta, .obs-cta, .obs-url, .num, .v { direction: ltr; unicode-bidi: isolate; }
.url-bar input { text-align: left; }
.i18n-sorry bdi { unicode-bidi: isolate; }
bdi.tme { unicode-bidi: isolate; direction: ltr; white-space: nowrap; }
.report-link { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; margin-top: 8px; padding: 4px; }
.report-link:hover { color: var(--text, #fff); }
.report-reasons { display: grid; gap: 8px; margin: 12px 0; }
.report-reasons label { display: flex; gap: 8px; align-items: center; justify-content: flex-start; text-align: left; font-size: 14px; color: var(--text, #fff); cursor: pointer; margin: 0; }
.report-reasons input[type=radio] { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; accent-color: var(--accent, #8ce8ff); }
#reportOverlay textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }

/* ---------- 配信者ページ ---------- */
.s-head { text-align: center; padding: 6px 0 4px; }
.s-name { font-size: 14px; color: var(--muted); }
.s-name b { color: var(--text); font-size: 16px; }
.s-name .s-tag { margin-left: 1em; }
/* スマホでは「名前 @ID」「・人類1円玉」「あなたのページ」を3行に分ける（1行だと「あなたのページ」が切れるため：2026-11-30 オーナー） */
@media (max-width: 600px) {
  .s-name .s-tag { display: block; margin: 2px 0 0; }
  .s-name .s-tag:empty { display: none; }
  .s-name .owner-chip { display: table; margin: 4px auto 0; }
}
.s-call {
  font-family: var(--font-head); font-weight: 400; font-size: clamp(22px, 4.6vw, 40px); margin: 4px 0 0; line-height: 1.25;
  text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 60%, transparent);
}

.stage-wrap { position: relative; margin: 8px 0 0; }
#stage { display: block; width: 100%; height: min(78vh, 760px); min-height: 520px; }
#stage { border-radius: var(--radius); }
.orb-empty, .orb-label {
  position: absolute; left: 0; right: 0; text-align: center; pointer-events: none;
}
.orb-empty { transform: translateY(-50%); font-family: var(--font-head); font-size: clamp(20px, 3.4vw, 30px); color: rgba(238, 242, 255, 0.55); }
.orb-empty span { font-family: var(--font-body); font-size: 14px; color: var(--muted); }
.orb-label .lv { font-family: var(--font-head); font-size: 14px; color: var(--accent); letter-spacing: 0.05em; text-shadow: 0 0 12px var(--accent); }
.orb-label .en { font-family: var(--font-head); font-size: clamp(22px, 3.6vw, 34px); line-height: 1.15; text-shadow: 0 0 4px #000, 0 0 10px rgba(0,0,0,0.8), 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent); }
.orb-label .zoom { font-size: 11px; color: var(--energy2); text-shadow: 0 0 4px #000; margin-top: 2px; }
.orb-label .pct { font-size: 12px; color: #c4cbe8; text-shadow: 0 0 4px #000, 0 0 8px #000; }
.lv-preview { position: absolute; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: calc(100% - 16px); background: rgba(0, 0, 0, 0.55); padding: 6px 8px; border-radius: 10px; font-size: 12px; }
.sim-ctl { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.sim-ctl button { font-size: 12px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.6); color: var(--text); cursor: pointer; }
.sim-ctl button:first-child { border-color: var(--accent); }
.lv-preview input[type=range] { width: min(320px, 60vw); padding: 0; accent-color: var(--accent); }
.lv-preview button { font-size: 11px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.6); color: var(--text); cursor: pointer; }
.lv-preview button.on { background: var(--accent); color: #001318; }
.stage-overlay { position: absolute; left: 0; right: 0; top: 10px; display: flex; justify-content: space-between; padding: 0 6px; pointer-events: none; }
.live-pill {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 13px;
}
.live-pill .v { font-family: var(--font-head); color: var(--ok); font-size: 18px; }

.counters { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.counter { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.counter .l { font-size: 12px; color: var(--muted); }
.counter .v { font-family: var(--font-head); font-size: 24px; line-height: 1.2; }
.counter.hero-c .v { font-size: 40px; color: var(--accent); text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 50%, transparent); }
.counter .s { font-size: 11px; color: var(--muted); }

.cta-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 18px 0 8px; }
.cta {
  font-family: var(--font-head); font-size: clamp(20px, 4.5vw, 30px); letter-spacing: 0.04em;
  padding: 18px 34px; border-radius: 999px; border: none; cursor: pointer; color: #001318;
  background: linear-gradient(90deg, var(--accent), #ffffff 50%, var(--accent));
  background-size: 200% 100%; animation: shine 3s linear infinite;
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 80px color-mix(in srgb, var(--accent) 25%, transparent);
}
.cta:active { transform: scale(0.98); }
@keyframes shine { to { background-position: -200% 0; } }

.cols { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin: 14px 0 30px; align-items: start; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 14px; }
.feed li.new { animation: slidein 0.4s ease; }
.feed li .who { font-weight: 800; }
.feed li .tag { color: var(--muted); font-size: 12px; }
.feed li .where { color: var(--muted); font-size: 12px; }
@keyframes slidein { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.list li .p { color: var(--energy2); font-family: var(--font-head); font-size: 13px; }
.record { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.record .t { font-weight: 800; }
.record .w { font-size: 12px; color: var(--muted); }
.mine { display: inline-block; margin-top: 4px; font-size: 12px; color: #1a1300; background: var(--energy2); border-radius: 6px; padding: 1px 8px; font-weight: 700; }
.you-n { font-family: var(--font-head); font-size: 40px; line-height: 1.1; color: var(--accent); text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent); }
.you-n span { font-size: 16px; color: var(--text); margin-left: 4px; }
.you-rows { margin-top: 8px; font-size: 13px; }
.you-rows div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.you-rows b { font-family: var(--font-head); font-weight: 400; color: var(--energy2); }
/* スポットライト：参加した人の名前が玉のまわりに大きく出る（同時に何人も） */
.spot-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.orb-label { z-index: 3; } /* 人数の表示は名前より手前 */
.spot-item { position: absolute; text-align: center; white-space: nowrap; animation: spotlife 3000ms ease forwards; }
.spot-item .nm { font-family: var(--font-head); font-size: 1em; line-height: 1.1; text-shadow: 0 0 6px #000, 0 0 16px color-mix(in srgb, var(--accent) 70%, transparent); }
.spot-item .nm small { font-family: var(--font-body); font-size: 0.5em; color: var(--muted); }
.spot-item .wh { font-size: max(10px, 0.42em); color: #c4cbe8; text-shadow: 0 0 4px #000; }
.spot-item.me { z-index: 2; }
.spot-item.me .nm { color: var(--energy2); text-shadow: 0 0 6px #000, 0 0 22px rgba(255, 211, 77, 0.9); }
@keyframes spotlife {
  0% { opacity: 0; transform: translateY(6px) scale(0.85); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  80% { opacity: 1; transform: translateY(-8px) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(0.97); }
}

.wave-wrap { margin: 14px 0; }
#wave { display: block; width: 100%; height: 170px; }

.url-bar { display: flex; align-items: center; gap: 8px; max-width: 620px; margin: 12px auto 0; }
.url-label { font-family: var(--font-body); font-weight: 800; font-size: 13px; color: #c4cbe8; letter-spacing: 0.02em; width: 11em; flex: none; text-align: end; line-height: 1.25; }
.url-bar input { font-size: 14px; padding: 8px 12px; flex: 1; min-width: 0; }
.url-btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.qr-thumb { flex: none; width: 44px; height: 44px; padding: 3px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.qr-thumb canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.obs-bar { margin-top: 6px; padding-right: 52px; } /* 上のURL欄と入力欄の幅をそろえる（QRの分） */
.obs-hint { max-width: 620px; margin: 2px auto 0; text-align: center; font-size: 11px; }
@media (max-width: 600px) {
  .url-bar { flex-wrap: wrap; }
  .url-label { width: 100%; text-align: left; }
  .obs-bar { padding-right: 0; }
}
.qr-big { width: min(280px, 70vw); height: auto; aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 10px; image-rendering: pixelated; }

/* ---------- 広告・参加中の画面 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center;
  background: rgba(2, 3, 10, 0.86); backdrop-filter: blur(6px); padding: 16px;
}
.overlay.show { display: flex; }
.modal { width: 100%; max-width: 460px; position: relative; }
/* 小窓の右上の×ボタン */
.modal-x { position: absolute; top: 10px; inset-inline-end: 10px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text, #fff); cursor: pointer; display: grid; place-items: center; padding: 0; }
.modal-x svg { display: block; }
.modal-x:hover { background: rgba(255, 255, 255, 0.12); }
.modal h2 { font-size: 22px; }
.ad-box {
  aspect-ratio: 16 / 9; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #151a38, #151a38 14px, #10142c 14px, #10142c 28px);
  border: 1px dashed var(--line); text-align: center; padding: 16px;
}
.ad-box .big { font-size: 22px; color: var(--text); }
.ad-count { font-family: var(--font-head); font-size: 44px; color: var(--energy2); }
.bar { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.2s linear; }

.energy-panel {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; width: min(560px, calc(100% - 24px));
  max-height: calc(100dvh - 24px); overflow-y: auto; /* 画面が低いときも上下が切れないように */
  display: none;
}
.energy-panel.show { display: block; }
.energy-panel .row { display: flex; align-items: center; gap: 12px; }
.cam-box { position: relative; width: 132px; height: 99px; border-radius: 10px; overflow: hidden; background: #000; flex: none; display: none; }
.cam-box.show { display: block; }
.cam-box video, .cam-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-status { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; text-align: center; background: rgba(0, 0, 0, 0.55); padding: 2px; }
.cam-status.up { background: rgba(40, 200, 110, 0.85); color: #001a0b; font-weight: 800; }
/* スマホを掲げて送る（判定の状態） */
#raiseBtn, #camBtn { flex: none; white-space: nowrap; }
.raise-box { display: none; flex: none; width: 132px; min-height: 64px; border-radius: 10px; padding: 8px; text-align: center;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); font-size: 12px; font-weight: 800; line-height: 1.35; }
.raise-box.show { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.raise-box .raise-ico { font-size: 22px; line-height: 1; transition: transform 0.25s; }
.raise-box.up { background: rgba(40, 200, 110, 0.85); border-color: transparent; color: #001a0b; }
.raise-box.up .raise-ico { transform: translateY(-4px); }
.hold-btn {
  flex: 1; user-select: none; -webkit-user-select: none; touch-action: none;
  font-family: var(--font-head); font-size: 18px; padding: 18px 10px; border-radius: 14px; border: 2px solid var(--accent);
  background: rgba(94, 242, 255, 0.08); color: var(--text); cursor: pointer;
}
.hold-btn.on { background: var(--accent); color: #001318; box-shadow: 0 0 30px var(--accent); }
.my-energy { font-family: var(--font-head); font-size: 26px; color: var(--accent); }
.privacy { font-size: 11px; color: var(--muted); margin-top: 8px; }

.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(calc(-100% - 40px)); z-index: 60;
  background: var(--energy2); color: #1a1300; font-weight: 800; padding: 10px 18px; border-radius: 999px;
  transition: transform 0.35s; max-width: calc(100% - 24px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- スマホ ---------- */
@media (max-width: 900px) {
  .grid2, .cols { grid-template-columns: 1fr; }
  .counters { grid-template-columns: 1fr 1fr; }
  .counter.hero-c { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; }
  #stage { height: 72vh; min-height: 460px; }
  table.rank .hide-sm, .hide-sm { display: none; }
  .logo { font-size: 16px; }
  .live-pill { font-size: 11px; padding: 4px 10px; }
  .live-pill .v { font-size: 15px; }
}

/* ---------- トップの一番上：画面いっぱいの動画 ---------- */
.hv { position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 1100px; overflow: hidden; background: #02030a; display: flex; flex-direction: column; }
.hv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 暗い幕＋細かい点の網（文字を読みやすくする）。下の端はページの背景色に溶かす */
.hv-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(rgba(0, 0, 0, 0.32) 1px, transparent 1.3px) 0 0 / 3px 3px,
    linear-gradient(180deg, rgba(4, 6, 20, 0.62) 0%, rgba(4, 6, 20, 0.42) 35%, rgba(4, 6, 20, 0.5) 70%, var(--bg) 100%); }
.hv-top { position: relative; z-index: 3; width: 100%; box-sizing: border-box; }
.hv-top .topbar { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.hv-body { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 16px 60px; }
.hv-title { font-family: var(--font-head); font-weight: 400; font-size: clamp(48px, min(12vw, 14vh), 128px); line-height: 1.02; margin: 0; letter-spacing: 0.03em; color: #f4f7ff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.55); }
.hv-title .k { color: var(--energy); text-shadow: 0 0 28px rgba(94, 242, 255, 0.75), 0 4px 30px rgba(0, 0, 0, 0.5); }
.hv-kao { font-size: clamp(28px, 6vw, 56px); margin-top: 10px; color: #ffe066; text-shadow: 0 0 18px rgba(255, 210, 60, 0.55), 0 2px 12px rgba(0, 0, 0, 0.6); white-space: nowrap; }
.hv-copy { font-size: clamp(18px, 3.6vw, 32px); font-weight: 800; margin: 18px 0 0; color: #ffffff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); max-width: 900px; }
.hv-cta { display: inline-block; margin-top: 30px; padding: 13px 30px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.85); color: #fff; text-decoration: none; font-weight: 800; font-size: 16px;
  background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(2px); transition: background 0.2s, color 0.2s; }
.hv-cta::after { content: ' ＞'; }
.hv-cta:hover, .hv-cta:focus-visible { background: #fff; color: #050716; }
.hv-scroll { position: absolute; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%); color: #fff; text-decoration: none; font-size: 12px; letter-spacing: 0.12em; opacity: 0.85; text-align: center; }
.hv-scroll::before { content: ''; display: block; width: 12px; height: 12px; margin: 0 auto 4px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); animation: hv-bob 1.6s ease-in-out infinite; }
@keyframes hv-bob { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(5px) rotate(45deg); } }
.hv-note { position: absolute; z-index: 2; right: 14px; bottom: 10px; margin: 0; font-size: 11px; color: rgba(255, 255, 255, 0.7); }
[dir="rtl"] .hv-note { right: auto; left: 14px; }
@media (max-width: 600px) {
  .hv { min-height: 520px; }
  .hv-body { padding-bottom: 70px; }
  .hv-cta { font-size: 15px; padding: 12px 24px; }
}
@media (prefers-reduced-motion: reduce) { .hv-scroll::before { animation: none; } }
/* 背の低い画面（ノートパソコンなど）では、Scroll がボタンに重ならないように隠す */
@media (max-height: 700px) { .hv-scroll { display: none; } .hv-body { padding-bottom: 30px; } .hv-cta { margin-top: 22px; } .hv-copy { margin-top: 12px; } }
