/* assets/app.css */
:root{
  --bg:#0a0f16;
  --bg-soft:#111824;
  --panel:#101722;
  --card:#141d2b;
  --card-strong:#192434;
  --text:#edf3fc;
  --muted:#98a6ba;
  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.12);
  --primary:#6d5efc;
  --primary-soft:rgba(109,94,252,.16);
  --danger:#ff6a6a;
  --shadow:0 22px 60px rgba(0,0,0,.32);
  --radius:18px;
  --container:1180px;
  --topbar-h:0px;
  --promo-h:0px;

  --bottom-safe-b:max(env(safe-area-inset-bottom), 16px);
}

*{box-sizing:border-box;}
html,body{min-height:100%;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  color:var(--text);
  background-color:var(--bg);
  background-image:
    radial-gradient(1200px 620px at 50% -12%, rgba(44,63,96,.48), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 24%),
    linear-gradient(180deg, #0c121c 0%, #0a0f16 100%);
  background-repeat:no-repeat;
  background-attachment:fixed;
  font-family:"Segoe UI Variable","Segoe UI","Pretendard Variable","Pretendard","Apple SD Gothic Neo","Noto Sans KR",system-ui,sans-serif;
  padding-bottom:var(--bottom-safe-b);
}

a{color:inherit;}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 20px;
  border-bottom:1px solid rgba(255,255,255,.06);
  background:rgba(8,12,18,.82);
  backdrop-filter:blur(12px);
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.brand__logo{
  width:34px;
  height:34px;
  border-radius:12px;
  display:block;
  flex:0 0 auto;
  box-shadow:0 14px 28px rgba(0,0,0,.28);
}

.brand__text{min-width:0;}

.brand__title{
  font-size:18px;
  font-weight:900;
  letter-spacing:-.04em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.brand__sub{
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.topbar__right{
  display:flex;
  align-items:center;
  gap:10px;
}

.wrap{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 296px;
  grid-template-areas:
    "play panel"
    "history panel";
  gap:14px;
  align-items:start;
  max-width:var(--container);
  margin:0 auto;
  padding:14px 18px 0;
  min-height:calc(100dvh - 66px);
}

.playColumn{
  grid-area:play;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:760px;
}

.panel{
  grid-area:panel;
  min-width:0;
}

.historyPanel{
  grid-area:history;
  max-width:760px;
}

.playHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:2px 2px 0;
}

.playHeader__mission{
  min-width:0;
  flex:1 1 auto;
}

.playHeader__title{
  margin:0;
  font-size:clamp(20px, 1.8vw, 28px);
  line-height:1.08;
  font-weight:900;
  letter-spacing:-.05em;
  text-wrap:balance;
}

.playHeader__status{
  flex:0 0 auto;
  min-width:126px;
  text-align:right;
}

.playHeader__timer{
  font-size:clamp(26px, 2vw, 34px);
  line-height:1;
  font-weight:900;
  letter-spacing:-.06em;
  font-variant-numeric:tabular-nums;
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.row--gap{
  justify-content:flex-start;
  flex-wrap:wrap;
}

.right{text-align:right;}

.label{
  color:var(--muted);
  font-size:12px;
  margin-bottom:6px;
  letter-spacing:.02em;
}

.big{
  font-size:18px;
  font-weight:800;
  letter-spacing:-.03em;
}

.timer{
  font-size:22px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}

.mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:12px;
  color:#d5e3f4;
}

.divider{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:12px 0;
}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:11px 14px;
  border-radius:14px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:800;
  font-size:14px;
  line-height:1.2;
  transition:background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.btn:hover{
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.16);
  transform:translateY(-1px);
}

.btn:disabled{
  opacity:.42;
  cursor:not-allowed;
  transform:none;
}

.btn--primary{
  background:linear-gradient(180deg, rgba(116,101,255,.98), rgba(101,91,234,.84));
  border-color:rgba(109,94,252,.82);
  box-shadow:0 14px 28px rgba(62,50,174,.32);
}

.btn--primary:hover{
  filter:brightness(1.05);
}

.btn--ghost{
  background:rgba(255,255,255,.025);
}

.btn--soft{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.10);
}

.btn--danger{
  background:rgba(255,106,106,.12);
  border-color:rgba(255,106,106,.38);
}

.btn--cta{
  min-width:158px;
  min-height:48px;
  font-size:16px;
  letter-spacing:-.03em;
  border-radius:16px;
  box-shadow:0 18px 42px rgba(68,76,194,.28);
}

.btn--tiny{
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
}

.chk{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:40px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.03);
  user-select:none;
  color:var(--text);
  font-weight:800;
}

.chk input{
  accent-color:var(--primary);
  transform:translateY(1px);
}

.input{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.25);
  color:var(--text);
}

.hint{
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.setSummary{
  padding:12px 13px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.22);
  font-size:12px;
  line-height:1.55;
  color:rgba(255,255,255,.88);
}

.stage{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.stage__frame{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  border-radius:26px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.018));
  box-shadow:var(--shadow);
  touch-action:none;
  width:100%;
  max-width:min(760px, max(420px, calc((100dvh - var(--topbar-h) - var(--promo-h) - 250px) * 16 / 9)));
  margin:0 auto;
}

.stage__frame::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  background:
    linear-gradient(45deg, rgba(255,255,255,.055) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.055) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.055) 75%);
  background-size:24px 24px;
  background-position:0 0, 0 12px, 12px -12px, -12px 0;
  opacity:.22;
}

#stage{
  position:relative;
  z-index:1;
  display:block;
  width:100%;
  height:auto;
  touch-action:none;
  -ms-touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
}

.hud{
  position:absolute;
  top:10px;
  left:50%;
  transform:translateX(-50%);
  z-index:3;
  pointer-events:none;
}

.hud__timer{
  padding:8px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.42);
  font-weight:900;
  font-size:15px;
  font-variant-numeric:tabular-nums;
  color:rgba(255,255,255,.94);
}

.stage__hint{
  position:absolute;
  left:12px;
  bottom:12px;
  z-index:2;
  max-width:min(420px, calc(100% - 28px));
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.42);
  color:rgba(255,255,255,.86);
  font-size:11px;
  line-height:1.45;
}

.btn--pressMobile{
  display:none;
}

#rawToggleWrap{
  width:100%;
  max-width:none !important;
  margin-top:10px !important;
  padding:11px 14px !important;
  border-radius:16px !important;
  border:1px solid rgba(255,255,255,.08) !important;
  background:rgba(255,255,255,.035) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

#rawToggleWrap label{
  font-size:15px !important;
  font-weight:800 !important;
}

#rawToggleWrap input{
  accent-color:var(--primary);
}

#rawToggleWrap[data-assist-enabled="true"]{
  border-color:rgba(109,94,252,.28) !important;
  background:rgba(109,94,252,.08) !important;
  box-shadow:0 14px 32px rgba(68,76,194,.14), inset 0 1px 0 rgba(255,255,255,.04);
}

.assistSwitch{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:16px;
  cursor:pointer;
  user-select:none;
}

.assistSwitch__copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.assistSwitch__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.assistSwitch__title{
  font-size:15px;
  line-height:1.2;
  font-weight:900;
}

.assistSwitch__state{
  color:var(--muted);
  font-size:12px;
  line-height:1.2;
  font-weight:800;
  transition:color .18s ease;
}

#rawToggleWrap[data-assist-enabled="true"] .assistSwitch__state{
  color:#d8d3ff;
}

.assistSwitch__hint{
  margin:0;
}

.assistSwitch__input{
  position:absolute;
  width:1px;
  height:1px;
  margin:-1px;
  padding:0;
  border:0;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
}

.assistSwitch__track{
  position:relative;
  width:54px;
  height:32px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  box-shadow:inset 0 1px 3px rgba(0,0,0,.28);
  transition:background .18s ease, border-color .18s ease, box-shadow .18s ease;
  flex:0 0 auto;
}

.assistSwitch__thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 8px 18px rgba(0,0,0,.28);
  transition:transform .18s ease, background .18s ease;
}

.assistSwitch__input:checked + .assistSwitch__track{
  border-color:rgba(109,94,252,.55);
  background:linear-gradient(180deg, rgba(109,94,252,.78), rgba(86,74,214,.98));
  box-shadow:0 10px 24px rgba(68,76,194,.24), inset 0 1px 0 rgba(255,255,255,.14);
}

.assistSwitch__input:checked + .assistSwitch__track .assistSwitch__thumb{
  transform:translateX(22px);
  background:#f7f4ff;
}

.assistSwitch__input:focus-visible + .assistSwitch__track{
  outline:2px solid rgba(109,94,252,.45);
  outline-offset:3px;
}

.actionDock{
  display:grid;
  grid-template-columns:minmax(0, 1.02fr) auto minmax(208px, .8fr);
  gap:10px;
  align-items:center;
  width:100%;
  max-width:760px;
  margin:0 auto;
  padding:10px 12px;
}

.actionDock__status{
  min-width:0;
}

.actionDock__title{
  font-size:16px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:-.04em;
}

.actionDock__sub{
  margin-top:4px;
  min-height:16px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.actionDock__buttons{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

.actionDock__exports{
  display:grid;
  gap:10px;
}

.actionDock__exports .btn{
  width:100%;
}

.settingsCard{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
}

.settingsCard__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.settingsCard__title{
  font-size:19px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:-.03em;
}

.settingsCard__eyebrow{
  flex:0 0 auto;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(109,94,252,.24);
  background:var(--primary-soft);
  color:#d8d3ff;
  font-size:12px;
  font-weight:800;
}

.settingsBlock{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:11px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(6,10,15,.28);
}

.settingsBlock__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.settingsBlock__mission{
  font-size:17px;
  line-height:1.32;
  font-weight:850;
  letter-spacing:-.03em;
}

.settingsStats{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.settingsStat{
  padding:10px 11px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.03);
}

.settingsStat span{
  display:block;
  color:var(--muted);
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.settingsStat strong{
  display:block;
  margin-top:7px;
  font-size:13px;
  line-height:1.5;
  white-space:normal;
  word-break:break-word;
}

.settingsToggleGrid{
  display:grid;
  gap:10px;
}

.settingsBtnGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  align-items:stretch;
}

.setSummary--compact{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:10px 12px;
}

.promoBar{
  position:sticky;
  top:var(--topbar-h);
  z-index:9;
  padding:10px 18px 0;
}

.promoBar__inner{
  max-width:var(--container);
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(109,94,252,.18), rgba(13,18,28,.95));
  box-shadow:var(--shadow);
  backdrop-filter:blur(12px);
}

.promoBar__text{
  font-size:13px;
  line-height:1.4;
  font-weight:900;
  letter-spacing:-.02em;
}

.promoBar__actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}

.promoBar__close{
  width:36px;
  height:36px;
  flex:0 0 auto;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-size:14px;
  font-weight:900;
  cursor:pointer;
}

.promoBar__close:hover{
  background:rgba(255,255,255,.12);
}

.robloxLoadGrid{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:8px;
}

.robloxStatus{
  min-height:18px;
  margin-top:-2px;
}

.robloxStatus--error{
  color:#ffb9b9;
}

.robloxStatus--ok{
  color:#b0f5d0;
}

.customThumb--avatar{
  aspect-ratio:1 / 1;
  max-width:180px;
  margin:0 auto;
  padding:10px;
}

.customMetaGroup{
  display:grid;
  gap:4px;
}

.historyPanel{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:14px 16px;
}

.historyPanel__head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.historyPanel__title{
  font-size:18px;
  line-height:1.2;
  font-weight:850;
  letter-spacing:-.03em;
}

.historyPanel__hint{
  color:var(--muted);
  font-size:12px;
}

.historyPanel__footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.history{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.history__controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

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

.history__page{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  color:rgba(255,255,255,.72);
  font-size:12px;
}

.histItem{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:6px 14px;
  padding:11px 13px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(0,0,0,.22);
}

.histItem__top{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
}

.histBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 8px;
  border-radius:999px;
  border:1px solid rgba(109,94,252,.24);
  background:var(--primary-soft);
  color:#d8d2ff;
  font-size:12px;
  font-weight:800;
}

.histPercent{
  font-size:16px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.03em;
}

.histRecord{
  color:rgba(255,255,255,.82);
  font-size:12px;
  font-weight:700;
}

.histMeta{
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.histTime{
  grid-column:2;
  grid-row:1 / span 2;
  align-self:center;
  text-align:right;
  white-space:nowrap;
  color:rgba(255,255,255,.68);
  font-size:11px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

.histTag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.82);
  font-size:11px;
  font-weight:800;
}

.resultpop{
  position:fixed;
  left:50%;
  bottom:calc(var(--bottom-safe-b) + 14px);
  transform:translateX(-50%);
  width:min(520px, calc(100vw - 24px));
  z-index:80;
  pointer-events:none;
}

.resultpop__card{
  pointer-events:auto;
  position:relative;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(20,30,43,.98), rgba(12,17,25,.98));
  box-shadow:0 20px 60px rgba(0,0,0,.55);
}

.resultpop__close{
  position:absolute;
  top:10px;
  right:10px;
  width:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-size:18px;
  font-weight:900;
  cursor:pointer;
}

.resultpop__close:hover{
  background:rgba(255,255,255,.08);
}

.resultpop__title{
  padding-right:42px;
  margin-bottom:10px;
  font-weight:900;
  letter-spacing:-.02em;
}

.resultpop__grid{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.resultpop__score{
  font-size:20px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}

.resultpop__grade{
  font-size:18px;
  font-weight:900;
  opacity:.92;
}

.resultpop__sub{
  margin-top:6px;
  font-size:12px;
  color:rgba(255,255,255,.70);
}

.resultpop__btns{
  margin-top:12px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.resultpop.hidden{display:none !important;}

.siteinfo{
  max-width:var(--container);
  margin:0 auto;
  padding:10px 24px calc(var(--bottom-safe-b) + 28px);
}

.siteinfo__inner{
  display:grid;
  gap:12px;
}

.infoFold{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  box-shadow:var(--shadow);
  overflow:hidden;
}

.infoFold[open]{
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
}

.infoFold__summary{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  list-style:none;
  cursor:pointer;
  font-size:17px;
  font-weight:850;
  letter-spacing:-.02em;
}

.infoFold__summary::-webkit-details-marker{
  display:none;
}

.infoFold__summary::after{
  content:"+";
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:rgba(255,255,255,.85);
}

.infoFold[open] .infoFold__summary::after{
  content:"-";
}

.infoFold__meta{
  margin-left:auto;
  padding-right:18px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  text-align:right;
}

.infoFold__body{
  padding:0 18px 18px;
}

.siteinfo__list{
  margin:0;
  padding-left:18px;
  color:rgba(255,255,255,.92);
}

.siteinfo__list li{
  margin:10px 0;
  line-height:1.55;
}

.siteinfo__text{
  color:rgba(255,255,255,.92);
  line-height:1.65;
  margin:8px 0 0;
}

.siteinfo__text--muted{
  color:rgba(255,255,255,.72);
}

.siteinfo__hint{
  margin-top:10px;
  color:rgba(255,255,255,.65);
  font-size:12px;
}

.edge-scroll{
  position:fixed;
  top:0;
  left:0;
  bottom:var(--bottom-safe-b);
  width:24px;
  z-index:70;
  background:transparent;
  touch-action:pan-y;
  pointer-events:auto;
}

.edge-scroll--right{
  left:auto;
  right:0;
}

.hidden{display:none !important;}

.modal{
  position:fixed;
  inset:0;
  z-index:99;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  background:rgba(0,0,0,.55);
}

.modal__sheet{
  width:min(920px, 96vw);
  max-height:min(88vh, 980px);
  overflow:auto;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(20,30,43,.98), rgba(12,17,25,.98));
  box-shadow:0 20px 60px rgba(0,0,0,.55);
}

.modal__sheet--wide{
  width:min(1100px, 96vw);
}

.modal__title{
  margin-bottom:10px;
  font-weight:900;
}

.cropWrap{flex:1;}
.cropSide{width:240px;}

#cropCanvas{
  width:100%;
  height:auto;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.25);
}

.customList{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:10px;
}

.customItem{
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.2);
}

.customThumb{
  width:100%;
  aspect-ratio:16/10;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.04);
}

.customThumb canvas{
  width:100%;
  height:100%;
}

.customName{
  margin-top:8px;
  font-weight:900;
}

.customBtns{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:8px;
}

.setList{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:12px;
}

.setBlock{
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18);
}

.setHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.setTitle{
  font-weight:900;
}

.setMeta{
  margin-top:4px;
  color:rgba(255,255,255,.70);
  font-size:12px;
}

.setGrid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:10px;
}

.setItem{
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.20);
}

.setRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.setName{
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pill{
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.88);
  font-size:12px;
}

.pill--off{
  opacity:.55;
}

.setBlock--collapsed .setGrid{
  display:none;
}

.setAccRow{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

@media (min-width: 981px){
  .settingsCard{
    position:sticky;
    top:calc(var(--topbar-h) + var(--promo-h) + 14px);
  }

  .resultpop{
    top:50%;
    left:50%;
    bottom:auto;
    transform:translate(-50%, -50%);
    width:min(460px, calc(100vw - 48px));
  }

  .edge-scroll{
    display:none;
  }
}

@media (max-width: 1180px){
  .actionDock{
    grid-template-columns:1fr;
  }

  .actionDock__buttons{
    justify-content:flex-start;
  }

  .actionDock__exports{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px){
  :root{
    --bottom-safe-b:max(env(safe-area-inset-bottom), 18px);
  }

  .topbar{
    padding:12px 14px;
  }

  .wrap{
    grid-template-columns:1fr;
    grid-template-areas:
      "play"
      "panel"
      "history";
    gap:10px;
    padding:10px 12px 0;
  }

  .playColumn{
    gap:10px;
    max-width:none;
  }

  .playHeader{
    order:3;
    padding:12px;
    border:1px solid var(--line);
    border-radius:16px;
    background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018));
    box-shadow:var(--shadow);
    align-items:flex-start;
  }

  .stage{
    order:1;
    min-height:0;
    align-items:center;
    gap:10px;
  }

  .actionDock{
    order:2;
  }

  .playHeader__status{
    display:none;
  }

  .stage__frame{
    width:min(calc(100vw - 28px), 420px);
    max-width:none;
    height:clamp(260px, calc(100dvh - var(--topbar-h) - var(--promo-h) - var(--bottom-safe-b) - 86px), 520px);
    max-height:none;
    border-radius:22px;
  }

  #stage{
    width:100%;
    height:100%;
    max-height:none;
  }

  .stage__hint{
    bottom:12px;
    max-width:calc(100% - 28px);
  }

  .actionDock{
    padding:10px 12px;
    gap:10px;
  }

  #rawToggleWrap{
    order:4;
    margin-top:0 !important;
  }

  #btnPress{
    display:none;
  }

  #btnPressMobile{
    position:static;
    left:auto;
    bottom:auto;
    transform:none;
    z-index:auto;
    display:flex;
    width:min(calc(100vw - 28px), 420px);
    margin:0 auto;
    padding:15px 18px;
    border-radius:20px;
    font-size:18px;
    font-weight:900;
    letter-spacing:-.02em;
  }

  .actionDock__title{
    font-size:17px;
  }

  .actionDock__buttons{
    justify-content:flex-start;
    width:100%;
  }

  .actionDock__exports{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .settingsCard{
    padding:14px;
  }

  .settingsCard__header,
  .settingsBlock__head,
  .historyPanel__head{
    flex-direction:column;
    align-items:flex-start;
  }

  .settingsStats{
    grid-template-columns:1fr;
  }

  .settingsBtnGrid{
    grid-template-columns:1fr;
  }

  .historyPanel{
    padding:14px;
    max-width:none;
  }

  .histItem{
    grid-template-columns:1fr;
  }

  .histTime{
    grid-column:auto;
    grid-row:auto;
    text-align:left;
  }

  .siteinfo{
    padding:10px 12px calc(var(--bottom-safe-b) + 20px);
  }

  .promoBar{
    padding:8px 12px 0;
  }

  .promoBar__inner{
    flex-direction:column;
    align-items:flex-start;
    padding:12px;
  }

  .promoBar__actions{
    width:100%;
    justify-content:space-between;
  }

  .robloxLoadGrid{
    grid-template-columns:1fr;
  }

  .infoFold__summary{
    flex-wrap:wrap;
    padding:14px 16px;
  }

  .infoFold__meta{
    width:100%;
    margin-left:0;
    padding-right:36px;
    text-align:left;
  }

  .resultpop__close{
    display:none;
  }
}

@media (max-width: 640px){
  .brand__sub{
    display:none;
  }

  .btn--cta{
    min-width:0;
    width:100%;
  }

  .actionDock__buttons{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    width:100%;
  }

  .actionDock__buttons .btn{
    width:100%;
  }

  .actionDock__exports{
    grid-template-columns:1fr;
  }
}
