/* SiGaI 3 · a calm, responsive learning space. */
:root{
  --bg:#F8F9FD;--card:#FFF;--card2:#F3F2F8;--ink:#29283E;--ink2:#77758A;
  --hair:#ECEBF2;--dot:#7861CE;--go:#3A9C7E;--good:#278769;--goodbg:#E6F5ED;
  --hot:#CF6069;--gold:#C18A20;--star:#E6B44A;--key:#FFF;--keyink:#29283E;
  --shadow:0 4px 18px rgba(45,39,78,.025);--keyshadow:0 3px 0 #E9E6F1;
  --r:22px;--accent-soft:#EEE9FB;--accent-ink:#6F55BD;--mint:#EBF6F0;--peach:#FFF0E3;
}
html[data-theme="dark"]{
  --bg:#171720;--card:#22222E;--card2:#2B2A39;--ink:#F0EDF8;--ink2:#ABA7BF;
  --hair:#363342;--dot:#B4A0F1;--go:#68CBA8;--good:#68CBA8;--goodbg:#233D34;
  --key:#302E40;--keyink:#F0EDF8;--shadow:0 4px 18px #00000012;--keyshadow:0 3px 0 #15151D;
  --accent-soft:#342C4E;--accent-ink:#C5B3F5;--mint:#263B34;--peach:#44352C;
}
html{scroll-padding-top:24px}
html[data-theme] body{background:var(--bg)}
body{padding:24px 28px calc(100px + env(safe-area-inset-bottom));font-weight:700;transition:none}
body::after,.skybg{display:none}
.wrap{max-width:1160px}
header{margin:0 0 30px;padding:0;min-height:48px;z-index:40}
.mark{width:44px;height:44px;border-radius:14px;background:#7861CE;box-shadow:none}
html[data-theme="dark"] .mark{background:#7861CE}
.brand h1{font-size:25px;letter-spacing:1px}
.brand h1,html[data-theme="dark"] .brand h1{color:var(--ink);text-shadow:none;transition:none}
.brand .sub{font-size:10px;letter-spacing:.2px}
.brand .sub,html[data-theme="dark"] .brand .sub{color:var(--ink2);transition:none}
.header-context{display:none}
.hchips{gap:10px;align-items:center}
.hchip,html[data-theme="dark"] .hchip{box-shadow:none;background:var(--card);color:var(--ink);border:1px solid var(--hair);border-radius:13px;min-height:42px;padding:8px 13px}
.hchip.cold{filter:none;opacity:1}
.hchip .ico{font-size:16px}
.shell-action{width:42px;height:42px;display:grid;place-items:center;border:1px solid var(--hair);border-radius:13px;background:var(--card);color:var(--ink2);cursor:pointer;font:inherit;font-size:13px}
.shell-action svg{width:19px;height:19px}
.card{border:1px solid var(--hair)}
.bigtap,.pad .go,.stepbar .stepbtn.primary{background:#7861CE;box-shadow:0 4px 0 #6250AF;color:#FFF;border-radius:14px}
.bigtap{font-size:15px}
.bigtap:active,.pad .go:active{transform:translateY(2px);box-shadow:0 2px 0 #6250AF}
.ghostbtn{border-radius:13px}
.seg{border-radius:15px}
.seg button{border-radius:11px;font-size:14px;transition:background .18s,color .18s}
.seg button[aria-pressed="true"]{color:var(--accent-ink);box-shadow:0 2px 8px #30225309}
.bar>i{background:var(--dot)}
section.view:focus{outline:none}
.tabbar{border-top:1px solid var(--hair);box-shadow:0 -4px 20px #29283E04}
.tabbar-inner{max-width:640px;gap:4px}
.tabbtn{border-radius:14px;gap:5px;color:var(--ink2);font-size:11px}
.tabbtn[aria-selected="true"]{background:var(--accent-soft);color:var(--accent-ink)}
.tabbtn[aria-selected="true"] svg,.tabbtn[aria-selected="true"] .tabav{transform:none}
.nav-caption,.nav-footer{display:none}
.tabav{font-size:21px}
.tabbtn[aria-selected="true"] .tabav{box-shadow:none}
#viewKira,#viewLukis,#viewKisah,.bl-playing{max-width:640px;margin-left:auto;margin-right:auto}
.bl-playing .bl-card{padding:24px}
.bl-bar{padding:8px 0}
.bl-x,.bl-say{border:1px solid var(--hair)}
.sg-sheet{border:1px solid var(--hair)}
.ob,html[data-theme="dark"] .ob{background:var(--bg)}
.ob-in{padding:16px 0}
.ob-h{color:var(--ink)!important;text-shadow:none!important}
.ob-hero{padding:12px 0}
.ob-langs{grid-template-columns:1fr 1fr}
.ob-lang{font-size:15px}
.ob-lang span{font-size:22px}
.ob-skip,html[data-theme="dark"] .ob-skip{background:var(--card2);color:var(--ink2)}
.ob-body{gap:7px}
button,a,input{touch-action:manipulation}
button{transition:transform .15s ease,background-color .15s ease,border-color .15s ease}
button:disabled{cursor:default}
@media(hover:hover){
  .tabbtn:hover{background:var(--card2)}
  .tabbtn[aria-selected="true"]:hover{background:var(--accent-soft)}
  .bigtap:hover:not(:disabled){background:#6D55C2}
  .shell-action:hover{background:var(--accent-soft);color:var(--accent-ink)}
}
@media(min-width:1050px){
  body{padding:28px 40px 50px 278px}
  header{margin-bottom:30px;min-height:45px}
  header>.mark{position:fixed;left:29px;top:32px;z-index:41}
  header>.brand{position:fixed;left:85px;top:36px;z-index:41;width:138px}
  .header-context{display:block;font-size:13px;color:var(--ink2);font-weight:700}
  .header-context b{color:var(--ink);font-weight:900}
  .tabbar{width:232px;top:0;bottom:0;right:auto;border:0;border-right:1px solid var(--hair);box-shadow:none;padding:117px 18px 24px;display:flex;flex-direction:column}
  .nav-caption{display:block;margin:0 16px 14px;color:var(--ink2);text-transform:uppercase;font-size:10px;font-weight:900;letter-spacing:1.7px}
  .tabbar-inner{display:flex;flex-direction:column;width:100%;margin:0;padding:0;gap:9px}
  .tabbtn{flex-direction:row;min-height:53px;font-size:14px;gap:14px;padding:14px 18px;text-align:left}
  .tabbtn svg,.tabbtn .tabav{width:23px;height:23px;flex:none}
  .nav-footer{display:block;margin-top:auto;padding-top:30px}
  .nav-note{background:var(--accent-soft);border-radius:19px;padding:19px 16px;font-size:12px;line-height:1.6;color:var(--ink2)}
  .nav-note .mascot{margin:-46px auto 4px}
  .nav-note b{display:block;text-align:center;font-size:14px;color:var(--ink);margin-bottom:4px}
  .nav-note p{text-align:center;margin:0}
  .nav-footer .nav-private{font-size:10px;text-align:center;color:var(--ink2);margin-top:18px;line-height:1.7}
}
@media(min-width:1450px){body{padding-left:298px;padding-right:60px}}
@media(max-width:640px){
  body{padding:18px 18px calc(94px + env(safe-area-inset-bottom))}
  header{gap:9px;margin-bottom:25px}
  .mark{width:38px;height:38px;border-radius:12px}.mark svg{width:25px}
  .brand h1{font-size:21px}.brand .sub{font-size:8px}
  .hchips{gap:5px}.hchip{padding:7px 8px;min-height:36px;font-size:12px;border-radius:11px}
  .hchip .ico{font-size:14px}
  .shell-action{width:34px;height:36px;border-radius:11px;font-size:11px}
  #themeToggle{display:none}
  .ob-in{padding:0}.ob-langs{grid-template-columns:1fr}
  .bl-playing .bl-card{padding:17px}
}
@media(max-width:360px){body{padding-left:12px;padding-right:12px}.brand .sub{display:none}.brand h1{font-size:19px}.hchip{padding:6px}.hchips{gap:4px}}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* focus mode for a lesson or practice round on phones and tablets: the tab bar and header
   step aside so the question, answer and keys fit one screen (✕ and Back still leave, after asking) */
@media(max-width:1049px){
  body.sg-immersive .tabbar,body.sg-immersive .wrap>header{display:none}
  body.sg-immersive{padding-top:calc(14px + env(safe-area-inset-top));padding-bottom:calc(20px + env(safe-area-inset-bottom))}
}

/* ---- polish: motion that feels physical and never gets in the way ---- */
html{-webkit-tap-highlight-color:transparent}
/* progress rings fill up when a screen opens */
@property --progress{syntax:'<percentage>';inherits:false;initial-value:0%}
@property --goal{syntax:'<percentage>';inherits:false;initial-value:0%}
@keyframes ring-fill-home{from{--progress:0%}}
@keyframes ring-fill-goal{from{--goal:0%}}
.home-ring{animation:ring-fill-home .9s cubic-bezier(.2,.8,.2,1) .15s backwards}
.sy-goal-ring{animation:ring-fill-goal .9s cubic-bezier(.2,.8,.2,1) .15s backwards}
/* the chosen tab's icon gives a small hop */
@keyframes tab-pop{0%{transform:scale(.82)}60%{transform:scale(1.12)}100%{transform:scale(1)}}
.tabbtn[aria-selected="true"] svg,.tabbtn[aria-selected="true"] .tabav{animation:tab-pop .34s cubic-bezier(.3,1.5,.5,1)}
/* every tappable thing answers the finger at once */
.tabbtn:active,.hchip:active,.shell-action:active,.seg button:active,.sy-badge:active,.ob-lang:active,.ob-av:active,.sy-avpick:active,
.histdel:active,.lt-hintbtn:active,.bl-hintbtn:active,.bl-hintchip:active,.sy-parent-link:active,.kr-again:active,.sy-action:active{transform:scale(.96)}
.sg-sheet{overscroll-behavior:contain}
.sg-sheet-back{touch-action:none}
.sg-sheet-back .sg-sheet{touch-action:pan-y}
html.sg-modal{overflow:hidden}
/* Draw on wide screens: tools on the left, a big board on the right, no scrolling */
@media(min-width:1050px){
  section#viewLukis{max-width:1060px}
  #viewLukis>.card{display:grid;grid-template-columns:minmax(280px,1fr) auto;column-gap:30px;align-items:start}
  #viewLukis>.card>*{grid-column:1}
  #viewLukis .drawzone{grid-column:2;grid-row:1/span 8;width:min(560px,max(320px,calc(100vh - 210px)));margin:0}
}
@media(prefers-reduced-motion:reduce){.home-ring,.sy-goal-ring,.tabbtn[aria-selected="true"] svg{animation:none}}
