
:root{
  --s2e-blue1:#183f9f;
  --s2e-blue2:#1ea7ff;
  --s2e-ink:#123a85;
  --s2e-border:#c8daf8;
  --s2e-gold-bg:#f8f0df;
  --s2e-gold-border:#e7b64d;
  --s2e-gold-text:#8b5a00;
  --s2e-ar:#667ea8;
}
.s2e-vocab-app,.s2e-vocab-app *{box-sizing:border-box}
.s2e-vocab-app{
  width:min(96vw,860px);
  margin:12px auto;
  font-family:Tahoma,Verdana,Arial,sans-serif;
  color:var(--s2e-ink);
}
.s2e-shell{
  background:#f7fbff;
  border:1px solid #d9e7fd;
  border-radius:30px;
  overflow:hidden;
  box-shadow:0 16px 38px rgba(12,51,120,.08);
}
.s2e-top{
  background:linear-gradient(135deg,var(--s2e-blue1) 0%, #2458c2 45%, var(--s2e-blue2) 100%);
  padding:10px 16px;
  min-height:70px;
  display:flex;
  align-items:center;
}
.s2e-count{
  margin-right:auto;
  background:rgba(255,255,255,.12);
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
  border-radius:22px;
  min-width:108px;
  text-align:center;
  padding:11px 16px;
  font-size:21px;
  font-weight:900;
}
.s2e-progress{
  height:7px;
  background:#e8f1fe;
  margin:8px 16px 0;
  border-radius:999px;
  overflow:hidden;
}
.s2e-progress>span{
  display:block;height:100%;
  background:linear-gradient(90deg,#2b6de0 0%, #1fb5ff 100%);
  border-radius:999px;
}
.s2e-body{padding:12px}
.s2e-card{
  min-height:min(68vh,560px);
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  gap:10px;
}
.s2e-row,.s2e-meaning-row{
  display:grid;
  grid-template-columns:1fr 80px;
  gap:10px;
  direction:ltr;
  align-items:stretch;
}
.s2e-box{
  border-radius:24px;
  border:2px solid var(--s2e-border);
  background:#fff;
  min-height:88px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:10px 14px;
  cursor:pointer;
  user-select:none;
  box-shadow:0 10px 22px rgba(20,61,130,.05);
}
.s2e-box-main .s2e-word{
  color:#1950b1;
  font-size:64px;
  line-height:1;
  font-weight:900;
}
.s2e-box-alt{
  background:var(--s2e-gold-bg);
  border-color:var(--s2e-gold-border);
}
.s2e-box-alt .s2e-word{
  color:var(--s2e-gold-text);
  font-size:52px;
  line-height:1;
  font-weight:900;
}
.s2e-speak-btn{
  border:none;
  border-radius:22px;
  min-height:88px;
  background:linear-gradient(180deg,#183f9f 0%, #1ea7ff 100%);
  color:#fff;
  font-size:34px;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(20,61,130,.12);
}
.s2e-speak-btn.ar{
  background:linear-gradient(180deg,#6b54c8 0%, #9f7dff 100%);
  box-shadow:0 10px 22px rgba(99,73,180,.15);
}
.s2e-box:active,.s2e-speak-btn:active,.s2e-nav:active{transform:scale(.985)}
.s2e-meaning{
  border-radius:24px;
  border:2px solid var(--s2e-border);
  background:#fff;
  padding:10px 14px 12px;
  text-align:center;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(20,61,130,.04);
}
.s2e-meaning-label{
  font-size:16px;
  color:#8198bf;
  font-weight:800;
  margin-bottom:2px;
}
.s2e-meaning-text{
  font-size:34px;
  color:var(--s2e-ar);
  font-weight:900;
  line-height:1.2;
}
.s2e-actions{
  margin-top:8px;
  padding-top:10px;
  border-top:1px solid #dfeafc;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  direction:ltr;
}
.s2e-nav{
  min-height:74px;
  border:none;
  border-radius:24px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:900;
  box-shadow:0 12px 24px rgba(20,61,130,.08);
}
.s2e-nav-main{
  background:linear-gradient(180deg,#183f9f 0%, #18b2ff 100%);
  color:#fff;
}
.s2e-nav-lite{
  background:#f4f8ff;
  color:#35568f;
  border:2px solid #d3e2ff;
}
.s2e-nav.disabled{
  opacity:.45;
  cursor:not-allowed;
}
.s2e-ar-big{display:block;font-size:30px;line-height:1.05}
.s2e-en-small{display:block;font-size:17px;line-height:1.05;margin-top:4px}
.s2e-question{
  border-radius:24px;
  border:2px solid var(--s2e-border);
  background:#fff;
  box-shadow:0 10px 22px rgba(20,61,130,.05);
  padding:14px 16px;
  font-size:28px;
  line-height:1.2;
  font-weight:900;
  color:#183f8f;
  direction:ltr;
  text-align:left;
}
.s2e-hl{
  display:inline-block;
  padding:2px 10px;
  border-radius:16px;
  background:linear-gradient(180deg,#ffe68e 0%, #ffd768 100%);
  border:2px solid #f0c252;
  color:#8a5800;
}
.s2e-options{display:grid;gap:8px}
.s2e-opt{
  direction:ltr;
  display:grid;
  grid-template-columns:70px 1fr;
  gap:12px;
  align-items:center;
  border:2px solid var(--s2e-border);
  background:#fff;
  border-radius:22px;
  min-height:72px;
  padding:10px 12px;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(20,61,130,.04);
}
.s2e-opt.locked{cursor:default}
.s2e-opt-letter{
  width:54px;height:54px;border-radius:16px;
  border:2px solid var(--s2e-border);
  display:flex;align-items:center;justify-content:center;
  font-size:26px;font-weight:900;color:#183f8f;background:#f7fbff;
}
.s2e-opt-text{
  font-size:23px;
  font-weight:900;
  color:#183f8f;
  text-align:left;
}
.s2e-opt.correct{border-color:#58c06d;background:#f7fff8}
.s2e-opt.correct .s2e-opt-letter{background:#58c06d;color:#fff;border-color:#58c06d}
.s2e-opt.correct .s2e-opt-letter::after{content:"✓";margin-left:3px;font-size:20px}
.s2e-opt.wrong{border-color:#ea7f7f;background:#fff8f8}
.s2e-opt.wrong .s2e-opt-letter{background:#ea7f7f;color:#fff;border-color:#ea7f7f}
.s2e-opt.wrong .s2e-opt-letter::after{content:"✕";margin-left:3px;font-size:18px}
.s2e-result{
  border-radius:24px;
  border:2px solid #d7e5ff;
  background:#fff;
  padding:18px;
  text-align:center;
  box-shadow:0 10px 22px rgba(20,61,130,.05);
}
.s2e-score-title{color:#183f8f;font-size:28px;font-weight:900;margin-bottom:8px}
.s2e-score-main{color:#18b2ff;font-size:54px;font-weight:900;line-height:1}
.s2e-score-sub{color:#59739d;font-size:22px;font-weight:800;margin-top:8px}
@media (max-width:768px){
  .s2e-vocab-app{width:min(100vw - 10px,100%);margin:8px auto}
  .s2e-shell{border-radius:24px}
  .s2e-top{padding:8px 12px;min-height:62px}
  .s2e-count{min-width:92px;padding:9px 12px;font-size:18px;border-radius:18px}
  .s2e-progress{margin:6px 12px 0}
  .s2e-body{padding:10px}
  .s2e-card{min-height:min(67vh,620px);gap:8px}
  .s2e-row,.s2e-meaning-row{grid-template-columns:1fr 64px;gap:8px}
  .s2e-box,.s2e-speak-btn{min-height:66px;border-radius:20px}
  .s2e-box-main .s2e-word{font-size:44px}
  .s2e-box-alt .s2e-word{font-size:38px}
  .s2e-speak-btn{font-size:26px}
  .s2e-meaning{padding:8px 12px 10px;border-radius:20px}
  .s2e-meaning-label{font-size:13px}
  .s2e-meaning-text{font-size:24px}
  .s2e-actions{gap:10px;margin-top:8px;padding-top:10px;border-top:1px solid #dfeafc}
  .s2e-nav{min-height:62px;border-radius:20px}
  .s2e-ar-big{font-size:22px}
  .s2e-en-small{font-size:13px}
  .s2e-question{padding:12px;font-size:21px;line-height:1.16;border-radius:20px}
  .s2e-options{gap:7px}
  .s2e-opt{min-height:58px;grid-template-columns:52px 1fr;gap:9px;border-radius:20px}
  .s2e-opt-letter{width:42px;height:42px;border-radius:14px;font-size:21px}
  .s2e-opt-text{font-size:19px}
  .s2e-result{padding:16px;border-radius:20px}
  .s2e-score-title{font-size:23px}
  .s2e-score-main{font-size:42px}
  .s2e-score-sub{font-size:18px}
}


/* v2 stability: single source of truth for layout previously duplicated in engine.js */
.s2e-card{position:relative;overflow:visible;padding-bottom:20px}
.s2e-opt{grid-template-columns:70px 1fr 45px;padding-right:5px}
.s2e-opt-speak{
  background:transparent;border:none;font-size:26px;cursor:pointer;transition:.2s;
  opacity:.6;padding:0;display:flex;align-items:center;justify-content:center
}
.s2e-opt-speak:hover{opacity:1;transform:scale(1.15)}
.s2e-opt-speak:active{transform:scale(.9)}
@media (max-width:768px){
  .s2e-opt{grid-template-columns:52px 1fr 40px}
}

/* =========================================================
   S2E Vocabulary Mobile Stability — 2026-09-29
   Mobile only: keep the bottom controls inside the card and
   hide the legacy floating "return to timetable" control.
========================================================= */
#s2e-return-to-table,
#s2e-return-to-timetable,
#s2e-back-to-table,
#s2e-back-to-timetable,
.s2e-return-to-table,
.s2e-return-to-timetable,
.s2e-back-to-table,
.s2e-back-to-timetable,
.s2e-table-return,
.s2e-timetable-return{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

@media (max-width:768px){
  html,body{max-width:100%!important;overflow-x:hidden!important}
  .s2e-vocab-app{
    width:100%!important;
    max-width:100%!important;
    margin:6px auto!important;
    padding:0 6px max(10px,env(safe-area-inset-bottom))!important;
    overflow:visible!important;
  }
  .s2e-shell{
    width:100%!important;
    max-width:100%!important;
    border-radius:22px!important;
    overflow:hidden!important;
  }
  .s2e-header-split-v2{
    width:100%!important;
    margin:8px auto 10px!important;
    padding:0 8px!important;
    gap:7px!important;
    flex-wrap:wrap!important;
  }
  .s2e-body{
    padding:8px 8px 10px!important;
    overflow:visible!important;
  }
  .s2e-card{
    min-height:0!important;
    height:auto!important;
    gap:9px!important;
    overflow:visible!important;
    padding-bottom:max(14px,env(safe-area-inset-bottom))!important;
  }
  .s2e-top-badges{margin-bottom:5px!important}
  .s2e-question{
    font-size:20px!important;
    line-height:1.25!important;
    padding:12px 14px!important;
    border-radius:20px!important;
  }
  .s2e-options{gap:7px!important}
  .s2e-opt{
    min-height:56px!important;
    grid-template-columns:48px minmax(0,1fr) 38px!important;
    gap:8px!important;
    padding:8px 8px!important;
    border-radius:18px!important;
  }
  .s2e-opt-letter{
    width:42px!important;
    height:42px!important;
    border-radius:13px!important;
    font-size:21px!important;
  }
  .s2e-opt-text{
    min-width:0!important;
    font-size:19px!important;
    line-height:1.2!important;
    overflow-wrap:anywhere!important;
  }
  .s2e-opt-speak{font-size:23px!important}
  .s2e-actions{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    width:100%!important;
    margin:8px 0 0!important;
    padding:10px 0 max(6px,env(safe-area-inset-bottom))!important;
    gap:9px!important;
    z-index:2!important;
  }
  .s2e-nav{
    min-width:0!important;
    min-height:58px!important;
    padding:8px 9px!important;
    border-radius:18px!important;
  }
  .s2e-ar-big{font-size:21px!important;line-height:1.1!important}
  .s2e-en-small{font-size:12px!important;line-height:1.05!important}
  .s2e-countdown-bar,.s2e-timer-bar{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    margin-top:2px!important;
    border-radius:999px!important;
  }
}
