/* 単語くぐり（Web）。アプリの白黒の見た目（黒地・白い糸・明朝）をそのまま Web に（2026-11-22） */
/* 数字だけ並びのそろう書体に（Cormorant Garamond の数字は旧字体で「101」が「IOI」に見える。Google Fonts の配信には lnum が無く font-variant-numeric が効かない） */
@font-face { font-family: "GateDigits"; font-weight: 100 500; unicode-range: U+0030-0039; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Noto Serif"), local("NotoSerif"), local("Droid Serif"), local("DroidSerif"); }
@font-face { font-family: "GateDigits"; font-weight: 501 900; unicode-range: U+0030-0039; src: local("Times New Roman Bold"), local("TimesNewRomanPS-BoldMT"), local("Noto Serif Bold"), local("NotoSerif-Bold"), local("Droid Serif Bold"), local("DroidSerif-Bold"); }
.gate {
  --g-bg: #000; --g-ink: #fff; --g-dim: #9a9a9a; --g-dim2: #6e6e6e; --g-line: #262626; --g-card: #0a0a0a; --g-card2: #161616;
  --g-gold: #ffd56a; --g-red: #ff7b7b; --g-green: #b8f0c0;
  --gj: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --ge: "GateDigits", "Cormorant Garamond", "Times New Roman", "Hiragino Mincho ProN", "Songti SC", "AppleMyungjo", "Noto Serif CJK JP", serif;
  --gu: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--g-bg); color: var(--g-ink); font-family: var(--gu);
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: lining-nums tabular-nums; /* Cormorant の旧字体数字（101→「IOI」）を避ける */
}
.gate *, .gate *::before, .gate *::after { box-sizing: border-box; }
.gate[data-lang="zh"] { --ge: "GateDigits", "Cormorant Garamond", "Songti SC", "STSong", "Noto Serif SC", "Noto Serif CJK SC", serif; }
.gate[data-lang="ko"] { --ge: "GateDigits", "Cormorant Garamond", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", "Noto Serif CJK KR", "Batang", serif; }
:where(.gate) :where(button) { font: inherit; color: inherit; }
.gate [hidden] { display: none !important; }
.gate kbd { display: inline-block; min-width: 1.9em; padding: 1px 6px; margin: 0 2px; border: 1px solid #3a3a3a; border-bottom-width: 2px; border-radius: 5px; font: 600 11px/1.5 var(--gu); color: #ddd; text-align: center; background: #111; }

/* 上の帯は黒に（共通の帯の色だけここで上書き） */
.gate .mtp-bar { background: rgba(0, 0, 0, .9); border-bottom-color: #1c1c1c; color: #fff; }
.gate .mtp-bar__back { color: #fff; }
.gate .mtp-bar__back:hover { background: #161616; }
.gate .mtp-bar__course { color: var(--g-dim); }
.gate .mtp-lives { color: #fff; }
.gate .mtp-lives__n small, .gate .mtp-lives__sub { color: var(--g-dim); }
.gate .mtp-heart:not(.is-on) { opacity: .35; }

/* ---------- 始める前 ---------- */
.gi { max-width: 1120px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-left)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)); }
.gi-hero { text-align: center; padding: 18px 0 8px; }
.gi-name { margin: 6px 0 0; font: 500 clamp(26px, 7vw, 34px)/1.2 var(--gj); letter-spacing: .42em; text-indent: .42em; color: #e8e8e8; }
.gi-lead { margin: 10px 0 0; font: 400 14px/1.6 var(--gj); color: var(--g-dim); letter-spacing: .08em; }
.gi-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 10px; margin: 22px auto 0; max-width: 420px; }
.gi-lvnav { flex: 1 1 190px; display: flex; align-items: center; min-height: 48px; border: 1px solid var(--g-line); border-radius: 24px; background: var(--g-card); }
.gi-arrow { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font: 400 28px/1 var(--gj); color: #fff; text-decoration: none; border-radius: 23px; }
.gi-arrow:hover { background: #1a1a1a; }
.gi-arrow.is-off { color: #444; pointer-events: none; }
.gi-course { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; font: 500 14px/1.3 var(--gj); }
.gi-course > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-lv { font-family: var(--ge); font-size: 15px; color: var(--g-dim); letter-spacing: .08em; }
.gi-lv b { color: #fff; font-weight: 600; }
.gi-lv small { font-size: 12px; }
.gi-best { flex: 0 0 auto; min-width: 112px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 4px 14px; border: 1px solid var(--g-line); border-radius: 12px; background: var(--g-card); }
.gi-stars, .gr-stars { letter-spacing: 3px; color: #3a3a3a; font-family: var(--gj); }
.gi-stars { font-size: 12px; line-height: 1.2; }
.gi-stars i, .gr-stars i { font-style: normal; }
.gi-stars i.on, .gr-stars i.on { color: var(--g-gold); }
.gi-bestm { font: 300 22px/1.1 var(--ge); }
.gi-bestm small { font-size: 12px; color: var(--g-dim); }
.gi-bestm b { font-weight: 300; }

.gi-startwrap { position: relative; max-width: 420px; height: 112px; margin: 16px auto 0; }
.gi-thread { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gi-start {
  position: relative; display: block; width: 100%; height: 100%; padding: 0 0 0 40%; border: 1px solid #1f1f1f; border-radius: 12px;
  background: transparent; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, background-color .2s;
}
.gi-start span { display: inline-block; font: 400 clamp(40px, 12vw, 54px)/1 var(--gj); letter-spacing: .08em; color: #fff; transform: skewX(-6deg); transform-origin: left center; animation: gi-pulse 1.8s ease-in-out infinite; }
.gi-start:hover { border-color: #3a3a3a; background: rgba(255, 255, 255, .03); }
.gi-start:focus-visible { outline: 2px solid var(--g-gold); outline-offset: 3px; }
.gi-start:disabled { cursor: wait; }
.gi-start:disabled span { color: #555; animation: none; }
@keyframes gi-pulse { 0%, 100% { transform: skewX(-6deg) scale(1); } 50% { transform: skewX(-6deg) scale(1.02); } }
.gi-keys { display: none; margin: 14px 0 0; font-size: 12px; color: var(--g-dim); }
.has-kbd .gi-keys { display: block; }
.gi-msg { margin: 14px auto 0; max-width: 420px; padding: 10px 14px; border: 1px solid #4a2a2a; border-radius: 10px; color: var(--g-red); font-size: 14px; }
.gi-msg a { color: #fff; }
.gi-change { display: inline-block; margin-top: 14px; padding: 13px 10px; line-height: 18px; font-size: 13px; color: var(--g-dim); text-decoration: underline; text-underline-offset: 3px; }
.gi-change:hover { color: #fff; }

.gi h2 { margin: 0; font: 500 17px/1.4 var(--gj); letter-spacing: .14em; color: #e8e8e8; }
.gi-words, .gi-how { max-width: 520px; margin: 34px auto 0; }
.gi-h2row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.gi-playall { flex: none; min-height: 44px; padding: 6px 14px; border: 1px solid var(--g-line); border-radius: 8px; background: var(--g-card2); font-size: 13px; cursor: pointer; }
.gi-playall:hover { border-color: #444; }
.gi-wlist, .gr-seen ol { list-style: none; margin: 0; padding: 0; border: 1px solid var(--g-line); border-radius: 12px; background: var(--g-card); overflow: hidden; }
.gw { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 14px 6px 6px; border-top: 1px solid #1c1c1c; cursor: pointer; }
.gw:first-child { border-top: 0; }
.gw:hover { background: #111; }
.gw__snd { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--g-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gw__snd svg { width: 18px; height: 18px; }
.gw__snd:hover, .gw.is-playing .gw__snd { color: #fff; background: #1c1c1c; }
.gw__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gw__en { font: 600 21px/1.15 var(--ge); color: #fff; overflow-wrap: anywhere; }
.gw__ja { margin-top: 2px; font: 400 13px/1.45 var(--gj); color: #cfcfcf; overflow-wrap: anywhere; }
.gw__mark { flex: none; font: 500 16px/1 var(--gj); }
.gw__mark.ok { color: var(--g-green); }
.gw__mark.ng { color: var(--g-red); }
.gw__n { flex: none; font: 300 14px/1 var(--ge); color: var(--g-dim); }
.gi-wlist .sk { height: 56px; border-top: 1px solid #1c1c1c; background: linear-gradient(90deg, #0a0a0a 0, #141414 50%, #0a0a0a 100%) 0 0/200% 100%; animation: gi-sk 1.2s linear infinite; }
@keyframes gi-sk { to { background-position: -200% 0; } }

.gi-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.gi-steps li { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border: 1px solid var(--g-line); border-radius: 12px; background: var(--g-card); }
.gi-steps img { flex: none; width: 78px; height: auto; aspect-ratio: 300 / 564; border-radius: 8px; border: 1px solid #1c1c1c; background: #050505; }
.gi-steps p { margin: 0; font-size: 14px; line-height: 1.6; color: #d8d8d8; }
.gi-steps b { color: #fff; font-weight: 600; }
.gi-steps small { display: block; margin-top: 3px; font-size: 12px; color: var(--g-dim); }

@media (min-width: 960px) {
  .gi { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 520px); grid-template-areas: "hero words" "hero how"; justify-content: center; column-gap: 56px; align-items: start; padding-top: 28px; }
  .gi-hero { grid-area: hero; position: sticky; top: 76px; padding-top: 40px; }
  .gi-words { grid-area: words; margin-top: 28px; }
  .gi-how { grid-area: how; }
  .gi-words, .gi-how { width: 100%; }
}
@media (min-width: 640px) and (max-width: 959px) {
  .gi-words, .gi-how { max-width: 640px; }
  .gi-steps { grid-template-columns: 1fr 1fr; }
}

/* ---------- 遊ぶ画面（画面いっぱい・スクロールしない） ---------- */
.is-play, .is-result { overflow: hidden; overscroll-behavior: none; }
.is-play .gi, .is-result .gi, .is-play .mtp-bar, .is-result .mtp-bar { visibility: hidden; }
.gs { position: fixed; inset: 0; z-index: 200; background: #000; touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: default; }
.gs-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gs-pause {
  position: absolute; z-index: 3; width: 52px; height: 52px; border-radius: 9px; border: 0; padding: 0;
  background: linear-gradient(#3a3a3a, #1b1b1b); box-shadow: 0 2px 0 #050505, 0 3px 10px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
  font: 500 16px/1 var(--gj); color: #eee; letter-spacing: .05em; cursor: pointer;
}
.gs-pause:active { transform: translateY(1px); filter: brightness(.9); }
.gs-side { position: absolute; top: 0; bottom: 0; z-index: 2; display: none; padding: calc(28px + env(safe-area-inset-top)) 28px 28px; pointer-events: none; overflow: hidden; }
.gs.has-sides .gs-side { display: block; }
.gs-side--l { left: 0; }
.gs-side--r { right: 0; }
.gs-wl { list-style: none; margin: 0 0 0 auto; padding: 0; max-width: 260px; }
.gs-wl li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid #141414; color: #5a5a5a; transition: color .25s; }
.gs-wl .en { font: 600 18px/1.2 var(--ge); flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-wl .ja { font: 400 12px/1.3 var(--gj); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-wl .c { font: 300 13px/1 var(--ge); flex: none; color: var(--g-green); min-width: 1.4em; text-align: right; }
.gs-wl li.seen { color: #9a9a9a; }
.gs-wl li.cur { color: #fff; }
.gs-wl li.cur .ja { color: #cfcfcf; }
.gs-wl li.ng { color: var(--g-red); }
.gs-goal { position: relative; height: 210px; width: 140px; margin-top: 8px; }
.gs-goal__bar { position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: #1c1c1c; }
.gs-goal__bar i { position: absolute; left: 0; bottom: 0; width: 2px; height: 0; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 230, .7); }
.gs-goal__bar span { position: absolute; left: 12px; transform: translateY(-50%); font: 400 12px/1 var(--gj); color: #3a3a3a; white-space: nowrap; letter-spacing: 2px; }
.gs-goal__bar span.on { color: var(--g-gold); }
.gs-goal__lbl { position: absolute; left: 72px; top: 8px; bottom: 8px; }
.gs-goal__lbl span { position: absolute; transform: translateY(-50%); font: 300 14px/1 var(--ge); color: var(--g-dim); white-space: nowrap; }
.gs-best { margin: 22px 0 0; font: 300 15px/1.4 var(--ge); color: var(--g-dim); }
.gs-keys { margin: 26px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; font-size: 12px; color: var(--g-dim); }
.gs-keys dt, .gs-keys dd { margin: 0; }
.is-result .gs-keys, .is-result .gs-touch { visibility: hidden; }
/* タッチの端末（iPad の横向きなど）は、キーの代わりに指の操作を案内する */
.gs-touch { display: none; margin: 26px 0 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.6; color: var(--g-dim); }
.gs-touch li + li { margin-top: 8px; }
.is-touch .gs-keys { display: none; }
.is-touch .gs-touch { display: block; } /* 結果の上に重ならないように（横向きのスマホで結果のカードと重なっていた） */
@media (max-height: 520px) { .is-result .gs-side { opacity: .35; } }

.gs-pausebox { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(0, 0, 0, .78); }
.gs-pausebox__h { margin: 0 0 10px; font: 500 24px/1 var(--gj); letter-spacing: 20px; text-indent: 20px; color: #fff; }
.g-snd { margin-top: 10px; min-height: 44px; padding: 6px 16px; border: 1px solid #333; border-radius: 8px; background: transparent; color: var(--g-dim); font: 400 13px/1 var(--gu); cursor: pointer; }
.g-snd[aria-pressed="true"] { color: #fff; border-color: #555; }

.g-btn {
  display: flex; align-items: center; justify-content: center; width: 220px; max-width: 100%; height: 48px; border-radius: 10px; border: 1px solid #2e2e2e;
  background: linear-gradient(#2a2a2a, #121212); box-shadow: 0 2px 0 #050505, 0 3px 10px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .14);
  font: 500 16px/1 var(--gj); letter-spacing: 6px; text-indent: 6px; color: #eee; text-decoration: none; cursor: pointer;
}
.g-btn:hover { filter: brightness(1.15); }
.g-btn:active { transform: translateY(1px); filter: brightness(.85); }
.g-btn--white { background: #fff; color: #000; border-color: #fff; box-shadow: 0 2px 0 #050505; font-size: 17px; letter-spacing: 8px; text-indent: 8px; }
.g-btn--white:hover { filter: none; background: #e8e8e8; }
.g-btn--ghost { background: transparent; box-shadow: none; border-color: #262626; color: #bbb; }
.g-btn:focus-visible, .g-snd:focus-visible, .gs-pause:focus-visible, .gw__snd:focus-visible, .gi-playall:focus-visible, .gi-arrow:focus-visible, .gr-app:focus-visible { outline: 2px solid var(--g-gold); outline-offset: 2px; }

/* ---------- 結果 ---------- */
.gr { position: fixed; inset: 0; z-index: 300; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: transparent; }
.gr-in { max-width: 440px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-left)) calc(36px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)); text-align: center; }
.gr-lv { margin: 0; font: 400 13px/1.4 var(--gj); color: var(--g-dim); letter-spacing: .1em; }
.gr-dist { margin: 6px 0 0; font: 300 76px/1 var(--ge); }
.gr-dist b { font-weight: 300; display: inline-block; }
.gr-dist small { font-size: 24px; }
.gr-cnt { margin: 2px 0 0; font: 300 24px/1 var(--ge); color: #cfcfcf; }
.gr-cnt b { font-weight: 300; }
.gr-cnt small { font: 400 15px/1 var(--gj); }
.gr-stars { margin: 12px 0 0; font-size: 30px; line-height: 1; color: #2e2e2e; }
.gr-stars i { display: inline-block; }
.gr-sub { min-height: 20px; margin: 10px 0 0; font: 500 14px/1.4 var(--gj); color: var(--g-dim); letter-spacing: .08em; }
.gr-sub.gold { color: var(--g-gold); }
.gr.go .gr-dist b { animation: gr-pop .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.gr.go .gr-stars i.on { animation: gr-star .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.gr.go .gr-sub { animation: gr-in .35s .9s ease-out both; }
@keyframes gr-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes gr-star { 0% { transform: scale(0); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes gr-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.gr-card { display: flex; gap: 14px; align-items: center; margin: 18px 0 0; padding: 12px; border: 1px solid var(--g-line); border-radius: 12px; background: var(--g-card); text-align: left; cursor: pointer; }
.gr-card:empty { display: none; }
.gr-card img { flex: none; width: 112px; height: 84px; object-fit: cover; border-radius: 8px; background: #111; border: 1px solid #222; }
.gr-card .t { flex: 1; min-width: 0; }
.gr-card .en { font: 600 26px/1.1 var(--ge); overflow-wrap: anywhere; }
.gr-card .ja { margin-top: 4px; font: 400 15px/1.45 var(--gj); color: #ddd; overflow-wrap: anywhere; }
.gr-card .why { margin-top: 6px; font: 400 12px/1.45 var(--gj); color: var(--g-red); overflow-wrap: anywhere; }
.gr-card .more { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 6px; margin: 0 0 -10px -6px; font-size: 12px; color: var(--g-dim); text-decoration: none; }
.gr-card .more:hover { color: #fff; }
.gr-btns { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 22px 0 0; }
.gr-lives { justify-content: center; margin-top: 14px; font-size: 12px; }
.gr-seen { margin: 30px 0 0; text-align: left; }
.gr-seen h2 { margin: 0 0 10px; font: 500 14px/1.4 var(--gj); color: var(--g-dim); letter-spacing: .1em; }
.gr-seen h2 b { font: 300 18px/1 var(--ge); color: #fff; }
.gr-seen .gw { min-height: 52px; }
.gr-seen .gw__en { font-size: 19px; }
.gr-seen .gw__ja { font-size: 12px; }
.gr-app { display: flex; align-items: center; gap: 12px; margin: 26px 0 0; padding: 12px 14px; border: 1px solid var(--g-line); border-radius: 12px; background: #050505; color: #ddd; text-decoration: none; text-align: left; }
.gr-app img { flex: none; border-radius: 10px; }
.gr-app span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.45; }
.gr-app b { font-weight: 600; color: #fff; }
.gr-app small { font-size: 12px; color: var(--g-dim); }
.gr-app:hover { border-color: #3a3a3a; }

@media (prefers-reduced-motion: reduce) {
  .gi-start span, .gr.go .gr-dist b, .gr.go .gr-stars i.on, .gr.go .gr-sub, .gi-wlist .sk { animation: none; }
}
.g-snd.gr-snd { margin-top: 16px; }
.g-snd.gi-snd { margin: 0 0 0 auto; }
