/* 名言タイピング（TYPE RUSH）。黒・紙の白・金・明朝・Playfair Display。文字は DOM、光と粒子は canvas */
.gm-stage[data-game="typing"] { aspect-ratio: 16 / 10; max-height: 84vh; min-height: 560px; background: #08080b; }
.gm-stage[data-game="typing"]:fullscreen { aspect-ratio: auto; max-height: none; min-height: 0; height: 100%; }
.ty { --gold: #c9a24a; --gold2: #e1c47e; --paper: #f3ede2; --red: #ef7a6b; --heat: 0; font-family: var(--jp), sans-serif; line-height: 1.6; text-align: left; }
.ty.is-play { touch-action: none; }
.ty-bg, .ty-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.ty-bg { z-index: 0; }
.ty-fx { z-index: 12; }
.ty p { margin: 0; }

/* ── 遊ぶ画面 */
.ty-play { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s 0.35s; }
.ty.is-play .ty-play { opacity: 1; visibility: visible; transition: opacity 0.35s; }

/* 時間の帯 */
.ty-tbar { flex: none; height: 3px; background: rgba(243, 237, 226, 0.07); overflow: hidden; }
.ty-tbar i { display: block; height: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, #6f5520, #c9a24a 45%, #f1d793 85%, #fff4d2); box-shadow: 0 0 14px rgba(225, 196, 126, 0.9); transition: background 0.4s; }
.ty-tbar.over i { box-shadow: 0 0 18px rgba(255, 236, 190, 1); }
.ty-tbar.warn i { background: linear-gradient(90deg, #6e1d17, #c8483a 60%, #ff8d7c); box-shadow: 0 0 16px rgba(230, 90, 70, 0.95); }

/* 上の HUD */
.ty-hud { flex: none; display: flex; align-items: flex-end; gap: clamp(14px, 3.4vw, 38px); padding: 14px clamp(16px, 3vw, 28px) 10px; font-family: 'Poppins', var(--jp), sans-serif; border-bottom: 1px solid rgba(201, 162, 74, 0.16); background: linear-gradient(180deg, rgba(6, 6, 8, 0.55), rgba(6, 6, 8, 0)); }
.ty-hud small { display: block; margin-bottom: 6px; font: 600 9.5px/1 'Poppins', sans-serif; letter-spacing: 0.24em; color: rgba(225, 196, 126, 0.72); }
.ty-hud b { display: block; font: 700 21px/1 'Poppins', sans-serif; letter-spacing: 0.02em; color: var(--paper); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ty-st b i { margin-left: 1px; font-style: normal; font-size: 0.62em; color: rgba(243, 237, 226, 0.6); }
.ty-clock { position: relative; min-width: 4.2em; }
.ty-clock b { font-size: 36px; letter-spacing: 0; color: #fff8e8; text-shadow: 0 0 22px rgba(225, 196, 126, 0.35); }
.ty-clock.warn b { color: var(--red); text-shadow: 0 0 22px rgba(230, 90, 70, 0.75); }
.ty-clock.warn small { color: rgba(239, 122, 107, 0.9); }
.ty-clock.beat b { animation: ty-beat 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes ty-beat { 0% { transform: scale(1.22); } 100% { transform: none; } }
.ty-clock b { transform-origin: 0 70%; }
.ty-cb { position: relative; display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: end; }
.ty-cb small { grid-column: 1 / -1; }
.ty-cb b { transition: color 0.2s, text-shadow 0.3s; }
.ty-cb em { font: 700 12px/1 'Poppins', sans-serif; font-style: normal; color: rgba(225, 196, 126, 0.85); padding-bottom: 2px; }
.ty-cbar { grid-column: 1 / -1; display: block; height: 2px; margin-top: 7px; background: rgba(243, 237, 226, 0.1); border-radius: 2px; overflow: hidden; }
.ty-cbar i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #a07c32, #f1d793); transition: transform 0.15s; }
.ty-cb.hot b { color: #f6dc9c; text-shadow: 0 0 calc(10px + 18px * var(--heat)) rgba(225, 196, 126, calc(0.4 + 0.5 * var(--heat))); }
.ty-cb.warn b { animation: ty-cwarn 0.35s; }
.ty-cb.broke b { animation: ty-broke 0.5s; }
@keyframes ty-cwarn { 30% { color: var(--red); transform: translateX(-3px); } 60% { transform: translateX(2px); } }
@keyframes ty-broke { 0% { color: var(--red); transform: scale(1.3); } 100% { transform: none; } }
.ty-pz { align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none; width: 40px; height: 40px; margin-left: auto; padding: 0; border-radius: 50%; border: 1px solid rgba(243, 237, 226, 0.25); background: rgba(255, 255, 255, 0.03); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.ty-pz:hover { border-color: rgba(225, 196, 126, 0.75); background: rgba(225, 196, 126, 0.08); }
.ty-pz i { width: 3px; height: 13px; border-radius: 1px; background: var(--paper); }

/* 真ん中：和訳・言った人・英文・次の文 */
.ty-main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: clamp(10px, 2.6vh, 26px) clamp(18px, 5.5vw, 70px) clamp(10px, 2vh, 18px); text-align: center; transition: filter 0.3s, opacity 0.3s; }
.ty.is-pause .ty-main { filter: blur(16px); opacity: 0.35; }
.ty.is-up .ty-main { filter: blur(6px); opacity: 0.28; transition-duration: 0.6s; }
.ty-main.shk { animation: ty-shk 0.35s; }
.ty-meta { flex: none; max-width: 46em; margin-bottom: clamp(14px, 3.4vh, 30px); }
.ty-meta.enter { animation: ty-in 0.45s ease-out; }
.ty-no { font: 600 10px/1 'Poppins', sans-serif; letter-spacing: 0.3em; color: rgba(225, 196, 126, 0.62); }
.ty-ja { margin-top: 10px !important; font: 700 clamp(14px, 1.9vw, 18px) / 1.7 'Shippori Mincho B1', var(--jp), serif; color: rgba(243, 237, 226, 0.94); }
.ty-who { margin-top: 2px !important; font: 600 12.5px/1.6 'Shippori Mincho B1', var(--jp), serif; letter-spacing: 0.08em; color: var(--gold2); }
.ty-who:empty { display: none; }
.ty-meta::after { content: ''; display: block; width: 64px; height: 7px; margin: 12px auto 0; background: radial-gradient(circle, #e1c47e 0 2px, transparent 2.5px) center / 7px 7px no-repeat, linear-gradient(90deg, transparent, rgba(225, 196, 126, 0.75) 35%, transparent 45%, transparent 55%, rgba(225, 196, 126, 0.75) 65%, transparent) center / 100% 1px no-repeat; }
.ty-box { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 2vh; }
.ty-line { max-width: 100%; font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 600; font-size: 40px; line-height: 1.42; letter-spacing: 0.005em; color: rgba(243, 237, 226, 0.6); text-wrap: balance; overflow-wrap: anywhere; }
.ty-line.enter { animation: ty-enter 0.38s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes ty-enter { from { opacity: 0; transform: translateY(22px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ty-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ty-line .w { display: inline-block; white-space: nowrap; }
.ty-line .w.shk, .ty-line.shk { animation: ty-shk 0.3s; }
@keyframes ty-shk { 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.ty-line .c { position: relative; transition: color 0.12s; }
.ty-line .c.p { color: rgba(243, 237, 226, 0.34); }
.ty-line .c.ok { color: var(--gold2); text-shadow: 0 0 calc(8px + 14px * var(--heat)) rgba(225, 196, 126, calc(0.32 + 0.45 * var(--heat))); }
.ty-line .c.pass { color: rgba(225, 196, 126, 0.6); }
.ty-line .c.fl { animation: ty-fl 0.45s ease-out; }
@keyframes ty-fl { from { color: #fffdf6; text-shadow: 0 0 14px rgba(255, 240, 200, 1), 0 0 30px rgba(225, 196, 126, 0.95); } }
.ty-line .c.was { text-decoration: underline dotted rgba(239, 122, 107, 0.75); text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
.ty-line .c.cur { color: #fffaf0; text-shadow: 0 0 16px rgba(255, 246, 226, 0.35); }
.ty-line .c.cur::before { content: ''; position: absolute; left: -0.04em; top: 0.18em; bottom: 0.1em; width: max(2px, 0.055em); border-radius: 2px; background: #f4dc9e; box-shadow: 0 0 10px rgba(225, 196, 126, 0.95), 0 0 22px rgba(225, 196, 126, 0.55); transform: skewX(-11deg); animation: ty-caret 0.95s ease-in-out infinite; }
.ty-line .c.cur::after { content: ''; position: absolute; left: 0.02em; right: -0.04em; bottom: 0.02em; height: max(2px, 0.05em); border-radius: 2px; background: linear-gradient(90deg, rgba(225, 196, 126, 0.15), rgba(241, 215, 147, 0.95), rgba(225, 196, 126, 0.15)); animation: ty-caret2 0.95s ease-in-out infinite; }
.ty-line .c.gs.cur::after { left: 0.08em; right: 0.08em; }
@keyframes ty-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; box-shadow: 0 0 4px rgba(225, 196, 126, 0.5); } }
@keyframes ty-caret2 { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.35; } }
.ty-line .c.bad { color: #ff8371; text-shadow: 0 0 14px rgba(236, 92, 72, 0.85); }
.ty-line .c.bad::before { background: #ff8371; box-shadow: 0 0 12px rgba(236, 92, 72, 0.95); }
.ty-line .c.bad::after { background: linear-gradient(90deg, rgba(236, 92, 72, 0.2), #ff8371, rgba(236, 92, 72, 0.2)); }
.ty-line .c.gs.bad { background: rgba(236, 92, 72, 0.22); border-radius: 3px; }
.ty-ghost { position: absolute; margin: 0; pointer-events: none; animation: ty-ghost 0.7s ease-out forwards; }
.ty-ghost .c, .ty-ghost .c.p { color: #f1d793; text-shadow: 0 0 18px rgba(225, 196, 126, 0.8); }
.ty-ghost .c::before, .ty-ghost .c::after { display: none; }
@keyframes ty-ghost { 0% { opacity: 1; transform: none; filter: none; } 100% { opacity: 0; transform: translateY(-34px) scale(1.03); filter: blur(5px); } }
.ty-next { flex: none; display: flex; align-items: baseline; justify-content: center; gap: 12px; width: 100%; max-width: 44em; margin-top: 6px !important; color: rgba(243, 237, 226, 0.48); }
.ty-next small { flex: none; font: 600 9.5px 'Poppins', sans-serif; letter-spacing: 0.26em; color: rgba(225, 196, 126, 0.7); }
.ty-next span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 600 15px/1.5 'Playfair Display', Georgia, serif; }
.ty-tap { display: none; position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(225, 196, 126, 0.6); background: rgba(12, 11, 15, 0.88); font: 700 13px var(--jp); color: var(--gold2); white-space: nowrap; animation: ty-glow 1.6s ease-in-out infinite; pointer-events: none; }
.ty.nofocus.is-play:not(.is-pause) .ty-tap { display: block; }
@keyframes ty-glow { 50% { box-shadow: 0 0 22px -4px rgba(225, 196, 126, 0.8); } }

/* スマホの入力欄 */
.ty-inbar { display: none; flex: none; align-items: center; gap: 12px; margin: 0 12px 12px; padding: 6px 8px 6px 14px; border-radius: 14px; border: 1px solid rgba(225, 196, 126, 0.5); background: rgba(14, 13, 18, 0.92); box-shadow: 0 0 26px -10px rgba(225, 196, 126, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.ty.touch .ty-inbar { display: flex; }
.ty.nofocus .ty-inbar { border-color: rgba(225, 196, 126, 0.85); animation: ty-glow 1.6s ease-in-out infinite; }
.ty-cw { flex: 0 1 auto; min-width: 0; max-width: 60%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: italic 600 19px/1.3 'Playfair Display', Georgia, serif; color: rgba(243, 237, 226, 0.7); }
.ty-cw .ok { color: var(--gold2); }
.ty-cw .cur { color: #fffaf0; box-shadow: inset 0 -2px 0 #e1c47e; }
.ty-cw .gp { padding: 0 3px; font-style: normal; font-size: 0.8em; color: var(--gold2); }
.ty-in { flex: 1; min-width: 0; height: 40px; padding: 0 8px; border: 0; border-left: 1px solid rgba(243, 237, 226, 0.14); border-radius: 0; background: transparent; color: var(--paper); font: 600 16px 'Poppins', sans-serif; outline: none; caret-color: #e1c47e; -webkit-user-select: text; user-select: text; }
.ty-in::placeholder { color: rgba(225, 196, 126, 0.75); font: 700 13px var(--jp); }

/* 日本語入力の注意・中央の大きな文字・ポップ */
.ty-ime { position: absolute; left: 50%; bottom: 22%; z-index: 15; transform: translate(-50%, 8px); padding: 10px 20px; border-radius: 999px; background: rgba(110, 28, 22, 0.94); border: 1px solid rgba(255, 140, 120, 0.5); color: #fff4ee; font: 700 13px/1.5 var(--jp); white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s; pointer-events: none; }
.ty-ime.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.25s, transform 0.25s; }
.ty-banner { position: absolute; left: 0; right: 0; top: 50%; z-index: 14; text-align: center; pointer-events: none; opacity: 0; transform: translateY(-50%); }
.ty-banner b { display: block; font: italic 600 clamp(44px, 9vw, 96px) / 1 'Playfair Display', Georgia, serif; letter-spacing: 0.06em; color: #f1d793; text-shadow: 0 0 40px rgba(201, 162, 74, 0.6), 0 4px 30px rgba(0, 0, 0, 0.8); }
.ty-banner small { display: block; margin-top: 14px; font: 600 13px 'Poppins', var(--jp), sans-serif; letter-spacing: 0.24em; color: rgba(243, 237, 226, 0.85); }
.ty-banner.on.cd { animation: ty-cd 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
.ty-banner.on.cd b { font-size: clamp(80px, 15vw, 150px); }
.ty-banner.on.go { animation-duration: 0.8s; }
.ty-banner.on.go b { letter-spacing: 0.2em; }
.ty-banner.on.up { animation: ty-up 1.8s ease forwards; background: radial-gradient(ellipse at center, rgba(8, 8, 10, 0.8), transparent 70%); padding: 40px 0; }
@keyframes ty-cd { 0% { opacity: 0; transform: translateY(-50%) scale(1.6); } 25% { opacity: 1; transform: translateY(-50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50%) scale(0.92); } }
@keyframes ty-up { 0% { opacity: 0; transform: translateY(-50%) scale(1.25); letter-spacing: 0.3em; } 18% { opacity: 1; transform: translateY(-50%); } 85% { opacity: 1; } 100% { opacity: 0; } }
.ty-pop { position: absolute; z-index: 13; pointer-events: none; transform: translate(-50%, -50%); white-space: nowrap; font: 700 15px/1.2 'Poppins', sans-serif; letter-spacing: 0.06em; color: #f1d793; text-shadow: 0 0 12px rgba(225, 196, 126, 0.85), 0 2px 8px rgba(0, 0, 0, 0.8); animation: ty-pop 1.15s ease-out forwards; }
.ty-pop small { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 0.2em; color: rgba(243, 237, 226, 0.85); text-align: center; }
.ty-pop.time { font-size: 22px; color: #fff3cf; animation-name: ty-popt; }
.ty-pop.time small { display: inline; margin-left: 1px; font: 700 11px var(--jp); letter-spacing: 0; color: #fff3cf; }
.ty-pop.pf, .ty-pop.sc { animation-name: ty-popd; }
.ty-pop.pf { font: italic 600 22px/1.2 'Playfair Display', Georgia, serif; letter-spacing: 0.14em; }
.ty-pop.pf b { font: 700 14px 'Poppins', sans-serif; letter-spacing: 0.04em; margin-left: 6px; }
.ty-pop.tier { font-size: 18px; letter-spacing: 0.12em; animation-name: ty-popd; animation-duration: 1.3s; }
.ty-pop.bad { color: #ff8f7e; font-size: 12px; letter-spacing: 0.2em; text-shadow: 0 0 12px rgba(230, 90, 70, 0.8); }
@keyframes ty-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 14% { opacity: 1; transform: translate(-50%, -60%) scale(1.12); } 28% { transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%); } }
@keyframes ty-popt { 0% { opacity: 0; transform: translate(-50%, 10%) scale(0.6); } 16% { opacity: 1; transform: translate(-50%, -40%) scale(1.2); } 34% { transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -150%) scale(0.8); } }
@keyframes ty-popd { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 30% { transform: translate(-50%, -50%) scale(1); } 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 10%); } }

/* ── 重ねる画面（タイトル・一時停止・結果） */
.ty-ov { z-index: 20; justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px; -webkit-overflow-scrolling: touch; }
.ty-ov .ty-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 860px; margin: auto 0; }
.ty-title { background: radial-gradient(circle at 50% 30%, rgba(24, 21, 30, 0.2), rgba(6, 6, 8, 0.72)); }
.ty-pause { background: radial-gradient(circle at 50% 42%, rgba(20, 18, 24, 0.62), rgba(6, 6, 8, 0.9)); }
.ty-result { background: radial-gradient(circle at 50% 24%, rgba(30, 26, 20, 0.9), rgba(7, 7, 9, 0.97)); }
.ty-ov .ty-kick { font: 600 11px 'Poppins', sans-serif; letter-spacing: 0.34em; color: var(--gold2); opacity: 0.9; max-width: none; }
.ty-ov h2.ty-logo { margin: 0; font: italic 600 clamp(46px, 7.6vw, 78px) / 1 'Playfair Display', Georgia, serif; letter-spacing: 0.05em; background: linear-gradient(180deg, #fff6dc 8%, #e8cb86 48%, #a9832f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 28px rgba(201, 162, 74, 0.32)); }
.ty-ov h2.ty-logo small { display: block; margin-top: 12px; font: 800 14px/1 'Shippori Mincho B1', var(--jp), serif; letter-spacing: 0.5em; color: var(--paper); -webkit-text-fill-color: var(--paper); text-indent: 0.5em; }
.ty-ov .ty-h2 { margin: 0; font: 800 clamp(26px, 4.4vw, 40px) / 1.3 'Shippori Mincho B1', var(--jp), serif; color: var(--paper); }
.ty-demo { width: 100%; max-width: 620px; min-height: 66px; padding: 6px 0 2px; transition: opacity 0.4s; }
.ty-demo.out { opacity: 0; }
.ty-ov .ty-demo-e { min-height: 1.4em; font: italic 600 clamp(20px, 2.8vw, 27px) / 1.35 'Playfair Display', Georgia, serif; color: rgba(243, 237, 226, 0.5); max-width: none; opacity: 1; }
.ty-ov .ty-demo-j { margin-top: 4px; font: 700 12.5px/1.6 'Shippori Mincho B1', var(--jp), serif; color: rgba(243, 237, 226, 0.6); opacity: 0; transition: opacity 0.5s; max-width: none; }
.ty-demo.done .ty-demo-j { opacity: 1; }
.ty-demo .c { position: relative; }
.ty-demo .c.p { color: rgba(243, 237, 226, 0.3); }
.ty-demo .c.ok { color: var(--gold2); text-shadow: 0 0 12px rgba(225, 196, 126, 0.5); }
.ty-demo .c.pass { color: rgba(225, 196, 126, 0.6); }
.ty-demo .c.cur { color: #fffaf0; }
.ty-demo .c.cur::before { content: ''; position: absolute; left: -0.04em; top: 0.2em; bottom: 0.1em; width: 2px; background: #f4dc9e; box-shadow: 0 0 8px rgba(225, 196, 126, 0.9); transform: skewX(-11deg); animation: ty-caret 0.95s ease-in-out infinite; }
.ty-sec { width: 100%; }
.ty-ov .ty-lab { margin-bottom: 8px; font: 700 11.5px/1 var(--jp); letter-spacing: 0.24em; color: rgba(243, 237, 226, 0.66); max-width: none; opacity: 1; }
.ty-courses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
.ty-course { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 13px 14px 12px; border-radius: 12px; border: 1px solid rgba(243, 237, 226, 0.15); background: linear-gradient(160deg, rgba(38, 35, 44, 0.78), rgba(14, 13, 17, 0.84)); color: var(--paper); text-align: left; cursor: pointer; transition: border-color 0.2s, box-shadow 0.25s, transform 0.2s, background 0.25s; }
.ty-course:hover { border-color: rgba(225, 196, 126, 0.5); transform: translateY(-2px); }
.ty-course i { font: 600 9.5px/1.2 'Poppins', sans-serif; font-style: normal; letter-spacing: 0.26em; color: rgba(225, 196, 126, 0.78); }
.ty-course b { font: 800 17px/1.35 'Shippori Mincho B1', var(--jp), serif; }
.ty-course span { font: 500 11.5px/1.5 var(--jp); color: rgba(243, 237, 226, 0.66); }
.ty-course em { margin-top: 5px; font: 600 11px/1.3 'Poppins', var(--jp), sans-serif; font-style: normal; color: rgba(243, 237, 226, 0.45); }
.ty-course em strong { color: var(--gold2); font-weight: 700; }
.ty-course[aria-checked="true"] { border-color: rgba(225, 196, 126, 0.9); background: linear-gradient(160deg, rgba(86, 68, 32, 0.6), rgba(22, 18, 12, 0.88)); box-shadow: 0 0 0 1px rgba(225, 196, 126, 0.35), 0 16px 32px -18px rgba(201, 162, 74, 0.85); }
.ty-course[aria-checked="true"]::after { content: ''; position: absolute; top: 13px; right: 13px; width: 7px; height: 7px; border-radius: 50%; background: #f1d793; box-shadow: 0 0 10px #e1c47e; }
.ty-opts { display: flex; justify-content: center; align-items: flex-end; gap: 14px 34px; flex-wrap: wrap; }
.ty-opt { display: flex; flex-direction: column; align-items: center; }
.ty-seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid rgba(243, 237, 226, 0.18); background: rgba(10, 10, 13, 0.55); }
.ty-seg button { padding: 7px 17px; border-radius: 999px; border: 0; background: transparent; color: rgba(243, 237, 226, 0.78); font: 700 14px/1 'Poppins', sans-serif; cursor: pointer; transition: background 0.2s, color 0.2s; }
.ty-seg button small { margin-left: 2px; font: 700 10.5px var(--jp); }
.ty-seg button[aria-checked="true"] { background: linear-gradient(180deg, #e9cf8f, #b8913c); color: #141217; box-shadow: 0 6px 16px -8px rgba(201, 162, 74, 0.9); }
.ty-tog { display: inline-flex; align-items: center; gap: 9px; padding: 6px 15px 6px 7px; border-radius: 999px; border: 1px solid rgba(243, 237, 226, 0.18); background: rgba(10, 10, 13, 0.55); color: rgba(243, 237, 226, 0.75); font: 700 13px/1 var(--jp); cursor: pointer; }
.ty-tog i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: rgba(243, 237, 226, 0.16); transition: background 0.2s; }
.ty-tog i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #f3ede2; transition: transform 0.2s; }
.ty-tog[aria-pressed="true"] { color: var(--gold2); }
.ty-tog[aria-pressed="true"] i { background: linear-gradient(180deg, #e9cf8f, #b8913c); }
.ty-tog[aria-pressed="true"] i::after { transform: translateX(14px); background: #141217; }
.ty-go { min-width: 220px; margin-top: 4px; padding: 14px 34px; font-size: 16px; letter-spacing: 0.12em; }
.ty-go small { margin-left: 4px; padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(20, 18, 23, 0.4); font: 600 10px/1.2 'Poppins', sans-serif; letter-spacing: 0.08em; opacity: 0.75; }
.ty-ov .ty-keys .ty-dot { margin: 0 8px; opacity: 0.5; }
.ty-ov .ty-keys { font-size: 12.5px; line-height: 1.8; color: rgba(243, 237, 226, 0.62); opacity: 1; max-width: 52em; }
.ty kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 2px; border-radius: 4px; border: 1px solid rgba(243, 237, 226, 0.3); border-bottom-width: 2px; font: 600 11px/1.5 'Poppins', sans-serif; color: var(--paper); text-align: center; }
.ty.touch .ty-pc, .ty:not(.touch) .ty-sp { display: none !important; }
.ty-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }
.ty-pinfo { font: 600 14px var(--jp); color: rgba(243, 237, 226, 0.75); opacity: 1 !important; }
.ty-pinfo b { margin: 0 3px; font: 700 18px 'Poppins', sans-serif; color: var(--gold2); }
.ty-pinfo span { margin: 0 10px; opacity: 0.4; }

/* 結果 */
.ty-res-top { display: flex; align-items: center; justify-content: center; gap: clamp(22px, 5vw, 56px); margin-top: 2px; }
.ty-rank { position: relative; display: flex; flex-direction: column; align-items: center; animation: ty-rank 0.9s 0.2s cubic-bezier(0.2, 1.2, 0.3, 1) both; }
.ty-rank small, .ty-res-sc small { font: 600 10px/1 'Poppins', sans-serif; letter-spacing: 0.3em; color: rgba(225, 196, 126, 0.75); }
.ty-rank b { display: block; padding: 0 0.12em; font: italic 600 clamp(92px, 15vw, 140px) / 1 'Playfair Display', Georgia, serif; background: linear-gradient(180deg, #fff7e0 5%, #e6c77f 50%, #9a7429 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px rgba(225, 196, 126, 0.45)); }
.ty-rank::before { content: ''; position: absolute; left: 50%; top: 56%; width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(225, 196, 126, 0.22), transparent 62%); z-index: -1; }
.ty-rank.r-S::before { background: radial-gradient(circle, rgba(255, 226, 150, 0.4), transparent 64%); animation: ty-halo 2.4s ease-in-out infinite; }
.ty-rank.r-B b, .ty-rank.r-C b { background: linear-gradient(180deg, #f3ede2 5%, #c9c0b0 55%, #7c7468 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 18px rgba(243, 237, 226, 0.2)); }
@keyframes ty-rank { from { opacity: 0; transform: scale(1.8); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ty-halo { 50% { opacity: 0.55; transform: translate(-50%, -50%) scale(1.08); } }
.ty-res-sc { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; }
.ty-ov .ty-big { font: 700 clamp(40px, 6.4vw, 60px) / 1 'Poppins', sans-serif; letter-spacing: 0.01em; color: #fff8e8; font-variant-numeric: tabular-nums; max-width: none; opacity: 1; }
.ty-ov .ty-new { padding: 4px 12px; border-radius: 999px; background: linear-gradient(180deg, #e9cf8f, #b8913c); color: #141217; font: 700 11px 'Poppins', sans-serif; letter-spacing: 0.24em; opacity: 1; animation: ty-new 1.4s ease-in-out infinite; }
@keyframes ty-new { 50% { box-shadow: 0 0 20px rgba(225, 196, 126, 0.8); } }
.ty-ov .ty-best { font-size: 12.5px; color: rgba(243, 237, 226, 0.62); opacity: 1; }
.ty-ov .ty-best b { color: var(--gold2); font-family: 'Poppins', sans-serif; }
.ty-ov .ty-msg { font: 700 14.5px/1.7 'Shippori Mincho B1', var(--jp), serif; color: rgba(243, 237, 226, 0.88); opacity: 1; }
.ty-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; max-width: 680px; margin: 4px 0 0; border-top: 1px solid rgba(201, 162, 74, 0.3); border-bottom: 1px solid rgba(201, 162, 74, 0.3); }
.ty-stats div { padding: 12px 6px 11px; }
.ty-stats div + div { border-left: 1px solid rgba(201, 162, 74, 0.16); }
.ty-stats dt { font: 700 11px/1.3 var(--jp); letter-spacing: 0.08em; color: rgba(225, 196, 126, 0.8); }
.ty-stats dd { margin: 6px 0 0; font: 700 24px/1 'Poppins', sans-serif; color: var(--paper); font-variant-numeric: tabular-nums; }
.ty-stats dd small { margin-left: 1px; font-size: 12px; opacity: 0.65; }
.ty-h3 { width: 100%; max-width: 720px; margin: 14px 0 0; padding-top: 4px; font: 800 17px/1.4 'Shippori Mincho B1', var(--jp), serif; text-align: left; color: var(--paper); display: flex; align-items: center; gap: 14px; }
.ty-h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201, 162, 74, 0.6), transparent); }
.ty-list { width: 100%; max-width: 720px; margin: 0; padding: 0; list-style: none; text-align: left; counter-reset: ty; }
.ty-list li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid rgba(243, 237, 226, 0.1); counter-increment: ty; }
.ty-list li::before { content: counter(ty, decimal-leading-zero); flex: none; align-self: flex-start; padding-top: 4px; font: 600 10.5px 'Poppins', sans-serif; letter-spacing: 0.1em; color: rgba(225, 196, 126, 0.7); }
.ty-list a { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.ty-list a:hover .gm-en { color: var(--gold2); }
.ty-list .gm-en { display: block; font-size: 17px; line-height: 1.45; color: #f3ede2; transition: color 0.2s; }
.ty-list .lj { display: block; margin-top: 3px; font: 600 12.5px/1.6 'Shippori Mincho B1', var(--jp), serif; color: rgba(243, 237, 226, 0.75); }
.ty-list .lw { display: block; font: 600 11.5px/1.6 'Shippori Mincho B1', var(--jp), serif; color: rgba(225, 196, 126, 0.85); }
.ty-list li.mid { opacity: 0.72; }
.ty-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ty-tag { padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(243, 237, 226, 0.3); font: 700 10px/1.4 var(--jp); font-style: normal; color: rgba(243, 237, 226, 0.75); }
.ty-tag.pf { border-color: rgba(225, 196, 126, 0.6); color: var(--gold2); font-family: 'Poppins', sans-serif; letter-spacing: 0.14em; }
.ty-say { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px 6px 9px; border-radius: 999px; border: 1px solid rgba(225, 196, 126, 0.5); background: transparent; color: var(--gold2); font: 700 12px/1 var(--jp); cursor: pointer; transition: background 0.2s; }
.ty-say svg { width: 16px; height: 16px; }
.ty-say:hover { background: rgba(225, 196, 126, 0.12); }
.ty-ov .ty-none { font-size: 13.5px; color: rgba(243, 237, 226, 0.7); }

/* ── スマホ */
@media (max-width: 640px) {
  .gm-stage[data-game="typing"] { aspect-ratio: auto; height: calc(100svh - 70px); max-height: 780px; min-height: 580px; }
  .ty-hud { gap: 12px; padding: 10px 12px 8px; }
  .ty-hud small { font-size: 8.5px; letter-spacing: 0.16em; margin-bottom: 5px; }
  .ty-hud b { font-size: 16px; }
  .ty-clock { min-width: 2.6em; }
  .ty-clock b { font-size: 26px; }
  .ty-cb { column-gap: 4px; }
  .ty-cb em { font-size: 10px; }
  .ty-pz { width: 34px; height: 34px; }
  .ty-main { padding: 12px 16px 8px; }
  .ty-ja { margin-top: 8px !important; font-size: 14px; line-height: 1.65; }
  .ty-who { font-size: 11.5px; }
  .ty-meta::after { margin-top: 8px; }
  .ty-next span { font-size: 13px; }
  .ty-ov { padding: 18px 14px; }
  .ty-ov .ty-inner { gap: 10px; }
  .ty-ov h2.ty-logo { font-size: 44px; }
  .ty-ov h2.ty-logo small { margin-top: 9px; font-size: 12.5px; }
  .ty-demo { min-height: 58px; }
  .ty-ov .ty-demo-e { font-size: 19px; }
  .ty-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ty-course { padding: 10px 12px 10px; }
  .ty-course b { font-size: 15.5px; }
  .ty-course span { font-size: 11px; }
  .ty-opts { gap: 12px 18px; }
  .ty-seg button { padding: 7px 13px; }
  .ty-row .gm-btn { min-width: 0; padding: 11px 20px; }
  .ty-res-top { gap: 18px; }
  .ty-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ty-stats div:nth-child(4) { border-left: 0; }
  .ty-stats div:nth-child(n + 4) { border-top: 1px solid rgba(201, 162, 74, 0.16); }
  .ty-stats dd { font-size: 20px; }
  .ty-list .gm-en { font-size: 15.5px; }
  .ty-say span { display: none; }
  .ty-say { padding: 7px; }
}
@media (max-width: 380px) {
  .ty-s-acc { display: none; }
}
/* キーボードが出ているとき：見えている高さに合わせて詰める */
.gm-stage[data-game="typing"].kb { height: var(--vvh) !important; min-height: 0 !important; max-height: none !important; aspect-ratio: auto !important; }
.ty.kb .ty-hud { padding-top: 7px; padding-bottom: 6px; }
.ty.kb .ty-hud small { display: none; }
.ty.kb .ty-main { padding-top: 6px; padding-bottom: 4px; }
.ty.kb .ty-no, .ty.kb .ty-next, .ty.kb .ty-meta::after { display: none; }
.ty.kb .ty-ja { margin-top: 0 !important; font-size: 13px; line-height: 1.55; }
.ty.kb .ty-inbar { margin-bottom: 6px; }
@media (max-height: 560px) and (min-width: 641px) {
  .ty-no, .ty-meta::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ty-line .c.fl, .ty-line .w.shk, .ty-line.shk, .ty-main.shk, .ty-line.enter, .ty-meta.enter, .ty-ghost, .ty-clock.beat b, .ty-rank, .ty-rank.r-S::before, .ty-ov .ty-new, .ty-tap, .ty.nofocus .ty-inbar { animation: none; }
  .ty-ghost { display: none; }
  .ty-line .c.cur::before, .ty-line .c.cur::after { animation-duration: 1.6s; }
}
