/* ShivassGame design tokens and base elements — shared by the site and the admin panel. */
:root {
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;

  --radius: 6px;
  --radius-lg: 10px;
  --gap: 16px;
  --maxw: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
  --bg: #07080b;
  --bg-elev: #0c0e13;
  --surface: #11141b;
  --surface-2: #181c25;
  --border: #252b38;
  --border-strong: #343c4d;
  --text: #f3f5f9;
  --text-soft: #c8cfda;
  --muted: #8d97a7;
  --accent: #1e90ff;
  --accent-strong: #0a74e6;
  --accent-soft: rgba(30, 144, 255, .14);
  --accent-text: #6ab8ff;
  --on-accent: #ffffff;
  --danger: #ff5468;
  --danger-soft: rgba(255, 84, 104, .14);
  --ok: #2fd27f;
  --ok-soft: rgba(47, 210, 127, .14);
  --warn: #f6b23c;
  --warn-soft: rgba(246, 178, 60, .14);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --pixel: var(--accent);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --border: #d8dee8;
  --border-strong: #b9c2d0;
  --text: #0a0c11;
  --text-soft: #2b3240;
  --muted: #5b6575;
  --accent: #0a6cff;
  --accent-strong: #0057d6;
  --accent-soft: rgba(10, 108, 255, .10);
  --accent-text: #0057d6;
  --danger: #d92640;
  --danger-soft: rgba(217, 38, 64, .10);
  --ok: #138a4f;
  --ok-soft: rgba(19, 138, 79, .10);
  --warn: #a86a00;
  --warn-soft: rgba(168, 106, 0, .10);
  --shadow: 0 10px 30px rgba(15, 23, 42, .12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    color-scheme: light;
    --bg: #f4f6f9;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef1f6;
    --border: #d8dee8;
    --border-strong: #b9c2d0;
    --text: #0a0c11;
    --text-soft: #2b3240;
    --muted: #5b6575;
    --accent: #0a6cff;
    --accent-strong: #0057d6;
    --accent-soft: rgba(10, 108, 255, .10);
    --accent-text: #0057d6;
    --danger: #d92640;
    --danger-soft: rgba(217, 38, 64, .10);
    --ok: #138a4f;
    --ok-soft: rgba(19, 138, 79, .10);
    --warn: #a86a00;
    --warn-soft: rgba(168, 106, 0, .10);
    --shadow: 0 10px 30px rgba(15, 23, 42, .12);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---- buttons ---- */
.btn {
  --b-bg: var(--surface-2);
  --b-fg: var(--text);
  --b-bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px;
  border: 1px solid var(--b-bd); border-radius: var(--radius);
  background: var(--b-bg); color: var(--b-fg);
  font: 600 14px/1 var(--font-sans); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { --b-bg: var(--accent); --b-fg: var(--on-accent); --b-bd: var(--accent); }
.btn-primary:hover { --b-bg: var(--accent-strong); --b-bd: var(--accent-strong); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; }
.btn-ghost:hover { --b-bg: var(--surface-2); }
.btn-danger { --b-bg: var(--danger-soft); --b-fg: var(--danger); --b-bd: transparent; }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: 16px; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-play::before {
  content: ""; width: 0; height: 0;
  border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}

/* ---- form controls ---- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.input, select.input, textarea.input {
  width: 100%; min-height: 38px; padding: 8px 12px;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: 14px/1.4 var(--font-sans);
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- badges & chips ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 3px;
  font: 700 11px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-soft); }
.chip.off { opacity: .55; text-decoration: line-through; }

/* ---- pixel accents ---- */
.pixel-corners { position: relative; }
.pixel-corners::before, .pixel-corners::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none;
  border-color: var(--pixel); border-style: solid; opacity: .9;
}
.pixel-corners::before { top: -1px; left: -1px; border-width: 3px 0 0 3px; }
.pixel-corners::after { bottom: -1px; right: -1px; border-width: 0 3px 3px 0; }
.pixel-rule {
  height: 6px; border: 0; margin: 28px 0;
  background-image: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
  background-size: 12px 6px; opacity: .55;
}
.eyebrow { font: 700 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.notice { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; }
.notice-warn { background: var(--warn-soft); border-color: transparent; color: var(--text); }
.notice-danger { background: var(--danger-soft); border-color: transparent; }
.notice-ok { background: var(--ok-soft); border-color: transparent; }
.notice-accent { background: var(--accent-soft); border-color: transparent; }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

/* ---- dialogs & toasts ---- */
dialog.dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dialog-body { padding: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-elev); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 1000; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 14px; animation: toast-in .2s var(--ease); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-ok { border-left: 3px solid var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

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