/* ShowcaseIt — styles */
:root {
  --bg1: #0b0418;
  --bg2: #1c0736;
  --panel: rgba(14, 6, 28, 0.84);
  --panel-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.14);
  --ink: #05061a;
  --text: #f4f6ff;
  --muted: #aab1d8;
  --green: #4cff5b;
  --yellow: #ffd335;
  --cyan: #c38bff;
  --accent: #b25cff;
  --accent-deep: #7a1fe0;
  --id: #f3e8ff;
  --pink: #ff5fd2;
  --purple: #7b3cff;
  --red: #ff5a5a;
  --radius: 16px;
  /* motion tokens (modern-web-design skill) */
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 420ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --head: 'Lilita One', 'Arial Black', Impact, system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --outline: 0 3px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink),
    0 -2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #0b0418; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  font-family: var(--body);
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(178, 92, 255, 0.32), transparent 60%),
    radial-gradient(800px 480px at -5% 5%, rgba(122, 31, 224, 0.28), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  padding-bottom: 120px;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
}

a { color: var(--cyan); }
a:hover { color: #e6d0ff; }

.wrap { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 28px 16px 16px; }
.wrap.wide { max-width: 1180px; }

/* ---------- header ---------- */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; text-decoration: none; color: inherit; }
.brand .logo { width: 68px; height: 68px; flex: none; border-radius: 18px; border: 3px solid var(--ink); box-shadow: 0 0 0 2px rgba(178, 92, 255, 0.7), 0 0 26px rgba(178, 92, 255, 0.55); animation: bob 3s ease-in-out infinite; }
.brand h1, .brand .title {
  margin: 0;
  font-family: var(--head);
  font-weight: 400;
  font-size: clamp(34px, 8vw, 48px);
  line-height: 1;
  letter-spacing: 0.5px;
  text-shadow: var(--outline);
}
.brand .title-accent { color: var(--accent); }
.brand picture { display: block; flex: none; line-height: 0; }
.brand .tagline { margin: 6px 0 0; color: var(--muted); font-weight: 800; font-size: 15px; }
.brand.small .logo { width: 46px; height: 46px; border-radius: 13px; animation: none; }
.brand.small .title { font-size: 28px; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-2deg); } }

.lead { font-size: 18px; margin: 6px 0 16px; }
.lead b { color: var(--cyan); }

.top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.social { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.social:empty { display: none; }

/* ---------- pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  font-weight: 800; font-size: 14px;
  background: rgba(76, 255, 91, 0.12); border: 2px solid rgba(76, 255, 91, 0.55);
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s ease-in-out infinite; }
.pill.closed { background: rgba(255, 90, 90, 0.12); border-color: rgba(255, 90, 90, 0.55); }
.pill.closed .dot { background: var(--red); box-shadow: 0 0 10px var(--red); animation: none; }
.pill.loading { background: var(--panel-2); border-color: var(--line); }
.pill.loading .dot { background: var(--muted); box-shadow: none; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px rgba(178, 92, 255, 0.3), 0 18px 40px rgba(0, 0, 0, 0.5);
  padding: 22px;
  margin-bottom: 18px;
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
}
.card h2 { margin: 0 0 12px; font-family: var(--head); font-weight: 400; font-size: 26px; letter-spacing: 0.4px; text-shadow: var(--outline); }
.card.compact { padding: 18px 22px; }
.card.compact h2 { font-size: 21px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---------- forms ---------- */
label { display: block; font-weight: 800; margin: 14px 0 6px; }
label:first-of-type { margin-top: 0; }
.req { color: var(--pink); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.count { float: right; color: var(--muted); font-weight: 700; font-size: 13px; }

input, textarea, select {
  width: 100%;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: rgba(0, 0, 0, 0.38);
  border: 2px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: rgba(170, 177, 216, 0.6); font-weight: 600; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(178, 92, 255, 0.22); }
input.big { font-family: var(--head); font-weight: 400; font-size: 28px; letter-spacing: 2px; padding: 10px 16px; color: var(--id); }
.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 4px rgba(255, 90, 90, 0.18) !important; animation: shake 0.35s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 540px) { .row { grid-template-columns: 1fr 1fr; } }
.row > div > label { margin-top: 14px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

.error {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 11px;
  background: rgba(255, 90, 90, 0.14); border: 2px solid rgba(255, 90, 90, 0.5);
  font-weight: 800;
}
.error a { color: var(--yellow); }
.notice {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 11px;
  background: rgba(255, 211, 53, 0.12); border: 2px solid rgba(255, 211, 53, 0.5);
  font-weight: 800;
}

.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; min-width: 0; }

.copy-field { display: flex; gap: 8px; margin: 10px 0 14px; }
.copy-field input { flex: 1; min-width: 0; font-size: 15px; color: var(--cyan); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  --c1: #c48bff; --c2: #7a1fe0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--head); font-weight: 400; font-size: 21px; letter-spacing: 0.5px;
  color: #fff; text-decoration: none; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
  padding: 11px 22px;
  border: 3px solid var(--ink); border-radius: 13px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.35), 0 4px 0 var(--ink);
  cursor: pointer; user-select: none;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease), filter var(--dur-fast);
  white-space: nowrap;
  position: relative;
}
.btn:hover { filter: brightness(1.1); color: #fff; transform: translateY(-2px); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.35), 0 6px 0 var(--ink), 0 10px 22px rgba(178, 92, 255, 0.28); }
.btn:active { transform: translateY(3px) scale(0.97); transition-duration: 60ms; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.35), 0 1px 0 var(--ink); }
.btn.is-loading { color: transparent !important; text-shadow: none; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 1.1em; height: 1.1em; margin: -0.55em 0 0 -0.55em;
  border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: grayscale(0.4); }
.btn.is-loading:disabled { opacity: 0.85; filter: none; }
.btn.full { width: 100%; margin-top: 18px; font-size: 24px; padding: 13px 22px; }
.btn-yellow { --c1: #ffe36b; --c2: #f0a800; }
.btn-cyan { --c1: #9fb2ff; --c2: #4c55e0; }
.btn-green { --c1: #74ff7f; --c2: #1fbf31; }
.btn-pink { --c1: #ff8fe1; --c2: #d12ea3; }
.btn-red { --c1: #ff8a8a; --c2: #d63434; }
.btn-purple { --c1: #a57dff; --c2: #5b25d6; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.06); border-color: var(--line);
  box-shadow: none; text-shadow: none; font-family: var(--body); font-weight: 800;
}
.btn-ghost:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); background: rgba(255, 255, 255, 0.1); }
.btn-ghost:active { box-shadow: none; }
.btn-sm { font-size: 16px; padding: 7px 13px; border-radius: 11px; border-width: 2.5px; }
.btn-ghost.btn-sm { font-size: 14px; }
.btn-xs { font-size: 13.5px; padding: 5px 10px; border-radius: 9px; border-width: 2px; font-family: var(--body); font-weight: 900; text-shadow: none; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 2px 0 var(--ink); }
.btn-xs:hover { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 4px 0 var(--ink); }
.btn-xs:active { box-shadow: 0 0 0 var(--ink); }

/* ---------- my requests list ---------- */
.mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mine a {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--text);
  background: var(--panel-2); border: 2px solid var(--line);
}
.mine a:hover { border-color: var(--accent); color: var(--text); }
.mine .id { font-family: var(--head); font-size: 20px; color: var(--id); letter-spacing: 1px; }
.mine .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mine .row-right { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- status badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-weight: 900; font-size: 13px; letter-spacing: 0.3px; text-transform: uppercase;
  border: 2px solid currentColor; white-space: nowrap;
}
.badge.queue { color: var(--cyan); background: rgba(195, 139, 255, 0.12); }
.badge.recording { color: var(--pink); background: rgba(255, 95, 210, 0.12); animation: pulse 1.6s ease-in-out infinite; }
.badge.done { color: var(--green); background: rgba(76, 255, 91, 0.1); }
.badge.skipped { color: var(--muted); background: rgba(170, 177, 216, 0.08); }

/* ---------- request status page ---------- */
.kicker { font-weight: 900; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.level-id-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 4px; }
h1.level-id { margin: 0; font-weight: 400; }
.level-id { font-family: var(--head); font-size: clamp(38px, 11vw, 56px); line-height: 1.05; color: var(--id); letter-spacing: 2px; text-shadow: var(--outline); word-break: break-all; }
.level-name { margin: 2px 0 0; font-size: 20px; font-weight: 900; }
.status-box { margin: 18px 0 0; padding: 16px; border-radius: 13px; background: var(--panel-2); border: 2px solid var(--line); }
.status-box p { margin: 10px 0 0; font-size: 17px; }
.big-pos { font-family: var(--head); color: var(--cyan); font-size: 1.35em; }
.video { position: relative; margin-top: 16px; aspect-ratio: 16 / 9; border-radius: 13px; overflow: hidden; border: 3px solid var(--ink); box-shadow: 0 0 0 2px rgba(178, 92, 255, 0.7), 0 0 30px rgba(178, 92, 255, 0.35); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- admin ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  font: inherit; font-weight: 900; color: var(--muted); cursor: pointer;
  padding: 8px 14px; border-radius: 11px; border: 2px solid var(--line); background: transparent;
}
.tab .n { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: var(--text); font-size: 13px; text-align: center; }
.tab[aria-selected='true'] { color: #fff; background: var(--accent); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.tab[aria-selected='true'] .n { background: rgba(0, 0, 0, 0.25); color: #fff; }
.toolbar .search { flex: 1 1 200px; min-width: 160px; padding: 9px 12px; }
.toolbar .spacer { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: 900; white-space: nowrap; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; padding: 0; border-radius: 999px; background: rgba(255, 90, 90, 0.5); border: 2px solid var(--ink); position: relative; cursor: pointer; transition: background 0.15s; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease-spring); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(20px); }
.closed-row { display: flex; gap: 8px; margin: -6px 0 16px; }
.closed-row input { flex: 1; min-width: 0; }

.warn {
  margin-bottom: 14px; padding: 12px 16px; border-radius: 13px;
  background: rgba(255, 211, 53, 0.13); border: 2px solid rgba(255, 211, 53, 0.6); font-weight: 800;
}
.warn.bad { background: rgba(255, 90, 90, 0.14); border-color: rgba(255, 90, 90, 0.6); }
.warn code { background: rgba(0, 0, 0, 0.35); padding: 1px 6px; border-radius: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }
.reqcard { margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.reqcard.s-recording { box-shadow: 0 0 0 2px rgba(255, 95, 210, 0.7), 0 18px 40px rgba(0, 0, 0, 0.45); }
.reqcard.s-done { box-shadow: 0 0 0 2px rgba(76, 255, 91, 0.45), 0 18px 40px rgba(0, 0, 0, 0.45); }
.reqcard.s-skipped { opacity: 0.7; }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rc-id {
  font-family: var(--head); font-size: 32px; line-height: 1; letter-spacing: 1.5px; color: var(--id);
  background: none; border: 0; padding: 0; cursor: pointer; text-shadow: var(--outline);
}
.rc-id:hover { color: #fff; }
.rc-id:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; border-radius: 6px; }
.rc-title { font-weight: 900; font-size: 17px; overflow-wrap: anywhere; }
.rc-title .by { color: var(--muted); font-weight: 700; }
.rc-meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.rc-meta b { color: var(--text); }
.rc-note { white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(0, 0, 0, 0.3); border-left: 4px solid var(--accent); padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.rc-warn { font-size: 13.5px; font-weight: 800; color: var(--yellow); }
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-video { display: flex; gap: 6px; }
.rc-video input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px; }
.rc-done { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.rc-link { font-size: 14px; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); font-weight: 800; padding: 40px 10px; }

.login { max-width: 420px; margin: 30px auto; }

/* ---------- footer, toast ---------- */
.foot { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 50;
  transform: translate(-50%, 24px) scale(0.9); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 12px; font-weight: 900;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  transition: opacity var(--dur) var(--ease), transform var(--dur-slow) var(--ease-spring); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.bad { background: #ffd0d0; }

/* ---------- page load: cards rise in one after another ---------- */
.stagger > * { animation: rise var(--dur-slow) var(--ease-spring) both; }
.stagger > :nth-child(2) { animation-delay: 50ms; }
.stagger > :nth-child(3) { animation-delay: 100ms; }
.stagger > :nth-child(4) { animation-delay: 150ms; }
.stagger > :nth-child(5) { animation-delay: 200ms; }
.stagger > :nth-child(6) { animation-delay: 250ms; }
.stagger > :nth-child(n + 7) { animation-delay: 300ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.grid.animate > .reqcard { animation: rise var(--dur-slow) var(--ease-spring) both; }
.grid.animate > .reqcard:nth-child(2) { animation-delay: 40ms; }
.grid.animate > .reqcard:nth-child(3) { animation-delay: 80ms; }
.grid.animate > .reqcard:nth-child(n + 4) { animation-delay: 120ms; }
.tab .ndot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); vertical-align: middle; }
.rc-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.unread-total { font-weight: 900; color: #fff; background: var(--pink); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; }

/* ---------- accessibility ---------- */
.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: 10px;
  background: #fff; color: var(--ink); font-weight: 900; text-decoration: none; border: 3px solid var(--ink);
  transition: top var(--dur) var(--ease);
}
.skip:focus { top: 12px; color: var(--ink); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
@media (pointer: coarse) {
  .btn-sm, .btn-xs, .tab { min-height: 44px; }
  .btn-xs { padding: 8px 13px; font-size: 14.5px; }
  .rc-actions, .rc-done { gap: 8px; }
}

/* ---------- loading placeholders ---------- */
.skel {
  display: block; border-radius: 9px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-wrap { display: grid; gap: 12px; }
.skel-line { height: 14px; }
.skel-big { height: 46px; border-radius: 12px; }
.skel-box { height: 92px; border-radius: 13px; }
.skel-pill { display: inline-block; width: 96px; height: 24px; border-radius: 999px; }
.skel-card { height: 230px; border-radius: var(--radius); }
.w25 { width: 25%; } .w35 { width: 35%; } .w55 { width: 55%; }

/* ---------- card header with a button ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--green); }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.6s ease-in-out infinite; }

/* ---------- details list ---------- */
.details { margin: 0; display: grid; }
.details > div { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); font-weight: 800; }
.details dd { margin: 0; font-weight: 800; white-space: pre-wrap; overflow-wrap: anywhere; }
#dLevelId { font-family: var(--head); font-weight: 400; font-size: 22px; letter-spacing: 1px; color: var(--id); }
@media (max-width: 480px) { .details > div { grid-template-columns: 1fr; } }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-log {
  display: flex; flex-direction: column; gap: 8px;
  height: min(52vh, 440px); min-height: 220px; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.34); border: 2px solid var(--line);
}
.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 320px; }
.chat-empty .big-emoji { font-size: 38px; }
.chat-empty p { margin: 6px 0 0; }
.msg {
  max-width: min(82%, 520px); padding: 8px 13px 9px; border-radius: 16px; line-height: 1.4;
  animation: msg-in var(--dur) var(--ease-spring) both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 700; }
.msg .who { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; font-weight: 900; margin-bottom: 1px; opacity: 0.92; }
.msg .when { font-size: 11.5px; font-weight: 700; opacity: 0.65; }
.msg.me { align-self: flex-end; background: linear-gradient(180deg, #a259ff, #6f22d9); border: 2px solid rgba(0, 0, 0, 0.35); border-bottom-right-radius: 5px; }
.msg.them { align-self: flex-start; background: rgba(255, 255, 255, 0.08); border: 2px solid var(--line); border-bottom-left-radius: 5px; }
.msg.them.from-admin { border-color: rgba(178, 92, 255, 0.6); box-shadow: 0 0 16px rgba(178, 92, 255, 0.18); }
.msg.pending { opacity: 0.65; }
.msg.failed { border-color: var(--red); }
.msg.sys {
  align-self: center; max-width: 95%; padding: 6px 12px; border-radius: 10px; text-align: center;
  background: rgba(255, 211, 53, 0.08); border: 1px dashed rgba(255, 211, 53, 0.4); color: #f6e7b4; font-size: 13px; font-weight: 700;
}
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 48px; max-height: 160px; resize: none; padding: 11px 14px; line-height: 1.35; }
.chat-form .btn { min-height: 48px; }
.chat-hint { margin: -2px 0 0; }
@media (pointer: coarse) { .chat-hint { display: none; } }
.ring { width: 0; height: 30px; flex: none; align-self: center; opacity: 0; margin-left: -10px; transition: opacity var(--dur), width var(--dur) var(--ease), margin var(--dur) var(--ease); }
.chat.typing .ring { width: 30px; opacity: 1; margin-left: 0; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 3; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset var(--dur) var(--ease), stroke var(--dur); }
.ring-fill.low { stroke: var(--red); }
.ring-text { fill: var(--muted); font: 900 9px var(--body); }
.chip-new {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--pink); color: #fff; font-weight: 900; font-size: 12.5px; border: 2px solid var(--ink);
  animation: pop var(--dur-slow) var(--ease-spring) both;
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* ---------- pop-up windows (admin chat / edit) ---------- */
dialog.modal {
  width: min(680px, calc(100vw - 20px)); max-height: calc(100dvh - 24px); padding: 0;
  color: var(--text); background: #120720;
  border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 0 0 0 2px rgba(178, 92, 255, 0.55), 0 30px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in var(--dur-slow) var(--ease-spring); }
dialog.modal::backdrop { background: rgba(6, 2, 14, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade var(--dur) var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(26px) scale(0.94); } }
@keyframes fade { from { opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 2px solid var(--line); background: rgba(178, 92, 255, 0.08); }
.modal-head .mh-text { flex: 1; min-width: 0; }
.modal-head .mh-title { font-family: var(--head); font-size: 26px; line-height: 1.1; color: var(--id); letter-spacing: 1px; }
.modal-head .mh-sub { color: var(--muted); font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 16px; overflow-y: auto; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; cursor: pointer;
  border-radius: 12px; border: 2px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); font: 900 18px var(--body);
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); transform: rotate(90deg); }
dialog.modal .chat-log { height: min(56dvh, 460px); }

/* ---------- top bar on inner pages ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.topbar .brand { margin: 0; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 46vw; min-height: 40px;
  padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 900;
  background: rgba(255, 255, 255, 0.07); border: 2px solid var(--line);
  transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur-fast), background var(--dur-fast);
}
.acct-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chip:hover { color: #fff; transform: translateY(-2px); border-color: var(--accent); background: rgba(178, 92, 255, 0.16); }
.acct-chip.in { border-color: rgba(178, 92, 255, 0.6); }
@media (max-width: 520px) { .topbar .brand .title { display: none; } }
.send-title { margin: 0 0 10px; }
.page-title { margin: 0; font-family: var(--head); font-weight: 400; font-size: clamp(30px, 7vw, 40px); letter-spacing: 0.5px; text-shadow: var(--outline); }

/* ---------- lobby ---------- */
.lobby { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 14px 16px 16px; text-align: center; }
.lobby-account { display: flex; justify-content: flex-end; min-height: 44px; }
.lobby-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 4px; }
.lobby-brand .logo { width: clamp(96px, 26vw, 128px); height: auto; aspect-ratio: 1; border-radius: 28px; border: 4px solid var(--ink); box-shadow: 0 0 0 3px rgba(178, 92, 255, 0.7), 0 0 50px rgba(178, 92, 255, 0.6); animation: bob 3s ease-in-out infinite; }
.lobby-title { margin: 8px 0 0; font-family: var(--head); font-weight: 400; font-size: clamp(48px, 13vw, 84px); line-height: 0.95; letter-spacing: 1px; text-shadow: var(--outline), 0 0 40px rgba(178, 92, 255, 0.5); }
.lobby-brand .tagline { margin: 4px 0 0; font-size: clamp(15px, 3.6vw, 18px); }
.lobby-status { margin: 14px 0 4px; }
.menu { display: flex; align-items: flex-end; justify-content: center; gap: clamp(14px, 5vw, 40px); margin: 18px 0 14px; }
.menu-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.menu-btn:hover { color: #fff; }
.menu-btn:focus-visible { outline: none; }
.menu-btn:focus-visible .mb-icon { outline: 4px solid var(--cyan); outline-offset: 5px; }
.mb-icon {
  --c1: #c48bff; --c2: #7a1fe0;
  position: relative; display: grid; place-items: center;
  width: clamp(84px, 22vw, 112px); aspect-ratio: 1; border-radius: 26px;
  border: 4px solid var(--ink);
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 -9px 0 rgba(0, 0, 0, 0.25), inset 0 5px 0 rgba(255, 255, 255, 0.35), 0 7px 0 var(--ink), 0 0 30px rgba(178, 92, 255, 0.35);
  transition: transform var(--dur) var(--ease-spring);
}
.mb-icon svg { width: 54%; height: 54%; overflow: visible; }
.menu-btn:hover .mb-icon { transform: translateY(-5px) scale(1.06) rotate(-2deg); }
.menu-btn:active .mb-icon { transform: translateY(2px) scale(0.94); transition-duration: 80ms; }
.menu-btn.main .mb-icon { --c1: #ff8fe6; --c2: #a12bff; width: clamp(128px, 34vw, 176px); border-radius: 36px; }
.menu-btn.main .mb-icon::before {
  content: ''; position: absolute; inset: -12px; border-radius: 44px; border: 3px solid rgba(255, 122, 224, 0.75);
  animation: ring 2.2s ease-out infinite; pointer-events: none;
}
@keyframes ring { from { transform: scale(0.92); opacity: 0.9; } to { transform: scale(1.2); opacity: 0; } }
.menu-btn.gold .mb-icon { --c1: #ffe27a; --c2: #f09a00; box-shadow: inset 0 -9px 0 rgba(0, 0, 0, 0.2), inset 0 5px 0 rgba(255, 255, 255, 0.4), 0 7px 0 var(--ink), 0 0 30px rgba(255, 200, 60, 0.3); }
.menu-btn.blue .mb-icon { --c1: #a9b8ff; --c2: #4652e0; box-shadow: inset 0 -9px 0 rgba(0, 0, 0, 0.22), inset 0 5px 0 rgba(255, 255, 255, 0.35), 0 7px 0 var(--ink), 0 0 30px rgba(110, 120, 255, 0.3); }
.mb-label { font-family: var(--head); font-size: clamp(15px, 4.2vw, 23px); letter-spacing: 0.5px; text-shadow: var(--outline); white-space: nowrap; }
.menu-btn.main .mb-label { font-size: clamp(21px, 5.6vw, 28px); }
.mb-badge { position: absolute; top: -10px; right: -12px; min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: var(--pink); color: #fff; font: 900 15px var(--body); border: 3px solid var(--ink); animation: pop var(--dur-slow) var(--ease-spring) both; }
.menu-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 18px; }
.lobby-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 560px; margin: 0 auto 18px; }
.stat { padding: 14px 8px; border-radius: 16px; background: var(--panel); border: 3px solid var(--ink); box-shadow: 0 0 0 2px rgba(178, 92, 255, 0.25); -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%); }
.stat b { display: block; font-family: var(--head); font-weight: 400; font-size: clamp(26px, 7vw, 36px); line-height: 1; color: var(--id); text-shadow: var(--outline); }
.stat span { color: var(--muted); font-weight: 800; font-size: 13.5px; }

/* ---------- tutorial video ---------- */
.tutorial video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 13px; border: 3px solid var(--ink); background: #000; box-shadow: 0 0 0 2px rgba(178, 92, 255, 0.55); }
.steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 8px; }
.steps li { counter-increment: step; display: flex; gap: 10px; align-items: flex-start; font-weight: 800; }
.steps li::before { content: counter(step); flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font: 400 15px var(--head); border: 2px solid var(--ink); }
.steps b { color: var(--cyan); }

/* ---------- leaderboard ---------- */
.lb { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.lb-row {
  display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--line);
  animation: rise var(--dur-slow) var(--ease-spring) both;
}
.lb-row.me { border-color: var(--accent); background: rgba(178, 92, 255, 0.14); }
.lb-rank { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font: 400 20px var(--head); background: rgba(255, 255, 255, 0.08); border: 2px solid var(--ink); text-shadow: var(--outline); }
.lb-row.r1 .lb-rank { background: linear-gradient(180deg, #ffe27a, #f0a800); }
.lb-row.r2 .lb-rank { background: linear-gradient(180deg, #f1f3ff, #9aa3c7); }
.lb-row.r3 .lb-rank { background: linear-gradient(180deg, #ffc48f, #c0662a); }
.lb-row.r1 { box-shadow: 0 0 24px rgba(255, 210, 60, 0.25); border-color: rgba(255, 210, 60, 0.6); }
.lb-name { font-weight: 900; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name .you { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); font-size: 11.5px; vertical-align: 2px; }
.lb-sub { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.lb-score { text-align: right; }
.lb-score b { display: block; font: 400 26px/1 var(--head); color: var(--id); text-shadow: var(--outline); }
.lb-score span { color: var(--muted); font-size: 12.5px; font-weight: 800; }
.skel-row { height: 64px; border-radius: 14px; }

/* ---------- account forms ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 2px solid var(--line); margin-bottom: 14px; }
.seg button { font: inherit; font-weight: 900; color: var(--muted); padding: 9px 16px; min-height: 40px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); }
.seg button[aria-selected='true'] { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--ink); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: 800 13px var(--body); color: var(--muted); background: rgba(255, 255, 255, 0.07); border: 0; border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.pw-toggle:hover { color: #fff; }
.linkish { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }
.ok-box { margin: 0 0 14px; padding: 12px 14px; border-radius: 11px; background: rgba(76, 255, 91, 0.1); border: 2px solid rgba(76, 255, 91, 0.5); font-weight: 800; }
details.fold summary { cursor: pointer; font-weight: 900; padding: 8px 0; }
.me-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.me-head .who b { font: 400 26px var(--head); text-shadow: var(--outline); }
.me-head .who span { display: block; color: var(--muted); font-weight: 800; font-size: 14px; }
.rc-acct { color: var(--cyan); font-weight: 900; }

/* ---------- moving ground ---------- */
.scene { position: fixed; left: 0; right: 0; bottom: 0; height: 96px; z-index: 0; pointer-events: none; overflow: hidden; }
.obstacles {
  position: absolute; left: 0; bottom: 64px; height: 32px; width: calc(100% + 320px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='32'%3E%3Cg fill='%23120624' stroke='%23b25cff' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M40 33 L54 6 L68 33 Z'/%3E%3Crect x='150' y='5' width='27' height='28'/%3E%3Cpath d='M228 33 L240 10 L252 33 Z M252 33 L264 10 L276 33 Z'/%3E%3C/g%3E%3C/svg%3E") repeat-x left bottom / 320px 32px;
  animation: scroll320 3.2s linear infinite;
  opacity: 0.85;
}
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px; overflow: hidden;
  background: linear-gradient(180deg, #4a1590, #14062b);
  border-top: 3px solid var(--accent);
  box-shadow: 0 -6px 26px rgba(178, 92, 255, 0.45);
}
.ground .track {
  position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% + 64px);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 64px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 60%);
  animation: scroll64 0.64s linear infinite;
}
@keyframes scroll320 { to { transform: translateX(-320px); } }
@keyframes scroll64 { to { transform: translateX(-64px); } }
body.admin .scene { display: none; }
body.admin { padding-bottom: 40px; }
body.admin .toast { bottom: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 480px) {
  .wrap { padding-top: 20px; }
  .card { padding: 18px 16px; }
  .brand .logo { width: 54px; height: 54px; }
  .lead { font-size: 16.5px; }
  .btn.full { font-size: 22px; }
}
