body:has(#nav [data-tab="upgrader"].active) {
  background:radial-gradient(ellipse at 20% 9%,#145d37 0,transparent 53%),
    radial-gradient(ellipse at 92% 68%,#0b4727 0,transparent 36%),
    radial-gradient(ellipse at 13% 99%,#153229 0,transparent 29%),#070b09;
  background-attachment:fixed;
}
.upg-view { width:100%; max-width:590px; margin-inline:auto; padding:clamp(12px,4vw,26px) clamp(16px,5vw,30px) 22px; }
.upg-head { display:flex; align-items:start; justify-content:space-between; gap:18px; margin:0 clamp(4px,1.6vw,10px) clamp(18px,5.5vw,32px); }
.upg-head h1 { color:#f1fcf6; font-size:clamp(32px,10.4vw,61px); font-weight:800; line-height:1.04; letter-spacing:-.04em; margin:0; }
.upg-head p { color:#abc6b7; font-size:clamp(13px,3.9vw,23px); line-height:1.39; max-width:15em; margin:.5em 0 0; }
.upg-emblem { flex:none; position:relative; display:block; width:clamp(44px,15vw,88px); aspect-ratio:1; border-radius:33%; border:1px solid #dceee752; background:linear-gradient(145deg,#e4f3ec30,#dceee708); box-shadow:inset 0 1px #f1fff23c,0 4px 12px #0004; }
.upg-emblem::before,.upg-emblem::after { content:""; position:absolute; left:50%; top:42%; width:18%; aspect-ratio:1; border-top:2.5px solid #82ecad; border-right:2.5px solid #82ecad; border-radius:1.5px; transform:translate(-50%,-50%) rotate(-45deg); }
.upg-emblem::after { top:54%; }
.upg-stage {
  padding:clamp(17px,4.8vw,28px); padding-top:clamp(23px,7.4vw,44px);
  border:1px solid #d9ead448; border-radius:clamp(25px,9.5vw,57px);
  background:linear-gradient(152deg,#d2eae427,#bdd9d211 70%,#c6ead116);
  box-shadow:inset 0 1px #e8fff04d;
}
.upg-wheel {
  --upg-chance:0%; --upg-rotation:0deg;
  --upg-rim-inset:clamp(6px,1.7vw,10px); --upg-rim-thickness:clamp(11px,3.5vw,21px);
  position:relative; width:min(58vw,332px,100%); aspect-ratio:1; margin:0 auto clamp(21px,6.6vw,39px);
  display:grid; place-items:center; border:1px solid #d6eae41c; border-radius:50%; background:#e3f0eb08;
}
.upg-wheel::before { content:""; position:absolute; inset:var(--upg-rim-inset); border-radius:50%; background:conic-gradient(#74df9b 0 var(--upg-chance),#81948a42 var(--upg-chance) 100%); }
.upg-wheel.has-chance::after { content:""; position:absolute; z-index:1; top:var(--upg-rim-inset); left:50%; width:var(--upg-rim-thickness); height:var(--upg-rim-thickness); border-radius:50%; background:#74df9b; transform:translateX(-50%); pointer-events:none; }
.upg-orbit { position:absolute; inset:0; z-index:2; border-radius:50%; transform:rotate(var(--upg-rotation)); pointer-events:none; }
.upg-pointer { position:absolute; left:50%; transform:translateX(-50%); top:calc(var(--upg-rim-inset) - 1px); width:clamp(6px,2vw,12px); height:calc(var(--upg-rim-thickness) + 3px); border-radius:999px; background:#f3fff9; box-shadow:0 1px 4px #0006; }
.upg-wheel.is-spinning .upg-pointer { background:#d2ffb7; box-shadow:0 0 12px #83fba5; }
.upg-wheel[data-outcome="success"] .upg-pointer,.upg-wheel[data-outcome="success"] .upg-wheel-center span { color:#74eead; }
.upg-wheel[data-outcome="failure"] .upg-pointer,.upg-wheel[data-outcome="failure"] .upg-wheel-center span { color:#f6a69c; }
.upg-wheel[data-outcome] .upg-pointer { background:currentColor; }
@media (prefers-reduced-motion:no-preference) {
  .upg-wheel[data-outcome] .upg-wheel-center { animation:upg-reveal 360ms ease-out; }
}
@keyframes upg-reveal { from {transform:scale(.94);opacity:.75;} to {transform:scale(1);opacity:1;} }
.upg-wheel-center { position:absolute; inset:calc(var(--upg-rim-inset) + var(--upg-rim-thickness)); border-radius:50%; background:#222d28; display:grid; grid-template-columns:minmax(0,1fr); align-content:center; text-align:center; container-type:inline-size; }
.upg-wheel-center strong { font-size:clamp(37px,11.3vw,67px); letter-spacing:-.04em; color:#eef9f4; font-variant-numeric:tabular-nums; line-height:1.04; white-space:nowrap; }
.upg-wheel.has-chance .upg-wheel-center strong { font-size:clamp(36px,12vw,78px); font-size:min(29cqi,78px); }
.upg-wheel.has-chance.wide-chance .upg-wheel-center strong { font-size:clamp(25px,9vw,59px); font-size:min(22cqi,59px); }
.upg-wheel-center span { margin-top:clamp(5px,1.4vw,9px); color:#bac8c1; font-size:clamp(13px,3.9vw,23px); }
.upg-slots { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(9px,3vw,18px); }
.upg-slot { display:grid; grid-template-rows:auto 1fr auto auto; justify-items:center; align-items:start; align-content:start; gap:clamp(8px,3vw,18px); padding:clamp(11px,4vw,24px) clamp(6px,2.45vw,14px); min-height:clamp(140px,45vw,266px); min-width:0; color:#eef9f3; background:linear-gradient(153deg,#effaf822,#def8ea09); border:1px solid #d9f4e236; box-shadow:inset 0 1px #e1f8e836; border-radius:clamp(18px,7vw,42px); text-align:left; cursor:pointer; }
.upg-slot[disabled] { cursor:default; color:#c4dfce; background:linear-gradient(153deg,#effaf816,#def8ea05); }
.upg-slot strong,.upg-opt strong { min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upg-slot strong { white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow-wrap:anywhere; line-height:1.18; font-size:clamp(13px,4vw,23px); font-weight:750; justify-self:start; min-height:2.36em; }
#upgSource strong { justify-self:center; }
.upg-slot small,.upg-opt small,.upg-notice { color:#a6b9ad; font-size:12px; }
.upg-slot img { width:clamp(44px,10.5vw,62px); height:clamp(48px,16vw,95px); object-fit:contain; align-self:center; }
.upg-slot[data-card]:not([data-card=""]) { min-height:clamp(166px,56vw,327px); gap:clamp(4px,1.1vw,7px); align-items:center; text-align:center; }
.upg-slot[data-card]:not([data-card=""]) img { width:min(100%,25vw,147px); height:clamp(76px,25.5vw,150px); }
.upg-slot[data-card]:not([data-card=""]) strong { justify-self:center; min-height:0; font-size:clamp(14px,4.6vw,27px); }
.upg-slot[data-card]:not([data-card=""]) small { color:#b4cabe; font-size:clamp(11px,3.5vw,20px); }
.upg-slot .upg-empty { aspect-ratio:1; width:clamp(44px,16vw,95px); border-radius:34%; place-self:center; display:grid; place-items:center; border:1px solid #c6ead34d; box-shadow:inset 0 1px #d7fae344; background:linear-gradient(155deg,#a0e4bc32,#8ad4ad0a); color:#8ef0b5; font-size:0; position:relative; }
.upg-empty::before,.upg-empty::after { content:""; position:absolute; top:50%; left:50%; width:29%; height:2.5px; border-radius:10px; background:currentColor; transform:translate(-50%,-50%); }
.upg-empty::after { transform:translate(-50%,-50%) rotate(90deg); }
.upg-slot[disabled] .upg-empty { color:#b0cebb; background:#b5d9c319; border-color:#c5e6d233; }
.upg-slot .upg-slot-label { color:#bdcec5; font-size:clamp(11px,3.4vw,20px); line-height:1.2; text-align:center; }
.upg-status { color:#c8d9cf; min-height:1.25em; text-align:center; margin:clamp(15px,4.5vw,27px) 0 clamp(15px,4.6vw,28px); font-size:clamp(13px,3.85vw,23px); line-height:1.4; overflow-wrap:anywhere; }
.upg-boost {
  margin-top:clamp(13px,4.2vw,24px); padding:clamp(12px,4.7vw,28px);
  border:1px solid #d9f4e236; border-radius:clamp(19px,7vw,42px);
  background:linear-gradient(145deg,#e7f8ef21,#a8ecca0a 72%,#c5f4d412); box-shadow:inset 0 1px #e1f8e836;
}
.upg-boost label,.upg-boost div { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 10px; }
.upg-boost label { color:#eefaf3; font-size:clamp(13px,4.5vw,26px); font-weight:750; line-height:1.2; }
.upg-boost output { color:#8af0b1; }
.upg-boost div { font-size:clamp(11px,3.35vw,19px); color:#b8cfc3; line-height:1.25; }
.upg-boost input {
  --upg-thumb:clamp(20px,7.1vw,40px); --upg-track:clamp(5px,1.5vw,9px);
  --upg-track-color:linear-gradient(to right,#80e8ac var(--upg-slider-fill,0%),#a0b6aa42 var(--upg-slider-fill,0%));
  appearance:none; -webkit-appearance:none; display:block; width:100%; height:clamp(36px,12vw,59px);
  margin:1px 0; padding:0; border:0; border-radius:12px; background:transparent; cursor:pointer;
}
.upg-boost input::-webkit-slider-runnable-track { height:var(--upg-track); border-radius:999px; background:var(--upg-track-color); }
.upg-boost input::-moz-range-track { height:var(--upg-track); border-radius:999px; background:var(--upg-track-color); }
.upg-boost input::-webkit-slider-thumb { -webkit-appearance:none; width:var(--upg-thumb); height:var(--upg-thumb); margin-top:calc((var(--upg-track) - var(--upg-thumb))/2); border:1px solid #d7ffe4; border-radius:50%; background:linear-gradient(#adebc6,#49cd84); box-shadow:0 2px 9px #5fe29844,inset 0 1px #f2fff6; }
.upg-boost input::-moz-range-thumb { width:var(--upg-thumb); height:var(--upg-thumb); border:1px solid #d7ffe4; border-radius:50%; background:linear-gradient(#adebc6,#49cd84); box-shadow:0 2px 9px #5fe29844,inset 0 1px #f2fff6; }
.upg-boost input:focus-visible { outline:2px solid #a7edc0; outline-offset:2px; }
.upg-boost input:disabled { cursor:default; opacity:.65; }
.upg-run,.upg-topup { width:100%; min-height:44px; }
.upg-stage :is(.upg-run,.upg-topup) { min-height:clamp(47px,14.7vw,87px); border-radius:999px; border:1px solid #baf8d4; background:linear-gradient(#83efab,#32d879); color:#092015; font-size:clamp(14px,4vw,24px); font-weight:800; letter-spacing:0; box-shadow:inset 0 1px #e1ffe9b0,0 5px 16px #21c16b35; }
.upg-stage .upg-run:disabled { border-color:#d5eddf55; box-shadow:inset 0 1px #effff046; background:linear-gradient(175deg,#cceede39,#cadfd116); color:#aec8b9; opacity:1; cursor:default; }
.upg-topup { margin-top:8px; }
.upg-view [hidden] { display:none!important; }
.upg-notice { margin:clamp(15px,4.6vw,27px) auto 0; max-width:22em; text-align:center; color:#adc4b7; font-size:clamp(11px,3.4vw,20px); line-height:1.35; }
.upg-history { margin:18px 0; }
.upg-history h2,.upg-picker h2 { font-size:17px; margin:0 0 9px; }
.upg-history-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid #253b2f; }
.upg-history-row strong { display:block; overflow-wrap:anywhere; }
.upg-history-row small,.upg-muted { color:#a6b9ad; font-size:12px; }
.upg-history-row > span { flex:none; font-size:12px; }
.upg-success { color:#68e5a3; }
.upg-failure { color:#f6a69c; }
.upg-picker { margin:auto; max-height:min(82dvh,650px); width:min(94vw,540px); max-width:none; border:1px solid #355243; border-radius:16px; background:#101c16; color:#f2f8f4; padding:16px; overflow:auto; }
.upg-picker::backdrop { background:#050b08b8; }
.upg-picker-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.upg-picker-head h2 { margin:0; }
.upg-filters { display:grid; grid-template-columns:minmax(0,1fr) minmax(76px,.6fr) minmax(88px,.7fr); gap:6px; }
.upg-filters input,.upg-filters select,.upg-admin input,.upg-admin select { min-width:0; width:100%; min-height:40px; background:#172a20; border:1px solid #3c5649; color:#f1f7f3; border-radius:8px; padding:7px; font:inherit; }
.upg-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0; }
.upg-opt { display:grid; grid-template-columns:minmax(0,1fr); justify-items:center; align-content:center; text-align:center; gap:4px; padding:7px 6px; border:1px solid #31493b; border-radius:13px; background:#14251b; color:inherit; min-width:0; cursor:pointer; }
.upg-opt img { display:block; width:min(100%,209px); height:clamp(126px,43vw,210px); object-fit:contain; }
.upg-opt-details { display:none; min-width:0; max-width:100%; }
.upg-opt img[data-fallback] { width:70px; height:78px; }
.upg-opt img[data-fallback] + .upg-opt-details { display:grid; gap:3px; justify-items:center; }
.upg-opt strong { font-size:13px; white-space:normal; overflow-wrap:anywhere; }
.upg-opt[aria-pressed="true"],.upg-slot:focus-visible,.upg-opt:focus-visible { outline:2px solid #63e4a4; outline-offset:1px; }
#admin-upgrader,#admin-upgrader .admin-card,#upgAdminContent { min-width:0; max-width:100%; }
.upg-admin { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:12px; }
.upg-admin [hidden] { display:none!important; }
.upg-admin h3 { margin:10px 0 0; }
.upg-admin-fields,.upg-stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(125px,100%),1fr)); gap:8px; }
.upg-admin label { display:grid; gap:4px; font-size:12px; color:var(--text-2,#bac8bf); }
.upg-admin summary { cursor:pointer; margin-bottom:8px; }
.upg-rating-rule { border:1px solid #31493b; border-radius:10px; padding:8px; align-items:end; }
.upg-extra-cards { display:grid; gap:6px; margin-block:8px; }
.upg-extra-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; padding:8px; border:1px solid #31493b; border-radius:8px; }
.upg-extra-row span { font-size:12px; overflow-wrap:anywhere; }
.upg-admin details > .upg-admin:not(:empty) { margin-bottom:8px; }
.upg-stat { border:1px solid #31493b; border-radius:10px; padding:8px; min-width:0; }
.upg-stat strong { display:block; overflow-wrap:anywhere; }
.upg-stat span { font-size:12px; color:#a6b9ad; }
.upg-table { min-width:0; max-width:100%; overflow-x:auto; }
.upg-table table { width:100%; border-collapse:collapse; text-align:left; font-size:12px; }
.upg-table th,.upg-table td { padding:8px; border-bottom:1px solid #31493b; white-space:nowrap; }
.upg-admin-actions { display:flex; flex-wrap:wrap; align-items:end; gap:8px; }
.upg-admin-actions label { flex:1 1 160px; min-width:0; }
.upg-audit { font-size:12px; margin:0; padding-left:18px; }
.upg-audit li { margin-block:7px; overflow-wrap:anywhere; }
@media (max-width:767px) {
  #nav .nav-btn { min-width:0; flex:1 1 0; padding-inline:1px; font-size:clamp(8px,2.65vw,11px); white-space:nowrap; }
  #nav .nav-btn .ic { height:22px; }
  #nav .nav-btn > span:last-child { line-height:1.2; }
}
@media (max-width:480px) {
  .upg-admin-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; }
  .upg-admin-actions label { grid-column:1/-1; }
  .upg-admin-actions button { min-width:0; padding-inline:5px; }
}
