/* Playnova JS — shared base styles */
:root {
  color-scheme: dark;
  --bg: #060a12;
  --bg-soft: #0a1120;
  --surface: rgba(15, 23, 42, 0.72);
  --surface-solid: #0e1729;
  --surface-2: #142036;
  --text: #e9effc;
  --muted: #93a4c3;
  --muted-2: #6f81a3;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.3);
  --accent: #22d3ee;
  --accent-contrast: #041016;
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 38%, transparent);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.12);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 20px 50px rgba(2, 6, 23, 0.55);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--accent-contrast);
  background: var(--accent);
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #080e19;
}

::-webkit-scrollbar-thumb {
  background: #24324d;
  border-radius: 999px;
  border: 2px solid #080e19;
}

::-webkit-scrollbar-thumb:hover {
  background: #33456a;
}

.container {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease,
    box-shadow 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: #1a2a46;
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #8b5cf6));
  color: var(--accent-contrast);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn--primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, white), color-mix(in srgb, var(--accent) 40%, #8b5cf6));
}

.btn--ghost {
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(148, 163, 184, 0.08);
}

.btn--danger {
  border-color: rgba(251, 113, 133, 0.35);
  background: var(--danger-soft);
  color: #fecdd3;
}

.btn--danger:hover {
  border-color: rgba(251, 113, 133, 0.6);
  background: rgba(251, 113, 133, 0.2);
}

.btn--sm {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 0.82rem;
}

.btn--icon {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 10px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Form fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span,
.field > label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.field small {
  color: var(--muted-2);
  font-size: 0.78rem;
  line-height: 1.4;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(6, 11, 20, 0.62);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #5f7192;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  background: rgba(6, 11, 20, 0.9);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Badges & chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge--accent {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--success {
  border-color: rgba(52, 211, 153, 0.3);
  background: var(--success-soft);
  color: #86efac;
}

.badge--warning {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}

.badge--danger {
  border-color: rgba(251, 113, 133, 0.3);
  background: var(--danger-soft);
  color: #fecdd3;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease,
    transform 0.18s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Ads ---------- */

.ad-slot {
  margin: 18px auto;
}

.ad-slot--header {
  max-width: 970px;
  margin-top: 20px;
}

.ad-slot--footer {
  max-width: 970px;
  margin: 34px auto 0;
}

.ad-slot--infeed {
  grid-column: 1 / -1;
  margin: 4px 0;
}

.ad-unit {
  position: relative;
  width: 100%;
}

.ad-label {
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

.ad-body {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
}

.ad-body img {
  width: 100%;
  height: auto;
}

.ad-body iframe {
  max-width: 100%;
  border: 0;
}

.ad-text {
  display: block;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(139, 92, 246, 0.1));
  transition: background 0.2s ease;
}

.ad-text:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), rgba(139, 92, 246, 0.16));
}

.ad-text strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1rem;
}

.ad-text span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.ad-text em {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

/* ---------- Empty states ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.35);
  text-align: center;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-state h3 {
  font-size: 1.05rem;
}

.empty-state p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Toasts ---------- */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #101b2f;
  color: var(--text);
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease both;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease both;
}

.toast__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.toast--success .toast__dot {
  background: var(--success);
}

.toast--error .toast__dot {
  background: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* ---------- Utilities ---------- */

.stack-8 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-16 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent);
}

.mono {
  font-family: var(--mono);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
