/* 単語軍団（Web 版）。始める前の画面・遊ぶ画面・結果 */
:root {
  --ink: #173A5E; --ink-soft: #4C6683;
  --bear: #35C2F2; --brand: #42D4FA;
  --blue: #1E9BF0; --red: #FF5A5F; --green: #2DBE6C; --amber: #FFB020; --gold: #F2B705;
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --round: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --word: system-ui, -apple-system, "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans KR", "PingFang SC", "Noto Sans SC", "Noto Sans JP", sans-serif;
  --army-w: 100vw;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.army { background: var(--mtp-bg, #f4f8fb); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
html.army-playing, html.army-playing body { overflow: hidden; overscroll-behavior: none; height: 100%; }
[hidden] { display: none !important; }
button { font-family: inherit; }

/* ================= 始める前 ================= */
.ai { max-width: 960px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.ai-hero { position: relative; border-radius: 20px; overflow: hidden; background: linear-gradient(180deg, #4FC3F7 0%, #9BE0FB 60%, #E3F6FF 100%); }
.ai-hero__art { display: block; width: 100%; height: auto; aspect-ratio: 720 / 252; object-fit: cover; }
.ai-hero__text { padding: 12px 18px 16px; background: #fff; }
.ai-hero__h { margin: 0; font: 900 28px/1.2 var(--round); letter-spacing: .02em; }
.ai-hero__lead { margin: 4px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }

.ai-start { background: #fff; border-radius: 20px; padding: 18px 16px 20px; box-shadow: 0 2px 0 rgba(23, 58, 94, .06), 0 10px 30px rgba(23, 58, 94, .06); display: grid; gap: 14px; }
.ai-course { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ai-course__name { font-weight: 800; font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.ai-course__change + .ai-sound { flex: none; }
.ai-course__name + .ai-course__change { margin-left: auto; }
.ai-course__change { display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px; margin: -14px 0; font-size: 14px; font-weight: 700; color: var(--blue); white-space: nowrap; }
.ai-rec { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 26px; font-size: 14px; color: var(--ink-soft); }
.ai-rec b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.ai-rec .st { color: #F2B705; letter-spacing: 2px; font-size: 18px; }
.ai-rec .st i { font-style: normal; color: #D5DBE3; }
.ai-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ai-diff { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ai-diff__b { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 16px; border: 2px solid #DCE6F0; background: #fff; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .08s, border-color .15s, background .15s; }
.ai-diff__b b { font: 900 18px/1.2 var(--round); }
.ai-diff__b small { font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; text-align: center; }
.ai-diff__stars { color: #D5DBE3; font-size: 15px; letter-spacing: 1px; }
.ai-diff__b.is-clear .ai-diff__stars { color: #F2B705; }
.ai-diff__b[aria-checked="true"] { border-color: #2CAEC3; background: #E8F8FB; box-shadow: inset 0 0 0 1px #2CAEC3; }
.ai-diff__b[aria-checked="true"]::after { content: ""; position: absolute; top: 6px; right: 8px; width: 12px; height: 7px; border-left: 3px solid #2CAEC3; border-bottom: 3px solid #2CAEC3; transform: rotate(-45deg); }
.ai-diff__b:active { transform: scale(.97); }
.ai-diff__b:focus-visible, .ai-go:focus-visible, .ar-btn:focus-visible, .ai-say:focus-visible { outline: 3px solid #FFB400; outline-offset: 2px; }
.ai-go { width: 100%; min-height: 64px; border: 0; border-radius: 18px; cursor: pointer; color: #fff; font: 900 22px/1 var(--round); letter-spacing: .08em;
  background: linear-gradient(90deg, #22C3B6, #1E9BF0); box-shadow: 0 5px 0 #1377C2; animation: aiBreath 1.8s ease-in-out infinite; }
.ai-go:disabled { animation: none; filter: grayscale(.5); opacity: .7; cursor: default; }
.ai-go:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #1377C2; }
@keyframes aiBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.ai-keys { margin: 0; font-size: 13px; color: var(--ink-soft); text-align: center; display: none; }
.is-desktop .ai-keys { display: block; }
.ai-err { margin: 0; color: #C42A3A; font-weight: 700; font-size: 14px; }
.ai-err__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-err__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 2px solid #DCE6F0; background: #fff; color: var(--blue); text-decoration: none; }

.ai-how, .ai-words { background: #fff; border-radius: 20px; padding: 16px; }
.ai-how h2, .ai-words h2 { margin: 0 0 12px; font: 900 18px/1.3 var(--round); }
.ai-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: st; }
.ai-steps li { counter-increment: st; display: grid; gap: 8px; align-content: start; }
.ai-steps img { display: block; width: 100%; height: auto; aspect-ratio: 300 / 564; object-fit: cover; border-radius: 14px; background: #E3F6FF; }
.ai-steps p { margin: 0; font-size: 13.5px; line-height: 1.6; }
.ai-steps p::before { content: counter(st); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 12px; vertical-align: 1px; }
@media (max-width: 760px) {
  .ai-steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(150px, 46%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; overscroll-behavior-x: contain; }
  .ai-steps li { scroll-snap-align: start; }
}

.ai-wlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.ai-wlist li { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; border-bottom: 1px solid #EEF2F6; }
.ai-wlist__wait { display: block !important; color: var(--ink-soft); border: 0 !important; }
.ai-say { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #DCE6F0; background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.ai-say svg { width: 18px; height: 18px; }
.ai-say::after { content: ""; position: absolute; inset: -6px; }   /* 枠の内側から 6px 広げて、押せる範囲は 48px */
.ai-say.is-on { border-color: var(--blue); background: #EAF5FE; }
.ai-w { min-width: 0; line-height: 1.3; }
.ai-w a { position: relative; display: inline-block; max-width: 100%; color: var(--blue); font: 800 17px/1.3 var(--word); text-decoration: none; overflow-wrap: anywhere; }
.ai-w a[href]::after { content: ""; position: absolute; left: -4px; top: -12px; bottom: -12px; width: calc(100% + 12px); min-width: 48px; }   /* 短い語（a など）も押せる範囲は 48px 以上 */
.ai-w a:hover { text-decoration: underline; }
.ai-w span { display: block; font-size: 13px; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ai-w .tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; vertical-align: 2px; }
.ai-w .tag.ng { background: #FFE5E8; color: #C42A3A; }
.ai-w .tag.lost { background: #EEF1F5; color: var(--ink-soft); }
@media (min-width: 900px) {
  .ai { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .ai-hero { grid-column: 1; }
  .ai-start { grid-column: 2; grid-row: 1; align-self: stretch; align-content: start; }
  .ai-how, .ai-words { grid-column: 1 / -1; }
  .ai-hero__h { font-size: 34px; }
}

/* ================= 遊ぶ画面 ================= */
.ap { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; background: linear-gradient(180deg, #CFEFFC 0%, #EAF7FD 55%, #F4FAFD 100%); touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#game { position: relative; flex: none; height: 100vh; height: 100dvh; overflow: hidden; touch-action: none; font-family: var(--round); color: var(--ink);
  background: linear-gradient(180deg, var(--s1, #4FC3F7) 0%, var(--s2, #9BE0FB) 18%, var(--s3, #E3F6FF) 30%, var(--s3, #E3F6FF) 100%); box-shadow: 0 0 40px rgba(23, 58, 94, .18); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#labels, #fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ap-side { flex: 1; min-width: 0; display: none; padding: 80px 20px 20px; }
@media (min-width: 760px) and (min-aspect-ratio: 1/1) {
  .ap-side { display: block; }
  .ap-side--l { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
}
.ap-card { width: min(260px, 100%); background: rgba(255, 255, 255, .92); border-radius: 18px; padding: 16px; box-shadow: 0 6px 24px rgba(23, 58, 94, .08); }
.ap-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; }
.ap-stat span { font-size: 13px; color: var(--ink-soft); }
.ap-stat b { font: 900 30px/1.1 var(--font); font-variant-numeric: tabular-nums; color: var(--blue); }
.ap-stat--s b { font-size: 17px; color: var(--ink); }
.ap-wl { width: min(260px, 100%); list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: calc(100dvh - 330px); overflow: hidden; }
.ap-wl li { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .8); font-size: 13px; animation: apIn .3s ease-out; }
.ap-wl li b { font: 800 15px/1.3 var(--word); overflow-wrap: anywhere; }
.ap-wl li span { color: var(--ink-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ap-wl li i { font-style: normal; font-weight: 900; }
.ap-wl li i.ok { color: var(--green); } .ap-wl li i.ng { color: #E8434F; }
@keyframes apIn { from { opacity: 0; transform: translateX(-10px); } }
.ap-diff { margin: 0 0 10px; font: 900 22px/1.2 var(--round); }
.ap-help { margin: 6px 0; font-size: 14px; color: var(--ink-soft); }
.ap-help--touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .ap-help--key { display: none; }
  .ap-help--touch { display: block; }
}
.ap-help__pause { display: inline-block; width: 22px; height: 22px; vertical-align: -6px; border-radius: 50%; border: 2px solid var(--ink); background: #fff linear-gradient(90deg, transparent 6px, var(--ink) 6px, var(--ink) 9px, transparent 9px, transparent 11px, var(--ink) 11px, var(--ink) 14px, transparent 14px) center / 18px 10px no-repeat; }
kbd { display: inline-block; min-width: 24px; padding: 2px 6px; margin: 0 1px; border-radius: 6px; border: 1px solid #C9D3E0; border-bottom-width: 3px; background: #fff; font: 700 12px/1.3 var(--font); color: var(--ink); text-align: center; }

/* ---- 3D に重ねる文字 ---- */
.bubble { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; will-change: transform; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bubble img { display: block; width: 124px; height: 87px; object-fit: cover; border-radius: 12px; border: 4px solid #fff; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .18); animation: bump .3s ease-out; }
.bubble.boss img { width: 156px; height: 109px; }
.bubble b { position: relative; display: block; min-width: 46px; padding: 2px 12px 3px; border-radius: 12px; border: 3px solid #fff; font: 900 22px/1.1 var(--font); color: #fff; text-align: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .18); font-variant-numeric: tabular-nums; animation: bump .3s ease-out; background: var(--bg, var(--blue)); white-space: nowrap; }
.bubble b::before, .bubble b::after { content: ""; position: absolute; left: 50%; border-style: solid; border-color: transparent; border-bottom-width: 0; }
.bubble b::after { bottom: -12px; margin-left: -8px; border-width: 9px 8px 0; border-top-color: #fff; }
.bubble b::before { bottom: -6px; margin-left: -5px; border-width: 6px 5px 0; border-top-color: var(--bg, var(--blue)); z-index: 1; }
.bubble.blue b { --bg: var(--blue); }
.bubble.red b { --bg: var(--red); }
.bubble.boss b { font-size: 28px; padding: 3px 16px 4px; }
.bubble.cage b { --bg: var(--green); font-size: 18px; }
.bubble.bump b { animation: bump2 .22s ease-out; }
@media (max-width: 380px) { .bubble img { width: 100px; height: 70px; } .bubble.boss img { width: 128px; height: 90px; } }
@keyframes bump { 0% { transform: scale(.3); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes bump2 { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.pop { position: absolute; left: 0; top: 0; font: 900 44px/1 var(--font); color: #fff; white-space: nowrap; pointer-events: none; -webkit-text-stroke: 7px var(--c, #173A5E); paint-order: stroke fill; animation: pop 1s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -140%) scale(1); } }
.pop.big { font-size: 68px; -webkit-text-stroke: 10px var(--c, #173A5E); animation-duration: 1.5s; }
.meaning { position: absolute; left: 0; top: 0; width: max-content; max-width: min(88%, 420px); text-align: center; pointer-events: none; animation: meaning 2.6s ease-out forwards; }
.meaning img { display: block; margin: 0 auto 4px; width: 156px; height: 109px; object-fit: cover; border-radius: 14px; border: 4px solid #fff; background: #fff; box-shadow: 0 3px 0 var(--c, #173A5E); animation: meaningPic 1.1s ease-in forwards; }
@keyframes meaningPic { 0%, 68% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.6); } }
.meaning .ja { display: block; font: 900 36px/1.2 var(--round); color: #fff; -webkit-text-stroke: 8px var(--c, #173A5E); paint-order: stroke fill; overflow-wrap: anywhere; }
.meaning.boss .ja { font-size: 42px; }
.meaning.boss img { width: 180px; height: 126px; animation: none; }
@media (max-width: 400px) { .meaning .ja { font-size: 28px; -webkit-text-stroke-width: 6px; } .meaning.boss .ja { font-size: 32px; } }
@keyframes meaning { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 24% { transform: translate(-50%, -50%) scale(1); } 62% { opacity: 1; transform: translate(-50%, -95%) scale(1.02); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1.08); } }
ruby.f rt { display: none; }
/* クイズの絵（three.js の板の上に重ねる） */
.qpic { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 10px; border: 3px solid #fff; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); will-change: transform; }
.qpic img { flex: 1; min-height: 0; width: 100%; object-fit: cover; display: block; }
.qpic span { flex: none; padding: 2px 4px; background: rgba(0, 0, 0, .62); color: #fff; font: 800 13px/1.25 var(--round); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qpic.ok { border-color: #22B573; box-shadow: 0 0 0 4px #22B573; }
.q-sign { border-color: #FEF519; }
#flash { position: absolute; inset: 0; pointer-events: none; background: #fff; opacity: 0; }
#flash.on { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .75; } 100% { opacity: 0; } }
.helper-bear { position: absolute; left: 50%; top: 38%; width: 120px; margin-left: -60px; pointer-events: none; animation: helper 1.4s ease-out forwards; }
.helper-bear img { width: 100%; height: auto; display: block; }
@keyframes helper { 0% { transform: translateY(-160px) scale(.6); opacity: 0; } 30% { transform: translateY(0) scale(1.05); opacity: 1; } 70% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(40px) scale(.7); opacity: 0; } }

/* ---- 上の帯（進み具合・音・一時停止） ---- */
#hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; pointer-events: none; z-index: 6; }
#hud .btns { display: flex; gap: 8px; }
.prog { position: relative; height: 14px; border-radius: 999px; background: #fff; border: 3px solid var(--ink); margin: 0 22px 0 8px; }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--brand); width: 0; }
.prog .me { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--brand); border: 3px solid var(--ink); left: 0; }
.prog .goal { position: absolute; right: -16px; top: 50%; width: 22px; height: 20px; margin-top: -12px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M2 21V8h3V5h3v3h3V5h2v3h3V5h3v3h3v13h-7v-5a2 2 0 0 0-4 0v5z' fill='%23C0392B' stroke='%23173A5E' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.iconbtn { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 3px 0 rgba(23, 58, 94, .35); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn:active { transform: translateY(2px); box-shadow: none; }
.iconbtn:focus-visible { outline: 3px solid #FFB400; outline-offset: 2px; }
#hint { position: absolute; left: 0; right: 0; bottom: calc(12% + env(safe-area-inset-bottom)); text-align: center; pointer-events: none; transition: opacity .4s; }
#hint.hidden { opacity: 0; }
#hint .hand { display: inline-block; width: 60px; height: 60px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M18 6a4 4 0 0 1 8 0v14l9 2.4a5 5 0 0 1 3.6 5.8L36.4 40a6 6 0 0 1-5.9 5H21a6 6 0 0 1-4.9-2.6L8.6 31.8a3.6 3.6 0 0 1 5.2-4.9L18 31z' fill='%23fff' stroke='%23173A5E' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E"); animation: swipe 1.4s ease-in-out infinite; }
@keyframes swipe { 0%, 100% { transform: translateX(-50px); } 50% { transform: translateX(50px); } }
#game.lost #c { filter: grayscale(.9) brightness(.92); transition: filter .9s; }
#game.night .prog { border-color: #fff; }
#count { position: absolute; left: 0; right: 0; top: 34%; text-align: center; pointer-events: none; font: 900 min(110px, 22vh)/1 var(--font); color: #fff; -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; opacity: 0; }
#count.on { animation: cnt .9s ease-out forwards; }
@keyframes cnt { 0% { opacity: 0; transform: scale(1.8); } 20% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.85); } }

/* ---- 復活のルーレット ---- */
#revive { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(14px, 2.5vh); padding: 8px; background: rgba(23, 58, 94, .35); touch-action: none; }
.rv-msg { margin: 0; font: 900 clamp(20px, 6.5vh, 34px)/1.2 var(--round); max-width: 100%; color: #fff; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-align: center; padding: 0 12px; }
.rv-box { position: relative; width: min(66vw, 260px, 42vh); aspect-ratio: 1; }
.rv-wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 0 rgba(23, 58, 94, .35)); }
.rv-pin { position: absolute; left: 50%; top: -14px; width: 0; height: 0; margin-left: -14px; border: 14px solid transparent; border-top: 26px solid #E8434F; filter: drop-shadow(0 2px 0 var(--ink)); }
.rv-stop { min-width: 180px; min-height: min(56px, 12vh); border-radius: 16px; border: 3px solid var(--ink); background: #FFC93C; color: var(--ink); font: 900 22px/1 var(--round); box-shadow: 0 5px 0 var(--ink); cursor: pointer; }
.rv-stop:disabled { opacity: .6; }
#revive.is-win .rv-msg { -webkit-text-stroke-color: #B8860B; }
#revive.is-miss .rv-box { filter: grayscale(.6); }

/* ---- 一時停止 ---- */
.army-pause { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(15, 23, 42, .5); padding: 16px; }
.army-pause__card { width: min(320px, 100%); background: #fff; border-radius: 20px; padding: 22px 18px 18px; display: grid; gap: 10px; text-align: center; font-family: var(--font); }
.army-pause__card h2 { margin: 0 0 6px; font: 900 22px/1.3 var(--round); }

/* ================= 結果 ================= */
.ar { position: fixed; inset: 0; z-index: 90; overflow-y: auto; overscroll-behavior: contain; background: rgba(15, 23, 42, .55); padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); animation: mtp-fade .25s ease-out; }
.ar-card { position: relative; width: min(560px, 100%); margin: 0 auto; background: #fff; border-radius: 22px; padding: 22px 16px 18px; display: grid; gap: 12px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.ar-sound { position: absolute; top: 12px; right: 12px; }
.ar-head { margin: 0; font: 900 34px/1.1 var(--round); }
.ar.is-win .ar-head { background: linear-gradient(180deg, #FFD43B, #F08C00); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .04em; }
.ar.is-lose .ar-head { color: var(--ink-soft); font-size: 26px; }
.ar-stars { display: flex; justify-content: center; gap: 8px; font-size: 40px; line-height: 1; }
.ar-stars i { font-style: normal; color: #DDE3EA; }
.ar-stars i.on { color: #F2B705; animation: star .45s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.ar-stars i.on:nth-child(2) { animation-delay: .15s; } .ar-stars i.on:nth-child(3) { animation-delay: .3s; }
@keyframes star { from { transform: scale(0) rotate(-30deg); } }
.ar-score { display: flex; justify-content: center; align-items: baseline; gap: 4px; }
.ar-score { flex-wrap: wrap; }
.ar-score__n { font: 900 clamp(34px, 11vw, 54px)/1 var(--font); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; color: var(--blue); }
.ar-score__u { font-weight: 800; font-size: 18px; }
.ar-best { margin: -4px 0 0; font-size: 14px; color: var(--ink-soft); }
.ar-best.is-new { color: #fff; background: linear-gradient(90deg, #FF8A3D, #F2B705); display: inline-block; justify-self: center; padding: 5px 14px; border-radius: 999px; font-weight: 900; animation: star .5s cubic-bezier(.2, 1.6, .4, 1); }
.ar-miss { text-align: left; border-top: 1px solid #EEF2F6; padding-top: 10px; }
.ar-miss h3 { margin: 0 0 6px; font-size: 15px; }
.ai-wlist--res { grid-template-columns: 1fr; }
.ar-ok { margin: 0; color: var(--green); font-weight: 800; font-size: 14px; }
.ar-diff { display: flex; justify-content: center; gap: 6px; }
.ar-diff button { min-width: 72px; min-height: 44px; padding: 6px 12px; border-radius: 12px; border: 2px solid #DCE6F0; background: #fff; color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer; }
.ar-diff button[aria-checked="true"] { border-color: #2CAEC3; background: #E8F8FB; }
.ar-acts { display: grid; gap: 8px; }
.ar-btn { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 16px; border-radius: 14px; border: 2px solid #DCE6F0; background: #fff; color: var(--ink); font: 800 17px/1.2 var(--font); text-decoration: none; cursor: pointer; }
.ar-btn--main { border: 0; color: #fff; background: linear-gradient(90deg, #22C3B6, #1E9BF0); box-shadow: 0 4px 0 #1377C2; font-size: 19px; }
.ar-btn--next { border: 0; color: #fff; background: linear-gradient(90deg, #FF9F1C, #F2B705); box-shadow: 0 4px 0 #C77A00; }
.ar-btn:active { transform: translateY(2px); }
@media (min-width: 520px) { .ar-acts { grid-template-columns: 1fr 1fr; } .ar-acts .ar-btn--main { grid-column: 1 / -1; } .ar-acts .ar-btn--next[hidden] + .ar-btn { grid-column: 1 / -1; } }
.ar-app { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 10px 12px; border-radius: 14px; background: #F4F8FB; color: var(--ink); text-decoration: none; text-align: left; }
.ar-app img { flex: none; border-radius: 10px; }
.ar-app span { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.ar-app b { font-size: 14px; }
.ar-app small { font-size: 12px; color: var(--ink-soft); }
@keyframes mtp-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ai-go, #hint .hand { animation: none; }
  .ar-stars i.on, .ar-best.is-new { animation: none; }
}
