/* Studio Showcase — uses Formula 1 Apex Legends tokens from style.css */
:root {
  --font-mona: 'Mona Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --color--lime: #d2ff00;
  --color--lime-glow: rgba(210, 255, 0, 0.45);
  --color--black: #0c0f0a;
  --color--white: #f5f6ed;
}

html, body.showcase-page {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--color--white);
  font-family: var(--font-mona);
  cursor: default;
}

#sx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

#sx-ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
#sx-ui > * { pointer-events: auto; }
#sx-ui .sx-hint-bar,
#sx-ui .sx-credit { pointer-events: none; }

body.ui-hidden #sx-ui .sx-panel,
body.ui-hidden #sx-ui .sx-topbar,
body.ui-hidden #sx-ui .sx-hint-bar,
body.ui-hidden #sx-ui .sx-credit { display: none; }
body.ui-hidden #sx-ui { pointer-events: none; }

.sx-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 14px 16px;
  background: linear-gradient(180deg, rgba(7, 10, 16, 0.78) 0%, rgba(7, 10, 16, 0.2) 70%, transparent 100%);
  pointer-events: none;
}
.sx-topbar > * { pointer-events: auto; }

.sx-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d1d9e2;
  text-decoration: none;
  font-family: var(--font-mona);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sx-back-chevron { font-size: 1.1rem; line-height: 1; }
.sx-back:hover {
  background: rgba(210, 255, 0, 0.15);
  border-color: var(--color--lime);
  color: #fff;
  transform: translateY(-1px);
}

.sx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sx-brand img {
  width: 22px; height: 22px;
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 0 12px rgba(210, 255, 0, 0.25);
}
.sx-brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.sx-brand-kicker {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #94a3b8;
}
.sx-brand-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff;
}

.sx-top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sx-subject-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 18, 0.65);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color--lime);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-hide-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d1d9e2;
  font-family: var(--font-mona);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.sx-hide-btn kbd {
  font-family: var(--mono, ui-monospace, monospace);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.68rem;
}
.sx-hide-btn:hover { border-color: var(--color--lime); color: #fff; }

.sx-panel {
  position: absolute;
  top: 68px;
  bottom: 22px;
  width: min(300px, calc(100vw - 24px));
  overflow: auto;
  padding: 2px 8px 8px;
  background: linear-gradient(145deg, rgba(14, 20, 32, 0.78) 0%, rgba(7, 10, 16, 0.86) 100%);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.sx-panel-left { left: 12px; border-radius: 16px; }
.sx-panel-right { right: 12px; border-radius: 16px; }
.sx-panel-right .sx-hint { display: none; }

.sx-section + .sx-section {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sx-section h2 {
  margin: 0 0 4px;
  font-family: var(--font-mona);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color--lime);
}

.sx-label {
  display: flex;
  justify-content: space-between;
  margin: 4px 0 2px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sx-select, .sx-input, .sx-section input[type="search"] {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.4);
  color: #f0f4f8;
  font-family: var(--font-mona);
  font-size: 0.8rem;
  font-weight: 600;
}
.sx-select:focus, .sx-input:focus { outline: 1px solid var(--color--lime); }

.sx-seg, .sx-chips, .sx-presets, .sx-move-row, .sx-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sx-seg button, .sx-chips button, .sx-presets button, .sx-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #d1d9e2;
  font-family: var(--font-mona);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.sx-seg button { flex: 1 1 auto; }
.sx-seg button.is-on, .sx-chips button.is-on, .sx-presets button.is-on {
  background: var(--color--lime);
  color: #080c12;
  border-color: #eeff80;
  box-shadow: 0 0 16px var(--color--lime-glow);
}
.sx-presets button {
  width: 28px; height: 28px; padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  background: var(--swatch, #888);
}
.sx-presets button.is-on {
  box-shadow: 0 0 0 2px #080c12, 0 0 0 4px var(--color--lime), 0 0 16px var(--color--lime-glow);
  background: var(--swatch, #888);
  border-color: #fff;
}

.sx-btn-ghost { width: 100%; margin-top: 8px; }
.sx-btn:hover, .sx-seg button:hover, .sx-chips button:hover {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.sx-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d1d9e2;
  cursor: pointer;
}
.sx-check input { accent-color: var(--color--lime); }

.sx-section input[type="range"] {
  width: 100%;
  accent-color: var(--color--lime);
}
.sx-section input[type="color"] {
  width: 42px; height: 32px;
  padding: 0; border: 0;
  background: none;
  cursor: pointer;
}
.sx-color-row .sx-input { flex: 1; }
.sx-color-row { align-items: center; }

.sx-file {
  display: block;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px dashed rgba(210, 255, 0, 0.4);
  border-radius: 8px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color--lime);
  cursor: pointer;
}
.sx-file input { display: none; }
.sx-drop {
  margin-top: 8px;
  padding: 16px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,0.18);
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8898ac;
}
.sx-drop.is-over {
  border-color: var(--color--lime);
  color: #fff;
  background: rgba(210, 255, 0, 0.08);
}

.sx-lib-list {
  max-height: 220px;
  overflow: auto;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sx-lib-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  color: #f0f4f8;
  font-family: var(--font-mona);
  text-align: left;
  cursor: pointer;
}
.sx-lib-item strong { font-size: 0.75rem; }
.sx-lib-item small { color: #8898ac; font-size: 0.62rem; letter-spacing: 0.04em; }
.sx-lib-item:hover { border-color: var(--color--lime); }

.sx-hint {
  margin: 4px 0 0;
  font-size: 0.6rem;
  line-height: 1.3;
  color: #8898ac;
}
.sx-hint-bar {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  white-space: nowrap;
}
.sx-credit {
  position: absolute;
  left: 12px;
  bottom: 8px;
  max-width: min(520px, calc(100vw - 360px));
  margin: 0;
  font-size: 0.58rem;
  line-height: 1.35;
  color: #7b8796;
}

.sx-toast {
  position: absolute;
  left: 50%;
  top: 78px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(8,12,18,0.9);
  border: 1px solid var(--color--lime);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.sx-loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(12px);
}
.sx-loader.is-done { opacity: 0; pointer-events: none; transition: opacity 0.45s ease; }
.sx-loader-card {
  min-width: 280px;
  padding: 22px 26px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(14, 20, 32, 0.92), rgba(7, 10, 16, 0.95));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 30px var(--color--lime-glow);
  text-align: center;
}
.sx-loader-kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color--lime);
  margin-bottom: 8px;
}
.sx-loader-card strong { display: block; font-size: 0.95rem; margin-bottom: 14px; }
.sx-loader-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.sx-loader-bar span {
  display: block;
  height: 100%;
  width: 20%;
  background: var(--color--lime);
  box-shadow: 0 0 12px var(--color--lime-glow);
  transition: width 0.25s ease;
}

@media (max-width: 900px) {
  .sx-panel { display: none; }
  body.sx-panels-open .sx-panel { display: block; top: auto; bottom: 48px; height: 42vh; width: calc(100vw - 16px); left: 8px; right: 8px; }
  .sx-hint-bar { display: none; }
  .sx-credit { max-width: calc(100vw - 24px); }
}
