/* ⚡ フラッシュ暗算チャレンジ（challenge.html・en/challenge.html）
   2026-10-17 夜の キングダム 風（ユーザー「この デザインを 入れて。シンプルすぎる」→ ChatGPT の 図の 雰囲気：紺の 夜・金の 光・親子の 写真・4つの 輪）
   写真は assets/miseru/cm_poster3.jpg（CM の 1コマ）。文字は 白と クリーム。読みやすさの ため 本文の 対比は 落とさない */
:root { --navy: #16305c; --deep: #0a1733; --gold: #e3b341; --gold2: #f7d772; --cream: #fff4d6; --red: #ff6b6b; --green: #4cd98a; --ink: #f3f0e8; --mute: #c9d0e0; }
* { box-sizing: border-box; }
html { background: var(--deep); }
body.cg { margin: 0; color: var(--ink); font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Meiryo", sans-serif;
  background: radial-gradient(900px 500px at 15% -5%, rgba(227,179,65,.22), transparent 60%),
              radial-gradient(700px 420px at 95% 20%, rgba(90,140,255,.18), transparent 60%),
              radial-gradient(600px 400px at 50% 110%, rgba(227,179,65,.14), transparent 60%),
              linear-gradient(180deg, #0a1733 0%, #122a55 55%, #0a1733 100%); min-height: 100vh; }
.cg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: rgba(6,14,34,.75); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(227,179,65,.25); }
.cg-head a { color: #fff; text-decoration: none; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cg-head img { height: 34px; filter: drop-shadow(0 0 6px rgba(227,179,65,.5)); }
.cg-head .cg-lang { font-size: 13px; font-weight: 700; opacity: .9; }
.cg-main { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; text-align: center; }
.hidden { display: none !important; }

/* 🌃 上の 写真（親子）と 光 */
.cg-hero { position: relative; margin: 0 0 14px; padding: 22px 16px 10px; overflow: hidden; text-align: center; }   /* main の 外に 置いて、パソコンでも 写真を 画面の 幅いっぱいに */
.cg-hero > * { max-width: 528px; margin-left: auto; margin-right: auto; }
.cg-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 220px at 50% 70%, rgba(227,179,65,.28), transparent 70%), radial-gradient(2px 2px at 12% 30%, #fff8, transparent), radial-gradient(2px 2px at 80% 20%, #fff8, transparent), radial-gradient(2px 2px at 65% 60%, #fff6, transparent), radial-gradient(2px 2px at 30% 75%, #fff6, transparent); }   /* 2026-10-17 城の 絵は やめた（ゲームと 関係ない） */
.cg-hero::after { content: none; }
.cg-hero > * { position: relative; z-index: 1; }
.cg-tag { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--gold2); border: 1px solid rgba(247,215,114,.6); border-radius: 999px; padding: 4px 12px; margin-bottom: 8px; background: rgba(10,23,51,.5); }
.cg-catch { font-size: clamp(22px, 6.4vw, 32px); font-weight: 900; line-height: 1.3; margin: 0 auto 14px; text-shadow: 0 2px 14px rgba(0,0,0,.6); }
.cg-catch b { color: var(--gold2); }

.cg-card { background: rgba(8,18,44,.82); border: 2px solid rgba(227,179,65,.75); border-radius: 22px; padding: 20px 16px; box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 10px 40px rgba(0,0,0,.45), 0 0 60px rgba(227,179,65,.12); backdrop-filter: blur(8px); text-align: center; }
.cg-title { word-break: keep-all; overflow-wrap: anywhere; font-size: clamp(24px, 6.5vw, 34px); font-weight: 900; color: #fff; margin: 6px 0 4px; line-height: 1.3; text-shadow: 0 0 18px rgba(227,179,65,.35); }
.cg-lead { font-size: 15px; line-height: 1.8; margin: 6px 0 12px; color: var(--ink); }
.cg-lead b { color: var(--gold2); }
.cg-solo { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(227,179,65,.45)); }
.cg-pair { display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.cg-keeper { width: 170px; height: 170px; filter: drop-shadow(0 0 14px rgba(120,170,255,.6)); }   /* 時の 番人（1分を はかる・2026-09-28） */
.cg-go { display: inline-block; font-size: 24px; font-weight: 900; padding: 16px 44px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #ffe27a, #e3b341 70%, #c9962a); color: #3a2a00; box-shadow: 0 5px 0 #8f6a14, 0 0 28px rgba(227,179,65,.55); margin: 8px 0; touch-action: manipulation; }
.cg-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #8f6a14, 0 0 16px rgba(227,179,65,.45); }
.cg-small { font-size: 13px; color: var(--mute); margin: 6px 0; }
.cg-small a { color: var(--gold2); }
.cg-sound { font-size: 14px; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; color: var(--mute); }

/* 🔁 広がる 輪（4つ） */
.cg-ring { margin: 18px 0 6px; }
.cg-ringH { font-size: 18px; font-weight: 900; color: var(--gold2); margin: 0 0 10px; letter-spacing: .04em; }
.cg-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cg-step { position: relative; background: rgba(8,18,44,.7); border: 1px solid rgba(227,179,65,.4); border-radius: 16px; padding: 26px 6px 10px; font-size: 12px; line-height: 1.5; color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.cg-step i { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(180deg, #ffe27a, #c9962a); color: #3a2a00; font-style: normal; font-weight: 900; font-size: 14px; line-height: 26px; box-shadow: 0 0 12px rgba(227,179,65,.6); }
.cg-step img { width: 52px; height: 52px; object-fit: contain; display: block; margin: 0 auto 4px; filter: drop-shadow(0 0 8px rgba(227,179,65,.35)); }
.cg-step img.photo { width: 100%; height: 64px; object-fit: cover; border-radius: 10px; filter: none; border: 1px solid rgba(227,179,65,.4); }   /* 写真（ChatGPT で 作った 絵・2026-10-17） */
.cg-step b { display: block; color: var(--gold2); font-size: 13px; margin-bottom: 2px; }
@media (max-width: 420px) { .cg-steps { grid-template-columns: repeat(2, 1fr); gap: 16px 8px; } .cg-step { font-size: 13px; } }

.cg-hud { font-size: 15px; font-weight: 800; color: var(--gold2); margin: 12px 0 6px; min-height: 22px; }
.cg-msg { font-size: 15px; color: var(--mute); min-height: 22px; }
.cg-stage { background: radial-gradient(circle at 50% 40%, #1d3a6e, #0a1733 75%); border: 2px solid rgba(227,179,65,.5); border-radius: 22px; height: min(46vw, 240px); display: flex; align-items: center; justify-content: center; margin: 10px 0; box-shadow: 0 0 40px rgba(227,179,65,.15), inset 0 0 40px rgba(0,0,0,.4); }
.cg-big { font-size: clamp(64px, 20vw, 128px); font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 2px; text-shadow: 0 0 24px rgba(255,255,255,.35); }
.cg-big.cg-answer { color: var(--gold2); }
.cg-big.pop { animation: cgpop .12s ease-out; }
@keyframes cgpop { from { transform: scale(.85); opacity: .5; } to { transform: scale(1); opacity: 1; } }
.cg-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; margin: 8px auto 0; }
.cg-pad button { font-size: 28px; font-weight: 900; padding: 14px 0; border-radius: 14px; border: 1px solid rgba(227,179,65,.45); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; touch-action: manipulation; }
.cg-pad button:active { background: rgba(227,179,65,.35); }
.cg-pad .k-ok { background: var(--green); color: #063; border-color: var(--green); font-size: 22px; }
.cg-pad .k-del { color: var(--mute); }
.cg-feedback { font-size: 20px; font-weight: 900; min-height: 30px; margin-top: 8px; }
.cg-feedback.ok { color: var(--green); }
.cg-feedback.ng { color: var(--red); }
.cg-feedback small { display: block; font-size: 14px; font-weight: 700; color: var(--mute); margin-top: 4px; word-break: break-all; }
.cg-resH { font-size: 18px; margin: 4px 0 0; color: var(--mute); }
.cg-resLv { font-size: clamp(24px, 7vw, 34px); font-weight: 900; color: var(--gold2); margin: 4px 0 8px; line-height: 1.3; text-shadow: 0 0 20px rgba(227,179,65,.5); }
.cg-share { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.cg-share a, .cg-share button { font-size: 14px; font-weight: 800; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(227,179,65,.7); background: rgba(255,255,255,.06); color: #fff; text-decoration: none; cursor: pointer; }
.cg-share #cgShare { background: linear-gradient(180deg, #ffe27a, #e3b341); color: #3a2a00; border-color: transparent; box-shadow: 0 0 16px rgba(227,179,65,.4); width: 100%; font-size: 18px; padding: 14px 20px; }
/* 2026-11-05「戻って こない」への 直し：友だちへの 入口の 見出し と、連続・あしたの 予告の 箱 */
.cg-shareH { margin: 14px 0 2px; font-size: 17px; font-weight: 900; color: #ffe27a; }
.cg-nextbox { margin: 10px auto; padding: 12px 14px; max-width: 520px; text-align: left; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(227,179,65,.5); }
.cg-nextbox p { margin: 4px 0; font-size: 15px; line-height: 1.5; }
.cg-nextbox b { color: #ffe27a; font-size: 19px; }
.cg-nextbox span { display: block; color: #eaf0ff; font-size: 14px; }
.cg-nextbox i { display: block; font-style: normal; font-weight: 800; color: #a9e6b8; margin-top: 4px; }
.cg-cta { display: block; margin: 10px auto 4px; padding: 14px 18px; border-radius: 16px; background: linear-gradient(180deg, #2b4f8f, #16305c); border: 1px solid rgba(227,179,65,.6); color: #fff; font-weight: 900; text-decoration: none; font-size: 16px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.cg-about { text-align: left; font-size: 14px; line-height: 1.9; margin-top: 22px; color: var(--mute); }
.cg-about h2 { font-size: 18px; color: var(--gold2); margin: 18px 0 6px; }
.cg-about a { color: var(--gold2); }
.cg-foot { text-align: center; font-size: 12px; color: #8d97b0; padding: 20px 16px; }
.cg-foot a { color: #aeb7cc; }
.cg-playing .cg-about, .cg-playing .cg-foot { display: none; }
/* 🚦 信号（数を 出す 前） */
.cg-signal { display: flex; gap: 14px; padding: 12px 18px; background: #0e1f3d; border-radius: 40px; border: 3px solid #2d4675; }
.cg-signal i { width: clamp(44px, 13vw, 64px); height: clamp(44px, 13vw, 64px); border-radius: 50%; background: #2b3a55; display: block; transition: background .08s; }
.cg-signal i.r.on { background: #ff4d4d; box-shadow: 0 0 22px #ff4d4d; }
.cg-signal i.y.on { background: #ffd23f; box-shadow: 0 0 22px #ffd23f; }
.cg-signal i.g.on { background: #3ee07a; box-shadow: 0 0 26px #3ee07a; }
.cg-adv { display: block; font-size: 18px; padding: 12px 20px; margin: 12px auto 0; text-decoration: none; background: linear-gradient(180deg, #7fd3ff, #2f8fd6); color: #fff; box-shadow: 0 4px 0 #1f5f96, 0 0 24px rgba(127,211,255,.35); }
/* 🏆 友だち挑戦・点数カード（2026-10-17） */
.cg-vs { background: rgba(227,179,65,.14); border: 1px solid rgba(247,215,114,.7); border-radius: 14px; padding: 10px 12px; margin: 0 0 8px; font-size: 15px; line-height: 1.6; box-shadow: 0 0 20px rgba(227,179,65,.2); }
.cg-vs b { display: block; color: var(--gold2); font-size: 18px; }
.cg-vs span { color: var(--mute); font-size: 13px; }
.cg-resVs { font-size: 16px; font-weight: 800; color: var(--mute); margin: 0 0 6px; min-height: 0; }
.cg-resVs.win { color: var(--gold2); font-size: 18px; text-shadow: 0 0 14px rgba(227,179,65,.5); }
.cg-resVs:empty { display: none; }
.cg-cardpic { display: block; width: min(100%, 320px); margin: 10px auto 4px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 30px rgba(227,179,65,.25); }
.cg-next { margin-top: 16px; padding-top: 12px; border-top: 1px dashed rgba(227,179,65,.4); }
.cg-nextH { font-size: 18px; font-weight: 900; color: var(--gold2); margin: 4px 0 6px; }
.cg-cta small { display: block; font-weight: 700; font-size: 12px; opacity: .9; margin-top: 4px; }
.cg-next .cg-small a { color: var(--gold2); font-weight: 800; }
/* 🦊 練習中の ソロモン・級アップ・紙ふぶき・ランキング（2026-10-17 ユーザー「演出しないと 張りぼて」「一般参加型の ランキング」） */
.cg-mate { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 76px; margin: 2px 0 -4px; }
.cg-mate img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(227,179,65,.45)); }
.cg-bubble { position: relative; background: #fff; color: #16305c; font-weight: 900; font-size: 15px; padding: 8px 14px; border-radius: 16px; max-width: 220px; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.cg-bubble::before { content: ""; position: absolute; left: -8px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-right-color: #fff; border-left: 0; }
.cg-mate.bounce img, .bounce { animation: cgBounce .55s cubic-bezier(.3,1.6,.5,1); }
.cg-mate.shake img { animation: cgShake .45s ease; }
@keyframes cgBounce { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-16px) scale(1.12); } 100% { transform: translateY(0) scale(1); } }
@keyframes cgShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px) rotate(-6deg); } 40% { transform: translateX(8px) rotate(6deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.cg-up { display: block; margin-top: 4px; font-size: 22px; color: var(--gold2); text-shadow: 0 0 14px rgba(227,179,65,.8); animation: cgUp .7s ease-out; }
@keyframes cgUp { from { transform: translateY(14px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.cg-resMsg { font-size: 16px; font-weight: 800; color: #fff; margin: -2px 0 8px; }
.cg-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.cg-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: cgFall linear forwards; }
@keyframes cgFall { to { top: 105%; transform: translateX(40px) rotate(720deg); } }
.cg-join { margin: 14px 0 4px; padding: 14px 12px; border-radius: 16px; background: rgba(227,179,65,.1); border: 1px solid rgba(247,215,114,.6); text-align: left; }
.cg-joinH { margin: 0 0 8px; font-weight: 900; color: var(--gold2); font-size: 17px; text-align: center; }
.cg-nick { display: block; font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.cg-nick input { display: block; width: 100%; margin-top: 4px; font-size: 18px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(227,179,65,.7); background: rgba(255,255,255,.95); color: #16305c; font-family: inherit; font-weight: 800; }
.cg-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: var(--ink); margin-bottom: 10px; }
.cg-consent input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.cg-joinBtn { display: block; width: 100%; font-size: 18px; font-weight: 900; padding: 12px; border: none; border-radius: 999px; cursor: pointer; background: linear-gradient(180deg, #ffe27a, #e3b341); color: #3a2a00; box-shadow: 0 4px 0 #8f6a14; font-family: inherit; }
.cg-joinBtn:disabled { opacity: .6; }
.cg-joinMsg { min-height: 20px; margin: 8px 0 0; font-size: 14px; font-weight: 800; text-align: center; }
.cg-joinMsg.ok { color: var(--green); }
.cg-joinMsg.ng { color: var(--red); }
.cg-rank { margin: 22px 0 6px; padding: 16px 12px; border-radius: 20px; background: rgba(8,18,44,.82); border: 2px solid rgba(227,179,65,.6); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.cg-rankH { margin: 0 0 2px; font-size: 20px; color: var(--gold2); }
.cg-rank-list { list-style: none; margin: 10px 0 6px; padding: 0; text-align: left; }
.cg-rk { display: grid; grid-template-columns: 40px 1fr auto 44px; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; font-weight: 800; font-size: 15px; }
.cg-rk:nth-child(odd) { background: rgba(255,255,255,.05); }
.cg-rk.top { background: linear-gradient(90deg, rgba(227,179,65,.25), rgba(227,179,65,.05)); }
.cg-rk.me { outline: 2px solid var(--green); }
.cg-rk .n { text-align: center; font-size: 18px; }
.cg-rk .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-rk .nm em { font-style: normal; font-size: 11px; background: var(--green); color: #063; border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.cg-rk .lv { color: var(--gold2); }
.cg-rk .hp { color: #ff5d73; font-size: 12px; letter-spacing: -1px; text-align: right; }
.cg-rk-empty { word-break: keep-all; overflow-wrap: anywhere; text-align: center; color: var(--mute); padding: 12px; font-weight: 700; }
/* 🏰 キャラクターの 行（目標・人数に 数えない） */
.cg-rk.ch { background: rgba(127,211,255,.08); border: 1px dashed rgba(127,211,255,.45); color: #dfe9ff; }
.cg-rk.ch .n img { width: 34px; height: 34px; object-fit: contain; display: block; margin: 0 auto; }
.cg-rk .tag { font-size: 10px; font-weight: 800; background: #7fd3ff; color: #0a2a4a; border-radius: 6px; padding: 1px 5px; margin-left: 2px; vertical-align: 2px; }
.cg-rank-note { color: #a9c8ef; }
/* 🏘 きみの 町（2026-10-17） */
/* 🧩 10/24：絵は 横いっぱい・3:2 で 大きく（ユーザー「小さい」）。ソロモンは 絵の 上に 重ねず、絵の 上の 行へ */
.cg-townbox { position: relative; width: 100%; aspect-ratio: 3 / 2; max-height: 270px; border-radius: 16px; overflow: hidden; border: 2px solid rgba(227,179,65,.55); margin: 4px 0 6px; background: #0a1733; }
.cg-townbox canvas { display: block; width: 100%; height: 100%; }
.cg-townbig { display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: 16px; border: 2px solid rgba(227,179,65,.7); margin: 10px 0 4px; background: #0a1733; }
.cg-towncap { font-size: 14px; font-weight: 800; color: #a9e6b8; margin: 0 0 8px; }
.cg-townmsg { display: block; margin-top: 4px; font-size: 18px; color: #a9e6b8; animation: cgUp .6s ease-out; }
/* 練習中は 町・数・キーだけ（輪・ランキング・見出しは かくす） */
.cg-playing .cg-ring, .cg-playing .cg-rank, .cg-playing .cg-hero { display: none; }
.cg-playing .cg-main { padding-top: 8px; }
/* 練習中の ソロモンの 行は 低め（絵を 大きく とる） */
#cgPlay .cg-mate { min-height: 60px; margin: 0; }
#cgPlay .cg-mate img { width: 56px; height: 56px; }
#cgPlay .cg-bubble { font-size: 14px; padding: 6px 12px; }
@media (max-height: 700px) { .cg-townbox { max-height: 190px; } .cg-stage { height: min(38vw, 200px); } }
/* 絵（ChatGPT）が 届くまで パズルを かくす（2026-10-17 絶対の 決まり：絵は ChatGPT の 絵だけ） */
.no-town #cgTownDemo, .no-town #cgTownDemo + .cg-towncap, .no-town #cgTownBig, .no-town #cgTownCap, .no-town .cg-townbox { display: none; }
.cg-townbox .cg-kplay { top: auto; bottom: 6px; }
/* 💖 敗者復活（2026-10-17 夜） */
.cg-revive { margin: 4px 0 10px; padding: 14px 12px; border-radius: 18px; background: linear-gradient(180deg, rgba(255,93,115,.22), rgba(255,93,115,.08)); border: 2px solid #ff8da0; box-shadow: 0 0 26px rgba(255,93,115,.3); }
.cg-reviveH { margin: 0 0 6px; font-size: 20px; font-weight: 900; color: #ffd0d8; }
.cg-reviveTxt { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: #fff; }
.cg-reviveBtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cg-reviveBtns a, .cg-reviveBtns button { font-size: 14px; font-weight: 800; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(255,141,160,.8); background: rgba(255,255,255,.08); color: #fff; text-decoration: none; cursor: pointer; font-family: inherit; }
.cg-reviveBtns .cg-reviveBtn { flex-basis: 100%; font-size: 17px; padding: 13px 16px; border: none; background: linear-gradient(180deg, #ff8da0, #ff5d73); box-shadow: 0 4px 0 #b8324a; }
.cg-reviveGo { background: linear-gradient(180deg, #ff8da0, #ff5d73 70%, #e0405a); color: #fff; box-shadow: 0 5px 0 #a02a40, 0 0 28px rgba(255,93,115,.5); }
.cg-kbar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin: 4px 0 6px; border: 1px solid rgba(227,179,65,.5); }
.cg-kbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f7d772, #e3b341); transition: width .8s ease; }
.cg-kplay { position: absolute; right: 8px; top: 6px; font-size: 13px; font-weight: 900; color: #fff; background: rgba(8,20,48,.72); padding: 3px 10px; border-radius: 999px; }
.cg-kteaser { margin-top: -2px; }
.no-town .cg-kbar, .no-town #cgKStart, .no-town .cg-kteaser, .no-town .cg-kplay { display: none; }
