:root{font-family:"Avenir Next",Avenir,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;color:#183e3c;background:#eee9d9;font-synthesis:none;--green:#24675e;--ink:#183e3c;--orange:#b55639;--paper:#faf6e9}
*{box-sizing:border-box}body{margin:0}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid #cc862c;outline-offset:4px}button:disabled{cursor:default}button,fieldset{border:0}button[hidden],[hidden]{display:none!important}button{user-select:none}p{margin:0}#app{position:fixed;inset:0;overflow:hidden;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}#court{position:absolute;width:100%;height:calc(100% - 300px);top:125px;left:0;display:block}.topbar{position:absolute;z-index:3;left:28px;right:28px;top:calc(18px + env(safe-area-inset-top));display:flex;align-items:center;justify-content:space-between}.clubmark{font-family:Georgia,serif;font-size:28px;font-style:italic;font-weight:bold;display:flex;align-items:center;gap:12px}.clubmark>span{font-family:inherit;font-style:normal;font-size:9px;letter-spacing:1.5px;max-width:125px}.quiet{font-size:11px;letter-spacing:.5px;background:transparent;padding:10px 12px;border:1px solid #526b5c55;border-radius:20px;margin-left:5px}.title-copy{position:absolute;top:82px;left:6%;z-index:2;pointer-events:none}.eyebrow{font-size:10px;font-weight:700;letter-spacing:2.4px}.title-copy h1{font-family:Georgia,"Times New Roman",serif;font-size:clamp(60px,8vw,112px);font-weight:900;letter-spacing:-6px;line-height:.83;margin:17px 0 14px;text-shadow:1px 1px #faf6e9,2px 2px #183e3c,3px 3px #183e3c}.title-copy h1>span{display:block}.title-copy h1>span:nth-child(2){color:var(--orange);padding-left:40px}.logo-ball{font-size:.27em;vertical-align:middle;color:#fff9e7;text-shadow:1px 3px #c39c67;display:inline-block;transform:translate(8px,-8px)}.japanese-title{font-size:11px;letter-spacing:4px;margin:22px 0 10px}.tagline{font-size:14px;letter-spacing:1px}.title-controls{position:absolute;bottom:40px;right:6%;width:330px;z-index:2}.title-controls fieldset{margin:0;padding:0}.title-controls legend{font-size:10px;font-weight:bold;letter-spacing:2px;margin-bottom:10px}.title-controls legend span{letter-spacing:1px;font-size:10px;margin-left:12px;font-weight:normal}.levels{display:flex;border-bottom:1px solid #a3afa0;gap:6px}.levels button{background:transparent;padding:12px 16px;color:#65736b;flex:1;font-family:Georgia,serif;font-size:12px;border-bottom:3px solid transparent}.levels b{font-family:Arial,sans-serif;font-size:14px;margin-left:8px}.levels button[aria-pressed=true]{color:var(--green);border-bottom-color:var(--green);background:#fff8e955}#level-description{font-size:10px;margin:12px 0 16px;letter-spacing:.2px}.primary{display:flex;align-items:center;justify-content:space-between;width:100%;background:var(--green);color:#fff9e9;padding:17px 24px;font-weight:700;font-size:15px;border-radius:3px;box-shadow:0 4px 0 #194c46}.primary:hover{background:#19564e}.primary:active{transform:translateY(2px);box-shadow:0 2px 0 #194c46}.title-foot{display:flex;justify-content:space-between;align-items:center;margin-top:12px;font-size:11px}.text-button{background:none;text-decoration:underline;text-underline-offset:4px;font-size:12px;padding:12px}.version{position:absolute;bottom:calc(9px + env(safe-area-inset-bottom));right:18px;font-size:9px;color:#647368;letter-spacing:.7px}.scoreboard{position:absolute;top:calc(65px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;justify-content:center;align-items:center;gap:22px;z-index:2}.player-label{font-size:10px;letter-spacing:2px;white-space:nowrap}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin:0 5px}.yours{background:#438f83}.theirs{background:#d97855}.scores{display:flex;align-items:center;gap:18px}.scores b{font-family:Georgia,serif;font-size:40px;font-weight:normal;min-width:42px;text-align:center}.scores span{color:#809287}.scoreboard small{position:absolute;top:48px;white-space:nowrap;font-size:8px;letter-spacing:2px}.question-caption{display:flex;justify-content:space-between;font-size:10px;line-height:15px;letter-spacing:1px;color:#647468}#phrase{font-family:Georgia,serif;font-size:clamp(24px,3vw,35px);margin:12px 0 7px;font-weight:bold;line-height:1.15}#meaning{font-size:15px;line-height:1.6}.timer{height:5px;background:#dce0d1;border-radius:3px;overflow:hidden;margin-top:7px}.timer i{display:block;height:100%;width:100%;background:var(--green);transform-origin:left}.play-controls{position:absolute;bottom:calc(18px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(520px,calc(100% - 32px));text-align:center;z-index:2}.answers{display:grid;grid-template-columns:1fr 1fr;gap:12px}.answers button{border:1px solid #b2bca9;background:#faf6e9e8;display:flex;align-items:center;justify-content:center;gap:14px;height:74px;border-radius:4px;color:var(--green);box-shadow:0 4px 0 #b7bead;transition:none}.answers #no{color:var(--orange)}.answers button[aria-pressed=true]{background:var(--green);color:#fff9ec;transform:translateY(2px);box-shadow:0 2px 0 #194c46}.answers #no[aria-pressed=true]{background:var(--orange);color:#fff9ec;box-shadow:0 2px 0 #793b2a}.answer-symbol{font-size:46px;line-height:1;font-weight:700;font-family:Arial,sans-serif}.answers button>span:nth-child(2){font-size:14px;font-weight:700}.answers small{display:block;font-size:9px;font-weight:normal;letter-spacing:1px;margin-top:5px}#combo{font-size:10px;letter-spacing:1px;margin-top:13px}#rally-label{font-family:Georgia,serif;font-size:12px;letter-spacing:2px;color:#486958}#feedback{position:absolute;top:53%;left:50%;transform:translate(-50%,-50%);text-align:center;white-space:nowrap;font-family:Georgia,serif;font-style:italic;font-size:clamp(32px,6vw,66px);font-weight:bold;color:var(--green);text-shadow:0 2px #fff9ec;pointer-events:none;z-index:4}.point-panel{position:absolute;bottom:calc(28px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(510px,calc(100% - 32px));background:var(--paper);border-top:2px solid var(--green);padding:18px 22px;z-index:5;text-align:center;box-shadow:0 5px 40px #183e3c12}#point-title{font-size:13px;font-weight:bold;letter-spacing:1px;color:var(--orange)}#correction-en{font-family:Georgia,serif;font-weight:bold;font-size:24px;margin:10px 0 5px}#correction{font-size:13px;margin-bottom:16px}.point-panel .primary{padding:13px 22px}.overlay{position:absolute;inset:0;background:#183e3c4d;backdrop-filter:blur(5px);z-index:10;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom))}.dialog,.result-sheet{background:var(--paper);width:min(520px,100%);padding:34px;border-radius:4px;max-height:100%;overflow:auto;box-shadow:0 16px 60px #112e3e24}.dialog h2{font-family:Georgia,serif;font-size:25px;margin:15px 0 20px}.dialog>p{font-size:12px;line-height:1.8}.dialog ol{padding-left:20px;font-size:14px;line-height:1.8}.dialog li{margin:18px 0}.dialog li small{font-size:11px;display:block;color:#667366}.dialog .primary{margin-top:22px}.dialog .text-button{display:block;margin:auto}.result-sheet{text-align:center}.result-sheet h2{font-family:Georgia,serif;font-size:clamp(34px,7vw,54px);letter-spacing:-2px;margin:16px 0 0}#result-score{font-family:Georgia,serif;font-size:66px;margin:6px 0}#result-stats,#record{font-size:12px;line-height:1.9}.review-heading{text-align:left;border-top:1px solid #c7cbb8;padding-top:20px;margin-top:20px;font-size:11px;letter-spacing:1px}#review-list{text-align:left;max-height:180px;overflow:auto;margin:10px 0 16px}#review-list p{padding:10px 0;border-bottom:1px solid #dedfce;font-size:12px}#review-list strong{font-family:Georgia,serif;font-size:18px;display:block;margin-bottom:5px}#result-hint{font-size:11px;margin:16px 0}#boot{position:absolute;inset:0;display:grid;place-items:center;background:#eee9d9;z-index:30;font-size:14px}#app[data-phase=play] #court,#app[data-phase=point] #court{top:265px;height:calc(100% - 400px)}#app[data-phase=point] .play-controls{visibility:hidden}#app[data-phase=point] #question-panel{opacity:0}#app[data-phase=point] #court{top:120px;height:calc(100% - 335px)}
@media(min-width:900px){#app[data-phase=play] #court{top:195px;height:calc(100% - 315px)}#phrase{font-size:29px}#meaning{font-size:13px}.scoreboard{top:24px}.topbar{top:25px}.title-controls{bottom:55px}#court{left:17%;width:72%;top:90px;height:calc(100% - 170px)}.title-copy{top:120px;left:5%}.play-controls{width:460px}#app[data-phase=play] #court,#app[data-phase=point] #court{left:12%;width:80%}}
@media(max-width:600px){.topbar{left:18px;right:18px;top:calc(12px + env(safe-area-inset-top))}.clubmark{font-size:24px}.clubmark>span{font-size:7px;max-width:105px}.quiet{font-size:10px;padding:8px 10px}.title-copy{left:0;right:0;text-align:center;top:calc(73px + env(safe-area-inset-top))}.title-copy h1{font-size:clamp(44px,13.8vw,68px);letter-spacing:-3px;line-height:.9;margin:14px 0}.title-copy h1>span{display:inline}.title-copy h1>span:nth-child(2){padding-left:0}.logo-ball{display:none}.eyebrow{font-size:8px;letter-spacing:2px}.japanese-title{font-size:10px;letter-spacing:3px;margin:17px 0 8px}.tagline{font-size:12px}.title-controls{left:24px;right:24px;bottom:calc(35px + env(safe-area-inset-bottom));width:auto}.title-controls legend{font-size:9px;margin-bottom:5px}.levels button{padding:10px}#level-description{margin:10px 0 12px;font-size:9px}#court{top:175px;height:calc(100% - 375px)}#feedback{top:53%;font-size:36px}.answers button{gap:8px;height:68px}.answers button>span:nth-child(2){font-size:13px}.answer-symbol{font-size:40px}.dialog,.result-sheet{padding:26px 23px}}
@media(max-height:690px){.title-copy{top:60px}.title-copy h1{font-size:48px;margin:10px 0}.japanese-title{margin:10px 0 6px}.tagline{font-size:10px}.title-controls{bottom:28px}.title-controls .primary{padding:12px 20px}.title-foot{margin-top:4px}#court{top:140px;height:calc(100% - 310px)}.scoreboard{top:45px}.scores b{font-size:30px}.scoreboard small{top:36px}#phrase{font-size:25px;margin:8px 0 4px}#meaning{font-size:13px}#app[data-phase=play] #court{top:203px;height:calc(100% - 328px)}.play-controls{bottom:10px}.answers button{height:56px}#combo{margin-top:8px}.point-panel{bottom:16px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* コートの切り抜き境界を弱め、タイトルと同じ紙色になじませる。 */
#court{mask-image:linear-gradient(to bottom,transparent,black 8%,black 88%,transparent);-webkit-mask-image:linear-gradient(to bottom,transparent,black 8%,black 88%,transparent)}
.answers button:disabled{opacity:1;-webkit-text-fill-color:currentColor}
@media(max-width:600px){.title-copy h1{white-space:nowrap}}
@media(max-height:480px) and (min-width:601px){.title-copy{top:70px;left:30px}.title-copy h1{font-size:56px}.title-controls{right:25px;width:300px;bottom:28px}#court{width:55%;height:240px;top:110px}#phrase{font-size:23px}.scoreboard{top:20px}.play-controls{left:auto;right:20px;transform:none;width:310px}#app[data-phase=play] #court{top:95px;left:32%;width:67%;height:190px}#feedback{left:67%;top:48%}.point-panel{width:320px;left:auto;right:20px;transform:none;padding:12px 18px}#app[data-phase=point] #court{top:95px;width:55%;height:260px}}

/* 選択→加速→打撃の強弱を、コート内の反応へ集める。 */
.rally-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;min-height:44px;text-align:left}
#commit{border:1px solid #28675f;background:#28675f;color:#fff8e8;padding:12px 16px;min-height:44px;border-radius:3px;font-size:11px;font-weight:700;white-space:nowrap}
#commit:disabled{color:#627468;background:#e2e3d3;border-color:#bbc3b2}
#combo{margin:5px 0 0;font-size:10px;letter-spacing:.2px}
#charge{display:flex;gap:4px;height:5px;width:90px}#charge i{flex:1;background:#bdc8b7;transform:skewX(-20deg)}#charge i.filled{background:#28776a}
.chance #charge i.filled{background:#c2812f}.chance #rally-label{color:#a26725;font-weight:700}.chance #combo{color:#915b22}
#speed-lines{pointer-events:none;position:absolute;inset:29% 0 19%;opacity:0;z-index:1;background:repeating-conic-gradient(from 12deg at 50% 48%,transparent 0deg 17deg,#285f511f 17.2deg 17.8deg,transparent 18deg 31deg);mask-image:radial-gradient(ellipse,transparent 28%,black 90%);-webkit-mask-image:radial-gradient(ellipse,transparent 28%,black 90%)}
#app[data-action=smash] #speed-lines{opacity:1}
#feedback[data-kind=smash]{font-size:clamp(48px,9vw,110px);color:#bf6734;letter-spacing:-3px;text-shadow:2px 3px #fff6dc,3px 4px #245a50;transform:translate(-50%,-50%) rotate(-7deg)}
#app[data-phase=play] #court{height:calc(100% - 426px)}
@media(min-width:900px){#app[data-phase=play] #court{height:calc(100% - 337px)}}
@media(max-width:600px){.rally-footer{gap:8px}#commit{padding:10px 12px;font-size:10px}#feedback[data-kind=smash]{font-size:65px}}
@media(max-height:690px){.rally-footer{margin-top:5px}#app[data-phase=play] #court{height:calc(100% - 354px)}}
@media(max-height:480px) and (min-width:601px){#app[data-phase=play] #court{height:190px}.rally-footer{gap:6px}#commit{padding:10px;font-size:9px}}
@media(prefers-reduced-motion:reduce){#speed-lines{display:none}#feedback[data-kind=smash]{transform:translate(-50%,-50%);text-shadow:1px 1px #fff6dc}}
/* 打撃の文字は選手と球から離して、アクションを見せる。 */
#feedback{top:calc(335px + env(safe-area-inset-top));font-size:30px;max-width:94%;white-space:normal;line-height:1;text-align:center}
#feedback[data-kind=smash]{font-size:58px}
#app[data-phase=point] #feedback{top:calc(147px + env(safe-area-inset-top))}
@media(min-width:900px){#feedback{left:70%;top:138px;font-size:38px}#feedback[data-kind=smash]{font-size:76px}#app[data-phase=point] #feedback{top:135px}}
@media(max-height:690px){#feedback{top:244px;font-size:26px}#feedback[data-kind=smash]{font-size:46px}}
@media(max-height:480px) and (min-width:601px){#feedback{left:66%;top:111px;font-size:25px}#feedback[data-kind=smash]{font-size:42px}#app[data-phase=point] #feedback{top:94px}}

/* 超次元の瞬間だけ、クラブの静けさを破る。問題と操作は常に読める。 */
#power-status{width:124px;min-height:44px;text-align:right;flex-shrink:0;color:#34635b}
#power-readout{font-size:13px;font-weight:800;letter-spacing:.3px}
#power-status small{display:block;font-size:9px;margin-top:4px}
.power-track{height:5px;background:#c7cbb8;overflow:hidden;margin-top:5px;transform:skewX(-18deg)}
#power-fill{display:block;width:100%;height:100%;background:#c37825;transform-origin:left}
#power-status[data-tier=warp]{color:#ac562e}#power-status[data-tier=warp] #power-readout{font-style:italic}
#charge i.half{background:linear-gradient(90deg,#28776a 50%,#bdc8b7 50%)}
#impact-frame{position:absolute;inset:28% 0 19%;pointer-events:none;z-index:1;opacity:0;border:0 solid #1b534c;clip-path:polygon(0 0,28% 5%,0 12%,0 75%,18% 100%,0 100%,100% 100%,80% 91%,100% 76%,100% 20%,83% 0,100% 0)}
#app[data-burst=hit] #impact-frame{opacity:.75;border-width:0 5px;background:transparent}
#app[data-burst=smash] #impact-frame{opacity:1;border-width:0 10px;background:transparent}
#app[data-burst=point] #impact-frame{opacity:1;border-width:0 8px;background:transparent}
#app[data-burst=charge] #impact-frame{opacity:.8;border-width:0 4px;background:transparent}
#speed-lines{background:repeating-conic-gradient(from 12deg at 50% 48%,transparent 0deg 11deg,#184e4766 11.2deg 11.8deg,transparent 12deg 23deg,#d1933980 23.2deg 23.7deg,transparent 24deg 31deg);mask-image:radial-gradient(ellipse,transparent 27%,#000 90%);-webkit-mask-image:radial-gradient(ellipse,transparent 27%,#000 90%)}
#app[data-burst=hit] #speed-lines{opacity:.6}#app[data-burst=smash] #speed-lines,#app[data-burst=point] #speed-lines{opacity:1}
#feedback[data-kind=smash]{font-size:clamp(31px,9.7vw,70px);color:#fff0bd;letter-spacing:-2px;text-shadow:1px 1px #123d36,2px 2px #123d36,3px 3px #123d36,4px 5px #b96533,5px 7px #b96533;transform:translate(-50%,-50%) rotate(-8deg)}
#feedback[data-kind=point]{font-size:clamp(42px,12vw,76px);color:#b45a31;letter-spacing:-2px;text-shadow:2px 2px #fff2ce,4px 4px #194c43;transform:translate(-50%,-50%) rotate(-5deg)}
#app[data-phase=point] #feedback[data-kind=point]{top:calc(176px + env(safe-area-inset-top))}



#app[data-burst=point] #you-score{color:#b45a31;text-shadow:2px 2px #fff6da}
#app[data-paused=true] *{animation-play-state:paused!important}
@media(min-width:900px){#feedback[data-kind=smash]{font-size:70px}}
@media(max-height:690px){#app[data-phase=point] #feedback[data-kind=point]{top:126px;font-size:42px}}
@media(max-height:480px) and (min-width:601px){#feedback[data-kind=smash]{font-size:40px}#app[data-phase=point] #feedback[data-kind=point]{top:96px;font-size:35px}#power-status{width:104px}}
@media(prefers-reduced-motion:reduce){#impact-frame,#speed-lines{display:none}#feedback[data-kind=smash],#feedback[data-kind=point]{transform:translate(-50%,-50%);text-shadow:1px 1px #f4ebd4}}

#feedback[data-kind=smash],#feedback[data-kind=point]{width:max-content;max-width:calc(100% - 32px);white-space:nowrap}

/* 間違えた時の文字：赤で、次のラリーまで表示したまま */
#feedback[data-kind=miss]{color:#c8452f;font-weight:bold;letter-spacing:1px;text-shadow:0 3px #fff6dc,0 0 14px #fff6dccc}
#app[data-burst=kill] #impact-frame{opacity:1;border-width:0 10px;border-color:#d64a34;background:transparent}
#app[data-burst=kill] #speed-lines{opacity:1}

/* ○（左）と ×（右）の色。ボタン・台の左右・自分の打球の光を同じ色でつなぐ。 */
:root{--maru:#2a8f62;--batsu:#cf5232}
.answers #yes{color:var(--maru);border-color:#2a8f6255}
.answers #no{color:var(--batsu);border-color:#cf523255}
.answers #yes[aria-pressed=true]{background:var(--maru);color:#fff9ec;box-shadow:0 2px 0 #1b5e40}
.answers #no[aria-pressed=true]{background:var(--batsu);color:#fff9ec;box-shadow:0 2px 0 #84321d}

/* タイトルロゴ：一点透視で飛び出す立体の IDIOM SMASH を、球の軌跡が斬る。3D演出と同じ3.4秒の周期で動く（logo.css 由来） */
.title-copy h1.ism-title{margin:0;padding:0;font-size:0;line-height:0;letter-spacing:0;text-shadow:none}
.ism-title svg{display:block;width:100%;height:auto;overflow:visible}
.ism-title .ism-pc{display:none}
.title-copy:has(.ism-title){left:0;right:0;top:calc(46px + env(safe-area-inset-top));text-align:left}
.ism-title .ism-sp{display:block;width:min(100vw,460px);margin:0 auto}
@media (min-width:900px){
  .title-copy:has(.ism-title){left:2%;right:auto;top:60px;width:min(46vw,620px)}
  .ism-title .ism-sp{display:none}.ism-title .ism-pc{display:block;width:100%}
  .title-controls{left:calc(2% + 36px);right:auto;width:min(40vw,440px);bottom:60px}
}
@media (max-height:690px) and (max-width:899px){.ism-title .ism-sp{width:min(88vw,360px)}.title-copy:has(.ism-title){top:34px}}
/* ============================================================
   IDIOM SMASH タイトルロゴのアニメーション
   - クラスなし ……… 完成形（切れてずれた状態）を静止表示
   - .intro ……………… 初回の登場（ページを開いた時に1回）
   - .beat ………………… 2周目以降の打点の再演出（3D演出の1周 3.4秒ごとに付け直す）
   付け直し方： el.classList.remove('intro','beat'); void el.getBoundingClientRect(); el.classList.add('beat');
   時刻は3D演出の1周の頭を0秒とする（打点 1.45秒／ヒットストップ 〜1.62秒／球がカメラに届く 1.86秒）
   ============================================================ */

.ism-logo { overflow: visible; }

/* 変形の基準点：文字は消失点（打点）から、その他は画面座標で指定する */
.ism-logo .ltr, .ism-logo .idl, .ism-logo .idiom, .ism-logo .smash-dn, .ism-logo .root,
.ism-logo .trail, .ism-logo .ball, .ism-logo .shard, .ism-logo .speed { transform-box: view-box; }
.ism-logo .root { transform-origin: 195px 130px; }
.ism-logo .band { transform-box: fill-box; transform-origin: 50% 50%; }

/* ---- 完成形（クラスなしの既定値） ---- */
.ism-logo .smash-dn { transform: translate(9px, -1.8px); }   /* 切り口の下半分のずれ（切り口に沿って右へ滑る）*/
.ism-logo .flash    { opacity: 0; }
.ism-logo .shard    { opacity: 0; }

/* ============================ 初回 .intro ============================ */
/* 0.00〜0.50 スピード線と IDIOM が左から滑り込む */
.ism-logo.intro .speed { animation: ism-speed-in .5s ease-out 0s both; }
.ism-logo.intro .idiom { animation: ism-idiom-in .55s cubic-bezier(.2, 1.5, .4, 1) .05s both; }
/* 0.35〜1.30 SMASH が奥（打点）から1文字ずつ飛び出し、行き過ぎて戻る */
.ism-logo.intro .ltr   { animation: ism-ltr-in .5s cubic-bezier(.25, .9, .35, 1) calc(.35s + var(--i) * .12s) both; }
/* 1.45 打点：閃光と球の軌跡が左から右へ一閃（ヒットストップ中に走りきる） */
.ism-logo.intro .flash { animation: ism-flash .4s ease-out 1.45s both; }
.ism-logo.intro .trail { animation: ism-trail-in .17s cubic-bezier(.1, .8, .2, 1) 1.45s both; }
.ism-logo.intro .ball  { animation: ism-ball-in .17s cubic-bezier(.1, .8, .2, 1) 1.45s both; }
/* 1.62 ヒットストップ明け：下半分がずれ、破片が散り、ロゴ全体が揺れる */
.ism-logo.intro .smash-dn { animation: ism-cut-in .55s cubic-bezier(.2, 1.2, .4, 1) 1.62s both; }
.ism-logo.intro .shard    { animation: ism-shard .7s cubic-bezier(.1, .7, .3, 1) 1.62s both; }
.ism-logo.intro .root     { animation: ism-shake .42s linear 1.62s; }
/* 1.86 球がカメラに届く：朱の和文帯がバンと貼られる */
.ism-logo.intro .band     { animation: ism-band .32s cubic-bezier(.2, 1.4, .4, 1) 1.86s both; }

/* ============================ 再演出 .beat ============================ */
/* 毎回の打点だけ：軽い一閃・切れ目が光る・ずれがズッと動いて戻る・小さな揺れ（登場はくり返さない） */
.ism-logo.beat .flash    { animation: ism-flash-sm .3s ease-out 1.45s; }
.ism-logo.beat .trail    { animation: ism-trail-in .15s cubic-bezier(.1, .8, .2, 1) 1.45s; }
.ism-logo.beat .ball     { animation: ism-ball-in .15s cubic-bezier(.1, .8, .2, 1) 1.45s; }
.ism-logo.beat .smash-dn { animation: ism-cut-beat .42s cubic-bezier(.2, 1.2, .4, 1) 1.62s; }
.ism-logo.beat .root     { animation: ism-shake-sm .26s linear 1.62s; }

/* ============================ keyframes ============================ */
@keyframes ism-speed-in { from { opacity: 0; transform: translateX(-40px); } to { opacity: .8; transform: none; } }
@keyframes ism-idiom-in {
  0%   { opacity: 0; transform: translateX(-340px) skewX(-25deg); }
  60%  { opacity: 1; transform: translateX(14px) skewX(8deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes ism-ltr-in {
  0%   { opacity: 0; transform: scale(.06); }
  15%  { opacity: 1; }
  55%  { transform: scale(1.2); }
  78%  { transform: scale(.94); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes ism-flash {
  0%   { opacity: 0; }
  12%  { opacity: .95; }
  100% { opacity: 0; }
}
@keyframes ism-flash-sm {
  0%   { opacity: 0; }
  15%  { opacity: .6; }
  100% { opacity: 0; }
}
@keyframes ism-trail-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ism-ball-in {
  0%   { opacity: 0; transform: translate(var(--bx), var(--by)); }
  1%   { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes ism-cut-in {
  0%   { transform: translate(0, 0); }
  30%  { transform: translate(18px, -3.6px); }
  60%  { transform: translate(6px, -1.2px); }
  100% { transform: translate(9px, -1.8px); }
}
@keyframes ism-cut-beat {
  0%   { transform: translate(9px, -1.8px); }
  30%  { transform: translate(15px, -3px); }
  100% { transform: translate(9px, -1.8px); }
}
@keyframes ism-shard {
  0%   { opacity: 0; transform: none; }
  1%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); }
}
@keyframes ism-shake {
  0%   { transform: scale(1.05); }
  15%  { transform: translate(-6px, 4px) scale(1.03); }
  30%  { transform: translate(5px, -4px); }
  45%  { transform: translate(-4px, 2px); }
  60%  { transform: translate(3px, -2px); }
  80%  { transform: translate(-1px, 1px); }
  100% { transform: none; }
}
@keyframes ism-shake-sm {
  0%   { transform: scale(1.02); }
  30%  { transform: translate(-3px, 2px); }
  60%  { transform: translate(2px, -1px); }
  100% { transform: none; }
}
@keyframes ism-band {
  0%   { opacity: 0; transform: scale(2.4) rotate(-14deg); }
  60%  { opacity: 1; transform: scale(.9) rotate(1deg); }
  100% { opacity: 1; transform: none; }
}

/* 動きを減らす設定：完成形を静止表示 */
@media (prefers-reduced-motion: reduce) {
  .ism-logo, .ism-logo * { animation: none !important; }
}


/* イディオム図鑑：集めたカードは緑の縁、宿題は朱の札、まだのものは伏せる */
.book-sheet{max-height:min(86vh,720px);overflow:auto;width:min(92vw,560px)}
/* カードの一覧だけを中でスクロールし、「閉じる」は常に画面内に残す。 */
.book-sheet{display:flex;flex-direction:column;overflow:hidden}
.book-sheet>*{flex:none}
.book-sheet #book-list{flex:1 1 auto;min-height:0;overflow:auto}
.book-sheet .primary{margin-top:12px}
#book-list h3{font-size:13px;letter-spacing:2px;margin:14px 0 6px}
.book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:6px}
.book-card{position:relative;padding:8px 10px;border:1px dashed #b2bca9;border-radius:4px;background:#f3eedf;color:#8a9688;min-height:52px}
.book-card strong{display:block;font:italic 700 13px/1.25 Georgia,serif}
.book-card span{display:block;font-size:10px;margin-top:3px;line-height:1.35}
.book-card.got{border:1px solid #2a8f62;background:#fbf8ee;color:#183e3c;box-shadow:0 2px 0 #2a8f6233}
.book-card.homework{border:1px solid #cf5232;background:#fff4ee;color:#5a2a1c}
.book-card em{position:absolute;top:-7px;right:6px;font:normal 700 10px/1 sans-serif;color:#fff;background:#cf5232;padding:3px 6px;border-radius:2px;letter-spacing:1px}
/* 直前の試合で新しく集めたカード。宿題の札と同じ位置に緑の「NEW」。枠の太さは変えず、外側に薄い緑の縁を足す。 */
.book-card.new{box-shadow:0 0 0 2px #2a8f6240,0 2px 0 #2a8f6233}
.book-card.new em{background:#2a8f62}
/* まだ出会っていないカード。「？？？」だけの低い札にして、集めたカードと宿題のカードを目立たせる。
   集めたカードと同じ行でも行の高さまで伸ばさず、行の真ん中に低いまま置く（低い「？？？」と高い「？？？」が混ざらないように）。 */
.book-card.unseen{min-height:0;padding:5px 8px;display:flex;align-items:center;justify-content:center;align-self:center;border-color:#c9cfbe;background:#f1ecdc;color:#aab2a4}
.book-card.unseen strong{font:700 11px/1.2 sans-serif;letter-spacing:3px}
.book-gain{font-size:13px;font-weight:700;color:#2a8f62;margin:6px 0 2px}
.book-gain .gain-part{white-space:nowrap}
.book-gain .gain-sep[data-tight="true"]{margin-left:-.5em}
#question-label[data-homework=true]{color:#cf5232;font-weight:700}
/* タイトルは3Dの体育館を画面いっぱいに出す。左上のクラブ名は出さない。操作の下には紙色の帯を敷いて読みやすくする。 */
#app[data-phase=title] #court{top:0;left:0;width:100%;height:100%}
#app[data-phase=title] .clubmark{visibility:hidden}
#app[data-phase=title]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:min(330px,42%);background:linear-gradient(to bottom,#eee9d900,#eee9d9e6 38%,#eee9d9);pointer-events:none;z-index:1}
@media (min-width:900px){#app[data-phase=title]::after{right:auto;width:min(48vw,600px);height:100%;background:linear-gradient(to right,#eee9d9f0 0,#eee9d9cc 55%,#eee9d900)}}

/* 試合画面：問題と○×を1枚の「答えるパネル」にまとめて画面の下へ置く。読む→押すが上から下の短い視線で済む（塾長選定のA案）。 */
.answer-panel{background:#f8f4e8;border:1.5px solid #d6cfba;border-radius:14px;overflow:hidden;box-shadow:0 6px 0 #d9d1bb}
#question-panel{padding:10px 14px 12px;text-align:center}
#question-panel #phrase{margin:10px 0 5px;font-size:clamp(23px,7vw,34px);line-height:1.15}
#question-panel #meaning{font-size:15px;line-height:1.35}
/* 残り1秒を切った出題（data-urgent）：残り時間の帯と秒数を×と同じ赤にする。時間切れは失点なので急ぎを知らせる。動きは付けない。 */
#question-panel[data-urgent="1"] #timer-fill{background:var(--batsu)}
#question-panel[data-urgent="1"] #time-left{color:var(--batsu);font-weight:700}
/* iPad・PC の大きさ（幅・高さとも700px以上）では、答えるパネルの見出しの行（問いかけ・「宿題！」・慣用句・返球中の「正解」「まちがい」と秒数）を10pxから13pxにする。
   英語（34px）と意味（15〜17px）の上で10pxは小さすぎ、離して持つ iPad では見出しが目に入りにくかった。スマホと低い横画面は今までどおり10px。 */
/* 見出しの行の高さ（もとの指定の15pxとここの19px）は文字の種類で決めず固定する。normal のままだと Safari 系は英字だけ（NEXT RALLY）の行が
   日本語の行より低くなり、サーブ前に出題欄が4px動いた。値は Chromium の日本語の行（10pxで15px・13pxで19px）にそろえ、今の見た目は変えない。 */
@media(min-width:700px) and (min-height:700px){.question-caption{font-size:13px;line-height:19px}}
.answer-panel .answers{gap:0;border-top:1.5px solid #d6cfba}
.answer-panel .answers button,.answer-panel .answers #yes,.answer-panel .answers #no{height:64px;border:0;border-radius:0;box-shadow:none}
.answer-panel .answers #yes{background:#e9f1e8;border-right:1.5px solid #d6cfba}
.answer-panel .answers #no{background:#f6e7df}
.answer-panel .answers #yes[aria-pressed=true]{background:var(--maru);transform:none;box-shadow:inset 0 -4px 0 #1b5e40}
.answer-panel .answers #no[aria-pressed=true]{background:var(--batsu);transform:none;box-shadow:inset 0 -4px 0 #84321d}
/* 指で触るだけの端末（iPhone・iPad など。マウスが無い）では、押せないキーの案内（○×の「← A」「→ D」、得点パネルの「Enter」、図鑑・遊び方の「Esc」）を隠す。PC では残す。 */
@media(hover:none) and (pointer:coarse){.answers .key-hint,#next .key-hint,#close-book .key-hint,#close-help .key-hint{display:none}}
.rally-tag{position:absolute;z-index:2;left:18px;top:calc(136px + env(safe-area-inset-top));display:flex;align-items:baseline;gap:10px;font-size:10px;letter-spacing:.5px;color:#5d6d64;pointer-events:none}
.play-controls .rally-footer{margin-top:10px}
#app[data-phase=point] .rally-tag{visibility:hidden}
#app[data-phase=play] #court{top:110px;height:calc(100% - 110px - 300px)}
#app[data-phase=point] #court{top:110px;height:calc(100% - 110px - 230px)}
@media(min-width:900px){
  .play-controls{width:620px}
  #question-panel #phrase{font-size:34px}#question-panel #meaning{font-size:17px}
  .rally-tag{left:28px;top:96px}
  #app[data-phase=play] #court,#app[data-phase=point] #court{left:10%;width:80%;top:90px;height:calc(100% - 90px - 290px)}
}
@media(max-height:690px){
  #question-panel{padding:7px 12px 8px}#question-panel #phrase{margin:6px 0 3px;font-size:22px}#question-panel #meaning{font-size:13px}
  .answer-panel .answers button,.answer-panel .answers #yes,.answer-panel .answers #no{height:54px}
  .rally-tag{top:calc(112px + env(safe-area-inset-top))}
  #app[data-phase=play] #court{top:96px;height:calc(100% - 96px - 250px)}
}
@media(max-height:480px) and (min-width:601px){
  .rally-tag{top:auto;bottom:14px;left:20px}
  #app[data-phase=play] #court,#app[data-phase=point] #court{top:70px;left:2%;width:58%;height:calc(100% - 100px)}
  .play-controls{width:330px}
}
/* 難易度は大会の名前。番号を小さく上に、大会名を下に置いて4つを1行に収める。 */
.levels button{padding:9px 4px;display:flex;flex-direction:column;align-items:center;gap:2px;line-height:1.1}
.levels button small{font-size:10px}.levels b{margin-left:0;font-size:13px;white-space:nowrap}
/* 版表示はタイトルの紙色の帯より手前に出す（スマホで帯に隠れていた）。 */
.version{z-index:2}
/* 結果シート：画面の高さが足りないときは、宿題リストだけを縮めて中でスクロールし、ボタンを常に画面内に残す。 */
.result-sheet{display:flex;flex-direction:column}
.result-main,.result-side>*{flex:none}
.result-side{display:flex;flex-direction:column;min-height:0;flex:0 1 auto}
.result-side #review-list{flex:0 1 auto;min-height:60px}
/* 縦の高い画面（iPad縦など、高さ900px以上）：上下に余白があるので、宿題の一覧を5問ぶんまで広げる（180pxでは2問しか見えなかった）。
   画面に入りきらない時は上の決まりどおり一覧だけが縮むので、ボタンは画面内に残る。 */
@media(orientation:portrait) and (min-height:900px){.result-side #review-list{max-height:440px}}
.result-side .text-button{align-self:center}
/* 横向きのスマホ：結果シートを左（スコア）と右（宿題・ボタン）の2列にして、スクロールなしで1画面に収める。左上はラボの「戻る」用に空ける。 */
@media(orientation:landscape) and (max-height:540px){
  #result{padding:calc(10px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
  #result .result-sheet{display:flex;flex-direction:row;gap:26px;align-items:stretch;width:min(720px,100%);padding:18px 24px}
  .result-main{flex:1 1 0;min-width:0;display:flex;flex-direction:column;justify-content:center}
  .result-side{flex:1.1 1 0;min-width:0;display:flex;flex-direction:column;border-left:1px solid #c7cbb8;padding-left:24px}
  .result-sheet h2{font-size:38px;margin-top:8px}
  #result-score{font-size:46px;margin:2px 0}
  #result-stats,#record{line-height:1.7}
  .result-side .review-heading{border-top:0;padding-top:0;margin-top:0}
  .result-side #review-list{flex:1 1 auto;min-height:44px;max-height:none;margin:6px 0 8px}
  #review-list p{padding:7px 0}#review-list strong{font-size:16px;margin-bottom:3px}
  #result-hint{margin:0 0 10px;text-align:left}
  .result-side .primary{padding:13px 22px}
  .result-side .text-button{padding:8px 12px;align-self:center}
  /* 遊び方：3つの手順を横に並べ、「わかった」までスクロールなしで収める。 */
  #help .dialog{width:min(760px,100%);padding:18px 26px}
  #help .dialog h2{font-size:22px;margin:6px 0 10px}
  #help .dialog ol{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:0;padding-left:18px;font-size:13px;line-height:1.5}
  #help .dialog li{margin:0}
  #help .dialog>p{margin:10px 0 0;line-height:1.6}
  #help .dialog .primary{margin-top:12px;padding:12px 22px}
  /* 図鑑：見出しを詰めて、カードの一覧を広く取る。 */
  #book{padding-top:calc(12px + env(safe-area-inset-top));padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  #book .book-sheet{width:min(760px,100%);padding:16px 24px;max-height:100%}
  #book .book-sheet h2{font-size:20px;margin:4px 0 6px}
  #book-list h3{margin:8px 0 5px}
  #book .book-sheet .primary{margin-top:10px;padding:11px 22px}
}
/* 縦の小さいスマホ（高さ700px以下）：結果のスコア周りを詰め、宿題が多い時も一覧に2件以上見えるようにする。 */
@media(orientation:portrait) and (max-height:700px){
  #result{padding-top:calc(16px + env(safe-area-inset-top));padding-bottom:calc(16px + env(safe-area-inset-bottom))}
  #result .result-sheet{padding:18px 22px}
  .result-sheet h2{font-size:32px;margin-top:8px}
  #result-score{font-size:50px;margin:2px 0}
  #result-stats,#record{line-height:1.7}
  .result-side .review-heading{padding-top:12px;margin-top:12px}
  .result-side #review-list{margin:6px 0 8px}
  #review-list p{padding:7px 0}#review-list strong{font-size:16px;margin-bottom:3px}
  #result-hint{margin:0 0 10px}
  .result-side .primary{padding:13px 22px}
  .result-side .text-button{padding:8px 12px}
}
/* さらに低い縦画面（高さ600px以下、320x568など）：上下の余白と得点の文字をもう少し詰め、宿題2件目まで見切れないようにする。 */
@media(orientation:portrait) and (max-height:600px){
  #result{padding-top:calc(10px + env(safe-area-inset-top));padding-bottom:calc(10px + env(safe-area-inset-bottom))}
  #result .result-sheet{padding:14px 20px}
  #result-score{font-size:44px;margin:0}
  /* 遊び方：見出し・手順・ボタンの間の余白を詰め、「わかった」までスクロールなしで収める。 */
  #help .dialog{padding:18px 20px}
  #help .dialog h2{font-size:22px;margin:8px 0 10px}
  #help .dialog ol{margin:0}
  #help .dialog li{margin:10px 0}
  #help .dialog .primary{margin-top:14px;padding:13px 22px}
}
/* 横向きのスマホ：タイトルロゴは左、難易度と開始ボタンは右（幅300px）。ロゴが操作欄に重ならない幅にし、左上はラボの「戻る」用に空ける。 */
@media(max-height:480px) and (min-width:601px){
  .title-copy:has(.ism-title){left:max(16px,env(safe-area-inset-left));right:auto;top:calc(48px + env(safe-area-inset-top))}
  .ism-title .ism-sp{display:block;width:min(calc(100vw - 365px - env(safe-area-inset-left) - env(safe-area-inset-right)),360px);margin:0}
  .ism-title .ism-pc{display:none}
  .title-controls{left:auto;right:max(25px,env(safe-area-inset-right));width:300px;bottom:calc(28px + env(safe-area-inset-bottom));background:#eee9d9eb;padding:10px 12px 2px;border-radius:4px;box-shadow:0 6px 24px #183e3c1a}
}
/* ゴールデンボール（3点・6点・9点目の慣用句）。金色は球と文字・枠だけに使い、ロゴには使わない。 */
.golden .answer-panel{border-color:#d9a63a;box-shadow:0 6px 0 #c9922c,0 0 0 3px #f6d77a66;background:#fbf3d9}
.golden #question-label{color:#9a6a12;font-weight:700}
.golden #question-panel #phrase{color:#7a520c}
.golden #rally-label{color:#b07d14;font-weight:700;letter-spacing:1px}
.golden #charge i.filled{background:#d9a63a}
.golden .point-panel #point-title,.golden #point-title{color:#a8740f}
#feedback[data-kind=golden-call]{font-size:clamp(28px,8vw,46px);color:#f6d36a;letter-spacing:1px;font-weight:700;text-shadow:1px 1px #6b4a08,2px 2px #6b4a08,3px 4px #fff6dc;width:max-content;max-width:calc(100% - 32px);white-space:nowrap}
#feedback[data-kind=golden]{font-size:clamp(34px,10vw,72px);color:#ffe07a;letter-spacing:-2px;text-shadow:1px 1px #5c3f06,2px 2px #5c3f06,3px 3px #5c3f06,4px 5px #c98b1c,5px 7px #c98b1c;transform:translate(-50%,-50%) rotate(-6deg);width:max-content;max-width:calc(100% - 32px);white-space:nowrap}
#app[data-burst=golden] #impact-frame{opacity:1;border-width:0 12px;border-color:#e0ae3c;background:transparent}
#app[data-burst=golden] #speed-lines{opacity:1}
#app[data-burst=golden] #you-score{color:#c48a17;text-shadow:2px 2px #fff6da}
#book-list h3.book-chapter{font-size:15px;letter-spacing:1px;margin:18px 0 4px;padding-top:10px;border-top:1.5px solid #d6cfba}
#book-list h3.book-chapter:first-child{margin-top:4px;padding-top:0;border-top:0}
@media(max-height:480px) and (min-width:601px){#feedback[data-kind=golden]{font-size:38px}#feedback[data-kind=golden-call]{font-size:26px}}
@media(prefers-reduced-motion:reduce){#feedback[data-kind=golden]{transform:translate(-50%,-50%);text-shadow:1px 1px #5c3f06}}
/* マッチポイント（あと1点で決着）：得点板の下の文字を強め、決める側の点数に色を付ける */
#app[data-match-point=you] #score-note,#app[data-match-point=cpu] #score-note,#app[data-match-point=both] #score-note{font-size:10px;font-weight:700;letter-spacing:1.5px;color:#fff9ec;background:#b45a31;padding:3px 10px;border-radius:10px;top:46px}
#app[data-match-point=you] #score-note{background:#2f7a6d}
#app[data-match-point=you] #you-score,#app[data-match-point=both] #you-score{color:#2f7a6d;font-weight:bold}
#app[data-match-point=cpu] #cpu-score,#app[data-match-point=both] #cpu-score{color:#b45a31;font-weight:bold}
#feedback[data-kind=match-point]{font-size:clamp(30px,8vw,52px);color:#b45a31;letter-spacing:1px;text-shadow:1px 1px #fff2ce,2px 2px #194c43;width:max-content;max-width:calc(100% - 32px);white-space:nowrap}
#app[data-match-point=you] #feedback[data-kind=match-point]{color:#2f7a6d}
#feedback[data-kind=homework]{font-size:clamp(26px,7vw,40px);color:#cf5232;letter-spacing:1px;text-shadow:0 2px #fff6dc,0 0 12px #fff6dccc;width:max-content;max-width:calc(100% - 32px);white-space:nowrap}
@media(max-height:480px) and (min-width:601px){#app[data-match-point=you] #score-note,#app[data-match-point=cpu] #score-note,#app[data-match-point=both] #score-note{top:44px}#feedback[data-kind=match-point]{font-size:28px}#feedback[data-kind=homework]{font-size:24px}}
/* 宿題の振り返り：その時に出ていた意味と自分の答えを、訳の下に小さく添える */
#review-list .review-trap{display:block;margin-top:3px;font-size:11px;line-height:1.45;color:#a4573a}
@media(orientation:landscape) and (max-height:540px),(orientation:portrait) and (max-height:700px){#review-list .review-trap{font-size:10.5px;margin-top:2px}}
/* 下に隠れた宿題がある間だけ、一覧の下端に「↓ あとN問」を重ねる。下の行を紙の色へぼかして続きがあると見せ、場所は取らない（高さぶん上へ重ねる） */
#review-list .review-more{position:sticky;bottom:0;height:28px;margin-top:-28px;display:flex;align-items:flex-end;justify-content:flex-end;padding:0 0 3px;font-size:11px;font-weight:700;letter-spacing:.5px;color:#24695d;background:linear-gradient(#faf6e900,var(--paper) 70%);pointer-events:none}
/* 320x568 など低い縦画面：添え書きのぶん行の余白を詰め、宿題2件目まで見切れないようにする */
@media(orientation:portrait) and (max-height:600px){#review-list p{padding:5px 0}#review-list .review-trap{margin-top:1px}}
/* 試合を通した最長の連続正解：正答率の下に、少し目立つ色で1行だけ出す */
#result-run{font-size:12px;line-height:1.9;font-weight:700;color:#b45a31}
/* 自己ベスト更新・最高更新：同じ行の後ろに小さな札で添える。行の高さを変えず、折り返さない */
#result-run .run-best,#record .run-best{display:inline-block;margin-left:5px;padding:0 5px;border-radius:999px;background:#b45a31;color:#fff6dc;font-size:10px;line-height:1.6;letter-spacing:.2px;vertical-align:1px;white-space:nowrap}
/* 札の中の「 · 前 N問」。一番長い「999問」「前 998問」でも、幅の狭い結果シート（320幅・小さい横向き）で1行に収まるよう札を1px小さくする。 */
#result-run .run-prev,#record .run-prev{font-weight:500;opacity:.82;letter-spacing:0}
@media(max-width:340px),(orientation:landscape) and (max-width:700px){#result-run .run-best,#record .run-best{font-size:9px}}
/* 最高正答率の行に「最高更新 · 前 99%」が付いても1行に収まるよう、同じ狭い画面だけ行の文字を1px小さくし、320幅は結果の外側の左右の余白を詰める。 */
@media(max-width:340px),(orientation:landscape) and (max-width:700px){#record{font-size:11px}}
/* 小さい横画面でも、後から加わった記録更新の札を左列の1行に収める。
   568x320 は Chromium の文字で残り0.3pxしかなく、実機の Avenir Next でも同じくらいと見積もったため、札の字間と余白を詰めて4px余裕を作る。 */
@media(orientation:landscape) and (max-height:540px) and (max-width:600px){#result-run{font-size:11px}#record{font-size:9px}#result-run .run-best,#record .run-best{font-size:8px;margin-left:2px;padding-inline:2px;letter-spacing:0}}
@media(max-width:340px){#result{padding-left:12px;padding-right:12px}}
@media(orientation:landscape) and (max-height:540px),(orientation:portrait) and (max-height:700px){#result-run{line-height:1.7}}
/* 320x568 など低い縦画面：連続正解の1行ぶん、見出しの上と成績の行間を詰め、宿題2件目まで見切れないようにする */
@media(orientation:portrait) and (max-height:600px){.result-sheet h2{margin-top:2px}#result-stats,#result-run,#record{line-height:1.45}.result-side .review-heading{padding-top:9px;margin-top:9px}}
/* 試合中の連続正解の節目（5問・10問…）：宿題クリア！と同じ大きさで、自分の色（緑）で短く出す。台の緑に埋もれないよう、縁を生成り色で囲む */
#feedback[data-kind=run]{font-size:clamp(26px,7vw,40px);color:#24695d;letter-spacing:1px;text-shadow:1px 1px #fff6dc,-1px -1px #fff6dc,1px -1px #fff6dc,-1px 1px #fff6dc,0 3px #fff6dc,0 0 14px #fff6dc;width:max-content;max-width:calc(100% - 32px);white-space:nowrap}
@media(max-height:480px) and (min-width:601px){#feedback[data-kind=run]{font-size:24px}}
/* 試合中に自己ベストを初めて超えた合図。大きさは連続正解の合図と同じで、色はタイトルの自己ベストの札と同じオレンジ。 */
#feedback[data-kind=best]{font-size:clamp(26px,7vw,40px);color:#b45a31;letter-spacing:1px;text-shadow:1px 1px #fff6dc,-1px -1px #fff6dc,1px -1px #fff6dc,-1px 1px #fff6dc,0 3px #fff6dc,0 0 14px #fff6dc;width:max-content;max-width:calc(100% - 32px);white-space:nowrap}
@media(max-height:480px) and (min-width:601px){#feedback[data-kind=best]{font-size:24px}}
/* タイトルの連続正解の自己ベスト：難易度の見出し（LEVEL 難易度を選ぶ）と同じ行の右端に重ねて置く。行も高さも増やさない */
#level-best{position:absolute;top:-1px;right:0;line-height:1.2;padding:1px 6px;border-radius:999px;background:#f3eedfe6;font-size:10px;font-weight:bold;letter-spacing:.5px;color:#b45a31;white-space:nowrap;pointer-events:none}
@media(max-height:480px) and (min-width:601px){#level-best{top:10px;right:12px}}
/* 最高正答率も並ぶ時（一番長いと「連続正解 自己ベスト 999問 · 最高正答率 100%」）：見出しの「難易度を選ぶ」を見た目だけ隠し（読み上げには残す。行の高さを変えないよう流れの中に幅0で残す）、LEVEL の右に1行で収める。
   幅の狭い縦（320px）と横向き（操作欄300px）は、札を9px・字間0にして見出しとの間をあける */
#level-best[data-full="1"]:not([hidden])~fieldset legend>span{display:inline-block;width:0;margin-left:0;white-space:nowrap;clip-path:inset(50%)}
@media(max-width:340px),(max-height:480px) and (min-width:601px){#level-best[data-full="1"]{font-size:9px;letter-spacing:0}}
/* 失点した時の得点パネル：「正しい意味」のすぐ下に、出ていた意味と自分の答えを小さく添える（結果の宿題と同じ色）。 */
/* 狭い画面で折り返す時は「出た意味…」と「→ ○と答えた」の間でだけ折る（「答/えた」のように語の途中で切らない）。 */
#point-note{font-size:12px;line-height:1.45;color:#a4573a;margin:-11px 0 14px}#point-note span{display:inline-block}
@media(max-height:480px) and (min-width:601px){#point-note{font-size:10.5px;margin:-12px 0 10px}}
/* 得点パネルの「次のラリーへ」：下の縁の帯が、自動で次へ進むまでの残り（--hold-left、1→0）に合わせて右から縮む。 */
.point-panel #next{position:relative;overflow:hidden}.point-panel #next::after{content:"";position:absolute;left:0;right:0;bottom:0;height:4px;background:#f2c46d;transform-origin:left;transform:scaleX(var(--hold-left,1));pointer-events:none}
/* 「次のラリーへ」の右端の小さなキーの札「Enter」（Enter・スペースでも次へ進める）。図鑑の「閉じる」・遊び方の「わかった」の右端にも同じ形の「Esc」（Escape キーでも閉じる）。ボタンの高さは変えない。 */
.point-panel #next .key-hint,#close-book .key-hint,#close-help .key-hint{font-size:10px;font-weight:700;line-height:1;letter-spacing:.5px;padding:3px 6px;border:1px solid #fff9e980;border-radius:3px;opacity:.85;margin-left:12px}
/* 一時停止の「タイトルへ戻る」を1回押した念押し：同じ場所のまま文字をオレンジの太字にし、すぐ下に試合の点が残らないことを小さく添える。札の大きさはほとんど変えない。 */
#quit[data-armed="1"]{color:#b45a31;font-weight:bold}
/* 一時停止の札の大会名と今の得点：見出しのすぐ下に緑の太字で1行。数字の幅をそろえ、狭い画面でも1行に収める。 */
#pause-panel .dialog>.pause-score{font-size:15px;font-weight:700;line-height:1.4;color:var(--green);font-variant-numeric:tabular-nums;white-space:nowrap;margin:0 0 4px}
/* 低い横画面（高さ540px以下）：得点の行の分だけ札の上下の余白と見出しの間を詰め、念押し中もスクロールなしで収める。 */
@media(orientation:landscape) and (max-height:540px){#pause-panel .dialog{padding-top:22px;padding-bottom:22px}#pause-panel .dialog h2{margin:10px 0 12px}}
#pause-panel .dialog>#quit-note{font-size:11px;line-height:1.5;color:#a4573a;text-align:center;margin:0}
/* 遊び方の決まり：1つの段落に詰めず、「見出し（緑の太字）＋文」の短い行に分けて上に細い線を引く。 */
.help-rules{margin:16px 0 0;padding-top:12px;border-top:1px solid #c7cbb8;font-size:12px;line-height:1.6}
.help-rules>div+div{margin-top:6px}
.help-rules dt{display:inline;font-weight:700;color:var(--green);letter-spacing:.5px;margin-right:.6em}
.help-rules dd{display:inline;margin:0}
/* 遊び方の文は、main.js が文節の間に置いた <wbr> でだけ折り返す（「出ま／す。」のように言葉の途中で次の行へ落とさない）。かたまりが行より長い時だけ途中で折る。 */
#help ol,.help-rules{word-break:keep-all;overflow-wrap:anywhere}
/* 横向きのスマホ：決まりを2列に並べ、「わかった」までスクロールなしで収める。 */
@media(max-height:480px) and (min-width:601px){.help-rules{display:grid;grid-template-columns:1fr 1fr;column-gap:20px;row-gap:0;margin-top:6px;padding-top:6px;font-size:11.5px;line-height:1.45}.help-rules>div+div{margin-top:0}}
/* 低い縦画面（高さ700px以下。320x568・360x640など）：決まりの行間と手順の間を詰め、見出しを「打ち返す。」まで1行に収めて（320pxで「す。」だけ次の行に落ちない）、「わかった」までスクロールなしで収める。 */
@media(orientation:portrait) and (max-height:700px){.help-rules{margin-top:8px;padding-top:7px;font-size:11.5px;line-height:1.5}.help-rules>div+div{margin-top:2px}#help .dialog{padding:14px 20px}#help .dialog h2{font-size:20px}#help .dialog li{margin:8px 0}}
/* 結果の下のボタン：負けた時は今までどおり「もう1セット」を大きく、その下に「難易度を変える」。勝って上の大会がある時は「◯◯へ進む」を大きく出し、「もう1セット」「難易度を変える」を小さな字で1行に並べる（札の高さは変わらない）。 */
.result-more{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;column-gap:10px}
.result-more .primary{flex:1 1 100%}
/* 図鑑の章へ飛ぶボタン：一覧の上に5つを横1行で並べる（部内戦・地区大会・県大会・全国大会・慣用句）。押すとその見出しまで一覧を送る。 */
.book-jump{display:flex;gap:4px;margin:0 0 6px}
.book-jump button{flex:1 1 0;min-width:0;min-height:32px;padding:4px 2px;border:1px solid #c7cbb8;border-radius:999px;background:#fbf8ee;color:var(--green);font-size:11px;font-weight:700;letter-spacing:.5px;white-space:nowrap}
.book-jump button:last-child{color:#a0702a;border-color:#d9b77a}
.book-jump button:active{background:#e9f1e8}
/* 幅の狭い縦（320px）は字を9.5px・字間0・間3pxにして「全国大会」まで縁に付かずに1行で収める。 */
@media(max-width:340px){.book-jump{gap:3px}.book-jump button{font-size:9.5px;letter-spacing:0;padding:4px 0}}
/* 横向きのスマホは一覧の高さを減らさないよう、題名「イディオム図鑑」の右の空きに重ねて置く。 */
@media(max-height:480px) and (min-width:601px){#book .book-sheet{position:relative}.book-jump{position:absolute;top:18px;right:24px;width:min(340px,56%);margin:0}.book-jump button{min-height:28px;padding:2px}}
/* 図鑑と遊び方は札の外（ぼかした背景）を押しても閉じる。マウスでは背景の上で指の形にし、札の中は元のまま。 */
#book,#help{cursor:pointer}
#book .dialog,#help .dialog{cursor:auto}
/* 返球中の見出し（data-verdict）：合っていたら「正解」を○の緑、違っていたら「まちがい」を×の赤で太く出す。宿題・慣用句の見出しの色より後に置いて上書きする。 */
#question-label[data-verdict=ok]{color:var(--maru);font-weight:700}
#question-label[data-verdict=miss]{color:var(--batsu);font-weight:700}

/* 友達対戦の受付状態。既存のタイトルと通常試合の配置は維持する。 */
#duel-lobby .dialog{max-height:calc(100dvh - 24px);overflow:auto;width:min(440px,calc(100% - 24px));padding:24px}
#duel-lobby label{display:block;margin-top:18px;font-size:13px}
#duel-lobby button:disabled{opacity:.45}
.room-entry{display:flex;gap:8px;margin:6px 0}
#room-code{flex:1 1 auto;min-width:0;width:100%;min-height:44px;font:inherit;font-size:18px;letter-spacing:.15em}
/* 「入る」は縮めず1行のまま（iPhone縦で入力欄に押されて「入／る」と縦に割れていた）。高さは入力欄にそろえる。 */
.room-entry #join-room{flex:none;white-space:nowrap;margin:0;padding:0 18px;min-height:44px;font-size:13px}
#room-status{white-space:pre-line;font-size:13px;line-height:1.6}
#friend-open{min-height:44px}
#app[data-action=online-wait] .answers{opacity:.6}

/* 友達対戦（ラリー）：名前の下に双方のチャージ（5目盛り）。相手のターンは問題の欄を「相手が回答中」の待ちにする。 */
.player-label{position:relative}.mini-charge{position:absolute;left:0;right:0;top:15px;display:flex;gap:2px;height:4px}.mini-charge i{flex:1;background:#bdc8b7;transform:skewX(-20deg)}.mini-charge i.filled{background:#28776a}#cpu-charge i.filled{background:#d97855}
#app[data-turn=cpu] #question-panel{background:#efe9d6;border-radius:4px}#app[data-turn=cpu] #phrase{color:#7d8a80;font-style:italic}#app[data-turn=cpu] .timer i{background:#d97855}#app[data-turn=cpu] .answers{opacity:.35}
#result-run[data-versus="1"]{font-weight:400;color:inherit}
.duel-levels[data-count="4"]{grid-template-columns:repeat(4,1fr)}.duel-levels{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin:12px 0 4px}.duel-levels button{border:1px solid #b2bca9;background:#faf6e9;border-radius:4px;padding:8px 2px;font-size:12px;font-weight:700;line-height:1.3;color:#486958}.duel-levels button small{display:block;font-size:9px;font-weight:400;letter-spacing:0}.duel-levels button[aria-pressed=true]{background:var(--green);color:#fff9ec;border-color:var(--green)}
#duel-level-note{font-size:13px;font-weight:700;margin:10px 0 0;color:#486958}#room-status{white-space:pre-line}
#room-code-big{margin:14px 0 2px;text-align:center;font-size:52px;font-weight:800;letter-spacing:8px;line-height:1.2;color:var(--green)}#room-code-big span{display:block}#room-code-big small{display:block;font-family:inherit;font-size:11px;letter-spacing:1px;font-weight:400;color:#647468}

/* 部屋の言葉を打たずに選ぶ：1文字目のかな（一覧にある字だけ）→ その字で始まる言葉。iPhone縦でも指で押せる44px以上。 */
.room-pick-label{margin:14px 0 6px;font-size:13px}
.room-kana{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:5px}
.room-kana button{min-height:44px;border:1px solid #b2bca9;background:#faf6e9;border-radius:4px;font-size:20px;font-weight:700;color:#28524a;padding:0}
.room-word-list{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.room-word-list button{min-height:52px;border:1px solid #b2bca9;background:#faf6e9;border-radius:4px;font-size:24px;font-weight:700;letter-spacing:4px;color:#28524a}
.room-word-list .room-back{font-size:13px;letter-spacing:0;font-weight:400;background:transparent;border-style:dashed}
.room-kana button:active,.room-word-list button:active{background:var(--green);color:#fff9ec}
/* iPhone縦など狭い画面：札の余白を詰めて、かなを6列にし、札が画面に収まる（ラボの「ラボへ戻る」と重ならない）ようにする。 */
@media(max-width:600px){#duel-lobby .dialog{padding:16px 16px}#duel-lobby h2{margin:6px 0 8px;font-size:22px}#duel-lobby .dialog>p{line-height:1.6}#duel-lobby .primary{padding:13px 20px}#duel-lobby label{margin-top:10px}.room-entry{margin:4px 0}.room-pick-label{margin:8px 0 5px}.room-kana{gap:4px}}
/* 音のオン・オフ（v0.15.66）。右上の「友達対戦」「一時停止」の左に同じ形で置く。 */
.topbar>div{display:flex;align-items:stretch}
#sound{min-width:52px}
#sound[aria-pressed=false]{color:#526b5c99;border-style:dashed}
/* 友達対戦の「対戦をやめる」の念押し。ボタンを目立たせ、すぐ下に一言を出す（試合の画面は隠さない）。 */
#pause[data-armed="1"]{color:#b45a31;border-color:#b45a31;font-weight:bold;background:#fff8e9}
.friend-quit-note{position:absolute;z-index:3;right:28px;top:calc(72px + env(safe-area-inset-top));max-width:min(320px,calc(100% - 56px));background:var(--paper);color:#a4573a;border:1px solid #b45a3155;border-radius:4px;padding:8px 12px;font-size:11px;line-height:1.5;box-shadow:0 4px 18px #183e3c14}
/* 得点板が右上まで広がる幅では、得点の下へずらす。 */
@media(max-width:1000px){.friend-quit-note{top:calc(128px + env(safe-area-inset-top))}}
@media(max-width:600px){.friend-quit-note{right:18px;top:calc(162px + env(safe-area-inset-top));max-width:calc(100% - 36px)}}
