/* EnviroMento skin for the Splat Universe hub: the scene library and annotation editor in
   people's accounts. Loaded after the hub's own CSS (build-hub.ps1 adds it), so it only
   restyles; the hub itself is unchanged and still builds from the Splat Universe repo. */

:root,
:root[data-theme],
:root:not([data-theme="light"]) {
  --brand-primary: #000;
  --brand-deep: #000;
  --brand-accent: #f1eff4;
  --brand-accent-strong: #d6d3db;
  --brand-on-accent: #0b0a0d;
  --page: #000;
  --card: #0a0d0f;
  --surface: #060809;
  --border: rgba(255, 255, 255, 0.09);
  --field-border: rgba(255, 255, 255, 0.2);
  --placeholder: #5c676c;
  --text: #f3f6f7;
  --muted: #8a959a;
  --brand-tint: rgba(241, 239, 244, 0.07);
  --brand-text: #f1eff4;
  --brand-text-strong: #fff;
  --danger: #ff8a8a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  --body-font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --heading-font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

body {
  background: radial-gradient(80% 40% at 50% 0%, rgba(241, 239, 244, 0.05), transparent 70%), #000;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 300; letter-spacing: -0.01em; }
::selection { background: rgba(241, 239, 244, 0.3); }

/* ---------- Header ---------- */

.su-header {
  height: 62px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.88);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-weight: 500;
}
.su-mark {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
}
.su-names strong { font-weight: 300; font-size: 14px; letter-spacing: 0.24em; text-transform: uppercase; }
.su-names small { color: #8a959a; font-weight: 400; letter-spacing: 0.04em; }
.su-nav a { color: #8a959a; font-weight: 500; }
.su-nav a:hover { color: #fff; }
.su-nav a[aria-current] { color: #fff; }
.su-theme { display: none !important; }   /* EnviroMento is dark only */

/* Account links added by enviromento-skin.js */
.em-links { display: flex; align-items: center; gap: 6px; margin-right: 4px; }
.em-links a,
.em-links button {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #b9c2c6;
  background: none;
  font: 500 13px/1 "Inter Tight", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.em-links a:hover,
.em-links button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.em-links button { border-color: rgba(255, 255, 255, 0.14); color: #f3f6f7; }
@media (max-width: 760px) { .em-links a[data-site] { display: none; } }

/* ---------- Buttons: pills ---------- */

.upload-button,
.primary-button,
.secondary-button,
.danger-button,
.import-button {
  border-width: 1px;
  border-radius: 999px;
  font-family: var(--body-font);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
}
.upload-button,
.primary-button { border-color: #fff; color: #000; background: #fff; }
.upload-button:hover,
.primary-button:hover:not(:disabled) { border-color: #dffcf3; background: #dffcf3; }
.secondary-button,
.import-button { border-color: rgba(255, 255, 255, 0.18); color: #f3f6f7; background: rgba(255, 255, 255, 0.04); }
.secondary-button:hover:not(:disabled),
.import-button:hover { border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.08); }
.icon-button { border-radius: 999px; }

/* ---------- Cards, dialogs, fields ---------- */

.scene-card { border-radius: 18px; overflow: hidden; }
.scene-card:hover { border-color: rgba(255, 255, 255, 0.24); }

.dialog {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: #07090a;
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.72); }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea {
  border-radius: 10px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid #f1eff4; outline-offset: 1px; }

/* ---------- Embeds: the scene and its annotations only ---------- */
.em-embed #site-header { display: none !important; }

/* Scenes arrive from Splat Universe on the PC for now; uploading here is switched off on the server. */
.upload-button,
.import-button { display: none !important; }
#export-button,
label:has(#replace-file),
.collision-row label { display: none !important; }

/* The glass-cube logo replaces the "EM" text badge (enviromento-skin.js). */
.su-mark:has(img) { padding: 0; border: 0; border-radius: 0; line-height: 0; }
.su-mark img { display: block; width: 34px; height: 34px; }

/* ============ Refined (like the website's css/refined.css) ============
   The system's own font for the interface, firm headings, plain sentence-case labels, small corners, solid
   surfaces: no letter-spaced capitals, pills or glows. The brand wordmark in the header keeps its face. */
:root, :root[data-theme], :root:not([data-theme="light"]) {
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --heading-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: #0c0d0e;
  --card: #15181a;
  --surface: #1b1f22;
  --border: rgba(255, 255, 255, 0.12);
}
body { background: var(--page); font-family: var(--body-font); }
h1, h2, h3 { font-family: var(--heading-font); font-weight: 650; letter-spacing: -0.005em; }
.su-header { background: #15181a; font-family: var(--body-font); }
.su-names strong { font-family: "Inter Tight", system-ui, sans-serif; }
.su-names small { letter-spacing: 0; }

.em-links a, .em-links button { border-radius: 6px; font: 500 14px/1 var(--body-font); }

.upload-button, .primary-button, .secondary-button, .danger-button, .import-button {
  border-radius: 6px;
  font-family: var(--body-font);
  font-weight: 500;
  letter-spacing: 0;
}
.upload-button, .primary-button { border-color: #f1eff4; color: #141317; background: #f1eff4; }
.upload-button:hover, .primary-button:hover:not(:disabled) { border-color: #ffffff; background: #ffffff; }
.secondary-button, .import-button { border-color: rgba(255, 255, 255, 0.22); background: #1b1f22; }
.icon-button { border-radius: 6px; }

.scene-card { border-radius: 8px; background: var(--card); }
.dialog { border-radius: 10px; background: #15181a; border-color: rgba(255, 255, 255, 0.12); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea { border-radius: 6px; }

/* Before a scene opens: its name and two plain buttons */
.sse-viewer .su-intro { font-family: var(--body-font); }
.sse-viewer .su-intro-eyebrow { color: rgba(255, 255, 255, 0.72); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.sse-viewer .su-intro-title { font-weight: 600; font-size: clamp(22px, 3vw, 30px); }
.sse-viewer .su-intro-actions { gap: 10px; }
.sse-viewer .su-intro-actions button {
  min-width: 150px;
  padding: 11px 22px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  font: 500 15px/1.2 var(--body-font);
  background: rgba(16, 18, 20, 0.78);
}
.sse-viewer .su-intro-actions button:hover:not(:disabled) { background: rgba(32, 36, 40, 0.9); }
.sse-viewer .su-intro-actions .su-intro-view { border-color: #f1eff4; color: #141317; background: #f1eff4; }
.sse-viewer .su-intro-actions .su-intro-view:hover:not(:disabled) { background: #ffffff; }

/* The library's cover over a scene before it loads */
.load-cover-kicker { color: rgba(255, 255, 255, 0.75) !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 500 !important; font-family: var(--body-font); }
.load-cover-name { font-family: var(--body-font); font-weight: 600 !important; }
.load-cover-action { border-radius: 6px !important; letter-spacing: 0 !important; text-transform: none !important; font-family: var(--body-font); }

/* A phone: the bar's right side (account links, display toggles) kept within the screen. The site's name goes
   (the mark stays and leads to the library), the links get tighter, the toggles show just their icons, and the
   sections' strip scrolls in what is left. Without this the bar was 600 px wide on a 375 px phone and pushed
   every page past the screen's edge. */
@media (max-width: 560px) {
  .su-header .su-names { display: none; }
  .su-header .em-links { gap: 2px; margin-right: 0; }
  .su-header .em-links a,
  .su-header .em-links button { padding: 7px 9px; font-size: 13px; }
  .su-header .prefs.in-bar { gap: 4px; margin-left: 2px; }
  .su-header .prefs.in-bar .pref { padding: 7px; }
  .su-header .prefs.in-bar .pref-track { display: none; }
}
