/* 原田英語 英語ゲームアーケード — 共通スタイル（ミッドナイト・ネオン） */
:root {
  --bg: #0b0716; --bg2: #140c2a; --panel: #1b1236; --panel2: #24184a; --line: #3a2a6e;
  --ink: #fff; --ink2: #d9d2ff; --mute: #a99fd6;
  --pink: #ff3ea5; --purple: #7a5cff; --cyan: #22e3ff; --yellow: #ffe14d; --green: #3dff9a; --red: #ff4d6d; --orange: #ff9f2e;
  --ok: #3dff9a; --ng: #ff4d6d;
  --r: 16px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Meiryo", system-ui, sans-serif;
  --display: "Dela Gothic One", "M PLUS Rounded 1c", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.6; min-height: 100vh;
  background-image: radial-gradient(1200px 600px at 10% -10%, rgba(122, 92, 255, .25), transparent 60%), radial-gradient(900px 500px at 110% 10%, rgba(255, 62, 165, .18), transparent 60%); background-attachment: fixed; }
a { color: var(--cyan); }
button { font-family: inherit; }
.dim { opacity: .45; }

/* 上のバー */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: rgba(11, 7, 22, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .logo { font-family: var(--display); font-size: 15px; color: #fff; text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.topbar .logo b { background: linear-gradient(90deg, var(--pink), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .sp { flex: 1; }
#coinbar { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 13px; white-space: nowrap; }
#coinbar span { background: var(--panel); border: 1px solid var(--line); padding: 3px 10px; border-radius: 99px; }
#coinbar .cb-title { color: var(--yellow); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
body.playing .topbar { display: none; }

/* 画面 */
.screen { max-width: 920px; margin: 0 auto; padding: 14px 16px 40px; }
.err { padding: 30px; text-align: center; color: var(--yellow); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--ink2); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* タイトル画面 */
.tt-hero { position: relative; text-align: center; padding: 26px 16px 22px; border-radius: 24px; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 40px rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(255, 255, 255, .15); overflow: hidden; }
.tt-hero::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 4px); pointer-events: none; }
.tt-emoji { font-size: 72px; line-height: 1.1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.tt-title { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 7vw, 44px); line-height: 1.2; margin: 8px 0 2px; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.tt-en { font-family: var(--display); font-size: 13px; letter-spacing: .12em; opacity: .9; text-transform: uppercase; }
.tt-desc { margin: 10px auto 0; max-width: 560px; font-weight: 700; font-size: 15px; }
.tt-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.tt-tags span { background: rgba(0, 0, 0, .28); padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.tt-sec h2 { font-size: 16px; margin: 20px 0 8px; }
.lv-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lv-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; transition: transform .1s; }
.lv-btn:active { transform: scale(.96); }
.lv-btn.on { border-color: var(--yellow); background: linear-gradient(180deg, #3b2a00, #241a00); box-shadow: 0 0 18px rgba(255, 225, 77, .35); }
.lv-ic { font-size: 26px; }
.lv-n { font-weight: 900; font-size: 13px; }
.lv-s { font-size: 10px; color: var(--mute); line-height: 1.3; text-align: center; }
.lv-best { font-size: 10px; color: var(--yellow); font-weight: 800; }
@media (max-width: 560px) { .lv-pick { grid-template-columns: repeat(5, 1fr); gap: 4px; } .lv-s { display: none; } .lv-n { font-size: 11px; } .lv-btn { padding: 8px 2px; } }
.start-btn { display: block; width: 100%; max-width: 420px; margin: 20px auto 10px; padding: 16px; font-family: var(--display); font-size: 26px; color: #1a0b00; border: 0; border-radius: 99px; cursor: pointer; background: linear-gradient(180deg, #fff27a, #ffb21e); box-shadow: 0 6px 0 #b86b00, 0 10px 30px rgba(255, 178, 30, .45); animation: pulse 1.6s infinite; }
.start-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b86b00; }
@keyframes pulse { 50% { filter: brightness(1.12); } }
.howto { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin: 14px 0; }
.howto summary { cursor: pointer; font-weight: 900; }
.howto div { margin-top: 6px; font-size: 14px; color: var(--ink2); }
.set-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.set-btn { background: var(--panel); color: var(--mute); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 12px; font-weight: 800; cursor: pointer; }
.set-btn.on { color: #fff; border-color: var(--cyan); }

/* プレイ画面 */
.play-screen { padding: 0; max-width: 920px; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.hud { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--bg2); border-bottom: 1px solid var(--line); height: 46px; }
.hud-quit, .hud-mute { width: 36px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: #fff; font-size: 16px; cursor: pointer; flex: none; }
.hud-info { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: nowrap; overflow: hidden; font-weight: 900; font-size: 15px; white-space: nowrap; }
.hud-info i { font-style: normal; }
.hud-info > span { background: rgba(255, 255, 255, .06); padding: 2px 8px; border-radius: 99px; }
.h-time.warn { color: var(--red); animation: blink .5s infinite; }
.h-combo { color: var(--orange); }
.h-text, .h-prog { color: var(--ink2); font-size: 13px; }
.qprompt { flex: none; padding: 8px 12px; background: linear-gradient(180deg, #22164a, #1a1038); border-bottom: 1px solid var(--line); text-align: center; min-height: 54px; }
.qprompt .p-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.qprompt .p-main { font-weight: 900; font-size: clamp(20px, 5.4vw, 30px); line-height: 1.25; word-break: break-word; }
.qprompt .p-main.long { font-size: clamp(15px, 4.2vw, 21px); }
.qprompt .p-main.big { font-size: clamp(34px, 10vw, 54px); }
.qprompt .p-sub { font-size: 13px; color: var(--yellow); font-weight: 800; margin-top: 2px; }
.p-say { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cyan); font-size: 20px; cursor: pointer; }
.stage { position: relative; width: 100%; flex: 1 1 auto; min-height: 300px; overflow: hidden; background: #070410; user-select: none; -webkit-user-select: none; }
.stage.free { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px; }
.canvas-wrap { position: absolute; inset: 0; display: grid; place-items: center; }
.stage-canvas { display: block; border-radius: 6px; image-rendering: auto; }

/* 選択肢 */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.choices.long { grid-template-columns: 1fr; }
.choices.bottom { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, rgba(7, 4, 16, .95), rgba(7, 4, 16, .6)); }
.choice { display: flex; align-items: center; gap: 8px; text-align: left; min-height: 54px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel2); color: #fff; font-size: 17px; font-weight: 800; cursor: pointer; line-height: 1.3; transition: transform .08s, background .15s; }
.choice:active { transform: scale(.97); }
.choice:hover { border-color: var(--purple); }
.c-key { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(255, 255, 255, .1); font-size: 12px; color: var(--mute); }
.c-txt { flex: 1; word-break: break-word; }
.choice.right { background: #0e5a36; border-color: var(--ok); animation: pop .3s; }
.choice.wrong { background: #5e1326; border-color: var(--ng); animation: shake .3s; }
.choice.dim { opacity: .45; }
@keyframes pop { 50% { transform: scale(1.06); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shakefx { animation: shake .25s; }
.tfbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.tfb { min-height: 64px; font-size: 22px; font-weight: 900; border-radius: 16px; border: 0; color: #fff; cursor: pointer; }
.tfb.yes { background: linear-gradient(180deg, #2bd47f, #0f8a4f); box-shadow: 0 5px 0 #075c33; }
.tfb.no { background: linear-gradient(180deg, #ff5f7e, #c11d43); box-shadow: 0 5px 0 #7d0f29; }
.tfb:active { transform: translateY(3px); box-shadow: none; }

/* 演出 */
.popfx { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-family: var(--display); font-size: 34px; color: var(--yellow); text-shadow: 0 3px 0 #000, 0 0 20px rgba(255, 225, 77, .7); pointer-events: none; animation: popup .9s ease-out forwards; z-index: 20; white-space: nowrap; }
.popfx.ok { color: var(--ok); } .popfx.ng { color: var(--ng); } .popfx.small { font-size: 20px; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -110%) scale(1); } }
.flashfx { position: absolute; inset: 0; pointer-events: none; z-index: 19; animation: fade .26s forwards; }
@keyframes fade { to { opacity: 0; } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 90px; color: #fff; text-shadow: 0 0 30px var(--pink); background: rgba(0, 0, 0, .35); z-index: 30; }

/* スマホ用パッド */
.vpad { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: space-between; padding: 0 10px; pointer-events: none; z-index: 10; }
.vpad-btn { pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; font-weight: 900; touch-action: none; }
.vpad-btn.on { background: rgba(34, 227, 255, .4); }
@media (hover: hover) and (pointer: fine) { .vpad.touch-only { display: none; } }

/* 結果画面 */
.rs-card { text-align: center; padding: 22px 16px; border-radius: 24px; background: linear-gradient(160deg, #2a1660, #120a2a); border: 2px solid var(--line); position: relative; overflow: hidden; }
.rs-rank { font-family: var(--display); font-size: 110px; line-height: 1; background: linear-gradient(180deg, #fff, var(--yellow)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: rankin .6s cubic-bezier(.2, 1.6, .4, 1); }
.rank-S .rs-rank { background-image: linear-gradient(180deg, #fff6a8, #ffb300, #ff3ea5); filter: drop-shadow(0 0 18px rgba(255, 200, 0, .6)); }
.rank-D .rs-rank { background-image: linear-gradient(180deg, #ccc, #777); }
@keyframes rankin { from { transform: scale(3) rotate(-20deg); opacity: 0; } }
.rs-comment { font-weight: 900; font-size: 18px; margin: 4px 0 6px; }
.rs-score { font-family: var(--display); font-size: 44px; }
.rs-score small { font-size: 16px; }
.rs-best { color: var(--yellow); font-weight: 900; animation: blink .8s 3; }
.rs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.rs-stats div { background: rgba(0, 0, 0, .3); border-radius: 12px; padding: 8px 2px; }
.rs-stats b { display: block; font-size: 20px; }
.rs-stats span { font-size: 11px; color: var(--mute); }
.rs-lv { margin-top: 8px; font-size: 13px; color: var(--ink2); }
.rs-levelup { margin-top: 10px; padding: 8px; border-radius: 12px; background: linear-gradient(90deg, var(--pink), var(--purple)); font-weight: 900; }
.rs-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.big-btn { display: block; text-align: center; padding: 14px 8px; border-radius: 14px; border: 0; font-size: 16px; font-weight: 900; color: #1a0b00; background: linear-gradient(180deg, #fff27a, #ffb21e); text-decoration: none; cursor: pointer; }
.big-btn.alt { background: var(--panel2); color: #fff; border: 1px solid var(--line); }
.big-btn.x { background: #000; color: #fff; border: 1px solid #555; }
.review h2, .related h2 { font-size: 18px; margin: 18px 0 8px; }
.review ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rv { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--ng); border-radius: 12px; padding: 8px 12px; }
.rv.ok { border-left-color: var(--ok); }
.rv-q { font-weight: 800; }
.rv-a { font-size: 15px; }
.rv-a b { color: var(--yellow); }
.rv-given { color: var(--mute); font-size: 13px; }
.rv-ex { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.rv-say { border: 0; background: var(--cyan); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; }
.rv-note { font-size: 13px; color: var(--mute); }
.review details { margin-top: 8px; } .review summary { cursor: pointer; font-weight: 800; color: var(--ink2); }
.rel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rel-card { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); color: #fff; text-decoration: none; font-weight: 800; }
.rel-e { font-size: 26px; }

/* ゲームページ下の説明（SEO） */
.seo { max-width: 920px; margin: 10px auto 40px; padding: 0 16px; color: var(--ink2); font-size: 14px; }
.seo h2 { color: #fff; font-size: 18px; margin: 22px 0 6px; }
.seo ul { padding-left: 20px; }
.crumb { font-size: 12px; color: var(--mute); max-width: 920px; margin: 10px auto 0; padding: 0 16px; }
.crumb a { color: var(--mute); }
body.playing .seo, body.playing .crumb, body.playing .site-foot { display: none; }
.site-foot { text-align: center; color: var(--mute); font-size: 12px; padding: 30px 16px 50px; border-top: 1px solid var(--line); }
.site-foot a { color: var(--ink2); }

/* DOM 型ゲームの共通パーツ */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.center { text-align: center; }
.bigtxt { font-family: var(--display); font-size: 28px; }
.kbd { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 6px; }
.kbd button { padding: 12px 0; border-radius: 8px; border: 0; background: #3a2d6e; color: #fff; font-weight: 900; font-size: 16px; text-transform: uppercase; cursor: pointer; }
.kbd button.used { opacity: .3; } .kbd button.hit { background: #0e7a46; } .kbd button.miss { background: #4a1320; opacity: .5; }
.kbd button.wide { grid-column: span 2; font-size: 13px; }
.txtin { width: 100%; font-size: 22px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--purple); background: #0f0a22; color: #fff; font-family: inherit; font-weight: 800; text-align: center; }
.txtin:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 227, 255, .25); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 440px) { .hud-info { gap: 4px; font-size: 13px; } .hud-info span { padding: 2px 5px; } .h-prog, .h-text { font-size: 11px; } }
@media (max-width: 370px) { .h-prog { display: none; } }
