/* Level Grind website - Geometry Dash look.
   1 GD point = var(--pt) CSS px (set from JS based on viewport width). */

:root {
  --pt: 2px;
  --cell-a: rgb(161, 88, 44);
  --cell-b: rgb(194, 114, 62);
  --gold: #ffd84a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* 1rem grows with the UI scale: 16px at the old default size, up to 24px on big screens */
html { font-size: clamp(16px, calc(var(--pt) * 7.6), 24px); }
body {
  background: #0b1a3f;
  color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a { color: #7fd0ff; }
button { font: inherit; color: inherit; }
img.spr { display: block; image-rendering: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; }
img.spr.flipx, .flipx img.spr { transform: scaleX(-1); }
img.spr.dim { filter: brightness(0.4); }
canvas.gdt { display: block; pointer-events: none; }
.hidden { display: none !important; }
.muted { color: #c9d4ff; opacity: .75; }
.small { font-size: 0.75rem; text-align: center; margin-top: 8px; }

/* ---------- background ---------- */
#bg {
  position: fixed; inset: 0; z-index: -1;
  background-color: var(--bg-color, #2d5ee0);
  background-image: url(/assets/gd/game_bg_01_001.png);
  background-blend-mode: multiply;
  /* one tile always covers the full height, so tall (phone) screens never show the tile seam */
  --tile: max(100vh, calc(512 * var(--pt)));
  background-size: var(--tile) var(--tile);
  background-position: 0 bottom;
  background-repeat: repeat-x;
  animation: bgscroll var(--bg-duration, 120s) linear infinite;
}
#bg.still { animation: none; }
@keyframes bgscroll { from { background-position-x: 0; } to { background-position-x: calc(-1 * var(--tile)); } }
body[data-bg="gradient"] #bg {
  animation: none;
  background-color: rgb(0, 102, 255);
  background-image: url(/assets/gd/GJ_gradientBG.png);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; display: grid; place-content: center; gap: 24px; justify-items: center; }
#boot img { width: min(420px, 80vw); }

/* ---------- pages ---------- */
#app { min-height: 100vh; }
#app.fade-in { animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.page { position: relative; min-height: 100vh; padding: calc(10 * var(--pt)) 16px calc(24 * var(--pt)); }
.page-top { position: absolute; left: calc(6 * var(--pt)); top: calc(6 * var(--pt)); z-index: 20; }
.page-title { display: flex; justify-content: center; margin-bottom: calc(6 * var(--pt)); }
.side-art { position: fixed; bottom: 0; z-index: 0; opacity: .95; }
.side-art.left { left: 0; }
.side-art.right { right: 0; transform: scaleX(-1); }

/* ---------- sprite buttons (GD bounce) ---------- */
.gd-sprbtn, .gd-toggle {
  background: none; border: 0; padding: 0; cursor: pointer; line-height: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1);
}
.gd-sprbtn:hover, .gd-toggle:hover { transform: scale(1.06); }
.gd-sprbtn:active, .gd-toggle:active { transform: scale(1.18); }
.gd-sprbtn:focus-visible, .gd-toggle:focus-visible, .gd-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }

/* ---------- GD ButtonSprite ---------- */
.gd-btn {
  --s: 1;
  border-style: solid;
  border-width: calc(10 * var(--pt) * var(--s));
  border-image-slice: 60 fill;
  border-image-width: calc(15 * var(--pt) * var(--s));
  border-image-repeat: stretch;
  background: none; cursor: pointer;
  padding: calc(1 * var(--pt) * var(--s)) calc(3 * var(--pt) * var(--s));
  min-height: calc(30 * var(--pt) * var(--s));
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1);
  transform: scale(1);
}
.gd-btn canvas.gdt { height: auto; }
.gd-btn > canvas { transform: scale(var(--s)); transform-origin: center; }
.gd-btn:hover { transform: scale(1.05); }
.gd-btn:active { transform: scale(1.15); }
.gd-btn-01 { border-image-source: url(/assets/gd/GJ_button_01.png); }
.gd-btn-02 { border-image-source: url(/assets/gd/GJ_button_02.png); }
.gd-btn-04 { border-image-source: url(/assets/gd/GJ_button_04.png); }
.gd-btn-06 { border-image-source: url(/assets/gd/GJ_button_06.png); }
.gd-btn-03 { border-image-source: url(/assets/gd/GJ_button_03.png); }
.gd-btn-05 { border-image-source: url(/assets/gd/GJ_button_05.png); }

/* ---------- panels (NineSlice) ---------- */
.gd-panel {
  border-style: solid;
  border-width: calc(14 * var(--pt));
  border-image-slice: 80 fill;
  border-image-width: calc(20 * var(--pt));
  border-image-repeat: stretch;
}
.gd-panel-01 { border-image-source: url(/assets/gd/GJ_square01.png); }
.gd-panel-02 { border-image-source: url(/assets/gd/GJ_square02.png); }
.gd-panel-05 { border-image-source: url(/assets/gd/GJ_square05.png); }
.gd-panel-small {
  border-image-source: url(/assets/gd/square02_small.png);
  border-image-slice: 40 fill; border-image-width: calc(10 * var(--pt)); border-width: calc(6 * var(--pt));
  opacity: .9;
}

/* ---------- inputs ---------- */
.gd-input {
  background: rgba(0, 0, 0, .35); border: 0; border-radius: calc(5 * var(--pt));
  color: #fff; padding: calc(4 * var(--pt)) calc(7 * var(--pt)); font-size: 1rem; outline: none;
  min-width: 0;
}
.gd-input:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.gd-color { width: 56px; height: 34px; border: 0; background: none; cursor: pointer; }
.gd-range { width: min(200px, 40vw); accent-color: #6bdc2c; }
.range-wrap { display: flex; align-items: center; gap: 8px; }
.speed-val { font-variant-numeric: tabular-nums; min-width: 3ch; }

/* ---------- hub ---------- */
.page-hub { display: flex; flex-direction: column; align-items: center; padding-top: calc(14 * var(--pt)); }
.hub-meta { position: absolute; right: 8px; top: 6px; text-align: right; font-size: 0.75rem; opacity: .55; line-height: 1.35; }
.hub-logo { margin: calc(8 * var(--pt)) 0 calc(12 * var(--pt)); max-width: 92vw; }
.hub-logo img, .search-logo img { max-width: 100%; height: auto !important; }
.hub-cats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: calc(5 * var(--pt));
  max-width: calc(400 * var(--pt)); position: relative; z-index: 2;
}
.hub-side { position: fixed; bottom: calc(12 * var(--pt)); display: flex; flex-direction: column-reverse; gap: calc(5 * var(--pt)); z-index: 5; }
.hub-side.left { left: calc(14 * var(--pt)); }
.hub-side.right { right: calc(10 * var(--pt)); }
.circle-blue {
  display: grid; place-items: center;
  width: calc(46 * var(--pt)); height: calc(46 * var(--pt)); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6fd8ff, #18a3ec 55%, #0a5fb8);
  box-shadow: inset 0 0 0 calc(2.2 * var(--pt)) #04294f, inset 0 calc(-3 * var(--pt)) 0 calc(2 * var(--pt)) rgba(0,0,0,.25);
}
.circle-blue.small { width: calc(34 * var(--pt)); height: calc(34 * var(--pt)); }
.hub-quick { margin-top: calc(14 * var(--pt)); position: relative; z-index: 2; }
.quick-id { display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .25); padding: 4px 6px 4px 4px; border-radius: 10px; }
.quick-id .gd-input { width: calc(80 * var(--pt)); min-width: 150px; }

/* ---------- search (MainLayer) ---------- */
/* Same layout as the mod: two columns of sections on one blue panel, a full width
   Version row, and a small Reset / Search / Random bar under it. */
.page-search { display: flex; flex-direction: column; align-items: center; gap: calc(7 * var(--pt)); }
.search-logo { max-width: 92vw; margin-top: calc(2 * var(--pt)); }
.search-count { position: absolute; top: calc(7 * var(--pt)); right: calc(9 * var(--pt)); z-index: 5; }
.search-panel { width: min(calc(500 * var(--pt)), 100%); border-width: calc(10 * var(--pt)); position: relative; z-index: 2; }
.sp-grid { display: grid; grid-template-columns: 282fr 190fr; gap: calc(8 * var(--pt)); }
.sp-col { display: flex; flex-direction: column; gap: calc(6 * var(--pt)); min-width: 0; }
.sp-wide { margin-top: calc(6 * var(--pt)); }
.sp-sec {
  position: relative; display: flex; align-items: center; min-height: calc(30 * var(--pt));
  background: rgba(0, 0, 0, .3); border-radius: calc(6 * var(--pt));
  padding: 0 calc(3 * var(--pt)) 0 calc(8 * var(--pt));
}
.sp-title { flex: none; width: calc((var(--tw) - 8) * var(--pt)); }
.sp-opts {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: calc(var(--gap, 4) * var(--pt)); padding: calc(3 * var(--pt)) 0;
}
.sp-sec.has-plus { padding-right: calc(22 * var(--pt)); }
.sp-plus { position: absolute; right: calc(3 * var(--pt)); top: 50%; transform: translateY(-50%); display: flex; }
.demons-hint { flex: 1; display: flex; align-items: center; justify-content: center; gap: calc(3 * var(--pt)); }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(1 * var(--pt));
  min-width: calc(var(--w) * var(--pt)); height: calc(17 * var(--pt)); padding: 0 calc(3 * var(--pt));
  border-style: solid; border-width: calc(1 * var(--pt));
  border-image: url(/assets/gd/GJ_button_04.png) 60 fill / calc(7 * var(--pt)) stretch;
}
.chip.on { border-image-source: url(/assets/gd/GJ_button_02.png); }
.type-btn {
  width: calc(40 * var(--pt)); height: calc(40 * var(--pt)); display: grid; place-items: center;
  background: url(/assets/gd/GJ_button_04.png) center / 100% 100% no-repeat;
}
.type-btn.sm { width: calc(24 * var(--pt)); height: calc(24 * var(--pt)); }
.type-btn.on { background-image: url(/assets/gd/GJ_button_02.png); }
.rate-ico { position: relative; display: block; width: calc(22 * var(--pt)); height: calc(24 * var(--pt)); }
.rate-ico > img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
/* the frame art sits a bit high, so it is moved down to center the face in it */
.rate-ico > .rate-frame { transform: translate(-50%, calc(-50% + 2.5 * var(--pt))); }
.rate-ico.dim > img { filter: brightness(.43); }
.search-bar {
  display: flex; align-items: center; justify-content: center; gap: calc(11 * var(--pt));
  border-width: calc(7 * var(--pt)); border-image-width: calc(12 * var(--pt)); padding: 0 calc(6 * var(--pt));
  position: relative; z-index: 2;
}
.search-bar .bar-btn {
  width: calc(92 * var(--pt)); height: calc(26 * var(--pt)); min-height: 0; padding: 0;
  border-width: calc(4 * var(--pt)); border-image-width: calc(12 * var(--pt));
}
.gd-btn.off { filter: brightness(.43); pointer-events: none; }
@media (max-width: 700px) {
  .page-search { padding-bottom: calc(48 * var(--pt)); }
  .search-count { position: static; order: -1; }
  .sp-grid { grid-template-columns: 1fr; }
  .search-panel { border-width: calc(7 * var(--pt)); }
}
.page-bottom-right { position: fixed; right: calc(8 * var(--pt)); bottom: calc(8 * var(--pt)); display: flex; gap: 10px; align-items: center; z-index: 5; }
.split-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.split-btns { display: flex; gap: 10px; }
.split-btn {
  display: inline-flex; align-items: center; gap: 2px; padding: calc(3 * var(--pt)) calc(6 * var(--pt));
  border-radius: calc(5 * var(--pt)); background: rgba(0, 0, 0, .35); filter: brightness(.55);
}
.split-btn.on { filter: none; background: rgba(0, 0, 0, .2); box-shadow: 0 0 0 2px #6bdc2c inset; }

/* ---------- GD list (cue::ListNode) ---------- */
.gd-list { --lw: min(calc(394 * var(--pt)), calc(100vw - 32px)); width: var(--lw); margin: 0 auto; position: relative; z-index: 2; }
.gd-list-head {
  aspect-ratio: 1576 / 215; background: url(/assets/gd/GJ_table_top_001.png) center / 100% 100% no-repeat;
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 3;
  padding-bottom: calc(var(--lw) * 0.035); margin-bottom: calc(var(--lw) * -0.06);
}
.gd-list-foot {
  aspect-ratio: 1556 / 206; background: url(/assets/gd/GJ_table_bottom_001.png) center / 100% 100% no-repeat;
  position: relative; z-index: 3; margin-top: calc(var(--lw) * -0.07); width: 98.7%; margin-left: .65%; pointer-events: none;
}
.gd-list-body {
  position: relative; margin: 0 calc(var(--lw) * 0.048);
  background: var(--cell-b);
  /* room for the list header/footer art and the page padding, which all grow with the UI scale */
  max-height: calc(100vh - var(--lw) * 0.15 - 56 * var(--pt)); min-height: calc(120 * var(--pt));
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.45) transparent;
  box-shadow: calc(var(--lw) * -0.012) 0 0 0 #000, calc(var(--lw) * 0.012) 0 0 0 #000;
  padding-top: calc(var(--lw) * 0.035); padding-bottom: calc(var(--lw) * 0.04);
}
.gd-list-body::-webkit-scrollbar { width: 8px; }
.gd-list-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.45); border-radius: 4px; }
.list-loading, .list-empty { display: grid; place-items: center; min-height: calc(120 * var(--pt)); }

/* ---------- level cells ---------- */
.level-cell {
  display: flex; align-items: center; gap: calc(8 * var(--pt));
  padding: calc(6 * var(--pt)) calc(8 * var(--pt)); min-height: calc(74 * var(--pt));
  border-bottom: 1px solid rgba(0, 0, 0, .3); cursor: pointer;
}
.level-cell.even { background: var(--cell-a); }
.level-cell.odd { background: var(--cell-b); }
.level-cell:hover { filter: brightness(1.07); }
.level-cell.done .lc-name canvas { filter: drop-shadow(0 0 0 transparent); }
.lc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(3 * var(--pt)); }
.lc-name { display: flex; align-items: center; gap: 6px; }
.lc-creator { width: max-content; }
.lc-stats { display: flex; gap: calc(10 * var(--pt)); flex-wrap: wrap; align-items: center; margin-top: calc(2 * var(--pt)); }
.lc-stat { display: inline-flex; align-items: center; gap: calc(2 * var(--pt)); }
.lc-right { display: flex; align-items: center; gap: calc(6 * var(--pt)); }
.lc-done { margin-right: 2px; }
.level-cell.missing { opacity: .8; }
.points-badge { display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 2px 6px; }

.diff-block { display: flex; flex-direction: column; align-items: center; gap: calc(1 * var(--pt)); min-width: calc(44 * var(--pt)); }
.face { position: relative; display: grid; place-items: center; }
.face-glow { position: absolute; z-index: 0; }
.face-img { position: relative; z-index: 1; }
.diff-stars, .diff-coins { display: flex; align-items: center; gap: calc(2 * var(--pt)); }
.diff-coins.unverified img { filter: sepia(1) saturate(2.5) hue-rotate(-15deg) brightness(.85); }

/* ---------- browser chrome ---------- */
.browser-wrap { display: flex; align-items: center; justify-content: center; gap: calc(6 * var(--pt)); margin-top: calc(14 * var(--pt)); }
.nav-arrow { flex: none; }
.browser-topright { position: absolute; right: 10px; top: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 10; }
.page-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.page-num-btn {
  width: calc(28 * var(--pt)); height: calc(28 * var(--pt)); border: 0; cursor: pointer;
  background: url(/assets/gd/GJ_button_02.png) center / 100% 100% no-repeat; display: grid; place-items: center;
}
.browser-completion { display: flex; justify-content: center; margin-top: 6px; }
.browser-bottom { position: fixed; left: 0; right: 0; bottom: calc(8 * var(--pt)); display: flex; justify-content: space-between; padding: 0 calc(10 * var(--pt)); z-index: 10; pointer-events: none; }
.browser-bottom > * { pointer-events: auto; }
.browser-bottom-right { display: flex; align-items: center; gap: calc(6 * var(--pt)); }
.browser-progress { width: calc(8 * var(--pt)); height: calc(150 * var(--pt)); background: rgba(0,0,0,.45); border-radius: 10px; position: relative; overflow: hidden; flex: none; }
.browser-progress .fill { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(#a6ff4a, #3cbf12); height: 0; transition: height .4s; }
.mode-switch { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; position: relative; z-index: 3; flex-wrap: wrap; }

/* ---------- packs ---------- */
.pack-cell {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8 * var(--pt)) calc(12 * var(--pt)); min-height: calc(60 * var(--pt));
  border-bottom: 1px solid rgba(0,0,0,.3); cursor: pointer;
}
.pack-cell.even { background: var(--cell-a); }
.pack-cell.odd { background: var(--cell-b); }
.pack-cell:hover { filter: brightness(1.07); }
.pack-main { display: flex; flex-direction: column; gap: calc(5 * var(--pt)); min-width: 0; flex: 1; }
.pack-head { display: flex; align-items: center; gap: calc(7 * var(--pt)); }
.pack-progress {
  position: relative; width: min(calc(200 * var(--pt)), 100%); height: calc(14 * var(--pt));
  background: rgba(0, 0, 0, .45); border-radius: calc(7 * var(--pt)); overflow: hidden; display: flex; align-items: center;
}
.pack-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.pack-progress-label { position: relative; width: 100%; display: flex; justify-content: center; }
.pack-done { position: absolute; right: 4px; }

/* ---------- level page (LevelInfoLayer) ---------- */
.page-level { display: flex; flex-direction: column; align-items: center; }
.level-page {
  width: min(calc(440 * var(--pt)), 100%); display: flex; flex-direction: column; align-items: center;
  gap: calc(7 * var(--pt)); position: relative; z-index: 2; padding-top: calc(4 * var(--pt));
}
.li-head { display: flex; flex-direction: column; align-items: center; gap: calc(3 * var(--pt)); max-width: 100%; }
.li-creator { display: block; }
.li-main {
  display: grid; align-items: center; justify-content: center; width: 100%;
  grid-template-columns: calc(28 * var(--pt)) calc(84 * var(--pt)) calc(96 * var(--pt)) minmax(0, calc(132 * var(--pt)));
  column-gap: calc(10 * var(--pt)); margin: calc(4 * var(--pt)) 0;
}
.li-left { display: flex; flex-direction: column; align-items: center; gap: calc(6 * var(--pt)); }
.li-diff { display: flex; justify-content: center; }
.li-center { display: flex; flex-direction: column; align-items: center; gap: calc(4 * var(--pt)); }
.li-stats { display: flex; flex-direction: column; gap: calc(5 * var(--pt)); justify-self: start; min-width: 0; }
.li-stat { display: flex; align-items: center; gap: calc(5 * var(--pt)); }
.li-stat-icon { width: calc(15 * var(--pt)); display: flex; justify-content: center; flex: none; }
.li-song {
  display: flex; align-items: center; gap: calc(7 * var(--pt)); width: min(calc(300 * var(--pt)), 100%);
  background: rgba(0, 0, 0, .3); border-radius: calc(6 * var(--pt)); padding: calc(5 * var(--pt)) calc(9 * var(--pt));
}
.li-song-text { display: flex; flex-direction: column; gap: calc(2 * var(--pt)); min-width: 0; }
.li-actions { display: flex; align-items: center; gap: calc(9 * var(--pt)); flex-wrap: wrap; justify-content: center; }
.li-actions .gd-btn { text-decoration: none; }
.ext-link { font-size: 0.875rem; }
.done-toggle { display: inline-flex; align-items: center; gap: calc(4 * var(--pt)); cursor: pointer; }
.li-indicators { display: flex; gap: calc(5 * var(--pt)); flex-wrap: wrap; justify-content: center; }
.ind {
  display: inline-flex; align-items: center; gap: calc(3 * var(--pt)); background: rgba(0,0,0,.3);
  padding: calc(2 * var(--pt)) calc(6 * var(--pt)); border-radius: calc(6 * var(--pt));
}
.ind.off { opacity: .65; }
.li-notes { width: 100%; border-width: calc(10 * var(--pt)); }
.li-notes-head { display: flex; align-items: center; gap: calc(5 * var(--pt)); margin-bottom: calc(4 * var(--pt)); }
.note-by { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: calc(4 * var(--pt)); }
.li-desc {
  width: 100%; font-size: 0.9375rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; text-align: center;
  background: rgba(0, 0, 0, .3); border-radius: calc(6 * var(--pt)); padding: calc(6 * var(--pt)) calc(10 * var(--pt));
  max-height: calc(70 * var(--pt)); overflow-y: auto;
}
.level-missing {
  display: flex; flex-direction: column; align-items: center; gap: calc(6 * var(--pt));
  margin-top: calc(14 * var(--pt)); padding: calc(4 * var(--pt)) calc(16 * var(--pt)); border-width: calc(10 * var(--pt));
}

/* ---------- popups ---------- */
#popups { position: relative; z-index: 100; }
.gd-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 12px;
  animation: ovin .15s ease;
}
.gd-overlay.closing { animation: ovout .15s ease forwards; }
@keyframes ovin { from { background: rgba(0,0,0,0); } }
@keyframes ovout { to { opacity: 0; } }
.gd-popup {
  position: relative; width: min(calc(var(--w) * var(--pt)), 100%); min-width: 0; max-height: calc(100vh - 24px);
  display: flex; flex-direction: column; animation: popin .35s cubic-bezier(.34, 1.6, .5, 1);
}
@keyframes popin { from { transform: scale(.6); } to { transform: scale(1); } }
.gd-popup-close { position: absolute; left: calc(-12 * var(--pt)); top: calc(-12 * var(--pt)); z-index: 3; }
.gd-popup-title { display: flex; justify-content: center; margin-bottom: calc(6 * var(--pt)); }
.gd-popup-title img, .gd-popup-title canvas { max-width: 100%; height: auto !important; }
.gd-popup-title { padding: 0 calc(14 * var(--pt)); }
.gd-popup-body { overflow-y: auto; overscroll-behavior: contain; min-height: 40px; padding: 2px; display: flex; flex-direction: column; gap: 8px; }
.gd-popup-buttons { display: flex; justify-content: center; gap: 12px; margin-top: calc(8 * var(--pt)); }
.gd-alert-text { text-align: center; font-size: 1rem; line-height: 1.45; padding: 4px 8px; }
.popup-subtitle { display: flex; justify-content: center; }
.center-row { display: flex; justify-content: center; gap: 10px; margin-top: 6px; }
.center-col { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.center-block { margin: 0 auto; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.guide-list, .ann-list { display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; }
.guide-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 0; cursor: pointer; padding: calc(7 * var(--pt)) calc(10 * var(--pt)); text-align: left;
}
.guide-item.even { background: var(--cell-a); }
.guide-item.odd { background: var(--cell-b); }
.guide-item:hover, .guide-item.sel { filter: brightness(1.15); }
.guide-item.sel { box-shadow: inset 4px 0 0 #ffd84a; }
.md-area { background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 10px 14px; font-size: 0.9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.md-area h3, .md-area h4, .md-area h5 { margin: .4em 0 .5em; font-family: inherit; }
.md-area h3 { font-size: 1.35em; text-align: center; }
.md-area p { margin: .45em 0; }
.md-area ul { margin: .4em 0; padding-left: 1.3em; }
.md-area hr { border: 0; border-top: 1px solid rgba(255,255,255,.2); }
.ann-wrap { display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 10px; min-height: 240px; }
.ann-list { max-height: 60vh; overflow-y: auto; }
.ann-detail { max-height: 60vh; overflow-y: auto; }
@media (max-width: 640px) { .ann-wrap { grid-template-columns: 1fr; } .ann-list { max-height: 30vh; } }

.carousel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.carousel-body { display: flex; flex-direction: column; gap: 8px; min-height: 100px; justify-content: center; }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.3); }
.dots span.on { background: #fff; }

/* credits */
.credits { display: flex; flex-direction: column; gap: 6px; }
.credits-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.credits-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 10px; }
.credit-user { display: flex; flex-direction: column; align-items: center; gap: 4px; width: calc(70 * var(--pt)); max-width: 30%; }
.credits-cta { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 10px; }

/* player icon */
.gd-player { position: relative; }
.gd-player-layer { position: absolute; inset: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; background-size: 100% 100% !important; }
.gd-player.glow { filter: drop-shadow(0 0 2px var(--glow)) drop-shadow(0 0 2px var(--glow)); }

/* weekly achievements podium */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: calc(10 * var(--pt)); padding-top: 10px; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: calc(120 * var(--pt)); max-width: 32%; }
.podium-user { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; }
.podium-title { display: flex; align-items: center; gap: 4px; }
.podium-block {
  width: 100%; height: calc(var(--hgt) * var(--pt)); border-radius: 8px 8px 0 0;
  background: linear-gradient(#35a3ff, #1764d6); box-shadow: inset 0 0 0 3px rgba(0,0,0,.35);
  display: flex; justify-content: center; padding-top: 8px;
  animation: grow .6s cubic-bezier(.34,1.4,.64,1) both;
  transform-origin: bottom;
}
.rank-1 .podium-block { background: linear-gradient(#ffd84a, #e59a0c); }
.rank-2 .podium-block { background: linear-gradient(#e7eef6, #9fb0c3); }
.rank-3 .podium-block { background: linear-gradient(#ffaf6b, #c4682b); }
@keyframes grow { from { transform: scaleY(0); } }

/* events */
.event-cells { display: flex; flex-direction: column; gap: 10px; }
.event-label { display: flex; align-items: center; gap: 6px; }
.event-cell { background: rgba(0,0,0,.28); border-radius: 10px; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.event-body { display: flex; align-items: center; gap: calc(10 * var(--pt)); position: relative; }
.event-crown { position: absolute; left: calc(4 * var(--pt)); top: calc(-16 * var(--pt)); }
.event-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.event-left { display: flex; justify-content: center; }
.event-empty { display: grid; place-items: center; min-height: 60px; }
.event-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* settings */
.page-settings { display: flex; flex-direction: column; align-items: center; }
.settings-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: calc(18 * var(--pt)); width: 100%; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(7 * var(--pt)) calc(12 * var(--pt)); border-bottom: 1px solid rgba(0,0,0,.25); flex-wrap: wrap; }
.setting-row:nth-child(odd) { background: var(--cell-a); }
.setting-row:nth-child(even) { background: var(--cell-b); }
.setting-label { display: flex; align-items: center; gap: 6px; }
.settings-list { min-height: 100%; }

/* ---------- staff tools ---------- */
.hub-staff { display: flex; justify-content: center; }
.staff-corner { opacity: .85; }
.staff-corner:hover { opacity: 1; }
.page-staff { display: flex; flex-direction: column; align-items: center; }
.page-staff .gd-list-body { max-height: none; padding-bottom: calc(var(--lw) * 0.06); }
.staff-wrap { margin-top: calc(18 * var(--pt)); width: 100%; display: flex; justify-content: center; }
.staff-login-wrap { padding: calc(10 * var(--pt)) calc(14 * var(--pt)); background: var(--cell-a); }
.staff-login, .staff-form { display: flex; flex-direction: column; gap: 10px; }
.staff-field { display: flex; flex-direction: column; gap: 4px; }
.staff-field-label { font-size: 0.875rem; font-weight: bold; color: var(--gold); text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.staff-field .gd-input, .staff-form > .gd-input { width: 100%; }
.staff-hint { font-size: 0.8125rem; color: #e6ecff; opacity: .8; line-height: 1.35; }
.staff-hint.center, .center { text-align: center; }
.staff-hint.pad { padding: 10px 14px; background: var(--cell-b); margin: 0; }
.staff-error { color: #ff8a8a; font-size: 0.875rem; min-height: 1em; }
.staff-error:empty { display: none; }
.staff-warn { background: rgba(255, 80, 80, .25); border-radius: 8px; padding: 6px 10px; font-size: 0.875rem; margin: 6px 0; }
.staff-actions { display: flex; justify-content: center; }
.staff-remember { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; }
.staff-me { display: flex; align-items: center; gap: 12px; padding: calc(8 * var(--pt)) calc(12 * var(--pt)); background: var(--cell-b); flex-wrap: wrap; }
.staff-me-name { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.staff-me-role { display: flex; align-items: center; gap: 6px; }
.staff-me-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.staff-section { padding: calc(6 * var(--pt)) calc(10 * var(--pt)) calc(8 * var(--pt)); }
.staff-section:nth-child(even) { background: var(--cell-a); }
.staff-section:nth-child(odd) { background: var(--cell-b); }
.staff-section-head { display: flex; justify-content: center; margin-bottom: 6px; }
.staff-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.staff-tool {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  background: rgba(0, 0, 0, .25); border: 0; border-radius: 10px; padding: 8px 10px;
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1), background .15s;
}
.staff-tool:hover { background: rgba(0, 0, 0, .38); transform: scale(1.02); }
.staff-tool:focus-visible { outline: 2px solid #fff; }
.staff-tool-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
/* every tool icon fills the same box, whatever the sprite's native size */
.staff-tool-icon img.spr { width: 40px !important; height: 40px !important; object-fit: contain; }
.staff-tool-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.staff-table { display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; margin-top: 8px; max-height: 60vh; overflow-y: auto; }
.staff-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; flex-wrap: wrap; }
.staff-row.even { background: var(--cell-a); }
.staff-row.odd { background: var(--cell-b); }
.staff-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.staff-row-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.staff-secret { display: block; text-align: center; font-size: 1.25rem; letter-spacing: 1px; background: rgba(0,0,0,.4); padding: 10px; border-radius: 8px; user-select: all; }
.staff-activity { display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; margin-top: 8px; max-height: 55vh; overflow-y: auto; }
.pre-line { white-space: pre-line; }
.action-body { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0; }
.gd-textarea { width: 100%; resize: vertical; font-family: inherit; line-height: 1.4; min-height: 70px; }

/* manage level */
.ml-head { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ml-status { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.ml-tag { background: rgba(255, 216, 74, .25); border-radius: 6px; padding: 1px 6px; font-size: 0.75rem; }
.ml-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ml-col { display: flex; flex-direction: column; align-items: center; gap: 8px; background: rgba(0, 0, 0, .25); border-radius: 10px; padding: 8px; }
.ml-col .btn-row { justify-content: center; }
.ml-vote, .ml-voted { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ml-coins { display: flex; gap: 6px; }
.gd-btn-sq {
  width: calc(26 * var(--pt)); height: calc(26 * var(--pt)); border: 0; cursor: pointer; display: grid; place-items: center;
  background: center / 100% 100% no-repeat; filter: brightness(.45); transition: transform .12s, filter .12s;
}
.gd-btn-sq[aria-pressed="true"] { filter: none; transform: scale(1.08); }
.gd-btn-sq-01 { background-image: url(/assets/gd/GJ_button_01.png); }
.gd-btn-sq-04 { background-image: url(/assets/gd/GJ_button_04.png); }
.gd-btn-sq-06 { background-image: url(/assets/gd/GJ_button_06.png); }
.ml-note { width: 100%; max-height: 150px; overflow-y: auto; font-size: 0.875rem; }
.ml-points { align-items: stretch; }
.ml-points > canvas { align-self: center; }
.ml-totals { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 6px; }
.ml-voters { display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; max-height: 180px; overflow-y: auto; }
.ml-voters .staff-row { padding: 4px 8px; flex-wrap: nowrap; }
.ml-icons { display: flex; gap: 4px; }

/* events / packs / users */
.ev-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 8px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 8px; }
.ev-inputs { display: flex; gap: 6px; }
.ev-inputs .gd-input { width: 50%; }
.pack-ids { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pack-diffs { display: flex; flex-wrap: wrap; gap: 4px; }
.pack-diff { background: rgba(0,0,0,.25); border: 2px solid transparent; border-radius: 8px; padding: 3px; cursor: pointer; opacity: .55; }
.pack-diff.on { border-color: #fff; opacity: 1; background: rgba(255,255,255,.15); }
.pack-btns { display: flex; align-items: center; gap: 6px; }
.user-search { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.user-search .gd-input { flex: 1; min-width: 120px; }
.user-result { display: flex; flex-direction: column; gap: 6px; border-radius: 8px; overflow: hidden; }
.um-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.um-pet { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 8px; }
.um-pet .btn-row { justify-content: center; }
.role-row { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.role-row > :last-child { margin-left: auto; }
.role-row.locked { cursor: not-allowed; opacity: .7; }
@media (max-width: 640px) {
  .ev-row { grid-template-columns: 1fr; justify-items: center; }
  .pack-ids { grid-template-columns: 1fr; }
}

/* ---------- toasts (Geode notification style) ---------- */
#toasts { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.gd-toast {
  display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .78); padding: 7px 14px 7px 10px;
  border-radius: 12px; font-size: 0.9375rem; animation: tin .25s ease; transition: opacity .35s, transform .35s; max-width: 92vw;
}
.gd-toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- spinner ---------- */
.gd-spinner {
  width: calc(var(--size) * 1px); height: calc(var(--size) * 1px); margin: 10px auto;
  border-radius: 50%; border: 5px solid rgba(255, 255, 255, .18); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  .side-art { display: none; }
  .nav-arrow { position: fixed; bottom: calc(50 * var(--pt)); z-index: 12; }
  .nav-arrow.prev { left: 6px; }
  .nav-arrow.next { right: 6px; }
  .browser-wrap { gap: 0; }
  .browser-progress { display: none; }
  .li-main { grid-template-columns: auto auto auto; column-gap: calc(8 * var(--pt)); row-gap: calc(8 * var(--pt)); }
  .li-stats { grid-column: 1 / -1; justify-self: center; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: calc(5 * var(--pt)) calc(12 * var(--pt)); }
  .search-grid { gap: 6px; }
  .search-logo { max-width: calc(100vw - 96px); }
  .page { padding-left: 8px; padding-right: 8px; }
  .gd-list { --lw: calc(100vw - 16px); }
  .browser-topright { top: 6px; right: 6px; }
}
img.spr.lc-note, img.spr.lc-done { pointer-events: auto; }
/* manual level details when GD doesn't answer */
.ml-manual { margin-bottom: 8px; }
.ml-manual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ml-manual-grid .gd-input { width: 100%; }
select.gd-input { appearance: auto; cursor: pointer; }
select.gd-input option { color: #000; }

/* ---------- legal pages ---------- */
.legal { padding: calc(10 * var(--pt)) calc(14 * var(--pt)); color: #fff; font-family: system-ui, sans-serif; font-size: calc(9 * var(--pt)); line-height: 1.45; }
.legal h3 { margin: calc(10 * var(--pt)) 0 calc(4 * var(--pt)); color: #ffde5a; font-size: calc(11 * var(--pt)); }
.legal p { margin: calc(4 * var(--pt)) 0; }
.legal ul { margin: calc(4 * var(--pt)) 0; padding-left: calc(16 * var(--pt)); }
.legal li { margin: calc(2 * var(--pt)) 0; }
.legal a { color: #7fc8ff; }
