/* property by @HexXylo @Kzuyoo @mrkGL01 @HoyoSlave */
@import url("https://mui.kernelsu.org/internal/insets.css");
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  /* ── Background palette (white / light) ── */
  --bg:        #f5f6fa;
  --bg-card:   #ffffff;
  --bg-card-2: #f0f2f8;
  --bg-card-3: #e8ebf5;
  --bg-input:  #f0f2f8;

  /* ── Brand accent ── */
  --accent:        #1a73e8;
  --accent-dim:    rgba(26, 115, 232, 0.10);
  --accent-glow:   rgba(26, 115, 232, 0.22);
  --accent-neon:   rgba(26, 115, 232, 0.45);

  /* ── Semantic colors ── */
  --green:  #12b76a;
  --amber:  #f79009;
  --red:    #f04438;
  --purple: #7c3aed;
  --cyan:   #0891b2;

  /* ── Text ── */
  --text:      #0f172a;
  --text-dim:  #334155;
  --text-gray: #64748b;
  --text-muted:#94a3b8;

  /* ── Borders / shadows ── */
  --border:     rgba(0,0,0,0.07);
  --border-lit: rgba(0,0,0,0.11);
  --shadow-xs:  0 1px 4px rgba(0,0,0,0.06);
  --shadow-sm:  0 2px 10px rgba(0,0,0,0.08);
  --shadow-md:  0 6px 24px rgba(0,0,0,0.10);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.14);

  /* ── Radius ── */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-xs:  8px;

  /* ── Typography ── */
  --font: 'Manrope', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ───────────────────────────────────────────────
   BASE RESET
─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  position: fixed;
  inset: 0;
}

::-webkit-scrollbar { width: 0; height: 0; }

/* ── Icon system ── */
.xi {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; font-size: inherit;
  flex-shrink: 0; vertical-align: middle; line-height: 1;
}
.xi svg { width: 100%; height: 100%; fill: currentColor; }

/* ───────────────────────────────────────────────
   LAYOUT
─────────────────────────────────────────────── */
.app-container {
  height: 100%; width: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding-top:    max(28px, calc(env(safe-area-inset-top,0px) + 14px));
  padding-bottom: max(var(--window-inset-bottom,0px), env(safe-area-inset-bottom,0px));
  padding-left:   max(16px, calc(16px + env(safe-area-inset-left,0px)));
  padding-right:  max(16px, calc(16px + env(safe-area-inset-right,0px)));
}

.page {
  display: none; flex-direction: column;
  height: 100%; width: 100%; overflow: hidden;
}
.page.active {
  display: flex !important;
  animation: pageIn .2s ease-out;
}
@keyframes pageIn {
  from { opacity:0; transform: translateY(8px) scale(0.99); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

#tab-home .page-scroll,
#tab-monitor .page-scroll,
#tab-apps .page-scroll,
#tab-tweaks .page-scroll,
#tab-settings .page-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 110px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  will-change: scroll-position;
  transform: translateZ(0);
}

/* ───────────────────────────────────────────────
   TOP BAR
─────────────────────────────────────────────── */
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-top: 4px; min-height: 48px;
}

.brand-sub {
  font-size: 0.55rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 2px; color: var(--text-muted); margin-bottom: 3px;
}
.brand-main {
  font-size: 1.18rem; font-weight: 900; letter-spacing: -.4px; color: var(--text);
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.status-btn {
  width: 40px; height: 40px;
  background: var(--bg-card);
  border-radius: 13px;
  border: 1px solid var(--border-lit);
  box-shadow: var(--shadow-xs);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform .15s;
}
.status-btn:active { transform: scale(.88); }

#pid-icon {
  width: 18px; height: 18px;
  fill: var(--text-muted);
  transition: fill .3s, filter .3s;
}
.dot-indicator {
  position: absolute; bottom: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  border: 1.5px solid var(--bg-card);
  transition: background .3s;
}
.dot-indicator.running {
  background: var(--green);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.5; transform:scale(.7); }
}

/* ───────────────────────────────────────────────
   PID BADGE ROW
─────────────────────────────────────────────── */
.pid-status-row {
  margin-bottom: 16px;
}
.pid-badge-card {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-lit);
  border-radius: 30px;
  padding: 7px 16px;
  box-shadow: var(--shadow-xs);
  font-size: 0.72rem; font-weight: 700;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
}
.status-dot.running {
  background: var(--accent);
  animation: pulseDot 2s infinite;
}
.status-label { color: var(--text); font-weight: 700; }
.status-pid {
  color: var(--text-muted); font-family: var(--mono);
  font-size: .6rem; letter-spacing: .3px;
}

/* ───────────────────────────────────────────────
   SECTION HEADERS
─────────────────────────────────────────────── */
.section-header-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem; font-weight: 800; color: var(--text);
}
.section-header-row .xi {
  font-size: 1.05rem; color: var(--accent);
  width: 20px; height: 20px;
}
.section-title { font-size: 0.92rem; font-weight: 800; flex: 1; }

.refresh-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  transition: background .15s;
}
.refresh-btn:active { background: var(--bg-card-2); }

/* ───────────────────────────────────────────────
   MODEL CARD
─────────────────────────────────────────────── */
.model-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
}
.model-id {
  font-size: 1.5rem; font-weight: 900;
  color: var(--text); letter-spacing: -.5px;
  font-family: var(--mono);
}

/* ───────────────────────────────────────────────
   DEVICE INFO GRID (2-column, 5 items)
─────────────────────────────────────────────── */
.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.device-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-xs);
}
.device-grid-item.wide {
  grid-column: span 2;
}
.dg-icon {
  font-size: 1rem; color: var(--accent);
  width: 18px; height: 18px; flex-shrink: 0;
}
.dg-content { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dg-label {
  font-size: 0.55rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
}
.dg-value {
  font-size: 0.82rem; font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ───────────────────────────────────────────────
   MONITOR — RING GAUGES
─────────────────────────────────────────────── */
.monitor-rings {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; margin-bottom: 10px;
}
.ring-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 13px 10px 12px;
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; align-items: center;
}
.ring-header {
  width: 100%; display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 8px;
}
.ring-label {
  font-size: 0.6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-gray);
}
.ring-icon { font-size: .85rem; color: var(--text-muted); width: 14px; height: 14px; }

.ring-wrap {
  position: relative; width: 72px; height: 72px;
}
.ring-svg {
  width: 72px; height: 72px;
  transform: rotate(-210deg);
  transform-origin: center;
  will-change: auto;
}
.ring-track {
  fill: none;
  stroke: var(--bg-card-2);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 201;
  stroke-dashoffset: 50; /* cuts bottom gap */
}
.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 201;
  stroke-dashoffset: 201;
  will-change: stroke-dashoffset, stroke;
  transition: stroke-dashoffset .55s cubic-bezier(.4,0,.2,1), stroke .35s ease;
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
}
.ring-value {
  font-size: .95rem; font-weight: 900;
  color: var(--text); letter-spacing: -.4px;
  line-height: 1;
}
.ring-sub {
  font-size: .5rem; font-weight: 600;
  color: var(--text-muted); font-family: var(--mono);
}

/* ───────────────────────────────────────────────
   MONITOR — BAR STATS CARD (RAM / STORAGE / TEMP)
─────────────────────────────────────────────── */
.bar-stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 6px 14px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 14px;
}
.bar-stat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.bar-stat-row:last-child { border-bottom: none; }
.bar-icon {
  font-size: 1rem; color: var(--accent);
  width: 18px; height: 18px; flex-shrink: 0;
}
.bar-body { flex: 1; min-width: 0; }
.bar-row-top {
  display: flex; align-items: baseline; gap: 4px;
  margin-bottom: 5px;
}
.bar-name {
  font-size: .58rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); flex: 1;
}
.bar-val {
  font-size: .7rem; font-weight: 700;
  color: var(--text); font-family: var(--mono);
}
.bar-pct {
  font-size: .62rem; font-weight: 800;
  color: var(--text-gray); margin-left: 4px;
}
.bar-track {
  height: 4px; border-radius: 10px;
  background: var(--bg-card-2); overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0%; border-radius: 10px;
  background: var(--text);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ───────────────────────────────────────────────
   CATEGORY LABELS / LIST CARDS
─────────────────────────────────────────────── */
.category-label {
  font-size: .57rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted);
  margin: 18px 0 8px 2px;
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  display: block;
}

.list-card-alt {
  background: var(--bg-card);
  padding: 15px 16px;
  border-radius: var(--r-md);
  margin-bottom: 7px;
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.list-card-alt { transition: background .12s, transform .1s; }
.list-card-alt:active { background: var(--bg-card-2); transform: scale(0.99); }
.list-content h3 {
  font-size: .9rem; font-weight: 700;
  color: var(--text); margin-bottom: 2px;
  display: flex; align-items: center; gap: 6px;
}
.list-content p {
  font-size: .7rem; color: var(--text-gray); font-weight: 500;
}
.list-card-alt > .xi { color: var(--text-muted); font-size: .9rem; width: 16px; height: 16px; }

/* ───────────────────────────────────────────────
   PAGE HEADERS (Tweaks / Apps / Settings)
─────────────────────────────────────────────── */
.page-header {
  padding-top: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.page-header h2 {
  font-size: 1.6rem; font-weight: 900; letter-spacing: -.6px;
  color: var(--text);
}

/* ───────────────────────────────────────────────
   ADD GAME BOX
─────────────────────────────────────────────── */
.add-game-box { display: flex; gap: 9px; margin-bottom: 14px; }
#manual-pkg-input {
  flex: 1; background: var(--bg-input);
  border: 1px solid var(--border-lit);
  padding: 12px 16px; border-radius: 14px;
  color: var(--text); font-size: .84rem;
  font-family: var(--mono); font-weight: 500; outline: none;
}
#manual-pkg-input:focus { border-color: var(--accent); }
#manual-pkg-input::placeholder { color: var(--text-muted); }
#manual-add-btn {
  background: var(--accent); border: none;
  width: 46px; height: 46px; border-radius: 14px;
  color: white; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform .12s, opacity .12s;
}
#manual-add-btn:active { transform: scale(.9); opacity: .85; }

/* ───────────────────────────────────────────────
   GAME CARDS
─────────────────────────────────────────────── */
.game-card {
  background: var(--bg-card); border-radius: var(--r-lg);
  margin-bottom: 9px; border: 1px solid var(--border);
  overflow: hidden; cursor: pointer;
  transition: transform .12s, background .15s;
}
.game-card:active { transform: scale(.985); background: var(--bg-card-2); }
.game-card-inner { display: flex; align-items: center; padding: 12px 14px; gap: 12px; }
.game-card-icon img {
  width: 50px; height: 50px; border-radius: 13px;
  object-fit: cover; border: 1px solid var(--border-lit); box-shadow: var(--shadow-sm);
}
.game-card-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.game-card-name { font-size:.9rem; font-weight:800; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.game-card-pkg { font-size:.6rem; color:var(--text-muted); font-family:var(--mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:4px; }
.game-card-badges { display:flex; gap:4px; flex-wrap:wrap; }
.gc-badge {
  font-size:.54rem; font-weight:800; padding:2px 8px;
  border-radius:20px; text-transform:uppercase; letter-spacing:.7px;
  border: 1.5px solid transparent;
}
.gc-badge.gc-inactive { color:var(--text-muted); border-color:var(--border-lit); }
.gc-badge.gc-active { background:var(--accent-dim); color:var(--accent); border-color:var(--accent-glow); }
.gc-badge.gc-recommended { background:rgba(18,183,106,.08); color:var(--green); border-color:rgba(18,183,106,.2); }
.game-card-actions { display:flex; flex-direction:column; align-items:center; gap:8px; flex-shrink:0; }
.gc-remove-btn { background:none; border:none; padding:4px; color:var(--text-muted); cursor:pointer; border-radius:7px; display:flex; align-items:center; }
.gc-remove-btn:active { color:var(--red); }
.gc-chevron { color:var(--text-muted); font-size:.9rem; }

/* ───────────────────────────────────────────────
   BOTTOM NAV
─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: max(18px, calc(env(safe-area-inset-bottom,0px) + 10px));
  left: 50%; transform: translateX(-50%);
  width: auto; min-width: 330px; height: 62px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; justify-content: space-around; align-items: center;
  border-radius: 36px;
  border: 1px solid var(--border-lit);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 100; padding: 0 10px; gap: 2px;
}
.nav-item {
  background: none; border: none;
  color: var(--text-muted);
  display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer;
  width: 52px; height: 50px; justify-content: center;
  border-radius: 26px; transition: color .2s;
}
.nav-item .xi {
  font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 30px; border-radius: 16px;
  transition: all .2s;
}
.nav-label { font-size: .55rem; font-weight: 700; letter-spacing: .5px; }
.nav-item.active { color: var(--accent); }
.nav-item.active .xi { background: var(--accent-dim); border-radius: 16px; }
.nav-item:active .xi { transform: scale(.85); opacity: .6; }

/* ───────────────────────────────────────────────
   TOAST
─────────────────────────────────────────────── */
.toast {
  visibility: hidden;
  background: var(--text);
  color: #fff;
  text-align: center; border-radius: 14px;
  padding: 10px 22px;
  position: fixed; z-index: 200;
  left: 50%; bottom: 105px;
  transform: translateX(-50%);
  font-size: .78rem; font-weight: 700;
  white-space: nowrap; box-shadow: var(--shadow-md);
}
.toast.show {
  visibility: visible;
  animation: toastIn .3s ease, toastOut .4s 2.5s ease;
}
@keyframes toastIn  { from { bottom:88px; opacity:0; } to { bottom:105px; opacity:1; } }
@keyframes toastOut { from { bottom:105px; opacity:1; } to { bottom:88px; opacity:0; } }

/* ───────────────────────────────────────────────
   SUB PAGE SHEET
─────────────────────────────────────────────── */
.sub-page {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 8px;
  background: rgba(0,0,0,0.32);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease-out;
}
.sub-page.active { opacity: 1; pointer-events: auto; }

.sub-modal-card {
  background: var(--bg);
  border: 1px solid var(--border-lit);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  width: 100%; max-width: 400px;
  height: 82vh; max-height: 82vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  will-change: transform;
  transform: translateZ(0);
  contain: layout style paint;
  position: relative;
}
.sub-modal-card::before {
  content: ''; position: absolute;
  top: 9px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 4px; border-radius: 4px;
  background: var(--border-lit); z-index: 10;
}
.sub-page.active .sub-modal-card { transform: translateY(0); }

.sub-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center; position: relative; flex-shrink: 0;
}
.back-btn {
  position: absolute !important; top: 16px; right: 12px;
  background: var(--bg-card-2) !important; border: 1px solid var(--border) !important;
  border-radius: 50% !important; width: 30px; height: 30px;
  color: var(--text-gray) !important; cursor: pointer; padding: 0 !important;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s; z-index: 2;
}
.back-btn:active { background: var(--bg-card-3) !important; }

.sub-modal-icon {
  width: 50px; height: 50px; border-radius: 16px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; font-size: 1.3rem; color: var(--accent);
}
.sub-modal-icon .xi { width: 20px; height: 20px; color: var(--accent); }
.sub-header h2 { font-size: 1rem; font-weight: 900; color: var(--text); margin-bottom: 3px; }
.sub-header-subtitle { font-size: .64rem; color: var(--text-gray); font-weight: 500; max-width: 80%; }

.sub-content {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding: 14px 14px 32px;
  will-change: scroll-position;
  transform: translateZ(0);
}
.sub-content::-webkit-scrollbar { display: none; }
.sub-page-scroll { height: 100%; padding-bottom: 4px; }

.app-container.sub-open { pointer-events: none; }

/* ───────────────────────────────────────────────
   SUB PAGE COMPONENTS
─────────────────────────────────────────────── */
.sub-description {
  color: var(--text-gray); font-size: .72rem; line-height: 1.6;
  margin-bottom: 14px; padding: 11px 13px; font-weight: 500;
  background: var(--bg-card); border-radius: 11px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
}

.stat-clean-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 15px; margin-bottom: 10px;
}

.clean-action-box-new {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card-2); padding: 13px 15px;
  border-radius: 14px; margin: 8px 0;
  border: 1px solid var(--border);
}
.clean-action-box-new .list-content h3 { font-size: .86rem; color: var(--text); font-weight: 700; margin-bottom: 2px; }
.clean-action-box-new .list-content p { font-size: .67rem; color: var(--text-gray); max-width: 85%; }

.main-clean-btn {
  width: 100%; padding: 13px; border-radius: 13px; border: none;
  background: rgba(18,183,106,.08); color: var(--green);
  font-weight: 700; font-size: .86rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-family: var(--font);
  border: 1px solid rgba(18,183,106,.15);
  transition: transform .12s, background .15s;
}
.main-clean-btn:active { transform: scale(.97); background: rgba(18,183,106,.16); }

.storage-info-header-sub {
  display: flex; justify-content: space-between;
  margin-bottom: 10px; font-size: .8rem; color: var(--text-dim); font-weight: 500;
}
.progress-container-sub {
  width: 100%; height: 5px; background: var(--bg-card-2);
  border-radius: 8px; overflow: hidden; margin-bottom: 12px;
}
.progress-bar-sub {
  height: 100%; background: linear-gradient(90deg,var(--green),var(--cyan));
  border-radius: 8px; transition: width .4s;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-card-3); border-radius: 30px;
  border: 1px solid var(--border-lit);
  transition: background .2s;
}
.slider:before {
  content: ""; position: absolute;
  width: 19px; height: 19px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0,0,0,.18);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
input:checked + .slider { background: var(--accent); border-color: var(--accent); }
input:checked + .slider:before { transform: translateX(22px); }

/* Radio */
.radio-indicator {
  width: 22px; height: 22px; border: 2px solid var(--border-lit);
  border-radius: 50%; position: relative; transition: border-color .2s; flex-shrink: 0;
}
.radio-indicator.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.radio-indicator.active::after {
  content: ''; position: absolute;
  width: 11px; height: 11px; background: var(--accent);
  border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%);
}

/* Buttons group */
.rr-btn-group { display: flex; gap: 9px; margin-top: 6px; }
.rr-btn-apply, .rr-btn-reset, .rr-btn-close {
  flex: 1; padding: 13px 0; border-radius: var(--r-sm); border: none;
  font-size: .86rem; font-weight: 800; font-family: var(--font);
  cursor: pointer; transition: opacity .12s, transform .12s;
}
.rr-btn-apply { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }
.rr-btn-apply:active { opacity: .82; transform: scale(.97); }
.rr-btn-reset, .rr-btn-close { background: var(--bg-card-2); color: var(--text-dim); border: 1px solid var(--border-lit); }

/* Slider cards */
.rr-slider-card {
  background: var(--bg-card); border-radius: var(--r-md);
  border: 1px solid var(--border); padding: 18px 16px 14px;
  margin: 12px 0 8px;
}
.rr-slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.rr-slider-label { font-size: .86rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.rr-slider-value {
  font-size: .84rem; font-weight: 900; color: var(--accent);
  background: var(--accent-dim); padding: 3px 11px;
  border-radius: 18px; border: 1px solid var(--accent-glow);
}
.rr-range {
  width: 100%; height: 4px; -webkit-appearance: none;
  background: var(--bg-card-2); border-radius: 4px; outline: none; cursor: pointer;
}
.rr-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  background: var(--accent); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 12px var(--accent-glow); border: 2px solid #fff;
}
.rr-range-marks {
  display: flex; justify-content: space-between;
  margin-top: 8px; font-size: .58rem; color: var(--text-muted); font-weight: 700;
}

/* DNS select */
.dns-page-card {
  background: var(--bg-card); border-radius: var(--r-md);
  border: 1px solid var(--border); padding: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.dns-select {
  padding: 7px 28px 7px 10px; font-size: .72rem;
  border-radius: 10px; background: var(--bg-card-2);
  border: 1px solid var(--border-lit); color: var(--text-dim);
  appearance: none; outline: none; font-family: var(--font); font-weight: 600;
  cursor: pointer; min-width: 128px;
}

/* AP (Game Profile) */
.ap-header { display: flex; flex-direction: column; align-items: center; padding: 6px 0 16px; gap: 7px; position: relative; }
.ap-header-bg {
  position: absolute; inset: 0;
  background-size: 180%; background-position: center 30%;
  filter: blur(50px) saturate(.5); opacity: .15;
  mask-image: linear-gradient(to bottom,rgba(0,0,0,.5),transparent);
  -webkit-mask-image: linear-gradient(to bottom,rgba(0,0,0,.5),transparent);
  pointer-events: none;
}
.ap-icon { width: 76px; height: 76px; border-radius: 20px; object-fit: cover; border: 1.5px solid var(--border-lit); box-shadow: var(--shadow-md); z-index: 1; }
.ap-name { font-size: 1.25rem; font-weight: 900; color: var(--text); letter-spacing: -.4px; z-index:1; }
.ap-pkg { font-size: .6rem; color: var(--text-muted); font-family: var(--mono); background: var(--bg-card-2); padding: 2px 10px; border-radius: 18px; border: 1px solid var(--border); z-index:1; }
.ap-enable-card { background: var(--bg-card); border-radius: var(--r-lg); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border: 1px solid var(--border); }
.ap-enable-label { font-size: .88rem; font-weight: 700; color: var(--text); }
.ap-section-label { display: block; color: var(--text-muted); font-size: .55rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; border-left: 2px solid var(--accent); padding-left: 8px; margin: 10px 0 7px 2px; }
.ap-row-card { background: var(--bg-card); border-radius: var(--r-md); padding: 13px 15px; margin-bottom: 7px; border: 1px solid var(--border); display: flex; align-items: center; gap: 11px; }
.ap-row-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-dim); border: 1px solid var(--accent-glow); display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--accent); flex-shrink: 0; }
.ap-row-icon .xi { width: 16px; height: 16px; }
.ap-row-body { flex: 1; min-width: 0; }
.ap-row-title { font-size: .83rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ap-row-desc { font-size: .63rem; color: var(--text-gray); line-height: 1.4; }
.ap-select { background: var(--bg-card-2); border: 1px solid var(--border-lit); border-radius: 9px; padding: 6px 24px 6px 9px; color: var(--text); font-size: .72rem; font-weight: 700; font-family: var(--font); outline: none; cursor: pointer; appearance: none; max-width: 130px; }
.ap-compile-btn { width: 100%; margin-top: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--accent); border: none; color: white; font-weight: 800; font-size: .86rem; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-family: var(--font); box-shadow: 0 4px 20px var(--accent-glow); transition: transform .12s, opacity .12s; }
.ap-compile-btn:active { transform: scale(.97); opacity: .88; }

/* Renderer cards */
.renderer-option-card { background: var(--bg-card); border-radius: var(--r-lg); margin-bottom: 9px; border: 1px solid var(--border); cursor: pointer; transition: transform .12s; }
.renderer-option-card:has(.radio-indicator.active) { border-color: var(--accent-glow); }
.renderer-option-card:active { transform: scale(.985); }
.renderer-option-inner { display: flex; align-items: center; padding: 14px 15px; gap: 11px; }
.renderer-option-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-dim); border: 1px solid var(--accent-glow); display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--accent); flex-shrink: 0; }
.renderer-option-body { flex: 1; min-width: 0; }
.renderer-option-title { font-size: .86rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.renderer-option-desc { font-size: .64rem; color: var(--text-gray); }

/* About page */
.about-header { text-align: center; padding: 16px 0 12px; }
.profile-img { width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--accent-glow); margin-bottom: 9px; object-fit: cover; box-shadow: var(--shadow-md); }
.about-header h2 { font-size: 1.18rem; color: var(--text); font-weight: 900; margin-bottom: 3px; }
.about-header .quote { font-style: italic; font-size: .7rem; color: var(--text-gray); }
.about-card { background: var(--bg-card); border-radius: var(--r-md); padding: 13px 15px; display: flex; gap: 11px; margin-bottom: 7px; border: 1px solid var(--border); }
.card-icon { min-width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; background: var(--accent-dim); color: var(--accent); }
.card-icon .xi { width: 17px; height: 17px; }
.card-text h3 { font-size: .82rem; color: var(--text); font-weight: 700; margin-bottom: 2px; }
.card-text p { font-size: .66rem; color: var(--text-gray); line-height: 1.45; }
.about-page-container { padding: 2px 0; }

/* Logging */
#log-display { font-family: var(--mono); font-size: .66rem; max-height: 280px; overflow-y: auto; line-height: 1.6; padding: 8px; color: var(--text-dim); }
#log-display::-webkit-scrollbar { width: 2px; }
#log-display::-webkit-scrollbar-thumb { background: var(--border-lit); border-radius: 8px; }

/* Home Banner */
.home-banner-wrap {
  width: 100%; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 14px; box-shadow: var(--shadow-sm);
  background: var(--bg-card-2);
  min-height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.home-banner-img {
  width: 100%; display: block;
  object-fit: cover; border-radius: var(--r-lg);
}

/* Translation fix */
iframe.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
.goog-te-gadget { font-size: 0 !important; }
.goog-te-gadget span { display: none !important; }
.goog-text-highlight { background-color: transparent !important; box-shadow: none !important; }