/* ゲーム */
.game { position: relative; max-width: 1000px; margin: 10px auto 0; padding: 0 10px; }
.g-screen { position: relative; border-radius: 26px; overflow: hidden; min-height: min(78vh, 640px); background: var(--paper2); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.g-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05); }
.g-panel { position: relative; z-index: 2; background: color-mix(in srgb, var(--card) 92%, transparent); border-radius: 24px; padding: 22px; margin: 16px; max-width: 560px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.g-panel h1 { margin: 4px 0; font-family: var(--head); font-size: clamp(1.5rem, 4vw, 2.2rem); }
.g-icon { width: 110px; height: 110px; }
.g-levels { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 4px; }
.g-hud { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.g-hud > * { pointer-events: auto; }
.g-pill { background: color-mix(in srgb, var(--card) 92%, transparent); border-radius: 999px; padding: 4px 14px; font-weight: 700; font-family: var(--head); font-size: 1.1rem; box-shadow: 0 2px 6px rgba(0,0,0,.12); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.g-pill img { width: 26px; height: 26px; }
.g-pill.bump { animation: bump 0.3s; }
@keyframes bump { 50% { transform: scale(1.3); } }
.g-time { flex: 1; height: 12px; background: rgba(255,255,255,.7); border-radius: 99px; overflow: hidden; min-width: 60px; }
.g-time i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--sun)); width: 100%; transition: width 0.2s linear; }
.g-time.low i { background: var(--berry); animation: blink 0.5s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.g-quit { border: 0; background: color-mix(in srgb, var(--card) 92%, transparent); border-radius: 50%; width: 38px; height: 38px; font-size: 1.2rem; font-weight: 700; }
.g-stage { position: absolute; inset: 0; }
.g-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.g-q { position: relative; z-index: 3; width: min(720px, calc(100% - 20px)); margin: 70px auto 20px; background: color-mix(in srgb, var(--card) 94%, transparent); border-radius: 24px; padding: 18px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.g-say { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--sun); box-shadow: 0 5px 0 #c48f1d; display: inline-flex; align-items: center; justify-content: center; }
.g-say img { width: 56px; height: 56px; }
.g-say:active { transform: translateY(4px); box-shadow: 0 1px 0 #c48f1d; }
.g-say.playing { animation: pulse 0.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 5px 0 #c48f1d, 0 0 0 12px rgba(242, 182, 50, 0.3); } }
.g-sent { font-family: var(--en); font-size: clamp(1.1rem, 3vw, 1.5rem); line-height: 1.7; margin: 12px 0; }
.g-sent .blank { display: inline-block; min-width: 4em; border-bottom: 3px solid var(--berry); color: var(--berry); font-weight: 700; }
.g-ja { color: var(--sky); font-weight: 700; font-size: 0.95rem; }
.g-choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); margin-top: 12px; }
.g-choices button { padding: 14px 10px; border-radius: 18px; border: 3px solid var(--line); background: var(--paper); font-family: var(--en); font-size: 1.25rem; font-weight: 700; transition: transform 0.1s; }
.g-choices button:hover { transform: translateY(-2px); border-color: var(--sky); }
.g-choices button.ok { background: var(--leaf2); border-color: var(--leaf); animation: bump 0.4s; }
.g-choices button.ng { background: var(--berry2); border-color: var(--berry); animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.g-pics { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.g-pics button { border: 4px solid var(--line); border-radius: 16px; background: #fffdf5; padding: 6px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.g-pics button img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.g-pics button.ok { border-color: var(--leaf); box-shadow: 0 0 0 4px var(--leaf2); }
.g-pics button.ng { border-color: var(--berry); opacity: 0.6; }
.g-order { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; }
.g-order .sc { position: relative; border: 4px solid var(--line); border-radius: 14px; background: #fffdf5; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; padding: 4px; cursor: pointer; }
.g-order .sc img.p { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.g-order .sc .n { position: absolute; top: -10px; left: -10px; width: 36px; height: 36px; border-radius: 50%; background: var(--berry); color: #fff; font-weight: 700; font-family: var(--head); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.g-order .sc .spk { position: absolute; bottom: 4px; right: 4px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--sun); display: flex; align-items: center; justify-content: center; }
.g-order .sc .spk img { width: 26px; height: 26px; }
.g-order .sc.on { border-color: var(--berry); }
.g-order .sc.right { border-color: var(--leaf); }
@media (max-width: 560px) { .g-order { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-pics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } }
.g-mem { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(110px, 30%), 1fr)); margin-top: 10px; perspective: 800px; }
.g-mem .cd { aspect-ratio: 3/4; position: relative; transform-style: preserve-3d; transition: transform 0.35s; cursor: pointer; }
.g-mem .cd.open, .g-mem .cd.got { transform: rotateY(180deg); }
.g-mem .cd > div { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; text-align: center; }
.g-mem .back { background: linear-gradient(135deg, var(--leaf), #77b05f); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.g-mem .back img { width: 60%; opacity: 0.9; }
.g-mem .face { background: #fffdf5; border: 3px solid var(--line); transform: rotateY(180deg); font-weight: 700; }
.g-mem .face.en { font-family: var(--en); font-size: clamp(1rem, 2.6vw, 1.4rem); color: var(--sky); }
.g-mem .face img { width: 70%; }
.g-mem .cd.got .face { border-color: var(--leaf); background: var(--leaf2); }
.g-result { text-align: center; }
.g-rank { font-family: var(--head); font-size: 4rem; line-height: 1; color: var(--berry); text-shadow: 0 3px 0 #fff; animation: stampin 0.6s cubic-bezier(.2, 1.6, .4, 1) both; }
.g-score { font-family: var(--head); font-size: 2.2rem; }
.g-float { position: absolute; z-index: 9; font-family: var(--head); font-weight: 700; font-size: 1.6rem; color: var(--berry); text-shadow: 0 2px 0 #fff; pointer-events: none; animation: floatup 0.9s ease-out forwards; }
@keyframes floatup { from { transform: translate(-50%, 0) scale(0.6); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.2); opacity: 1; } to { transform: translate(-50%, -60px) scale(1); opacity: 0; } }
.g-riddle { font-family: var(--en); font-size: clamp(1.1rem, 3vw, 1.45rem); line-height: 1.7; margin: 10px 0; }
.g-riddle .l.now { background: var(--hl); border-radius: 6px; }
.rh-judge { position: absolute; left: 50%; top: 38%; transform: translateX(-50%); font-family: var(--head); font-size: 2.4rem; font-weight: 700; z-index: 6; pointer-events: none; text-shadow: 0 3px 0 #fff; }
.g-tapzone { position: absolute; left: 0; right: 0; bottom: 0; height: 32%; z-index: 4; }

/* ===== 2026-11-05 作り直し ===== */
.g-panel .g-collsel { display: block; margin: 10px 0 0; font-weight: 700; }
.g-panel .g-collsel select { font: inherit; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); max-width: 100%; }
.g-count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 8; font-family: var(--head); font-size: clamp(4rem, 14vw, 7rem); font-weight: 700; color: #fff; text-shadow: 0 4px 0 var(--berry), 0 8px 20px rgba(0,0,0,.3); pointer-events: none; }
.g-count.pop { animation: cpop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes cpop { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.g-banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); z-index: 9; background: var(--berry); color: #fff; font-family: var(--head); font-weight: 700; font-size: clamp(1.4rem, 5vw, 2.2rem); padding: 8px 26px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.25); white-space: nowrap; pointer-events: none; animation: bannerin 1.1s ease-out forwards; }
@keyframes bannerin { 0% { transform: translateX(-50%) scale(.4); opacity: 0; } 15% { transform: translateX(-50%) scale(1.15); opacity: 1; } 30% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
.g-pill.combo { background: var(--berry); color: #fff; }
.g-screen:not(.g-title) { align-items: flex-start; }
.btn.sm { padding: 6px 14px; font-size: .88rem; min-height: 38px; }
.qz-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; align-items: center; }
.qz-ex { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--paper); border: 2px dashed var(--line); text-align: left; line-height: 1.8; animation: fadein .3s; }
.qz-ex .btn { display: block; margin: 10px auto 0; }
.qz-ex .src { font-size: 1.05rem; color: var(--ink); font-family: var(--en); }
.qz-ex .src small { color: var(--ink2); font-size: .78rem; margin-left: 6px; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.qz-head { display: flex; gap: 12px; align-items: center; text-align: left; margin-bottom: 8px; }
.qz-head img { width: 64px; height: 64px; object-fit: contain; mix-blend-mode: multiply; background: #fffdf5; border-radius: 12px; padding: 4px; flex: none; }
.qz-head small { display: block; color: var(--ink2); font-size: .8rem; }
.qz-head b { font-size: 1.05rem; }
.q-time { margin: 6px 0 10px; height: 10px; background: var(--paper2); }
.qz-q { font-size: clamp(1.1rem, 3.6vw, 1.45rem); line-height: 1.6; margin: 8px 0 4px; }
.g-choices.list { grid-template-columns: 1fr; }
.g-choices.list button { text-align: left; font-family: inherit; font-size: clamp(.98rem, 3vw, 1.12rem); display: flex; gap: 10px; align-items: center; line-height: 1.5; padding: 12px 14px; }
.g-choices.list button small { display: block; margin-left: auto; font-size: .78rem; color: var(--ink2); font-weight: 400; white-space: nowrap; }
.g-choices .no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--sky); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--head); font-size: .95rem; }
.g-choices button.gone { opacity: .25; text-decoration: line-through; }
.g-choices button small.en { display: block; font-size: .85rem; color: var(--ink2); font-weight: 400; }
.g-choices button:disabled:not(.ok):not(.ng) { opacity: .55; }
.g-say.sm { width: 46px; height: 46px; box-shadow: 0 3px 0 #c48f1d; flex: none; }
.g-say.sm img { width: 30px; height: 30px; }
.g-say[hidden] { display: none; }
.g-slow { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 12px 4px 6px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; min-height: 40px; color: var(--ink); }
.g-slow img { width: 28px; height: 28px; }
.g-slow.on { border-color: var(--sky); background: var(--sky); color: #fff; }
.ls-top { display: flex; gap: 12px; align-items: center; justify-content: center; }
/* ことばキャッチ：お題 */
.ct-target { position: absolute; z-index: 6; left: 50%; top: 58px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--card) 94%, transparent); border-radius: 999px; padding: 6px 8px 6px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.18); max-width: calc(100% - 20px); }
.ct-target b { font-size: clamp(1.1rem, 4.4vw, 1.6rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-target .ct-pic img { width: 48px; height: 48px; display: block; }
.ct-target.pop { animation: bump .4s; }
/* ならべかえ */
.sc-from { color: var(--ink2); font-size: .85rem; margin: 0; }
.sc-ja { font-weight: 700; font-size: clamp(1.05rem, 3.4vw, 1.3rem); line-height: 1.6; margin: 6px 0 12px; }
.sc-ans { min-height: 62px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; padding: 10px; border-radius: 16px; border: 3px dashed var(--line); background: var(--paper); }
.sc-ans.right { border-style: solid; border-color: var(--leaf); background: var(--leaf2); }
.sc-ans.shake, .ty-word.shake { animation: shake .35s; }
.sc-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; min-height: 50px; }
.tile { font-family: var(--en); font-size: clamp(1.05rem, 3.6vw, 1.3rem); font-weight: 700; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: #2c3e66; box-shadow: 0 3px 0 var(--line); transition: transform .1s; }
.tile:active { transform: translateY(3px); box-shadow: none; }
.tile:disabled { visibility: hidden; }
.tile.on { background: var(--sky); color: #fff; border-color: var(--sky); box-shadow: 0 3px 0 #2b6496; }
.tile.fixed { display: inline-block; }
/* タイピング */
.ty-q { text-align: center; }
.ty-pic img { width: 92px; height: 92px; }
.ty-ja { font-size: clamp(1.3rem, 5vw, 1.9rem); font-weight: 700; margin: 4px 0; }
.ty-word { font-size: clamp(2rem, 9vw, 3.4rem); letter-spacing: .08em; font-weight: 700; margin: 6px 0 4px; min-height: 1.3em; }
.ty-word span { color: var(--ink2); opacity: .55; }
.ty-word span.done { color: var(--leaf); opacity: 1; }
.ty-word span.cur { color: var(--ink); opacity: 1; border-bottom: 4px solid var(--berry); }
.ty-word.good { animation: bump .25s; }
.ty-in { position: absolute; opacity: 0; width: 1px; height: 1px; left: 50%; top: 50%; pointer-events: none; font-size: 16px; }
.ty-help { font-size: .85rem; }
/* 挿絵クイズ */
.pc-img { background: #fffdf5; border-radius: 16px; padding: 8px; height: min(42vh, 340px); display: flex; align-items: center; justify-content: center; }
.pc-img img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
/* 神経衰弱 */
.g-mem .back img { width: 70%; }
.g-mem .face.ja { font-size: clamp(.85rem, 2.6vw, 1.05rem); line-height: 1.3; }
.g-mem .face.ja img { width: 62%; }
/* なぞなぞ */
.rd-top { display: flex; justify-content: center; align-items: center; gap: 14px; }
.rd-top img { width: 90px; height: 90px; object-fit: contain; mix-blend-mode: multiply; }
.rd-ja { text-align: left; background: var(--paper); border-radius: 12px; padding: 8px 12px; line-height: 1.7; }
.rd-ja summary { cursor: pointer; font-weight: 700; color: var(--sky); }
.rd-hint { background: var(--hl, #fff3c4); border-radius: 12px; padding: 8px 12px; }
.g-choices.why button { font-size: .98rem; }
/* 結果 */
.g-result { max-width: 600px; }
.g-rank.r-S { color: #e0a100; } .g-rank.r-A { color: var(--berry); } .g-rank.r-B { color: var(--sky); } .g-rank.r-C, .g-rank.r-D { color: var(--ink2); }
.g-title-get { font-size: 1.15rem; margin: 4px 0; }
.g-title-get b { color: var(--berry); }
.g-stat { color: var(--ink2); }
.g-newbest { font-weight: 700; color: var(--berry); animation: bump .5s 2; }
.g-review { text-align: left; margin-top: 12px; }
.g-review summary { font-weight: 700; cursor: pointer; }
.g-review ul { list-style: none; padding: 0; margin: 8px 0 0; max-height: 260px; overflow: auto; }
.g-review li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.6; }
/* ゲームの入口 */
@media (max-width: 560px) {
  .g-screen { min-height: calc(100svh - 120px); border-radius: 18px; }
  .g-q { margin-top: 58px; padding: 14px 12px; border-radius: 18px; }
  .g-hud { gap: 6px; }
  .g-pill { padding: 3px 10px; font-size: 1rem; }
  .g-pill img { width: 22px; height: 22px; }
}
