/* Local copies of Inter (text) and Manrope (headings), SIL Open Font License. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Base visual language for the local RPG interfaces. Themes only change presentation. */
:root {
  color-scheme: dark;
  --rpg-accent: #7de1dd;
  --rpg-accent-soft: rgb(125 225 221 / 10%);
  --rpg-secondary: #a99bff;
  --rpg-focus: #f1d08d;
  --rpg-font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
  --rpg-font-display: "Manrope", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
  --rpg-text-xs: .75rem;
  --rpg-text-sm: .875rem;
  --rpg-text-base: 1rem;
  --rpg-text-lg: 1.125rem;
  --rpg-title-sm: 1.125rem;
  --rpg-title-md: 1.5rem;
  --rpg-title-lg: clamp(1.75rem, 3vw, 2.25rem);
  --rpg-weight-regular: 400;
  --rpg-weight-medium: 500;
  --rpg-weight-semibold: 600;
  --rpg-weight-bold: 700;
  --rpg-radius-panel: 13px;
  --rpg-radius-control: 8px;
  --rpg-space-1: 6px;
  --rpg-space-2: 10px;
  --rpg-space-3: 16px;
  --rpg-space-4: 24px;
}

body[data-rpg-theme] {
  font-family: var(--rpg-font-body);
  font-size: var(--rpg-text-base);
  font-weight: var(--rpg-weight-regular);
  line-height: 1.55;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(ellipse at 82% -14%, var(--rpg-accent-soft), transparent 42%),
    repeating-linear-gradient(135deg, transparent 0 27px, rgb(255 255 255 / 1.2%) 27px 28px),
    var(--rpg-page-backdrop, none);
}

body[data-rpg-theme] :where(h1, h2, h3, .brand strong, .wordmark strong) {
  font-family: var(--rpg-font-display);
  font-synthesis: none;
  letter-spacing: -0.025em;
}
body[data-rpg-theme] :where(h1) { font-size: var(--rpg-title-lg); font-weight: var(--rpg-weight-bold); line-height: 1.15; }
body[data-rpg-theme] :where(h2) { font-size: var(--rpg-title-md); font-weight: var(--rpg-weight-semibold); line-height: 1.2; }
body[data-rpg-theme] :where(h3) { font-size: var(--rpg-title-sm); font-weight: var(--rpg-weight-semibold); line-height: 1.3; }

body[data-rpg-theme] :where(button, input, select, textarea) {
  font-family: var(--rpg-font-body);
}

body[data-rpg-theme] :where(th, td, .metric strong, .balance, .amount, .money, [data-number]) {
  font-variant-numeric: tabular-nums;
}

.site-theme-toggle {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line, #334155);
  border-radius: 10px;
  background: var(--panel, #171d26);
  color: var(--text, var(--ink, #f4f3ff));
  font: 18px/1 var(--rpg-font-body);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.site-theme-toggle:hover { transform: translateY(-1px); }
.site-theme-toggle:focus-visible { outline: 3px solid var(--rpg-focus); outline-offset: 3px; }
.login-card, .access-card { position: relative; }
.login-card > .site-theme-toggle, .access-card > .site-theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
}

html[data-site-theme="light"] { color-scheme: light; }
html[data-site-theme="light"] body[data-rpg-theme] {
  background-color: #f3f5f9 !important;
  background-image: none !important;
  color: #202838 !important;
}
html[data-site-theme="light"] body[data-rpg-theme] :where(h1, h2, h3, p, label, .muted, .note, .metric-label, .metric-foot, .section-head p, .brand small, .row-main small, .sync, .table td, .table th, .panel-title) {
  color: #253044;
}
html[data-site-theme="light"] body[data-rpg-theme] :where(.sidebar, .top, .topbar, .card, .login-card, .access-card, .moves-panel, .log-panel, .table-wrap, .site-card, .cmd, .event, .detail, .pill, .table th, .site-preview) {
  border-color: #d8deea !important;
  background: #fff !important;
  color: #202838 !important;
  box-shadow: 0 8px 24px rgb(35 47 70 / 6%);
}
html[data-site-theme="light"] body[data-rpg-theme] :where(button, input, select, textarea, .field) {
  border-color: #cbd3e1;
  background-color: #fff;
  color: #202838;
}
html[data-site-theme="light"] body[data-rpg-theme] :where(.nav, .button.secondary, .btn.secondary, .btn.ghost, .move, .type-chip, .condition-chip) {
  border-color: #d4dbe7;
  background: #eef1f6;
  color: #273248;
}
html[data-site-theme="light"] body[data-rpg-theme] :where(.table td, .table th) { border-color: #e1e5ee !important; }
html[data-site-theme="light"] body[data-rpg-theme] :where(.table tr:hover td, .nav:hover) { background-color: #f1f4f8 !important; }
html[data-site-theme="light"] body[data-rpg-theme] :where(.btn, .button, .move, .nav, .site-theme-toggle) { color-scheme: light; }

body[data-rpg-theme="portal"] {
  --rpg-accent: #75dedb;
  --rpg-secondary: #a99bff;
  --rpg-accent-soft: rgb(117 222 219 / 7%);
}

body[data-rpg-theme="admin"] {
  --rpg-accent: #a99bff;
  --rpg-accent-soft: rgb(169 155 255 / 12%);
  --rpg-secondary: #76d8e9;
  --green: #c1b7ff;
  --green2: #8e7bea;
  --lime: #e0d9ff;
  --blue: #76d8e9;
}

body[data-rpg-theme="bank"] {
  --rpg-accent: #50d6c4;
  --rpg-accent-soft: rgb(80 214 196 / 10%);
  --rpg-secondary: #a6ede3;
  --bg: #0b191d;
  --panel: #10272c;
  --panel2: #153238;
  --line: #2c4d50;
  --purple: #50d6c4;
  --mint: #a6ede3;
  --gold: #e8d59d;
}

body[data-rpg-theme="bank-admin"] {
  --rpg-accent: #58dce1;
  --rpg-accent-soft: rgb(88 220 225 / 11%);
  --rpg-secondary: #a4f0e8;
  --bg: #0c1b22;
  --panel: #112a33;
  --line: #2a4b55;
  --purple: #58dce1;
  --mint: #a4f0e8;
  --gold: #cbe7e7;
}

body[data-rpg-theme="arena"],
body[data-rpg-theme="arena-lobby"] {
  --rpg-accent: #f3bd5f;
  --rpg-accent-soft: rgb(243 189 95 / 10%);
  --rpg-secondary: #64c9ec;
  --mint: #f3bd5f;
  --blue: #64c9ec;
  --gold: #ffd47b;
}

body[data-rpg-theme] :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--rpg-focus) !important;
  outline-offset: 3px !important;
}

body[data-rpg-theme] :where(button, .button, .btn, .link, .cancel) {
  min-height: 40px;
  border-radius: var(--rpg-radius-control);
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

body[data-rpg-theme] :where(button, .button, .btn, .link, .cancel):not(:disabled):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--rpg-accent) 65%, transparent);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--rpg-accent) 13%, transparent);
}

body[data-rpg-theme] :where(input, select, textarea) {
  border-radius: var(--rpg-radius-control);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

body[data-rpg-theme] :where(input, select, textarea):focus-visible {
  border-color: var(--rpg-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rpg-accent) 18%, transparent) !important;
}

body[data-rpg-theme] :where(.card, .metric, .login-card, .access-card, .moves-panel, .log-panel, .cmd, .table-wrap) {
  border-radius: var(--rpg-radius-panel);
}

body[data-rpg-theme] :where(.topbar, .top, .top-inner, .topbar, .topbar header) {
  border-color: color-mix(in srgb, var(--rpg-accent) 22%, var(--line, transparent));
}

body[data-rpg-theme] :where(.eyebrow, .section-head h2, .panel-title, .brand-icon, .brand .icon) {
  color: var(--rpg-accent);
}

body[data-rpg-theme] :where(.table th, .table thead th) {
  border-bottom: 1px solid color-mix(in srgb, var(--rpg-accent) 32%, var(--line, transparent));
}

body[data-rpg-theme="portal"] .nav-cta,
body[data-rpg-theme="portal"] .button-primary {
  border-color: rgb(117 222 219 / 34%);
}

@media (hover: none) {
  body[data-rpg-theme] :where(button, .button, .btn, .link, .cancel):not(:disabled):hover {
    transform: none;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-rpg-theme] *,
  body[data-rpg-theme] *::before,
  body[data-rpg-theme] *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
