:root {
  --fs: 19px;
  --blue: #1f4e8c;
  --bg: #f6f4ef;
  --card: #fff;
  --line: #ddd6c8;
  --ink: #222;
  --sub: #666;
  --gold: #e0a400;
}
html.fs1 { --fs: 22px; }
html.fs2 { --fs: 26px; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: var(--fs)/1.5 -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
}
header h1 { flex: 1; font-size: 1.05em; margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbtn { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 10px; font-size: .85em; padding: 8px 12px; min-width: 64px; min-height: 44px; }
#back[hidden] { display: inline-block; visibility: hidden; }
main { max-width: 720px; margin: 0 auto; padding: 14px; }
button { font: inherit; cursor: pointer; }
.big { display: block; width: 100%; font-size: 1em; padding: 16px; border-radius: 14px; border: 0; background: var(--blue); color: #fff; margin: 10px 0; min-height: 56px; }
.big.gray { background: #777; }
.big.light { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.hint { background: #fff8e1; border: 1px solid #f0d98a; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.menu button { background: #fff; border: 2px solid var(--blue); color: var(--blue); border-radius: 14px; padding: 14px 6px; font-weight: 700; min-height: 64px; }
h2 { font-size: 1.05em; margin: 18px 4px 8px; }
.scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scene { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px; text-align: center; min-height: 92px; color: var(--ink); }
.scene .ic { font-size: 1.6em; display: block; }
.scene .cnt { color: var(--sub); font-size: .75em; }
.search { width: 100%; font: inherit; padding: 14px; border-radius: 14px; border: 2px solid var(--line); margin-bottom: 12px; background: #fff; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.card.playing { outline: 4px solid var(--gold); }
.card .ko { font-size: 1.1em; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.star { background: none; border: 0; font-size: 1.4em; line-height: 1; color: #bbb; padding: 0 4px; min-width: 44px; min-height: 44px; }
.star.on { color: var(--gold); }
.note { color: var(--sub); font-size: .82em; margin: 2px 0 8px; }
.var { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.var:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.who { display: inline-block; background: #e8eef8; color: var(--blue); border-radius: 8px; padding: 1px 8px; font-size: .78em; font-weight: 700; margin-bottom: 4px; }
.he { font-family: "SBL Hebrew", "Noto Serif Hebrew", "David", "Times New Roman", serif; font-size: 1.75em; line-height: 1.6; text-align: right; direction: rtl; }
.kor { font-size: 1.3em; font-weight: 500; letter-spacing: .02em; }
.kor b { color: #c0392b; font-weight: 800; }
.rom { color: #999; font-size: .78em; }
.play { display: flex; gap: 8px; margin-top: 8px; }
.play button { flex: 1; border: 0; border-radius: 12px; padding: 12px 6px; background: var(--blue); color: #fff; min-height: 52px; font-size: .95em; }
.play button.slow { background: #3d7d4a; }
.legend { font-size: .8em; color: var(--sub); margin: 0 4px 12px; }
#player { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 3px solid var(--blue); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); z-index: 9; box-shadow: 0 -4px 14px rgba(0,0,0,.12); }
#pl-text { text-align: center; font-weight: 700; }
.pl-btns { display: flex; gap: 8px; }
.pl-btns .big { margin: 8px 0 0; padding: 12px; }
.flash { text-align: center; padding: 26px 14px; min-height: 260px; }
.flash .q { font-size: 1.3em; font-weight: 700; margin: 12px 0; }
.row { display: flex; gap: 10px; }
.row .big { flex: 1; }
.big.ok { background: #2e7d32; }
.big.no { background: #c62828; }
.choice { display: block; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 14px; margin: 8px 0; min-height: 56px; color: var(--ink); }
.choice.right { border-color: #2e7d32; background: #e8f5e9; }
.choice.wrong { border-color: #c62828; background: #ffebee; }
.progress { color: var(--sub); text-align: center; font-size: .85em; }
.boxes { display: flex; gap: 6px; justify-content: center; margin: 8px 0 16px; flex-wrap: wrap; }
.boxes span { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; font-size: .8em; }
table.abc { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
table.abc td, table.abc th { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: center; font-size: .9em; }
table.abc td.L { font-family: "SBL Hebrew", "Noto Serif Hebrew", serif; font-size: 1.8em; }
.small { font-size: .8em; color: var(--sub); }
.empty { text-align: center; color: var(--sub); padding: 30px 0; }
table.abc td:nth-child(2) { white-space: nowrap; }
