/* Additive Premium Chines enhancements: lightweight, no large blur/filter loops. */
.btn-cont.gh-settings-btn-wrap{display:flex;align-items:center;justify-content:center;height:auto;background:#1e1e1e;margin:0;border:1px solid rgba(255,255,255,.35);border-radius:10px;position:relative;z-index:12}
.gh-settings-btn-wrap .button{background:none;border:0;cursor:pointer;padding:9px;border-radius:7px;position:relative;color:#e8eaed;transition:background-color .2s ease}
.gh-settings-btn-wrap .button:hover{background:rgba(255,255,255,.09)}
.gh-settings-btn-wrap .settings-btn{display:block;transition:transform .35s ease-in}
.gh-settings-btn-wrap .button:hover .settings-btn{transform:rotate(60deg)}
.gh-settings-btn-wrap .tooltip{visibility:hidden;width:90px;background:#05070a;color:#fff;text-align:center;border-radius:6px;padding:5px;position:absolute;z-index:50;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);margin:0;opacity:0;transition:opacity .2s;pointer-events:none;font-size:12px}
.gh-settings-btn-wrap .button:hover .tooltip{visibility:visible;opacity:1}

/* Cyber / diagonal navigation */
.controls .cyber-nav-btn{position:relative;isolation:isolate;overflow:hidden;border:1px solid rgba(61,220,255,.38)!important;border-radius:8px!important;background:linear-gradient(135deg,rgba(8,20,36,.96),rgba(15,37,58,.94))!important;color:#dff9ff!important;clip-path:polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%);box-shadow:inset 0 0 0 1px rgba(255,255,255,.035),0 5px 14px rgba(0,0,0,.12)!important;transition:transform .18s ease,filter .18s ease,box-shadow .18s ease!important}
.controls .cyber-nav-btn::before{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 0 42%,rgba(0,234,255,.14) 43% 47%,transparent 48%);transform:translateX(-110%);transition:transform .35s ease;z-index:-1}
.controls .cyber-nav-btn:hover::before{transform:translateX(110%)}
.controls .cyber-nav-btn:hover{transform:translateY(-1px)!important;filter:brightness(1.08);box-shadow:0 7px 18px rgba(0,160,255,.14)!important}
.controls .cyber-nav-btn.active{border-color:#00e5ff!important;background:linear-gradient(135deg,#102b42,#173d55)!important;box-shadow:inset 0 0 14px rgba(0,229,255,.12),0 0 0 1px rgba(0,229,255,.12)!important}
body:not(.dark-mode) .controls .cyber-nav-btn{background:linear-gradient(135deg,#172c40,#214b64)!important}

.gh-modal[hidden]{display:none}.gh-modal{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:18px}.gh-modal-backdrop{position:absolute;inset:0;background:rgba(3,10,18,.68)}
.gh-modal-card{position:relative;width:min(760px,96vw);max-height:min(760px,92vh);overflow:auto;border:1px solid rgba(0,229,255,.2);border-radius:22px;background:#0b1624;color:#e8f7ff;box-shadow:0 20px 70px rgba(0,0,0,.36)}
.gh-modal-head{display:flex;justify-content:space-between;gap:20px;padding:24px 24px 16px}.gh-modal-head h2{margin:3px 0 5px}.gh-modal-head p{margin:0;color:#9eb5c8;font-size:13px}.gh-mini-kicker{font-size:10px;letter-spacing:1.5px;color:#32d9ff;font-weight:900}.gh-close{border:1px solid #29465a;background:#102334;color:#fff;width:38px;height:38px;border-radius:12px;font-size:25px;cursor:pointer}
.gh-tabs{display:flex;gap:7px;padding:0 20px;border-bottom:1px solid #20384c;overflow:auto}.gh-tab{white-space:nowrap;border:0;background:transparent;color:#8fa8bb;padding:12px 14px;font-weight:800;cursor:pointer;border-bottom:2px solid transparent}.gh-tab.active{color:#6feaff;border-bottom-color:#00dcff}.gh-panel{display:none;padding:20px}.gh-panel.active{display:block}
.gh-setting-list{display:grid;gap:10px}.gh-setting-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:15px;border:1px solid #20384c;border-radius:15px;background:#0e1d2c}.gh-setting-row b,.gh-setting-row small{display:block}.gh-setting-row small{margin-top:4px;color:#8da5b7;font-size:12px}.gh-setting-row input{appearance:none;width:48px;height:26px;border-radius:99px;background:#314657;position:relative;cursor:pointer;flex:0 0 auto}.gh-setting-row input::after{content:"";position:absolute;width:20px;height:20px;top:3px;left:4px;border-radius:50%;background:#fff;transition:transform .2s}.gh-setting-row input:checked{background:#00a9c8}.gh-setting-row input:checked::after{transform:translateX(20px)}.gh-reset-settings{margin-top:15px;border:1px solid #2d4b60;background:#102334;color:#d8f6ff;padding:10px 14px;border-radius:10px;cursor:pointer}
.gh-profile-card{display:flex;gap:22px;align-items:center}.gh-avatar-wrap{text-align:center;min-width:130px}.gh-avatar-wrap img{width:112px;height:112px;border-radius:50%;object-fit:cover;border:2px solid #21d5f5;background:#102334}.gh-avatar-upload{display:block;margin-top:9px;font-size:12px;color:#65e5ff;cursor:pointer}.gh-avatar-upload input{display:none}.gh-profile-form{flex:1;display:grid;gap:11px}.gh-profile-form label{font-size:12px;color:#9eb5c8;font-weight:700}.gh-profile-form input{display:block;width:100%;box-sizing:border-box;margin-top:6px;border:1px solid #29465a;border-radius:11px;background:#0a1724;color:#fff;padding:12px}.gh-primary{border:0;border-radius:11px;padding:11px 15px;background:linear-gradient(135deg,#00b9d8,#006a9a);color:#fff;font-weight:900;cursor:pointer}.gh-primary:disabled{opacity:.6}.gh-status{font-size:12px;color:#7fe8a9}
.gh-honor{display:flex;align-items:center;gap:14px;padding:17px;border-radius:17px;background:linear-gradient(135deg,#132f3d,#102031);border:1px solid rgba(255,214,88,.25);margin-bottom:17px}.gh-honor>span{font-size:36px}.gh-honor small{display:block;color:#ffd75a;font-weight:900;letter-spacing:1px;font-size:10px}.gh-honor strong{display:block;font-size:18px;margin-top:3px}.gh-honor p{margin:2px 0 0;color:#9fc0d1;font-size:12px}.gh-ranking-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.gh-rank-filter{border:1px solid #29465a;background:#0e1d2c;color:#91a9ba;padding:7px 10px;border-radius:9px;cursor:pointer}.gh-rank-filter.active{background:#073e51;color:#70eaff;border-color:#00b8da}.gh-ranking-list{display:grid;gap:7px}.gh-rank-row{display:grid;grid-template-columns:38px 36px 1fr auto;align-items:center;gap:10px;padding:9px 11px;border:1px solid #20384c;border-radius:12px;background:#0d1b29}.gh-rank-row.top{border-color:rgba(255,215,90,.35)}.gh-rank-row img{width:34px;height:34px;border-radius:50%;object-fit:cover;background:#182c3c}.gh-rank-no{font-weight:900;text-align:center}.gh-rank-name b,.gh-rank-name small{display:block}.gh-rank-name small{color:#7892a4;font-size:11px;margin-top:2px}.gh-rank-row>strong{font-size:13px;color:#72e8ff}.gh-empty{padding:28px;text-align:center;color:#829aac;border:1px dashed #29465a;border-radius:14px}.gh-ranking-note{display:block;color:#718b9d;font-size:11px;line-height:1.5;margin-top:12px}
body.gh-modal-open{overflow:hidden}
.gh-compact .container{max-width:1120px}.gh-compact .controls{gap:5px!important}.gh-compact .controls button{padding:7px 9px!important}.gh-compact main>section{padding-top:12px}.gh-no-motion *, .gh-no-motion *::before, .gh-no-motion *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}.gh-no-shadow .gh-modal-card,.gh-no-shadow .gh-rank-row,.gh-no-shadow .gh-setting-row{box-shadow:none!important}
@media(max-width:680px){.gh-modal{padding:8px}.gh-modal-card{max-height:96vh;border-radius:18px}.gh-modal-head{padding:18px 16px 12px}.gh-tabs{padding:0 10px}.gh-panel{padding:14px}.gh-profile-card{align-items:stretch;flex-direction:column}.gh-avatar-wrap{min-width:0}.gh-ranking-head{align-items:flex-start;flex-direction:column}.gh-rank-row{grid-template-columns:30px 32px 1fr auto}.controls .cyber-nav-btn{clip-path:none;border-radius:10px!important}}


/* V4: compact settings icon beside the dark-mode toggle.
   Intentionally not a fixed square/container and does not stay fixed on screen. */
.gh-settings-btn-wrap{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  margin:0 0 0 4px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  position:relative!important;
}
.gh-settings-btn-wrap .button{
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  padding:5px!important;
  margin:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  color:inherit!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.gh-settings-btn-wrap .settings-btn{
  width:20px!important;
  height:20px!important;
}
.gh-settings-btn-wrap .button:hover{
  background:rgba(128,128,128,.12)!important;
}
@media (max-width:600px){
  .gh-settings-btn-wrap{margin-left:2px!important}
  .gh-settings-btn-wrap .button{padding:4px!important}
  .gh-settings-btn-wrap .settings-btn{width:19px!important;height:19px!important}
}


/* V5: align the Settings close (X) button */
.gh-settings-modal .gh-settings-close,
#gh-settings-modal .gh-settings-close,
.gh-settings-panel .gh-settings-close{
  position:absolute!important;
  top:12px!important;
  right:12px!important;
  left:auto!important;
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  box-sizing:border-box!important;
  transform:none!important;
  z-index:20!important;
}
.gh-settings-modal .gh-settings-close svg,
#gh-settings-modal .gh-settings-close svg,
.gh-settings-panel .gh-settings-close svg{
  display:block!important;
  margin:auto!important;
  width:18px!important;
  height:18px!important;
}


/* V6: compact hamburger menu beside HSK selector */
.gh-nav-menu-wrap{position:relative;display:inline-flex;align-items:center;margin-left:4px;z-index:120}
.gh-hamburger-btn{width:38px;height:38px;padding:7px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;border:1px solid rgba(128,128,128,.35);border-radius:10px;background:transparent;color:inherit;cursor:pointer;transition:.2s}
.gh-hamburger-btn:hover{transform:translateY(-1px);box-shadow:0 5px 16px rgba(0,0,0,.12)}
.gh-hamburger-btn span{display:block;width:20px;height:2px;border-radius:2px;background:currentColor;transition:.2s}
.gh-hamburger-btn[aria-expanded="true"] span:nth-child(1){transform:translateY(6px) rotate(45deg)}
.gh-hamburger-btn[aria-expanded="true"] span:nth-child(2){opacity:0}
.gh-hamburger-btn[aria-expanded="true"] span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
.gh-nav-menu{position:absolute;top:calc(100% + 8px);left:0;width:205px;padding:7px;border:1px solid rgba(128,128,128,.25);border-radius:14px;background:var(--card-bg,#fff);box-shadow:0 12px 30px rgba(0,0,0,.16);display:grid;gap:4px}
.gh-nav-menu[hidden]{display:none}
.gh-nav-item{width:100%;padding:10px 12px;border:0;border-radius:9px;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer;display:flex;align-items:center;gap:9px}
.gh-nav-item:hover{background:rgba(128,128,128,.12)}
.dark-mode .gh-nav-menu,.dark-theme .gh-nav-menu{background:#171a20;color:#fff}
@media(max-width:600px){.gh-nav-menu{left:auto;right:0;width:190px}.gh-hamburger-btn{width:36px;height:36px}}

/* V7: one compact hamburger menu next to HSK selector */
.controls{overflow:visible!important;z-index:100!important}
.gh-hsk-picker{display:inline-flex;align-items:center;gap:6px}
.gh-hsk-label{font-size:12px;font-weight:800;opacity:.75;white-space:nowrap}
.gh-nav-menu-wrap{position:relative!important;display:inline-flex!important;align-items:center!important;z-index:9999!important}
.gh-hamburger-btn{width:40px!important;height:40px!important;padding:8px!important;border:1px solid rgba(128,128,128,.28)!important;border-radius:10px!important;background:var(--card-bg,#fff)!important;color:inherit!important}
.gh-nav-menu{position:absolute!important;top:calc(100% + 7px)!important;left:0!important;width:230px!important;max-height:70vh;overflow:auto;padding:8px!important;display:grid!important;gap:3px!important;background:var(--card-bg,#fff)!important;color:inherit!important;border:1px solid rgba(128,128,128,.22)!important;border-radius:14px!important;box-shadow:0 18px 45px rgba(0,0,0,.2)!important}
.gh-nav-menu[hidden]{display:none!important}
.gh-nav-title{font-size:10px;font-weight:900;letter-spacing:1px;opacity:.55;padding:6px 10px 5px}
.gh-nav-item{min-height:40px!important;width:100%!important;padding:9px 11px!important;border:0!important;border-radius:9px!important;background:transparent!important;color:inherit!important;text-align:left!important;font:inherit!important;cursor:pointer!important;display:flex!important;align-items:center!important;gap:9px!important}
.gh-nav-item:hover{background:rgba(128,128,128,.12)!important;transform:none!important}
.gh-nav-divider{height:1px;background:rgba(128,128,128,.18);margin:4px 3px}
.dark-mode .gh-nav-menu,.dark-theme .gh-nav-menu,body.dark-mode .gh-nav-menu{background:#171a20!important;color:#fff!important}
@media(max-width:600px){.gh-hsk-label{display:none}.gh-nav-menu{left:auto!important;right:0!important;width:210px!important}.gh-hamburger-btn{width:36px!important;height:36px!important}}


/* V8: make the requested menu visibly sit beside HSK and stay above old controls. */
.controls{position:relative!important;overflow:visible!important;display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;z-index:500!important}
.gh-hsk-picker{position:relative!important;z-index:501!important}
.gh-nav-menu-wrap{position:relative!important;display:inline-flex!important;flex:0 0 auto!important;z-index:10000!important}
#gh-nav-menu-toggle{display:inline-flex!important;visibility:visible!important;opacity:1!important;position:relative!important;z-index:10001!important}
#gh-nav-menu{z-index:10002!important}


/* V9: FINAL UI FIXES — menu must never be clipped; flashcard must never hide text/buttons. */
.container>header{
  overflow:visible!important;
  isolation:isolate;
}
.container>header .controls{
  overflow:visible!important;
  position:relative!important;
  z-index:500!important;
}
.gh-nav-menu-wrap{
  position:relative!important;
  z-index:100000!important;
  overflow:visible!important;
}
#gh-nav-menu-toggle{
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  padding:0!important;
  border-radius:8px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  flex:0 0 42px!important;
  color:#244466!important;
  background:rgba(255,255,255,.94)!important;
  border:1px solid rgba(82,139,202,.24)!important;
}
#gh-nav-menu-toggle span{
  width:22px!important;
  height:2px!important;
  background:currentColor!important;
}
body.dark-mode #gh-nav-menu-toggle,
body.dark-theme #gh-nav-menu-toggle{
  color:#f4f8ff!important;
  background:#17283c!important;
  border-color:rgba(160,200,240,.25)!important;
}
#gh-nav-menu{
  top:calc(100% + 9px)!important;
  left:0!important;
  right:auto!important;
  width:250px!important;
  max-width:min(250px,calc(100vw - 24px))!important;
  max-height:min(70vh,520px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  z-index:100001!important;
  box-sizing:border-box!important;
  background:#fff!important;
  color:#173a63!important;
}
.gh-nav-title{color:#6f8197!important}
.gh-nav-item{
  color:#173a63!important;
  background:transparent!important;
  white-space:nowrap!important;
  overflow:visible!important;
}
.gh-nav-item span{color:inherit!important}
.gh-nav-item:hover{background:rgba(44,137,231,.10)!important;color:#0d72d8!important}
body.dark-mode #gh-nav-menu,
body.dark-theme #gh-nav-menu{
  background:#101c2b!important;
  color:#f4f8ff!important;
  border-color:#2c4661!important;
  box-shadow:0 18px 45px rgba(0,0,0,.48)!important;
}
body.dark-mode .gh-nav-title,
body.dark-theme .gh-nav-title{color:#9fb2c7!important}
body.dark-mode .gh-nav-item,
body.dark-theme .gh-nav-item{color:#f4f8ff!important}
body.dark-mode .gh-nav-item:hover,
body.dark-theme .gh-nav-item:hover{background:rgba(92,171,255,.14)!important;color:#fff!important}

/* V10: precise top-control sizing/alignment.  Only the header controls are enlarged. */
.container > header .controls{
  align-items:center!important;
  gap:9px!important;
}
.container > header .controls #hsk-level{
  width:126px!important;
  min-width:126px!important;
  height:46px!important;
  min-height:46px!important;
  box-sizing:border-box!important;
  padding:0 13px!important;
  border-radius:14px!important;
  line-height:46px!important;
}
.container > header .controls #gh-nav-menu-toggle{
  width:46px!important;
  min-width:46px!important;
  height:46px!important;
  min-height:46px!important;
  flex:0 0 46px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  padding:0!important;
  border-radius:12px!important;
}
.container > header .controls #gh-nav-menu-toggle span{
  display:block!important;
  width:24px!important;
  height:2.5px!important;
  flex:0 0 auto!important;
  margin:0!important;
  border-radius:999px!important;
}
.container > header .controls .gh-settings-btn-wrap{
  width:46px!important;
  min-width:46px!important;
  height:46px!important;
  min-height:46px!important;
  flex:0 0 46px!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:0!important;
  opacity:1!important;
  mask-image:none!important;
  background-image:none!important;
}
.container > header .controls .gh-settings-btn-wrap .button{
  width:46px!important;
  min-width:46px!important;
  height:46px!important;
  min-height:46px!important;
  padding:0!important;
  margin:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
}
.container > header .controls .gh-settings-btn-wrap .settings-btn{
  width:24px!important;
  height:24px!important;
}
.container > header .controls .streak-widget{
  min-width:46px!important;
  width:46px!important;
  height:46px!important;
  min-height:46px!important;
  padding:0!important;
  box-sizing:border-box!important;
  border-radius:12px!important;
  gap:3px!important;
}
.container > header .controls .streak-flame{font-size:18px!important}
.container > header .controls .streak-count{font-size:15px!important}

/* V10: the settings close button is a true square; no inherited button padding can move the X. */
#gh-settings-modal .gh-modal-head{
  align-items:flex-start!important;
}
#gh-settings-modal .gh-close{
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  flex:0 0 44px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  align-self:flex-start!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:0!important;
  line-height:1!important;
  text-align:center!important;
  font-family:Arial,sans-serif!important;
  font-size:28px!important;
  font-weight:400!important;
  transform:none!important;
}
#gh-settings-modal .gh-close:hover,
#gh-settings-modal .gh-close:focus-visible{
  transform:none!important;
}
@media(max-width:600px){
  .container > header .controls #hsk-level{width:116px!important;min-width:116px!important;height:44px!important;min-height:44px!important}
  .container > header .controls #gh-nav-menu-toggle,
  .container > header .controls .gh-settings-btn-wrap,
  .container > header .controls .gh-settings-btn-wrap .button,
  .container > header .controls .streak-widget{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
  .container > header .controls #gh-nav-menu-toggle{flex-basis:44px!important}
  .container > header .controls .gh-settings-btn-wrap{flex-basis:44px!important}
  .container > header .controls .gh-settings-btn-wrap .button{flex-basis:44px!important}
}

/* V11: Flashcard close control matches the other learning modal X buttons. */
.gh-fc-head-actions{display:flex!important;align-items:center!important;gap:8px!important;flex:0 0 auto!important}
.gh-fc-head-actions .gh-primary{margin:0!important}
.gh-fc-close{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;padding:0!important;margin:0!important;border:1px solid rgba(128,128,128,.28)!important;border-radius:12px!important;background:rgba(128,128,128,.10)!important;color:inherit!important;font:400 28px/1 Arial,sans-serif!important;cursor:pointer!important}
.gh-fc-close:hover,.gh-fc-close:focus-visible{transform:none!important}
@media(max-width:600px){.gh-fc-head-actions{gap:6px!important}.gh-fc-close{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}}

/* V13: larger learning menu; profile and leaderboard live outside Settings. */
#gh-nav-menu{
  width:310px!important;
  max-width:min(310px,calc(100vw - 20px))!important;
  padding:10px!important;
  gap:5px!important;
}
#gh-nav-menu .gh-nav-title{font-size:11px!important;padding:9px 12px 7px!important}
#gh-nav-menu .gh-nav-item{
  min-height:52px!important;
  padding:12px 14px!important;
  border-radius:12px!important;
  gap:11px!important;
  font-size:15px!important;
  font-weight:800!important;
}
#gh-nav-menu .gh-nav-item:first-letter{font-size:20px}
#gh-nav-menu .gh-nav-divider{margin:6px 4px!important}

/* V25: single canonical Uiverse-style 3D flashcard; old overlapping flashcard CSS removed. */
#gh-flashcard-panel{
  perspective:1200px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  overflow:visible!important;
  padding:12px 0 24px!important;
}

/* ========================================================
   MODERN 3D CRYSTAL-CLEAR FLASHCARD (NO BLUR, SMOOTH ROTATION)
   ======================================================== */
.gh-fc-scene {
  perspective: 1200px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gh-fc-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 480px;
  min-height: 440px;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 24px;
}

.gh-fc-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 24px;
}

.gh-fc-card.is-flipped .gh-fc-flipper {
  transform: rotateY(180deg);
}

.gh-fc-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 24px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  transform-style: preserve-3d;
  transform: translateZ(1px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 24px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  background: #ffffff;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Light & Dark Modes for Flashcard Face */
body.dark-mode .gh-fc-face {
  background: linear-gradient(155deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(51, 65, 85, 0.8);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.gh-fc-front {
  transform: rotateY(0deg) translateZ(1px);
  z-index: 2;
}

.gh-fc-back {
  transform: rotateY(180deg) translateZ(1px);
  z-index: 1;
  background: linear-gradient(155deg, #f8fafc 0%, #f1f5f9 100%);
}

body.dark-mode .gh-fc-back {
  background: linear-gradient(155deg, #1e2538 0%, #0d1424 100%);
}

/* Flashcard Header */
.gh-fc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
}

.gh-fc-level-pill {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 99px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.gh-fc-level-pill.answer {
  background: #dcfce7;
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.2);
}

body.dark-mode .gh-fc-level-pill {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

body.dark-mode .gh-fc-level-pill.answer {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

.gh-fc-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
}

body.dark-mode .gh-fc-counter {
  color: #94a3b8;
}

/* Flashcard Image / Grammar Tag */
.gh-fc-image-container {
  width: 100%;
  height: 140px;
  max-height: 150px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  margin: 6px 0;
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .gh-fc-image-container {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

.gh-fc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gh-fc-img-tag {
  position: absolute;
  bottom: 6px;
  left: 8px;
  right: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-fc-grammar-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 6px 14px;
  border-radius: 99px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 6px 0;
}

body.dark-mode .gh-fc-grammar-tag {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

/* Flashcard Body */
.gh-fc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px 0;
}

.gh-fc-hanzi-display {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(64px, 15vw, 92px);
  font-weight: 900;
  line-height: 1.1;
  color: #1e293b;
  letter-spacing: 2px;
  text-shadow: none;
}

body.dark-mode .gh-fc-hanzi-display {
  color: #f8fafc;
}

/* Back Face Content */
.gh-fc-back-meaning {
  font-size: clamp(24px, 5.5vw, 34px);
  font-weight: 850;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 12px;
}

body.dark-mode .gh-fc-back-meaning {
  color: #f1f5f9;
}

.gh-fc-back-pinyin {
  display: inline-block;
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 4px 16px;
  border-radius: 99px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

body.dark-mode .gh-fc-back-pinyin {
  color: #38bdf8;
  background: rgba(2, 132, 199, 0.2);
}

.gh-fc-back-hanzi-small {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(32px, 7vw, 44px);
  font-weight: 900;
  color: #64748b;
}

body.dark-mode .gh-fc-back-hanzi-small {
  color: #94a3b8;
}

/* Flashcard Footer */
.gh-fc-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gh-fc-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 99px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.gh-fc-speak-btn:hover {
  background: #e2e8f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.gh-fc-speak-btn:active {
  transform: scale(0.95);
}

body.dark-mode .gh-fc-speak-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .gh-fc-speak-btn:hover {
  background: #334155;
}

.gh-fc-tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
}

.gh-fc-hint-icon {
  display: inline-block;
  font-size: 0.95rem;
  animation: ghSpinHint 3s linear infinite;
}

@keyframes ghSpinHint {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

/* Flashcard Action Buttons Dock */
.gh-fc-actions-dock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin: 18px auto 0;
  box-sizing: border-box;
}

.gh-fc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 18px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  color: #ffffff;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  touch-action: manipulation;
}

.gh-fc-btn:active {
  transform: scale(0.96) !important;
}

.gh-fc-btn-again {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);
}

.gh-fc-btn-again:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.38);
}

.gh-fc-btn-known {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
}

.gh-fc-btn-known:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.38);
}

.gh-fc-btn-icon {
  font-size: 1.35rem;
  font-weight: 900;
}

.gh-fc-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.gh-fc-btn-text b {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.gh-fc-btn-text small {
  font-size: 0.72rem;
  opacity: 0.88;
}

.gh-fc-empty {
  padding: 44px 20px;
  text-align: center;
  border-radius: 24px;
  background: #ffffff;
  border: 1.5px dashed rgba(203, 213, 225, 0.8);
  color: #475569;
}

body.dark-mode .gh-fc-empty {
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.8);
  color: #cbd5e1;
}

.gh-fc-empty strong {
  display: block;
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 6px;
}

body.dark-mode .gh-fc-empty strong {
  color: #f8fafc;
}

.gh-fc-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gh-fc-head-btn {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 8px 14px !important;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.gh-fc-head-btn:active {
  transform: scale(0.96);
}

/* ========================================================
   EXERCISE VISUAL IMAGE STYLES (VERIFIED & STANDARD)
   ======================================================== */
.exercise-visual-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 10px 0;
  transition: all 0.25s ease;
}

.exercise-visual-slot.empty {
  display: none !important;
}

.gh-vocab-visual-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
  animation: ghVisualFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ghVisualFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.gh-vocab-img-box {
  position: relative;
  width: 100%;
  height: 160px;
  background: #f1f5f9;
  overflow: hidden;
  border-radius: 20px;
  border: 2px solid #ffffff;
}

body.dark-mode .gh-vocab-img-box {
  background: #0f172a;
  border-color: #334155;
}

.gh-vocab-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gh-vocab-img:hover {
  transform: scale(1.04);
}

.gh-vocab-img-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(16, 185, 129, 0.9);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gh-vocab-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #64748b;
  background: #e2e8f0;
}

/* Semantic Grammatical Card */
.gh-semantic-card {
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1.5px solid #c7d2fe;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

body.dark-mode .gh-semantic-card {
  background: linear-gradient(135deg, #1e293b 0%, #1e1e38 100%);
  border-color: #4338ca;
}

.gh-semantic-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-semantic-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 99px;
  background: #3b82f6;
  color: #ffffff;
}

.gh-semantic-icon {
  font-size: 1.1rem;
}

.gh-semantic-hanzi {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: #1e293b;
  line-height: 1.1;
}

body.dark-mode .gh-semantic-hanzi {
  color: #f8fafc;
}

.gh-semantic-role {
  font-size: 0.85rem;
  font-weight: 700;
  color: #3b82f6;
}

body.dark-mode .gh-semantic-role {
  color: #818cf8;
}

.gh-semantic-hint {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.3;
}

body.dark-mode .gh-semantic-hint {
  color: #94a3b8;
}

/* ========================================================
   YOUTHFUL GAMIFIED UI & PHONE ANIMATIONS
   ======================================================== */

/* Streak Widget Flare & Flame */
.streak-widget {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.dark-mode .streak-widget {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.streak-widget.streak-hot {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
  color: #ea580c;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.22);
}

body.dark-mode .streak-widget.streak-hot {
  background: linear-gradient(135deg, #431407 0%, #2a0b04 100%);
  border-color: #ea580c;
  color: #fdba74;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.35);
}

.streak-flame {
  display: inline-block;
  font-size: 1.15rem;
  transition: transform 0.25s ease;
}

.streak-widget.streak-hot .streak-flame {
  animation: ghFlamePulse 1.8s ease-in-out infinite;
}

@keyframes ghFlamePulse {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 2px #f97316); }
  50% { transform: scale(1.22) rotate(-6deg); filter: drop-shadow(0 0 8px #ea580c); }
}

.streak-widget.streak-done {
  border-color: #10b981;
}

/* Streak Celebration Toast */
.streak-celebration {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -40px) scale(0.9);
  opacity: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 20px;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(249, 115, 22, 0.4);
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  max-width: 90vw;
}

.streak-celebration.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.streak-celebration-badge {
  font-size: 2rem;
  animation: ghFlamePulse 1s ease-in-out infinite;
}

.streak-celebration-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #fdba74;
}

.streak-celebration-text span {
  font-size: 0.8rem;
  color: #e2e8f0;
}

/* Quiz Option Buttons on Phone */
.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  touch-action: manipulation;
}

.quiz-option-btn:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.quiz-option-btn:active {
  transform: scale(0.97) !important;
}

body.dark-mode .quiz-option-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .quiz-option-btn:hover {
  border-color: #475569;
}

.quiz-option-btn.quiz-correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #065f46 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25) !important;
  animation: ghCorrectBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.dark-mode .quiz-option-btn.quiz-correct {
  background: #064e3b !important;
  color: #a7f3d0 !important;
}

@keyframes ghCorrectBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.quiz-option-btn.quiz-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25) !important;
  animation: ghWrongShake 0.4s ease-in-out;
}

body.dark-mode .quiz-option-btn.quiz-wrong {
  background: #7f1d1d !important;
  color: #fecaca !important;
}

@keyframes ghWrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Mobile Bottom Dock Active Indicator & Animation */
@media (max-width: 760px) {
  .gh-fc-card {
    height: 440px;
    min-height: 410px;
  }
  .gh-fc-image-container {
    height: 120px;
  }
  .gh-fc-hanzi-display {
    font-size: clamp(56px, 16vw, 76px);
  }
  .gh-vocab-img-box {
    height: 135px;
  }
  #gh-mobile-nav button {
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.18s ease;
  }
  #gh-mobile-nav button:active {
    transform: scale(0.88);
  }
}
/* V29: no hover transform on either face. */
/* Theme switch remains in the outer header only. */
#gh-learning-plus .sun-moon,#gh-learning-plus .theme-toggle,#gh-learning-plus #theme-toggle,#gh-learning-plus .theme-switch,
#gh-flashcard-mode .sun-moon,#gh-flashcard-mode .theme-toggle,#gh-flashcard-mode #theme-toggle,#gh-flashcard-mode .theme-switch{display:none!important}

/* V13: external profile/ranking cards and precise close buttons. */
.gh-external-card{width:min(820px,calc(100vw - 28px))!important}
#gh-profile-modal .gh-modal-card,#gh-ranking-modal .gh-modal-card{max-height:88vh!important;overflow:auto!important}
#gh-profile-modal .gh-modal-head,#gh-ranking-modal .gh-modal-head{align-items:flex-start!important}
#gh-profile-modal .gh-close,#gh-ranking-modal .gh-close{width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;flex:0 0 46px!important;padding:0!important;margin:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;line-height:1!important;font:400 28px/1 Arial,sans-serif!important;transform:none!important}
.gh-ranking-modal-card{width:min(900px,calc(100vw - 28px))!important}
.gh-ranking-live{margin-top:14px;padding:11px 13px;border-radius:11px;background:rgba(0,180,255,.07);border:1px solid rgba(0,180,255,.18);font-size:12px;color:#7892a5}
.gh-live-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#32d583;box-shadow:0 0 0 4px rgba(50,213,131,.12);margin-right:6px}
.gh-rank-row.me{border-color:#27c9ef!important;box-shadow:0 0 0 1px rgba(39,201,239,.12)!important}
.gh-rank-name em{font-style:normal;font-size:10px;color:#21c7ee;margin-left:5px}
@media(max-width:600px){
  #gh-nav-menu{width:280px!important}
  #gh-nav-menu .gh-nav-item{min-height:50px!important;font-size:14px!important}
}

/* Youthful modern buttons (Duolingo / Linear style) */
.gh-cyber-top-btn, .gh-cyber-action, .gh-nav-item, .gh-primary, .gh-rank-filter, .gh-settings-btn-wrap .button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 999px !important;
  clip-path: none !important;
  border: 1.5px solid rgba(239, 68, 68, 0.25) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease !important;
}

.gh-cyber-top-btn {
  min-width: 76px !important;
  min-height: 42px !important;
  padding: 8px 14px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  font-size: 13.5px !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.dark-mode .gh-cyber-top-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

.gh-cyber-top-btn:hover, .gh-cyber-action:hover, .gh-nav-item:hover, .gh-primary:hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.05) !important;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.18) !important;
  border-color: #ef4444 !important;
}

.gh-cyber-top-btn:active, .gh-cyber-action:active, .gh-nav-item:active, .gh-primary:active {
  transform: translateY(0) scale(0.97) !important;
}

.gh-nav-menu {
  width: 270px !important;
  padding: 12px !important;
  border-radius: 24px !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2) !important;
}

.gh-nav-item {
  min-height: 48px !important;
  padding: 10px 16px !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  clip-path: none !important;
  background: transparent !important;
  color: #334155 !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

body.dark-mode .gh-nav-item {
  color: #f1f5f9 !important;
}

.gh-nav-item:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}

.gh-nav-item span {
  font-size: 14.5px !important;
}

.gh-nav-title {
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  color: #94a3b8 !important;
  padding: 6px 12px 10px !important;
}

.gh-cyber-action {
  min-width: 180px !important;
  min-height: 52px !important;
  padding: 12px 24px !important;
  background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%) !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 850 !important;
  border-radius: 16px !important;
  clip-path: none !important;
  border: none !important;
  box-shadow: 0 4px 0 #b91c1c, 0 12px 24px rgba(239, 68, 68, 0.35) !important;
}

.gh-cyber-action:hover {
  box-shadow: 0 5px 0 #b91c1c, 0 16px 28px rgba(239, 68, 68, 0.4) !important;
}

.gh-cyber-action:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #b91c1c, 0 4px 10px rgba(239, 68, 68, 0.3) !important;
}

/* Theme switch is an outer-header control only. Never render it inside sub-sections/modals/cards. */
.gh-extra-mode .switch, .gh-extra-mode .sun-moon, .gh-extra-mode .theme-toggle, .gh-extra-mode #theme-toggle, .gh-extra-mode .theme-switch, .gh-modal .switch, .gh-modal .sun-moon { display: none !important }

@media (max-width: 760px) {
  .gh-cyber-top-btn {
    min-width: 64px !important;
    min-height: 40px !important;
    padding: 6px 10px !important;
  }
  .gh-cyber-top-btn span { font-size: 12px !important; }
  .gh-nav-menu { width: min(300px, calc(100vw - 24px)) !important; }
  .gh-nav-item { min-height: 50px !important; }
  .gh-cyber-action { min-width: 145px !important; min-height: 48px !important; font-size: 14px !important; }
}

#gh-learning-plus .ghlp-primary, #gh-learning-plus .ghlp-small, #gh-learning-plus .ghlp-answer, #gh-learning-plus .ghlp-route-step,
.gh-extra-mode button:not(.gh-fc-speak) {
  border-radius: 16px !important;
  clip-path: none !important;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease !important;
}
#gh-learning-plus .ghlp-primary:hover, #gh-learning-plus .ghlp-small:hover, #gh-learning-plus .ghlp-answer:hover, #gh-learning-plus .ghlp-route-step:hover,
.gh-extra-mode button:not(.gh-fc-speak):hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.08) !important;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.25) !important;
}


/* Hamburger-to-X state. */
#gh-nav-menu-toggle{position:relative!important;overflow:hidden!important;}
#gh-nav-menu-toggle span{position:absolute!important;left:50%!important;top:50%!important;width:24px!important;height:3px!important;margin:0!important;transform-origin:center!important;transition:transform .22s ease,opacity .18s ease!important;}
#gh-nav-menu-toggle span:nth-child(1){transform:translate(-50%,-50%) translateY(-7px)!important}
#gh-nav-menu-toggle span:nth-child(2){transform:translate(-50%,-50%)!important}
#gh-nav-menu-toggle span:nth-child(3){transform:translate(-50%,-50%) translateY(7px)!important}
#gh-nav-menu-toggle.is-open span:nth-child(1){transform:translate(-50%,-50%) rotate(45deg)!important}
#gh-nav-menu-toggle.is-open span:nth-child(2){opacity:0!important;transform:translate(-50%,-50%) scaleX(.2)!important}
#gh-nav-menu-toggle.is-open span:nth-child(3){transform:translate(-50%,-50%) rotate(-45deg)!important}
@media(max-width:760px){
  #gh-nav-menu-toggle{width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important}
  #gh-nav-menu-toggle span{width:22px!important;height:3px!important}
}



/* V30 - profile XP / level / achievements */
#gh-profile-modal .gh-profile-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:2px}
#gh-profile-modal .gh-profile-stats>div{padding:12px 13px;border:1px solid rgba(0,224,255,.18);border-radius:13px;background:linear-gradient(135deg,rgba(8,29,44,.95),rgba(8,19,31,.95));box-shadow:inset 0 0 18px rgba(0,180,255,.035)}
#gh-profile-modal .gh-profile-stats small{display:block;color:#72b7ca;font-size:9px;font-weight:900;letter-spacing:1px;margin-bottom:5px}
#gh-profile-modal .gh-profile-stats strong{display:block;color:#eaffff;font-size:15px;line-height:1.25}
#gh-profile-modal .gh-profile-stats span{display:block;color:#7597a9;font-size:10px;margin-top:3px}
#gh-profile-modal .gh-profile-xpbar{padding:11px 12px 12px;border:1px solid rgba(0,224,255,.18);border-radius:13px;background:#071521}
#gh-profile-modal .gh-profile-xpbar>div{display:flex;justify-content:space-between;gap:10px;color:#8cb1c1;font-size:10px;margin-bottom:7px}
#gh-profile-modal .gh-profile-xpbar i{display:block;height:8px;border-radius:999px;background:#132c3b;overflow:hidden;border:1px solid rgba(0,224,255,.12)}
#gh-profile-modal .gh-profile-xpbar b{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#00b9d8,#6cecff);box-shadow:0 0 12px rgba(0,220,255,.4);transition:width .3s ease}
@media(max-width:680px){#gh-profile-modal .gh-profile-stats{grid-template-columns:1fr}}


/* Speech Speed Setting */
.gh-setting-speed-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
}
.gh-setting-speed-info b,
.gh-setting-speed-info small {
  display: block;
}
.gh-setting-speed-info small {
  margin-top: 3px;
  color: #8da5b7;
  font-size: 12px;
}
.gh-speed-btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
.gh-speed-btn {
  padding: 9px 12px;
  border: 1px solid #20384c;
  background: #102334;
  color: #9eb5c8;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gh-speed-btn:hover {
  background: #163248;
  color: #e8f7ff;
  border-color: #2e5572;
}
.gh-speed-btn.active {
  background: #00a9c8 !important;
  color: #04131f !important;
  border-color: #00e5ff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4) !important;
}


/* Floating Update Badge & Manual Reset Pill */
.gh-update-badge {
  display: none !important;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  animation: ghBadgeFadeIn 0.3s ease-out;
}
@keyframes ghBadgeFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.gh-update-badge span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gh-update-badge button {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.gh-update-badge button:hover {
  background: #1d4ed8;
  transform: scale(1.04);
}
@media (max-width: 640px) {
  .gh-update-badge {
    bottom: 10px;
    right: 10px;
    left: 10px;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 6px 10px;
  }
}


/* Permanently disable mobile bottom dock */
#gh-mobile-nav { display: none !important; visibility: hidden !important; pointer-events: none !important; }


.gh-avatar-presets-title {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 10px;
  margin-bottom: 5px;
}
.gh-avatar-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 140px;
  margin: 0 auto;
}
.gh-preset-btn {
  background: #102334;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.gh-preset-btn:hover, .gh-preset-btn:active {
  transform: scale(1.15);
  border-color: #21d5f5;
  background: #0a1724;
}
