@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400..700&family=Geist:wght@400..750&display=swap');

:root {
  color-scheme: dark light;
  --theme-bg: #080a0c;
  --theme-panel: rgb(20 24 27 / 0.88);
  --theme-panel-raised: rgb(29 34 38 / 0.92);
  --theme-panel-soft: rgb(10 13 15 / 0.78);
  --theme-panel-deep: #080b0d;
  --theme-line: rgb(255 255 255 / 0.09);
  --theme-line-strong: rgb(255 255 255 / 0.16);
  --theme-text: #f0f1ee;
  --theme-muted: #a3aaa6;
  --theme-faint: #737b77;
  --theme-accent: #d8754f;
  --theme-accent-strong: #e68b68;
  --theme-accent-ink: #1f100a;
  --theme-focus: #ef9b79;
  --theme-success: #76b291;
  --theme-warning: #d0a25b;
  --theme-danger: #d56770;
  --theme-shadow: 0 28px 80px rgb(0 0 0 / 0.38), inset 0 1px 0 rgb(255 255 255 / 0.055);
  --theme-display: "Geist", system-ui, sans-serif;
  --theme-body: "Geist", system-ui, sans-serif;
  --theme-mono: "Geist Mono", ui-monospace, monospace;
  --radius-surface: 24px;
  --radius-control: 13px;
  --layer-header: 20;
  --layer-dialog: 40;
  font-family: var(--theme-body);
}

:root[data-theme="light"] {
  color-scheme: light;
  --theme-bg: #f3f2ee;
  --theme-panel: rgb(255 255 255 / 0.84);
  --theme-panel-raised: rgb(255 255 255 / 0.96);
  --theme-panel-soft: rgb(236 233 225 / 0.78);
  --theme-panel-deep: #eceae4;
  --theme-line: rgb(49 45 38 / 0.1);
  --theme-line-strong: rgb(49 45 38 / 0.18);
  --theme-text: #202321;
  --theme-muted: #59605c;
  --theme-faint: #747a76;
  --theme-accent: #b95131;
  --theme-accent-strong: #913b25;
  --theme-accent-ink: #fffaf4;
  --theme-focus: #b95131;
  --theme-success: #397759;
  --theme-warning: #8a641e;
  --theme-danger: #a23e47;
  --theme-shadow: 0 28px 80px rgb(72 61 43 / 0.13), inset 0 1px 0 rgb(255 255 255 / 0.86);
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgb(216 117 79 / 0.13), transparent 34%),
    radial-gradient(circle at 88% 20%, rgb(91 111 127 / 0.1), transparent 32%);
}

.theme-toggle,
.support-trigger,
.discord-link {
  min-height: 38px;
  border: 1px solid var(--theme-line-strong);
  border-radius: 999px;
  background: linear-gradient(145deg, var(--theme-panel-raised), var(--theme-panel));
  color: var(--theme-text);
  cursor: pointer;
  font: 650 0.78rem var(--theme-body);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 10px 28px rgb(0 0 0 / 0.12);
  text-decoration: none;
  transition: border-color 220ms cubic-bezier(0.16, 1, 0.3, 1), background-color 220ms cubic-bezier(0.16, 1, 0.3, 1), color 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle {
  width: 38px;
  min-width: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.site-icon { width: 17px; height: 17px; display: inline-block; background: currentColor; -webkit-mask: var(--site-icon) center / contain no-repeat; mask: var(--site-icon) center / contain no-repeat; }
.site-icon-sun { --site-icon: url("https://cdn.jsdelivr.net/npm/heroicons@2/24/outline/sun.svg"); }
.site-icon-moon { --site-icon: url("https://cdn.jsdelivr.net/npm/heroicons@2/24/outline/moon.svg"); }
.site-icon-x-mark { --site-icon: url("https://cdn.jsdelivr.net/npm/heroicons@2/24/outline/x-mark.svg"); }
.support-trigger,
.discord-link { display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; white-space: nowrap; }
.support-trigger { border-color: rgb(230 139 104 / 0.42); background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-strong)); color: var(--theme-accent-ink); }
.discord-link { border-color: rgb(122 139 255 / 0.25); }
.theme-toggle:hover,
.support-trigger:hover,
.discord-link:hover { border-color: var(--theme-accent); transform: translateY(-2px); }
.theme-toggle:active,
.support-trigger:active,
.discord-link:active { transform: translateY(1px) scale(0.98); }
.theme-toggle:focus-visible,
.support-trigger:focus-visible,
.discord-link:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 3px; }

.support-dialog {
  width: min(520px, calc(100vw - 32px));
  height: min(780px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--theme-line-strong);
  border-radius: var(--radius-surface);
  background: linear-gradient(160deg, var(--theme-panel-raised), var(--theme-panel));
  color: var(--theme-text);
  box-shadow: 0 30px 100px rgb(2 5 6 / 0.62);
}

.support-dialog::backdrop { background: rgb(3 5 6 / 0.78); backdrop-filter: blur(6px); }
.support-dialog-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.support-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--theme-line); }
.support-dialog-header div { min-width: 0; }
.support-dialog-header p { margin: 0 0 3px; color: var(--theme-accent-strong); font: 650 0.68rem var(--theme-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.support-dialog-header h2 { margin: 0; font: 650 1.08rem var(--theme-display); letter-spacing: -0.02em; }
.support-dialog-close { width: 40px; min-width: 40px; height: 40px; border: 1px solid var(--theme-line); border-radius: 999px; background: var(--theme-panel-raised); color: var(--theme-text); cursor: pointer; font-size: 1.2rem; }
.support-dialog-close .site-icon { width: 20px; height: 20px; }
.support-dialog-close:hover { border-color: var(--theme-accent); color: var(--theme-accent-strong); }
.support-dialog-close:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 2px; }
.support-frame-wrap { min-height: 0; background: #f9f9f9; }
.support-frame { width: 100%; height: 100%; display: block; padding: 4px; border: 0; background: #f9f9f9; }
.support-dialog-footer { margin: 0; padding: 12px 18px 14px; border-top: 1px solid var(--theme-line); color: var(--theme-muted); font-size: 0.74rem; line-height: 1.45; }
.support-dialog-footer a { color: var(--theme-accent-strong); text-underline-offset: 3px; }

@media (max-width: 580px) {
  .support-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 20px; }
  .support-dialog-header { padding: 13px 14px; }
  .support-dialog-footer { padding: 10px 14px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
