/* Zenou Unblocked, plus.css
   Styles for the shared "plus" layer: command palette, toasts, sheets,
   ratings, playlist picker, the My Library hub, stats and catalogue filters.
   Loaded after style.css on every page. */

:root { --zpanel: rgba(13, 16, 27, .92); }

/* ---------------- toasts ---------------- */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgb(var(--accent-rgb) / .35);
  background: var(--zpanel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 26px rgb(var(--accent-rgb) / .18);
  font-size: 13px;
  color: var(--muted);
  transform: translateY(10px) scale(.98);
  opacity: 0;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.toast.in { transform: none; opacity: 1; }
.toast strong { color: var(--text); font-size: 13.5px; font-weight: 650; }
.toast-ach { border-color: rgb(251 191 36 / .5); box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 30px rgb(251 191 36 / .25); }
.toast-act {
  justify-self: start;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgb(var(--accent-rgb) / .5);
  background: rgb(var(--accent-rgb) / .14);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* ---------------- command palette ---------------- */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 12vh 16px 16px;
  background: rgba(4, 5, 10, .62);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .16s var(--ease);
}
.cmdk-overlay.open { opacity: 1; }
.cmdk {
  width: min(680px, 100%);
  border-radius: 18px;
  border: 1px solid rgb(var(--accent-rgb) / .28);
  background: var(--zpanel);
  box-shadow: 0 40px 90px rgba(0,0,0,.6), 0 0 50px rgb(var(--accent-rgb) / .16);
  overflow: hidden;
  transform: translateY(-8px) scale(.985);
  transition: transform .18s var(--ease);
}
.cmdk-overlay.open .cmdk { transform: none; }
.cmdk-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-bar .icon { width: 18px; height: 18px; fill: var(--muted-2); flex: none; }
.cmdk-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.cmdk-bar kbd, .cmdk-foot kbd, .kb-row kbd {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.05);
}
.cmdk-list { max-height: min(58vh, 460px); overflow-y: auto; padding: 8px; }
.cmdk-group {
  margin: 10px 10px 4px;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cmdk-item.active, .cmdk-item:hover { background: rgb(var(--accent-rgb) / .14); }
.cmdk-ico { width: 22px; text-align: center; color: var(--muted-2); flex: none; }
.cmdk-item.active .cmdk-ico { color: rgb(var(--accent-rgb)); }
.cmdk-txt { display: grid; min-width: 0; }
.cmdk-txt b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-txt small { color: var(--muted-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted-2); font-size: 13px; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11.5px; }
.cmdk-foot span { display: flex; align-items: center; gap: 4px; }

/* ---------------- sheets ---------------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 5, 10, .6);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.sheet-overlay.open { opacity: 1; }
.sheet {
  width: min(430px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgb(var(--accent-rgb) / .25);
  background: var(--zpanel);
  box-shadow: 0 40px 90px rgba(0,0,0,.6);
}
.sheet-wide { width: min(560px, 100%); }
.sheet-narrow { width: min(400px, 100%); }
.sheet h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.02em; }
.sheet-sub { margin: 0 0 14px; color: var(--muted-2); font-size: 12.5px; }
.sheet-list { display: grid; gap: 6px; margin-bottom: 14px; }
.sheet-empty { color: var(--muted-2); font-size: 13px; margin: 0; }
.sheet-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sheet-row:hover { border-color: rgb(var(--accent-rgb) / .5); }
.sheet-row[aria-pressed="true"] { border-color: rgb(var(--accent-rgb) / .7); background: rgb(var(--accent-rgb) / .12); }
.sheet-row-name { font-size: 13.5px; }
.sheet-row-meta { color: var(--muted-2); font-size: 11.5px; flex: none; }
.sheet-new { display: flex; gap: 8px; }
.sheet-new input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.sheet-foot { margin: 12px 0 0; color: var(--muted-2); font-size: 12px; }
.kb-grid { display: grid; gap: 8px; margin-top: 14px; }
.kb-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.kb-row kbd { min-width: 84px; text-align: center; color: var(--text); }

/* ---------------- first-run tour ---------------- */
.tour-step { margin: 0 0 6px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgb(var(--accent-rgb)); }
.tour-title { margin: 0 0 8px; font-size: 22px; }
.tour-body { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- scroll chrome ---------------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, rgb(var(--accent-rgb)), rgb(var(--accent-2-rgb)));
  box-shadow: 0 0 12px rgb(var(--accent-rgb) / .8);
  z-index: 80;
  pointer-events: none;
}
.to-top {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 60;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--zpanel);
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.to-top svg { width: 20px; height: 20px; fill: var(--text); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: rgb(var(--accent-rgb) / .6); }

/* ---------------- gamepad badge ---------------- */
.gamepad-badge {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgb(52 211 153 / .45);
  background: var(--zpanel);
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.gamepad-badge svg { width: 18px; height: 18px; fill: var(--success); }
.gamepad-badge.show { opacity: 1; transform: none; }

/* ---------------- ratings ---------------- */
.rating { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rating button {
  border: 0;
  background: none;
  color: var(--line-strong);
  font-size: 19px;
  line-height: 1;
  padding: 2px;
  cursor: pointer;
  transition: color .15s var(--ease), transform .15s var(--ease);
}
.rating button:hover { transform: translateY(-1px) scale(1.1); }
.rating button.on { color: #fbbf24; text-shadow: 0 0 12px rgb(251 191 36 / .6); }
.rating-label { margin-left: 8px; color: var(--muted-2); font-size: 12px; }
.card-rating {
  position: absolute;
  left: 8px;
  bottom: 44px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(6, 8, 14, .78);
  color: #fbbf24;
  font-size: 10px;
  letter-spacing: .06em;
  z-index: 2;
}
.card-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(6, 8, 14, .72);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease);
}
.card:hover .card-x { opacity: 1; }
.card-x:hover { color: var(--danger); border-color: rgb(255 92 122 / .6); }

/* ---------------- list view ---------------- */
html[data-view="list"] .grid,
html[data-view="list"] #filteredGrid { grid-template-columns: 1fr; }
html[data-view="list"] .grid .card,
html[data-view="list"] #filteredGrid .card {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  padding: 0;
  min-height: 78px;
}
html[data-view="list"] .card .card-thumb,
html[data-view="list"] .card .card-plaque { height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: cover; }
html[data-view="list"] .card .card-name { padding: 6px 14px; font-size: 14px; }
html[data-view="list"] .card .card-play-badge { display: none; }
html[data-view="list"] .card .card-src { top: auto; bottom: 8px; }
html[data-view="list"] .card .card-rating { left: auto; right: 12px; bottom: 10px; }

/* ---------------- library hub ---------------- */
.lib-shell { display: grid; gap: 18px; }
.lib-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  width: fit-content;
  max-width: 100%;
}
.lib-tab {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.lib-tab[aria-selected="true"] {
  background: linear-gradient(120deg, rgb(var(--accent-rgb)), rgb(var(--accent-2-rgb)));
  color: var(--accent-ink);
  font-weight: 650;
}
.lib-panel[hidden] { display: none; }
.lib-empty { color: var(--muted-2); font-size: 13.5px; padding: 24px 0; }
.lib-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.lib-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.lib-head p { margin: 0; color: var(--muted-2); font-size: 12.5px; }

.xp-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid rgb(var(--accent-rgb) / .22);
  background: linear-gradient(140deg, rgb(var(--accent-rgb) / .12), rgba(255,255,255,.02) 55%);
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.xp-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.xp-level { display: flex; align-items: baseline; gap: 10px; }
.xp-level b { font-size: 40px; line-height: 1; letter-spacing: -.04em; }
.xp-level span { color: var(--muted-2); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.xp-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.xp-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(var(--accent-rgb)), rgb(var(--accent-2-rgb)));
  box-shadow: 0 0 18px rgb(var(--accent-rgb) / .7);
  transition: width .6s var(--ease);
}
.xp-note { color: var(--muted-2); font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.stat-card b { display: block; font-size: 26px; letter-spacing: -.03em; }
.stat-card span { color: var(--muted-2); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
.stat-card em { display: block; margin-top: 4px; font-style: normal; color: var(--muted); font-size: 12px; }

.bars { display: grid; gap: 10px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: linear-gradient(90deg, rgb(var(--accent-rgb) / .8), rgb(var(--accent-2-rgb) / .8)); }
.bar-row b { text-align: right; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ach {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  display: grid;
  gap: 4px;
  opacity: .55;
}
.ach.on { opacity: 1; border-color: rgb(251 191 36 / .45); background: rgb(251 191 36 / .07); }
.ach i { font-style: normal; font-size: 18px; }
.ach b { font-size: 13px; }
.ach span { color: var(--muted-2); font-size: 11.5px; }

/* ---------------- player extras ---------------- */
.play-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.play-side-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.play-side-card h3 { margin: 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.note-box {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.session-timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }

/* ---------------- catalogue filters ---------------- */
.filter-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.filter-panel[hidden] { display: none; }
.filter-row { display: grid; gap: 6px; }
.filter-row > span { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.filter-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.filter-chip[aria-pressed="true"] {
  border-color: rgb(var(--accent-rgb) / .65);
  background: rgb(var(--accent-rgb) / .16);
  color: var(--text);
}
.filter-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .cmdk-overlay { padding-top: 8vh; }
  .bar-row { grid-template-columns: 96px 1fr 56px; }
  .to-top { bottom: 92px; }
}

/* ---------------- extra accent presets ---------------- */
[data-theme="ocean"]  { --accent: #38bdf8; --accent-2: #6366f1; --accent-rgb: 56 189 248;  --accent-2-rgb: 99 102 241;  --accent-ink: #03121c; }
[data-theme="sunset"] { --accent: #fb923c; --accent-2: #f43f5e; --accent-rgb: 251 146 60;  --accent-2-rgb: 244 63 94;   --accent-ink: #1a0a03; }
[data-theme="rose"]   { --accent: #f472b6; --accent-2: #c084fc; --accent-rgb: 244 114 182; --accent-2-rgb: 192 132 252; --accent-ink: #1a0612; }
[data-theme="mint"]   { --accent: #5eead4; --accent-2: #22d3ee; --accent-rgb: 94 234 212;  --accent-2-rgb: 34 211 238;  --accent-ink: #031513; }
[data-theme="gold"]   { --accent: #facc15; --accent-2: #f59e0b; --accent-rgb: 250 204 21;  --accent-2-rgb: 245 158 11;  --accent-ink: #1a1402; }

.sw-ocean  { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.sw-sunset { background: linear-gradient(135deg, #fb923c, #f43f5e); }
.sw-rose   { background: linear-gradient(135deg, #f472b6, #c084fc); }
.sw-mint   { background: linear-gradient(135deg, #5eead4, #22d3ee); }
.sw-gold   { background: linear-gradient(135deg, #facc15, #f59e0b); }

/* hue slider inside settings */
.hue-field { display: grid; gap: 8px; }
.hue-field input[type="range"] { width: 100%; }
.hue-swatch {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4d4d, #ffb84d, #e5ff4d, #4dff88, #4dd2ff, #7a4dff, #ff4dbe, #ff4d4d);
  border: 1px solid var(--line);
}

/* external-only badge reads as a different kind of card */
.card-src[data-src="external"] {
  background: rgba(6, 8, 14, .82);
  border-color: rgb(255 255 255 / .22);
  color: #cbd5e1;
}
