:root{--bg:#fff7fb;--ink:#2e2730;--muted:#91828c;--line:#f0e2e9;--pink:#f6bbd3;--pink2:#ffddec;--purple:#6959f6;--purple2:#9c61f5;--blue:#dcecff;--blueEdge:#c78bad;--good:#21a879;--bad:#ef6571;--shadow:0 16px 45px rgba(103,61,84,.11)}
*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Pretendard","Noto Sans KR",sans-serif;-webkit-tap-highlight-color:transparent}button,input{font:inherit}button{cursor:pointer}.site-top{max-width:720px;margin:auto;padding:18px}.brand{display:flex;align-items:center;gap:10px}.brand>span{width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,var(--pink),#e8ddff);display:grid;place-items:center;font-weight:900;color:#65435a}.brand small{display:block;font-size:10px;color:var(--muted)}.brand b{display:block}
main{max-width:720px;margin:auto;padding:0 16px 100px}.screen{display:none}.screen.active{display:block}.hero{position:relative;min-height:235px;padding:27px 24px;border-radius:30px;background:radial-gradient(circle at 84% 17%,#fff 0 12%,transparent 13%),linear-gradient(135deg,#ffe2ee,#efe4ff 70%,#e2f6ef);overflow:hidden}.eyebrow{font-size:10px;font-weight:900;color:#7d5870;background:#ffffffbd;padding:7px 10px;border-radius:999px}.hero h1{font-size:30px;line-height:1.22;margin:15px 0 9px;letter-spacing:-1px}.hero h1 em{font-style:normal;color:#a15879}.hero p{max-width:78%;font-size:12px;color:#75656f;line-height:1.6}.hero-star{position:absolute;right:24px;bottom:27px;width:72px;height:72px;border-radius:26px;background:#fff;display:grid;place-items:center;font-size:36px;color:#cb779d;box-shadow:var(--shadow);animation:float 3s ease-in-out infinite}@keyframes float{50%{transform:translateY(-8px) rotate(5deg)}}
.home-card{margin-top:13px;padding:19px;background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:0 6px 20px rgba(75,45,62,.04)}.home-title{display:flex;justify-content:space-between;align-items:center}.home-title small,.home-title span{font-size:11px;color:var(--muted)}.home-title b{font-size:20px}.home-title i{font-style:normal}.xp-chip{padding:8px 11px;background:#fff0bd;border-radius:999px;font-weight:900}.home-progress{height:9px;background:#f2e7ed;border-radius:999px;overflow:hidden;margin:15px 0}.home-progress i{display:block;height:100%;width:0;background:linear-gradient(90deg,#e78dad,#9e85dc)}.home-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.home-stats div{text-align:center;background:#fcf9fb;border-radius:15px;padding:9px}.home-stats b{display:block}.home-stats span{font-size:9px;color:var(--muted)}.day-chips{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:15px}.day-chip{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 11px;font-size:10px;color:var(--muted);font-weight:800}.day-chip.active{background:var(--pink2);color:#7f4b65;border-color:#efc9d8}.main-btn,.sub-btn{width:100%;border:0;border-radius:17px;padding:15px 16px;font-weight:900}.main-btn{background:#493940;color:white;box-shadow:0 10px 24px rgba(55,35,47,.14)}.main-btn span{float:right}.sub-btn{margin-top:8px;background:#f8f1f5;color:#73636c}
.bottom-nav{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(720px,100%);display:grid;grid-template-columns:repeat(4,1fr);padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:#ffffffef;backdrop-filter:blur(16px);border-top:1px solid var(--line);z-index:30}.bottom-nav button{border:0;background:transparent;color:#9c8e97;font-size:10px;padding:5px}.bottom-nav span{display:block;font-size:18px}.bottom-nav button.active{color:#754c63;font-weight:900}
/* Full-screen game lesson. */
body.learn-mode{overflow:hidden;background:linear-gradient(#f9d3e4,#fce6f0)}body.learn-mode .site-top,body.learn-mode .bottom-nav{display:none}body.learn-mode main{max-width:none;padding:0}.learn-screen.active{position:fixed;z-index:100;inset:0;height:100svh;overflow:hidden;display:grid;grid-template-rows:60px 38px minmax(0,1fr) auto;background:radial-gradient(circle at 12% 16%,#ffeaf3 0 10%,transparent 11%),radial-gradient(circle at 89% 42%,#ffe8f1 0 13%,transparent 14%),linear-gradient(180deg,#f8cee0,#fde4ef 73%,#fff 73%);padding:calc(8px + env(safe-area-inset-top)) 14px env(safe-area-inset-bottom)}
.game-hud{display:grid;grid-template-columns:48px 1fr 48px;align-items:center;gap:10px}.hud-icon{width:44px;height:44px;border:0;border-radius:50%;background:#ffffff7a;color:#fff;font-size:32px;font-weight:400}.counter-pill{justify-self:center;width:min(310px,70vw);height:54px;border-radius:28px;background:#090909;color:#fff;display:flex;align-items:center;justify-content:center;position:relative;box-shadow:0 8px 25px rgba(0,0,0,.12)}.counter-pill b{font-size:25px;letter-spacing:.3px}.hud-ring{position:absolute;right:13px;width:34px;height:34px;border-radius:50%;background:conic-gradient(#6f5ff8 var(--deg,0deg),#26262a 0);display:block}.hud-ring:after{content:"";position:absolute;inset:6px;border-radius:50%;background:#090909}.game-progress-wrap{display:grid;grid-template-columns:48px 1fr 48px;align-items:center;gap:10px}.flame{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:#f06db0;font-size:23px;transform:translateY(2px);box-shadow:0 6px 14px rgba(240,109,176,.26)}.game-progress{height:13px;background:#ffffff8a;border-radius:999px;overflow:hidden}.game-progress i{display:block;height:100%;width:0;background:repeating-linear-gradient(135deg,#f28ebd 0 12px,#f5a2c7 12px 24px);border-radius:999px;transition:width .35s ease}
.question-area{min-height:0;display:grid;grid-template-rows:minmax(0,1fr) 58px;gap:10px;padding-top:8px}.question-card{min-height:0;background:#fff;border-radius:28px;overflow:hidden;box-shadow:0 16px 50px rgba(119,68,94,.12);display:grid;grid-template-rows:42% 58%;border:1px solid #f3dce7}.kr-panel{background:linear-gradient(180deg,#eefaff,#f4fbff);padding:24px 25px;display:flex;align-items:center}.kr-panel p{margin:0;font-size:clamp(18px,4.6vw,27px);line-height:1.55;font-weight:700;letter-spacing:-.35px}.en-panel{position:relative;padding:22px 24px 26px;display:flex;align-items:center}.english-sentence{margin:0;font-size:clamp(22px,5.2vw,31px);line-height:1.55;font-weight:700;letter-spacing:-.35px}.source-badge{position:absolute;right:20px;bottom:12px;color:#d4ccd0;font-size:10px}
.cloze{display:inline-flex;align-items:center;justify-content:flex-start;vertical-align:-.22em;width:clamp(66px,calc(var(--chars) * .68em + 1.2em),310px);height:1.55em;margin:0 .09em;padding:0 .38em;border-radius:.40em;background:linear-gradient(#deedff,#d5e8ff);box-shadow:inset 0 -3px 0 var(--blueEdge),0 3px 9px rgba(90,133,180,.08);white-space:nowrap;overflow:hidden;transition:.2s}.cloze-text{font:inherit;font-weight:780;letter-spacing:.01em;color:#59484f;white-space:nowrap}.cloze.empty .cloze-text:after{content:"";display:inline-block;width:2px;height:.92em;background:#347aff;animation:caret 1s steps(1) infinite;vertical-align:-.08em}.cloze.correct{background:#daf6eb;box-shadow:inset 0 -3px 0 #5ec4a0}.cloze.correct .cloze-text{color:#18976a}.cloze.wrong{background:#ffe5e8;box-shadow:inset 0 -3px 0 #ef6571;animation:shake .38s ease}.cloze.hint .cloze-text{color:#6b64d8}@keyframes caret{50%{opacity:0}}@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-7px)}50%{transform:translateX(6px)}75%{transform:translateX(-3px)}}.question-card.correct-burst{animation:correctCard .55s cubic-bezier(.2,.9,.2,1.15)}@keyframes correctCard{45%{transform:scale(1.012);box-shadow:0 22px 64px rgba(36,176,126,.20)}}
.status-bar,.answer-bar{height:58px;background:#ffffffed;border-radius:20px;display:grid;grid-template-columns:110px 1fr 110px;align-items:center;overflow:hidden;box-shadow:0 7px 22px rgba(90,55,74,.07)}.status-action{height:100%;border:0;background:transparent;color:#9285df;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.status-action+*{border-left:1px solid #eee6eb}.status-action span{font-size:20px;font-weight:900}.status-action b{font-size:10px}.status-center{text-align:center;padding:0 8px;border-left:1px solid #eee6eb;border-right:1px solid #eee6eb}.status-center span{font-size:10px;color:#9b8c95}.status-center span.warn{color:#df5f69;font-weight:850}.status-center span.good{color:#249c72;font-weight:850}.answer-bar{grid-template-columns:1fr 1.1fr 1fr}.result-small,.next-btn{height:100%;border:0;background:transparent;font-size:10px;font-weight:900;color:#8173df}.next-btn{background:linear-gradient(135deg,#9a5cf2,#6459f7);color:#fff;font-size:12px}.answer-chip{justify-self:center;background:#6658f3;color:#fff;border-radius:15px;padding:9px 14px;font-size:20px;font-weight:750;box-shadow:0 6px 14px rgba(101,88,243,.24);animation:answerPop .4s cubic-bezier(.2,1.1,.2,1)}@keyframes answerPop{from{transform:scale(.65) translateY(7px);opacity:0}to{transform:none;opacity:1}}
.keyboard-panel{background:linear-gradient(#f4f4f8,#e5e6ec);margin:10px -14px 0;padding:9px 6px calc(8px + env(safe-area-inset-bottom));border-top:1px solid #d6d8df;display:grid;gap:7px;align-content:center;transition:.18s}.key-row{display:grid;grid-template-columns:repeat(10,1fr);gap:5px}.key-row.row2{grid-template-columns:repeat(9,1fr);padding:0 5.5%}.key-row.row3{grid-template-columns:42px repeat(7,1fr) 52px;padding:0 1%}.key{height:clamp(43px,6.3svh,57px);border:0;border-radius:7px;background:#fff;color:#151515;font-size:clamp(20px,5vw,29px);box-shadow:0 1.5px 0 #aeb2bd;display:grid;place-items:center;user-select:none;touch-action:manipulation;transition:transform .06s,background .08s}.key:active,.key.pressed{transform:translateY(2px) scale(.96);background:#e7ddff}.key.special{font-size:20px;background:#c7cbd5}.keyboard-panel.disabled .key{opacity:.46;pointer-events:none}.keyboard-panel.hint-pulse{animation:keyGlow .5s ease}@keyframes keyGlow{50%{filter:brightness(1.05);transform:translateY(-2px)}}
.combo-pop{position:fixed;left:50%;top:39%;transform:translate(-50%,-50%);z-index:170;background:linear-gradient(135deg,#ff8cbd,#7b60fa);color:white;border-radius:22px;padding:14px 24px;font-size:31px;font-weight:1000;box-shadow:0 18px 45px rgba(122,79,181,.28);animation:comboIn .75s cubic-bezier(.2,1.25,.2,1) both}.combo-pop[hidden]{display:none}@keyframes comboIn{0%{opacity:0;transform:translate(-50%,-50%) scale(.35) rotate(-8deg)}55%{opacity:1;transform:translate(-50%,-50%) scale(1.13) rotate(3deg)}100%{opacity:0;transform:translate(-50%,-70%) scale(.94)}}.xp-pop{position:fixed;left:50%;top:30%;z-index:171;color:#fff;background:#222;border-radius:999px;padding:7px 12px;font-size:12px;font-weight:900;animation:xpFly .8s ease both}.xp-pop[hidden]{display:none}@keyframes xpFly{from{opacity:0;transform:translate(-50%,10px) scale(.7)}35%{opacity:1}to{opacity:0;transform:translate(-50%,-38px) scale(1.05)}}.screen-flash{position:fixed;inset:0;z-index:160;pointer-events:none;opacity:0}.screen-flash.good{background:#65e0ae;animation:flash .38s ease}.screen-flash.bad{background:#ff7580;animation:flash .38s ease}@keyframes flash{0%{opacity:0}28%{opacity:.17}100%{opacity:0}}.particles{position:fixed;inset:0;z-index:165;pointer-events:none;overflow:hidden}.particle{position:absolute;width:9px;height:9px;border-radius:3px;background:#f58db7;animation:particle .75s ease-out forwards}.particle:nth-child(3n){background:#7c66fb}.particle:nth-child(3n+1){background:#62cba7}@keyframes particle{to{transform:translate(var(--dx),var(--dy)) rotate(260deg) scale(.2);opacity:0}}
.finish-panel{position:fixed;inset:0;z-index:180;background:linear-gradient(#f8d2e4,#fff);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;text-align:center}.finish-panel[hidden]{display:none}.finish-star{font-size:64px;color:#bc69a0}.finish-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%;max-width:430px;margin:22px 0}.finish-grid div{background:#fff;border-radius:18px;padding:16px}.finish-grid b{display:block;font-size:20px}.finish-grid span{font-size:9px;color:var(--muted)}
.basic-screen{padding-top:8px}.basic-screen h2{font-size:28px}.search{width:100%;padding:14px;border:1px solid var(--line);border-radius:16px}.word-list{display:grid;gap:8px;margin-top:10px}.word-item{display:flex;justify-content:space-between;text-align:left;width:100%;border:1px solid var(--line);border-radius:16px;background:#fff;padding:14px}.word-item p{font-size:11px;color:var(--muted);margin:5px 0 0}.word-item span{font-size:9px;color:#826e79}.big-number{font-size:46px;font-weight:900}.data-actions{display:grid;gap:8px}.data-actions button,.data-actions label{border:1px solid var(--line);border-radius:14px;background:#faf6f8;padding:12px;text-align:center;font-size:11px;font-weight:800}.weak-row{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:10px 0;font-size:11px}.toast{position:fixed;left:50%;bottom:95px;z-index:300;transform:translate(-50%,18px);opacity:0;background:#3f3239;color:white;border-radius:999px;padding:10px 14px;font-size:10px;font-weight:800;transition:.2s;pointer-events:none}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-height:740px){.learn-screen.active{grid-template-rows:52px 31px minmax(0,1fr) auto;padding-top:calc(5px + env(safe-area-inset-top))}.counter-pill{height:48px}.counter-pill b{font-size:22px}.hud-icon{height:40px;width:40px}.flame{width:40px;height:40px}.question-area{gap:7px;padding-top:5px}.question-card{border-radius:23px}.kr-panel{padding:14px 20px}.en-panel{padding:15px 20px 20px}.kr-panel p{font-size:clamp(16px,4vw,21px)}.english-sentence{font-size:clamp(19px,4.8vw,25px)}.status-bar,.answer-bar{height:50px}.keyboard-panel{gap:5px;padding-top:6px}.key-row{gap:4px}.key{height:43px}.source-badge{bottom:7px}}
@media(max-height:650px){.learn-screen.active{grid-template-rows:47px 28px minmax(0,1fr) auto}.question-card{grid-template-rows:38% 62%}.key{height:38px;font-size:20px}.keyboard-panel{gap:4px}.status-bar,.answer-bar{height:45px}.kr-panel p{font-size:16px}.english-sentence{font-size:19px}.source-badge{display:none}}

.problem-count{text-align:right}.problem-count small{display:block}.problem-count b{display:block;margin-top:3px;color:#8c5470}
.sense-note{margin:3px 0 14px;color:var(--muted);font-size:10px;line-height:1.55}
.day-chip{display:inline-flex;gap:5px;align-items:center}.day-chip .count{font-size:8px;opacity:.72}


/* v4.2 — compact one-screen lesson + full built-in keyboard */
.learn-screen.active{
  grid-template-rows:56px 32px minmax(0,1fr) 178px !important;
  gap:0;
  padding:calc(5px + env(safe-area-inset-top)) 10px env(safe-area-inset-bottom) !important;
}
.game-hud{min-height:0}
.counter-pill{height:50px}
.game-progress-wrap{min-height:0}
.flame{width:40px;height:40px;font-size:20px}
.game-progress{height:11px}

.question-area{
  min-height:0;
  display:grid;
  grid-template-rows:minmax(0,1fr) 52px;
  gap:7px;
  padding:5px 2px 6px;
}
.question-card{
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) !important;
  border-radius:25px;
}
.kr-panel{
  padding:15px 20px 12px !important;
  align-items:flex-start !important;
  min-height:0;
}
.kr-panel p{
  font-size:clamp(16px,4.2vw,23px) !important;
  line-height:1.42 !important;
}
.en-panel{
  min-height:0;
  padding:13px 20px 20px !important;
  align-items:flex-start !important;
  border-top:1px solid #f2edf0;
}
.english-sentence{
  font-size:clamp(19px,4.9vw,28px) !important;
  line-height:1.48 !important;
}
.source-badge{bottom:6px}

.status-bar,.answer-bar{
  height:52px !important;
  grid-template-columns:104px 1fr 104px;
}
.answer-bar{grid-template-columns:1fr 1fr 1fr}
.answer-status{
  height:100%;
  display:grid;
  place-items:center;
  color:#249c72;
  font-size:12px;
  font-weight:900;
  border-left:1px solid #eee6eb;
  border-right:1px solid #eee6eb;
}
.result-small:disabled{opacity:.35}

/* Entire keyboard is always visible as one fixed lesson component. */
.keyboard-panel{
  height:178px;
  min-height:178px;
  max-height:178px;
  margin:0 -10px !important;
  padding:7px 5px calc(6px + env(safe-area-inset-bottom)) !important;
  display:grid !important;
  grid-template-rows:repeat(3,1fr);
  gap:6px !important;
  align-self:end;
  overflow:hidden;
  background:linear-gradient(#f4f4f8,#dfe1e8);
}
.key-row{
  display:flex !important;
  justify-content:center;
  align-items:stretch;
  gap:4px !important;
  padding:0 !important;
  min-width:0;
}
.key{
  min-width:0;
  height:auto !important;
  flex:1 1 0;
  max-width:58px;
  border-radius:7px;
  font-size:clamp(18px,4.5vw,26px) !important;
}
.key-row.row2{padding:0 4.5% !important}
.key-row.row3{padding:0 8% !important}
.key-row.row3 .key[data-action="backspace"]{
  flex:1.35 1 0;
  max-width:72px;
}
.key.physical{
  background:#ded4ff !important;
  transform:translateY(2px) scale(.96);
}

/* Keep every key visible even on short phones. */
@media(max-height:760px){
  .learn-screen.active{grid-template-rows:50px 28px minmax(0,1fr) 154px !important}
  .counter-pill{height:44px}
  .counter-pill b{font-size:21px}
  .hud-icon{width:38px;height:38px}
  .flame{width:35px;height:35px;font-size:18px}
  .question-area{grid-template-rows:minmax(0,1fr) 46px;gap:5px;padding-top:3px}
  .status-bar,.answer-bar{height:46px !important}
  .kr-panel{padding:10px 17px 8px !important}
  .en-panel{padding:9px 17px 15px !important}
  .kr-panel p{font-size:clamp(14px,3.8vw,19px) !important}
  .english-sentence{font-size:clamp(17px,4.4vw,23px) !important}
  .keyboard-panel{height:154px;min-height:154px;max-height:154px;gap:4px !important;padding-top:5px !important}
  .key-row{gap:3px !important}
}
@media(max-height:650px){
  .learn-screen.active{grid-template-rows:44px 24px minmax(0,1fr) 136px !important}
  .counter-pill{height:40px}
  .question-area{grid-template-rows:minmax(0,1fr) 42px}
  .status-bar,.answer-bar{height:42px !important}
  .kr-panel{padding:8px 15px 6px !important}
  .en-panel{padding:7px 15px 12px !important}
  .kr-panel p{font-size:14px !important}
  .english-sentence{font-size:17px !important;line-height:1.4 !important}
  .keyboard-panel{height:136px;min-height:136px;max-height:136px}
}

/* Desktop: comfortable centered lesson while physical keyboard also works. */
@media(min-width:760px){
  .learn-screen.active{padding-left:max(18px,calc((100vw - 720px)/2));padding-right:max(18px,calc((100vw - 720px)/2))}
  .keyboard-panel{margin-left:0 !important;margin-right:0 !important;border-radius:18px 18px 0 0}
  .key{font-size:22px !important}
}


/* v4.3 — reference-style spacing + complete four-row built-in keyboard */
.learn-screen.active{
  height:100dvh;
  min-height:100dvh;
  max-height:100dvh;
  overflow:hidden;
  grid-template-rows:54px 32px minmax(0,1fr) 260px !important;
  gap:0;
  padding:calc(5px + env(safe-area-inset-top)) 10px env(safe-area-inset-bottom) !important;
}
.game-hud{min-height:0}.counter-pill{height:49px}.game-progress-wrap{min-height:0}
.question-area{
  min-height:0;
  display:grid;
  grid-template-rows:minmax(0,1fr) 62px !important;
  gap:9px !important;
  padding:7px 2px 7px !important;
}
.question-card{
  position:relative;
  min-height:0;
  display:grid !important;
  grid-template-rows:42% 58% !important;
  border-radius:28px !important;
  overflow:hidden;
}
/* Restore the comfortable separation in the reference. Only trim edge padding a little. */
.kr-panel{
  padding:20px 23px !important;
  display:flex !important;
  align-items:center !important;
  min-height:0;
}
.kr-panel p{
  margin:0 !important;
  font-size:clamp(18px,4.5vw,26px) !important;
  line-height:1.52 !important;
}
.en-panel{
  position:relative;
  padding:19px 22px 24px !important;
  display:flex !important;
  align-items:center !important;
  min-height:0;
  border-top:0 !important;
}
.english-sentence{
  margin:0 !important;
  font-size:clamp(21px,5.05vw,30px) !important;
  line-height:1.54 !important;
}
.source-badge{right:18px !important;bottom:9px !important}
.study-badge{
  position:absolute;z-index:5;right:15px;top:-1px;
  transform:translateY(-42%);
  min-width:68px;padding:10px 14px;border-radius:18px 18px 18px 5px;
  background:#39b9c7;color:#fff;text-align:center;
  font-size:12px;font-weight:900;box-shadow:0 7px 16px rgba(52,166,183,.18)
}
.study-badge.new{background:#ff5668}
.status-bar,.answer-bar{height:62px !important;grid-template-columns:112px 1fr 112px !important;border-radius:18px !important}
.status-center{height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0 8px !important}
.live-typed,.typed-result{
  min-height:26px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:21px;font-weight:800;color:#6658ef;letter-spacing:.015em;
}
.guide-mini{display:block;min-height:12px;margin-top:1px;font-size:9px;color:#9b8c95;white-space:nowrap}
.guide-mini.warn{color:#df5f69;font-weight:850}.guide-mini.good{color:#249c72;font-weight:850}
.answer-bar{grid-template-columns:1fr 1.15fr 1fr !important}
.typed-result-wrap{height:100%;display:grid;place-items:center;border-left:1px solid #eee6eb;border-right:1px solid #eee6eb}
.result-small,.next-btn{font-size:11px !important}

/* Exact keyboard silhouette: 3 letter rows + bottom space/confirm row. */
.keyboard-panel{
  height:260px !important;min-height:260px !important;max-height:260px !important;
  margin:0 -10px !important;
  padding:7px 6px calc(7px + env(safe-area-inset-bottom)) !important;
  display:grid !important;
  grid-template-rows:repeat(4,minmax(0,1fr)) !important;
  gap:7px !important;
  align-self:end;overflow:hidden;
  background:linear-gradient(#e8e9ee,#d9dbe2) !important;
}
.key-row{display:flex !important;align-items:stretch;justify-content:center;gap:5px !important;padding:0 !important;min-width:0}
.key-row.row2{padding:0 5.2% !important}
.key-row.row3{padding:0 !important}
.key-row.row4{padding:0 !important}
.key{
  height:auto !important;min-width:0 !important;max-width:none !important;
  flex:1 1 0;border-radius:7px !important;font-size:clamp(19px,4.7vw,27px) !important;
  background:#fff !important;color:#111 !important;box-shadow:0 1.5px 0 #9fa3ad !important;
}
.key.modifier,.key.backspace,.key.utility{background:#b9bec9 !important}
.key.modifier{flex:1.15 1 0}.key.backspace{flex:1.2 1 0}
.key.space{flex:5.2 1 0;background:#fff !important;font-size:16px !important}
.key.confirm{flex:2.05 1 0;background:#b9bec9 !important;font-size:16px !important;font-weight:850}
.key.utility{flex:1.55 1 0;font-size:13px !important;color:#333 !important}
.key:active,.key.pressed,.key.physical{transform:translateY(2px) scale(.97) !important;background:#ded4ff !important}
.keyboard-panel.disabled .key{opacity:.58 !important}

/* Keep the entire keyboard visible on shorter phones without collapsing the example card. */
@media(max-height:760px){
 .learn-screen.active{grid-template-rows:49px 28px minmax(0,1fr) 230px !important}
 .question-area{grid-template-rows:minmax(0,1fr) 54px !important;gap:7px !important;padding:5px 2px !important}
 .status-bar,.answer-bar{height:54px !important}
 .kr-panel{padding:16px 20px !important}.en-panel{padding:15px 20px 20px !important}
 .kr-panel p{font-size:clamp(16px,4vw,21px) !important}.english-sentence{font-size:clamp(19px,4.7vw,25px) !important}
 .keyboard-panel{height:230px !important;min-height:230px !important;max-height:230px !important;gap:5px !important;padding-top:5px !important}
 .key-row{gap:4px !important}.live-typed,.typed-result{font-size:19px}
}
@media(max-height:660px){
 .learn-screen.active{grid-template-rows:44px 24px minmax(0,1fr) 205px !important}
 .question-area{grid-template-rows:minmax(0,1fr) 48px !important;gap:5px !important;padding:4px 2px !important}
 .status-bar,.answer-bar{height:48px !important}
 .kr-panel{padding:12px 17px !important}.en-panel{padding:11px 17px 16px !important}
 .kr-panel p{font-size:15px !important}.english-sentence{font-size:18px !important;line-height:1.48 !important}
 .keyboard-panel{height:205px !important;min-height:205px !important;max-height:205px !important;gap:4px !important}
 .key-row{gap:3px !important}.key.space,.key.confirm{font-size:14px !important}.source-badge{display:none}
}
@media(min-width:760px){
 .learn-screen.active{padding-left:max(18px,calc((100vw - 720px)/2)) !important;padding-right:max(18px,calc((100vw - 720px)/2)) !important}
 .keyboard-panel{margin-left:0 !important;margin-right:0 !important;border-radius:18px 18px 0 0}
 .key{font-size:23px !important}.key.space,.key.confirm{font-size:16px !important}
}


/* v4.4 — HUD / spacing / study badge polish */
.learn-screen.active{
  grid-template-rows:46px 44px minmax(0,1fr) 260px !important;
}

/* Top row: only back + sound. No duplicate black counter. */
.game-hud.simple{
  display:grid !important;
  grid-template-columns:44px 1fr 44px !important;
  align-items:center;
  padding:0 3px;
}
.game-hud.simple .hud-icon{
  width:42px !important;
  height:42px !important;
  border-radius:50%;
  background:rgba(255,255,255,.42) !important;
  box-shadow:0 4px 12px rgba(111,70,94,.06);
  font-size:25px !important;
}
.hud-spacer{min-width:0}
.counter-pill,.hud-ring{display:none !important}

/* Reference-like progress composition: flame + 2/82 + one clean bar */
.game-progress-wrap{
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) !important;
  align-items:center;
  gap:10px !important;
  padding:0 8px 2px 3px;
  overflow:visible;
}
.progress-lead{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.flame{
  width:42px !important;
  height:42px !important;
  border-radius:50% !important;
  transform:none !important;
  font-size:21px !important;
  background:linear-gradient(145deg,#f477b4,#ed64a9) !important;
  box-shadow:0 7px 17px rgba(237,100,169,.25) !important;
}
.progress-counter{
  display:block;
  min-width:48px;
  color:#d75896;
  font-size:16px;
  line-height:1;
  font-weight:950;
  letter-spacing:-.25px;
  white-space:nowrap;
  text-shadow:0 1px 0 rgba(255,255,255,.55);
}
.game-progress{
  height:12px !important;
  border-radius:999px !important;
  background:rgba(255,255,255,.64) !important;
  box-shadow:inset 0 1px 3px rgba(159,99,133,.08);
}
.game-progress i{
  box-shadow:0 0 10px rgba(240,112,175,.16);
}

/* Card gets a little breathing room below progress, while preserving the
   reference's large separation between Korean and English sentences. */
.question-area{
  padding:14px 2px 7px !important;
  gap:9px !important;
}
.question-card{
  overflow:visible !important;          /* allows time badge to sit above card */
  grid-template-rows:43% 57% !important;
  border-radius:28px !important;
  box-shadow:0 16px 48px rgba(119,68,94,.11) !important;
}
.kr-panel{
  border-radius:28px 28px 0 0;
  overflow:hidden;
  padding:23px 24px 20px !important;
  align-items:center !important;
}
.en-panel{
  border-radius:0 0 28px 28px;
  overflow:hidden;
  padding:22px 23px 27px !important;
  align-items:center !important;
}
.kr-panel p{
  line-height:1.52 !important;
}
.english-sentence{
  line-height:1.54 !important;
}

/* Time badge floats clearly above/right of the card like the reference badge. */
.study-badge{
  right:14px !important;
  top:-16px !important;
  transform:none !important;
  width:max-content !important;
  min-width:72px !important;
  max-width:132px !important;
  padding:9px 14px !important;
  border-radius:18px 18px 18px 6px !important;
  overflow:visible !important;
  white-space:nowrap !important;
  line-height:1.15 !important;
  font-size:12px !important;
  z-index:20 !important;
  box-shadow:0 8px 18px rgba(52,166,183,.19) !important;
}
.study-badge:after{
  content:"";
  position:absolute;
  right:11px;
  bottom:-6px;
  width:12px;
  height:12px;
  background:inherit;
  transform:rotate(45deg);
  border-radius:2px;
  z-index:-1;
}
.study-badge.new{
  background:#ff5668 !important;
  box-shadow:0 8px 18px rgba(255,86,104,.18) !important;
}

/* Short phones: keep the same visual relationships instead of crushing
   Korean and English panels together. */
@media(max-height:740px){
  .learn-screen.active{
    grid-template-rows:43px 39px minmax(0,1fr) 244px !important;
  }
  .question-area{padding-top:12px !important}
  .question-card{grid-template-rows:42% 58% !important}
  .kr-panel{padding:18px 21px 16px !important}
  .en-panel{padding:18px 21px 22px !important}
  .study-badge{top:-14px !important}
  .flame{width:38px !important;height:38px !important;font-size:19px !important}
  .progress-counter{font-size:15px}
}
@media(max-height:650px){
  .learn-screen.active{
    grid-template-rows:40px 36px minmax(0,1fr) 220px !important;
  }
  .question-card{grid-template-rows:41% 59% !important}
  .kr-panel{padding:14px 18px 12px !important}
  .en-panel{padding:14px 18px 18px !important}
  .study-badge{top:-12px !important}
}

/* v4.5 — resume + CSV data manager */
.resume-card{background:linear-gradient(135deg,#fff,#fff2f7);border-color:#f0d9e4}
.resume-copy{display:flex;align-items:center;justify-content:space-between;gap:12px}
.resume-copy small{display:block;color:var(--muted);font-size:10px;font-weight:800}
.resume-copy b{display:block;margin-top:4px;font-size:18px}
.resume-copy>span{white-space:nowrap;border-radius:999px;padding:7px 10px;background:#f7e8f0;color:#8e6077;font-size:10px;font-weight:850}
.resume-progress{height:8px;background:#f1e7ed;border-radius:999px;overflow:hidden;margin:13px 0 4px}.resume-progress i{display:block;height:100%;width:0;background:linear-gradient(90deg,#ef82b2,#9f85df);border-radius:999px}
.resume-btn{margin-top:10px!important}
.data-manager-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.data-manager-head small{display:block;color:var(--muted);font-size:10px;font-weight:800}.data-manager-head b{display:block;margin-top:4px;font-size:18px}.data-manager-head>span{font-size:9px;color:var(--muted);white-space:nowrap}
.data-help{font-size:10px!important;line-height:1.55;color:var(--muted);margin:12px 0!important}
.csv-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.csv-btn{display:grid;place-items:center;min-height:44px;border:1px solid #eadfe5;border-radius:14px;background:#faf6f8;color:#6f5c67;font-size:11px;font-weight:900;cursor:pointer}.csv-btn.primary-csv{background:#4a3942;color:#fff;border-color:#4a3942}
.csv-status{margin-top:10px;padding:10px 11px;background:#fbf8fa;border-radius:12px;font-size:10px;line-height:1.5;color:#82727c}.csv-status.good{background:#edf8f3;color:#3f7561}.csv-status.warn{background:#fff5e7;color:#986d37}.csv-status.bad{background:#fff0f1;color:#a9535b}
.restore-data-btn{width:100%;margin-top:9px;border:0;background:transparent;color:#9a7d8b;text-decoration:underline;font-size:10px;padding:8px}
@media(max-width:390px){.csv-actions{grid-template-columns:1fr}.data-manager-head{align-items:flex-start;flex-direction:column}.data-manager-head>span{align-self:flex-end}}
