/* クイックスワイプ スタイル - 依存なし、ポップトーン */
:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --accent-2: #06b6d4;
  --danger: #ef4444;
  --warning: #f59e0b;
  --card: #1f2937;
  --btn: #3b82f6;
  --btn-2: #64748b;
  --shadow: rgba(0,0,0,.3);
}

/* --- 追加: ネオン配色・背景・ロゴ・タイムゲージ・ネオン帯・パニック演出 --- */

:root {
  --neon-blue: #60a5fa;
  --neon-green: #10b981;
  --neon-orange: #f59e0b;
  --neon-gold: #fbbf24;
}

/* 背景（提供画像をカバー表示） */
.bg-animated {
  background: url('../images/bg/bg_main.jpg') center/cover no-repeat fixed, var(--bg);
}

/* ロゴ（ネオンの柔らかい発光） */
.logo {
  display: block;
  margin: 12px auto 0;
  width: min(720px, 92vw);
  filter: drop-shadow(0 8px 24px rgba(96,165,250,.35)) drop-shadow(0 0 22px rgba(96,165,250,.35));
}

/* タイムゲージ（CSSのみで実装） */
.timebar {
  position: relative;
  width: clamp(160px, 30vw, 380px);
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.2), 0 4px 16px rgba(0,0,0,.35);
  overflow: hidden;
}
.timebar-fill {
  position: absolute;
  left: 2px; top: 2px; right: 2px; bottom: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(96,165,250,.65), 0 0 24px rgba(16,185,129,.45);
  transform: scaleX(1);
}
.panic .timebar-fill {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  box-shadow: 0 0 16px rgba(239,68,68,.85), 0 0 28px rgba(245,158,11,.65);
}

/* サイドラベルに軽い外側発光 */
.side-label { filter: drop-shadow(0 0 8px rgba(255,255,255,.25)); }

/* 左右帯をネオン風に強化 */
#lane-left, #lane-right { opacity: .36; }
#lane-left {
  box-shadow: 0 0 18px rgba(16,185,129,.55), inset 0 0 28px rgba(16,185,129,.25);
}
#lane-right {
  box-shadow: 0 0 18px rgba(96,165,250,.55), inset 0 0 28px rgba(96,165,250,.25);
}
.blink { animation: neonBlink .08s ease 0s 2; }
@keyframes neonBlink { from { opacity: .95; filter: drop-shadow(0 0 18px rgba(255,255,255,.6)); } to { opacity: .36; filter: none; } }

/* 残り5秒で赤点滅（画像差し替え無し、オーバーレイで表現） */
.panic-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 50%, rgba(239,68,68,.22), rgba(239,68,68,0));
  pointer-events: none;
  z-index: 40;
}
.panic .panic-overlay { animation: panicPulse .6s ease-in-out infinite; }
@keyframes panicPulse { 0%,100% { opacity: .2; } 50% { opacity: .6; } }

/* モバイルでゲージ幅を少し短く */
@media (max-width: 420px) {
  .timebar { width: clamp(140px, 40vw, 220px); }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Noto Sans JP, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1f2a44, transparent),
              radial-gradient(900px 500px at 100% 0%, #13213b, transparent),
              var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* 背景 画像1枚（点滅はオーバーレイで表現） */
.bg-animated { background: url('../images/bg/bg_main.jpg') center/cover no-repeat fixed, var(--bg); }

/* ヘッダ/HUD */
#header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,0));
  backdrop-filter: blur(4px);
}
.brand { font-weight: 800; letter-spacing: .02em; }
.sound-buttons { display: flex; gap: 8px; }
.icon-btn {
  border: none;
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 6px 16px var(--shadow) inset, 0 4px 10px rgba(0,0,0,.25);
  cursor: pointer;
}
.icon-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.hud { display: flex; gap: 16px; align-items: center; }
.hud.hidden { display: none; }
.hud-item { background: var(--panel); padding: 6px 10px; border-radius: 10px; box-shadow: 0 2px 10px var(--shadow) inset; }
.hud-label { color: var(--muted); font-size: 12px; margin-right: 6px; }
.hud-item span:not(.hud-label) { font-size: 20px; font-weight: 900; }

/* スクリーン切替 */
.screen { display: none; padding: 16px; max-width: 960px; margin: 0 auto; }
.screen.active { display: block; animation: screenIn .18s cubic-bezier(0.2,0.8,0.2,1); }
/* ゲーム画面では初期シフト感を無くす */
#screen-game.screen.active { animation: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* タイトル */
.title { font-size: 40px; margin: 24px 0 8px; text-align: center; font-weight: 900; }
.subtitle { text-align: center; color: #e8edf6; text-shadow: 0 2px 6px rgba(0,0,0,.45); margin-bottom: 24px; font-weight: 700; }
.title-rules { list-style: none; padding: 0; margin: 8px auto 20px; max-width: 720px; color: #e8edf6; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,.45); }
.title-rules li { margin: 6px 0; text-align: center; }
.title-actions { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }
.site-link { margin-top: 16px; text-align: center; }
.site-link a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 14px; font-weight: 400; transition: color 0.2s ease; }
.site-link a:hover { color: rgba(255,255,255,0.9); text-decoration: underline; }
.highscore { text-align: center; color: var(--warning); font-weight: 700; }

/* 共通ボタン */
button {
  font-size: 16px; font-weight: 800; letter-spacing: .02em; border: none; cursor: pointer;
}
.primary { background: var(--btn); color: white; border-radius: 14px; padding: 12px 20px; box-shadow: 0 8px 20px rgba(59,130,246,.35); transition: transform .12s cubic-bezier(0.2,0.8,0.2,1), box-shadow .12s cubic-bezier(0.2,0.8,0.2,1); }
.secondary { background: var(--btn-2); color: white; border-radius: 14px; padding: 12px 20px; box-shadow: 0 6px 16px rgba(100,116,139,.25); transition: transform .12s cubic-bezier(0.2,0.8,0.2,1), box-shadow .12s cubic-bezier(0.2,0.8,0.2,1); }
.share { background: var(--accent-2); color: #022c22; border-radius: 14px; padding: 12px 20px; font-weight: 900; }
.primary:focus, .secondary:focus, .share:focus, .big-btn:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.primary:hover, .secondary:hover, .share:hover, .big-btn:hover { transform: scale(1.02); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.primary:active, .secondary:active, .share:active, .big-btn:active { transform: scale(0.99); box-shadow: 0 6px 12px rgba(0,0,0,.25); }

/* お題選択 */
#screen-select h2 { text-align: center; }
.theme-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0 20px; }
.theme-card {
  background: linear-gradient(180deg, #3b4f6d, #2a3c58);
  border-radius: 16px; padding: 14px; box-shadow: 0 12px 24px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.10);
  border: 2px solid rgba(255,255,255,.18);
}
.theme-card[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,197,94,.3), 0 16px 30px rgba(0,0,0,.35); }
.theme-card h3 { margin: 6px 0 8px; font-weight: 900; }
.theme-labels { display: flex; justify-content: space-between; font-weight: 800; }
.theme-counts { color: #c7d2fe; font-weight: 700; opacity: .9; }

/* お題別ハイスコア表示 */
.theme-meta { margin-top: 8px; color: #fef3c7; font-weight: 700; font-size: 13px; opacity: .95; }
.select-actions { display: flex; justify-content: center; gap: 10px; }

/* プレイ画面 */
.swipe-area {
  position: relative; height: calc(100vh - 260px); min-height: 300px; max-height: 520px;
  background: linear-gradient(180deg, rgba(11,18,32,.9), rgba(10,22,38,.9));
  border-radius: 20px; box-shadow: inset 0 2px 0 rgba(255,255,255,.06), 0 8px 30px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
.time-large { position: absolute; bottom: 12px; right: 60px; transform: translate(0, 0); font-size: clamp(32px, 8vw, 90px); font-weight: 900; letter-spacing: 0; opacity: .3; pointer-events: none; z-index: 1; white-space: nowrap; line-height: .9; font-variant-numeric: tabular-nums; max-width: 100px; text-align: right; overflow: visible; box-sizing: border-box; }
.score-large { position: absolute; top: 8px; left: 12px; transform: translate(0, 0); font-size: clamp(48px, 10vw, 120px); font-weight: 900; letter-spacing: .01em; opacity: .18; pointer-events: none; z-index: 1; white-space: nowrap; line-height: .9; }
.word { position: relative; z-index: 2; font-size: clamp(40px, 8vw, 90px); font-weight: 900; text-align: center; padding: 0 16px; transform: translateZ(0); }
.word-img {
  width: min(300px, 80vw);
  height: min(300px, 60vh);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.labels { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: space-between; padding: 12px; }
.side-label { font-weight: 900; background: rgba(255,255,255,.08); padding: 10px 14px; border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); font-size: clamp(16px, 3.5vw, 28px); filter: drop-shadow(0 0 8px rgba(255,255,255,.25)); }
.side-label.left { color: #a7f3d0; }
.side-label.right { color: #bfdbfe; }

.big-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.big-btn { font-size: 18px; font-weight: 900; padding: 16px 10px; border-radius: 16px; }
.big-btn.left { background: #10b981; color: #052e2b; }
.big-btn.right { background: #60a5fa; color: #0b2042; }

.esc-hint { text-align: center; color: #e8edf6; text-shadow: 0 2px 6px rgba(0,0,0,.45); margin-top: 8px; font-size: 12px; font-weight: 700; }

/* リザルト */
.result-main { text-align: center; margin: 6px 0 10px; }
.result-theme { text-align: center; color: #e8edf6; text-shadow: 0 2px 6px rgba(0,0,0,.4); margin-top: 4px; margin-bottom: 2px; font-weight: 800; letter-spacing: .01em; }
.result-title { color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.result-number { font-size: clamp(52px, 10vw, 120px); font-weight: 900; }
.result-subgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.result-sub { background: var(--panel); padding: 12px; border-radius: 12px; text-align: center; box-shadow: inset 0 2px 0 rgba(255,255,255,.06); }
.result-sub .label { color: var(--muted); font-size: 12px; }
.result-sub .value { font-size: 22px; font-weight: 900; }
.hiscore-banner { text-align: center; color: #fef3c7; background: #d97706; padding: 10px 14px; border-radius: 12px; font-weight: 900; box-shadow: 0 8px 20px rgba(217,119,6,.35); }
.hidden { display: none !important; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 12px; }

/* ランキング */
.leaderboard { background: var(--panel); border-radius: 16px; padding: 12px; box-shadow: inset 0 2px 0 rgba(255,255,255,.06); margin: 12px auto 16px; max-width: 640px; }
.lb-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lb-title { font-weight: 900; color: #e8edf6; }
.lb-actions { display: none; }
.lb-list { list-style: none; margin: 0; padding: 0; max-height: none; overflow: visible; }
.lb-list li { margin: 8px 0; font-weight: 800; text-align: left; }
.lb-name { color: #e5e7eb; white-space: normal; overflow: visible; max-width: none; }
.lb-score { color: #fef3c7; }
.lb-date { color: #9ca3af; font-weight: 600; font-size: 12px; }
.lb-line1 { font-weight: 900; }
.lb-line2 { color: #9ca3af; font-weight: 600; font-size: 12px; margin-top: 2px; }

/* オーバーレイ等 */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; }
.countdown { font-size: clamp(48px, 12vw, 140px); font-weight: 900; background: linear-gradient(180deg, #22c55e, #16a34a); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 10px 40px rgba(34,197,94,.35); }
.overlay.light { background: rgba(0,0,0,.1); }
.bonus-banner { position: fixed; top: 18px; inset-inline: 0; margin: auto; width: max-content; padding: 12px 22px; border-radius: 999px; background: #22c55e; color: #052e2b; font-weight: 900; z-index: 45; opacity: 0; transform: translateY(-4px) scale(0.96); transition: transform .35s cubic-bezier(0.2,0.8,0.2,1), opacity .35s ease; font-size: clamp(28px, 5vw, 48px); box-shadow: 0 18px 50px rgba(34,197,94,.5); letter-spacing: .02em; }
.bonus-banner.show { opacity: 1; transform: translateY(-16px) scale(1.12); }
.flash-overlay { position: fixed; inset: 0; background: rgba(239,68,68,.18); pointer-events: none; z-index: 45; animation: flash .25s ease; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }

/* ラスト10秒の脈動 */
.pulse { animation: pulse .6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* タイム用（translateを維持してスケール） */
.pulse-time { animation: pulseTime .6s ease-in-out infinite; }
@keyframes pulseTime { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* 正解ポップ */
.pop { animation: pop .2s cubic-bezier(0.2,0.8,0.2,1); }
@keyframes pop { from { transform: scale(1); } 50% { transform: scale(1.08); } to { transform: scale(1); } }

/* 不正解シェイク */
.shake { animation: shake .12s cubic-bezier(0.2,0.8,0.2,1); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* 追加 フラッシュ薄赤（クラス付与で瞬間発火） */
.flash-wrong { animation: flashWrong .08s ease; }
@keyframes flashWrong { from { opacity: .9; } to { opacity: 0; } }

/* コンボレーン */
#combo-lane { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 35; }
.combo-tick { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.combo-tick.lit { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }

/* 左右帯（ネオン化）: 画面左右に配置 */
#lane-left, #lane-right { position: fixed; top: 0; bottom: 0; width: 64px; z-index: 20; opacity: .36; pointer-events: none; }
#lane-left { left: 0; background: radial-gradient(100% 100% at 0 50%, rgba(16,185,129,.55), transparent); box-shadow: 0 0 18px rgba(16,185,129,.55), inset 0 0 28px rgba(16,185,129,.25); }
#lane-right { right: 0; background: radial-gradient(100% 100% at 100% 50%, rgba(96,165,250,.55), transparent); box-shadow: 0 0 18px rgba(96,165,250,.55), inset 0 0 28px rgba(96,165,250,.25); }
.blink { animation: neonBlink .08s ease 0s 2; }
@keyframes neonBlink { from { opacity: .95; filter: drop-shadow(0 0 18px rgba(255,255,255,.6)); } to { opacity: .36; filter: none; } }
/* フィニッシュバナー */
.finish-banner { position: fixed; inset: 0; margin: auto; width: min(80vw, 720px); height: auto; z-index: 80; filter: drop-shadow(0 6px 20px rgba(0,0,0,.5)); animation: finishPop .2s ease; }
@keyframes finishPop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* パーティクル */
#particles { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.p { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.82); filter: blur(.2px); animation: float 12s ease-in-out infinite; }
.p.burst { animation: burstSlow .8s cubic-bezier(0.2,0.8,0.2,1); }
@keyframes float { 0%,100% { transform: translateY(0) translateX(0); opacity: .45; } 50% { transform: translateY(-18px) translateX(10px); opacity: .9; } }
@keyframes burstSlow { from { transform: scale(1); opacity: .95; filter: blur(.2px); } to { transform: scale(2.4); opacity: 0; filter: blur(1px); } }

/* モーダル */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 60; }
.modal.hidden { display: none; }
.modal-content { background: var(--panel); width: min(92vw, 420px); border-radius: 16px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.toggle { display: flex; align-items: center; gap: 8px; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

/* スコア登録モーダル微調整 */
#modal-submit .modal-content p { margin: 6px 0 8px; color: #cbd5e1; font-size: 14px; }
#modal-submit input { background: #0b1220; color: #e5e7eb; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }

/* トースト */
.toast { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); background: #111827; color: #e5e7eb; padding: 10px 14px; border-radius: 999px; box-shadow: 0 12px 30px rgba(0,0,0,.5); opacity: 0; transition: .25s ease; z-index: 70; }
.toast.show { opacity: 1; }

/* レスポンシブ */
@media (max-width: 420px) {
  .title { font-size: 32px; }
  .hud-item { padding: 6px 8px; }
  .big-btn { font-size: 16px; }
}


