/* ============================================================
   Lay The Path — Design System
   Dark theme. All design tokens defined here as CSS variables.
   Every page and panel in the client imports this file.
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */

:root {
  /* Background scale */
  --bg-void:      #090b0f;
  --bg-base:      #0d1117;
  --bg-surface:   #131922;
  --bg-elevated:  #1a2333;
  --bg-overlay:   #20293d;
  --bg-muted:     #2a3650;

  /* Border */
  --border-subtle:  #1e2d42;
  --border-default: #2a3d5a;
  --border-strong:  #3d5475;

  /* Text */
  --text-primary:   #e8eaf0;
  --text-secondary: #8a9bbf;
  --text-muted:     #4d6080;
  --text-disabled:  #2e3e54;
  --text-inverse:   #090b0f;

  /* Accent — gold (primary action, highlights) */
  --accent-gold:        #c8a84b;
  --accent-gold-dim:    #8a7030;
  --accent-gold-bright: #e8c870;
  --accent-gold-glow:   rgba(200, 168, 75, 0.25);

  /* Relic tier colors — canonical, do not alter */
  --relic-common:    #d8dce8;
  --relic-rare:      #4caf72;
  --relic-heroic:    #4a90d9;
  --relic-legendary: #c8a84b;
  --relic-mythic:    #7b3fa0;

  /* Relic glow variants */
  --relic-common-glow:    rgba(216, 220, 232, 0.3);
  --relic-rare-glow:      rgba(76, 175, 114, 0.3);
  --relic-heroic-glow:    rgba(74, 144, 217, 0.3);
  --relic-legendary-glow: rgba(200, 168, 75, 0.3);
  --relic-mythic-glow:    rgba(123, 63, 160, 0.4);

  /* Effect colors */
  --effect-damage: #d94040;
  --effect-pickup: #e8c870;
  --effect-mythic: #7b3fa0;
  --effect-heal:   #4caf72;

  /* Status / semantic */
  --status-ok:      #4caf72;
  --status-warn:    #e0913a;
  --status-danger:  #d94040;
  --status-info:    #4a90d9;

  /* Sidebar */
  --sidebar-width:         220px;
  --sidebar-collapsed-width: 0px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Typography */
  --font-ui:   'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-lore: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   17px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  30px;
  --text-3xl:  38px;

  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --leading-tight:  1.2;
  --leading-normal: 1.5;
  --leading-loose:  1.8;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.7);

  /* Transitions */
  --transition-fast:   80ms ease;
  --transition-normal: 160ms ease;
  --transition-slow:   300ms ease;

  /* Z-index layers */
  --z-base:    0;
  --z-above:   10;
  --z-nav:     100;
  --z-modal:   200;
  --z-toast:   300;
}

/* ── Reset & Base ───────────────────────────────────────────── */

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

html {
  height: 100%;
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-gold-bright);
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

/* ── Scrollbar ──────────────────────────────────────────────── */

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

::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ── Layout — App Shell ─────────────────────────────────────── */

/*
  The app shell is a two-column layout: sidebar + main content.
  Pages that don't use a sidebar (login) override .app-main directly.
*/

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */

.sidebar {
  flex-shrink: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-void);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--z-nav);
}

.sidebar-header {
  padding: var(--space-6) var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: var(--font-lore);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
  letter-spacing: 0.03em;
  line-height: var(--leading-tight);
}

.sidebar-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
}

.sidebar-section {
  padding: var(--space-3) var(--space-4) var(--space-1);
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-nav-list {
  padding: var(--space-1) 0;
}

.sidebar-nav-item {
  display: block;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
  border-left: 2px solid transparent;
  text-decoration: none;
}

.sidebar-nav-link:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.sidebar-nav-link.active {
  background: var(--bg-elevated);
  color: var(--accent-gold);
  border-left-color: var(--accent-gold);
}

.sidebar-nav-link .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav-link:hover .nav-icon,
.sidebar-nav-link.active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── Main Content Area ──────────────────────────────────────── */

.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Page Header ────────────────────────────────────────────── */

.page-header {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.page-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ── Page Body ──────────────────────────────────────────────── */

.page-body {
  flex: 1;
  padding: var(--space-8);
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-void);
}

/* ── Forms ──────────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group + .form-group {
  margin-top: var(--space-5);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--status-danger);
  margin-top: var(--space-1);
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border: 1px solid transparent;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Primary — gold */
.btn-primary {
  background: var(--accent-gold);
  color: var(--text-inverse);
  border-color: var(--accent-gold);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-gold-bright);
  border-color: var(--accent-gold-bright);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

/* Secondary — outlined */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Danger */
.btn-danger {
  background: var(--status-danger);
  color: #fff;
  border-color: var(--status-danger);
}

.btn-danger:hover:not(:disabled) {
  background: #b83030;
  border-color: #b83030;
}

/* Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-full {
  width: 100%;
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-common    { background: rgba(216,220,232,0.15); color: var(--relic-common); }
.badge-rare      { background: rgba(76,175,114,0.15);  color: var(--relic-rare); }
.badge-heroic    { background: rgba(74,144,217,0.15);  color: var(--relic-heroic); }
.badge-legendary { background: rgba(200,168,75,0.15);  color: var(--relic-legendary); }
.badge-mythic    { background: rgba(123,63,160,0.2);   color: #c080f0; }

.badge-ok      { background: rgba(76,175,114,0.15);  color: var(--status-ok); }
.badge-warn    { background: rgba(224,145,58,0.15);  color: var(--status-warn); }
.badge-danger  { background: rgba(217,64,64,0.15);   color: var(--status-danger); }
.badge-info    { background: rgba(74,144,217,0.15);  color: var(--status-info); }

/* ── Activity Feed ──────────────────────────────────────────── */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  transition: background var(--transition-fast);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: var(--bg-elevated);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-dot-ok      { background: var(--status-ok); }
.activity-dot-warn    { background: var(--status-warn); }
.activity-dot-danger  { background: var(--status-danger); }
.activity-dot-info    { background: var(--status-info); }
.activity-dot-mythic  { background: var(--relic-mythic); box-shadow: 0 0 4px var(--relic-mythic-glow); }
.activity-dot-gold    { background: var(--accent-gold); }

.activity-text {
  flex: 1;
  color: var(--text-secondary);
  line-height: var(--leading-tight);
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Tables ─────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-void);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.data-table td:first-child {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

/* ── Stat Bar (HP / MP) ─────────────────────────────────────── */

.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.stat-bar-label {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  width: 24px;
  flex-shrink: 0;
}

.stat-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-muted);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-normal);
}

.stat-bar-fill-hp { background: var(--status-ok); }
.stat-bar-fill-mp { background: var(--status-info); }
.stat-bar-fill-ap { background: var(--accent-gold); }

.stat-bar-value {
  color: var(--text-muted);
  font-size: var(--text-xs);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Dividers ───────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: var(--space-6) 0;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Grid Layouts ───────────────────────────────────────────── */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}

/* ── Utility ────────────────────────────────────────────────── */

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-gold      { color: var(--accent-gold); }
.text-ok        { color: var(--status-ok); }
.text-warn      { color: var(--status-warn); }
.text-danger    { color: var(--status-danger); }
.text-info      { color: var(--status-info); }
.text-mythic    { color: #c080f0; }

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

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }

.weight-normal   { font-weight: var(--weight-normal); }
.weight-medium   { font-weight: var(--weight-medium); }
.weight-semibold { font-weight: var(--weight-semibold); }
.weight-bold     { font-weight: var(--weight-bold); }

.text-center { text-align: center; }
.text-right  { text-align: right; }

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

.flex            { display: flex; }
.flex-col        { display: flex; flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.flex-1 { flex: 1; }

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }

.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.border-subtle  { border: 1px solid var(--border-subtle); }
.border-default { border: 1px solid var(--border-default); }

.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* ── Login Page Specific ────────────────────────────────────── */

.login-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

.login-art-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  border-right: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  padding: var(--space-12);
}

.login-art-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(200,168,75,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(123,63,160,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.login-art-content {
  position: relative;
  text-align: center;
  max-width: 420px;
}

.login-game-title {
  font-family: var(--font-lore);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
  letter-spacing: 0.04em;
  line-height: var(--leading-tight);
  text-shadow: 0 0 60px var(--accent-gold-glow);
}

.login-tagline {
  font-family: var(--font-lore);
  font-size: var(--text-md);
  color: var(--text-secondary);
  margin-top: var(--space-4);
  font-style: italic;
  line-height: var(--leading-loose);
}

.login-inscription {
  margin-top: var(--space-8);
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
}

.login-inscription-text {
  font-family: var(--font-lore);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  line-height: var(--leading-loose);
}

.login-form-panel {
  width: 440px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  background: var(--bg-base);
}

.login-form-wrap {
  width: 100%;
  max-width: 360px;
}

.login-form-header {
  margin-bottom: var(--space-8);
}

.login-form-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.login-form-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.login-form-footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .login-art-panel {
    display: none;
  }

  .login-form-panel {
    width: 100%;
    padding: var(--space-8) var(--space-6);
  }
}

/* ── Admin Dashboard Specific ───────────────────────────────── */

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--border-default);
}

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-card-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-card-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.stat-card-ok     { border-left: 3px solid var(--status-ok); }
.stat-card-warn   { border-left: 3px solid var(--status-warn); }
.stat-card-danger { border-left: 3px solid var(--status-danger); }
.stat-card-gold   { border-left: 3px solid var(--accent-gold); }
.stat-card-mythic { border-left: 3px solid var(--relic-mythic); }

/* ── Empty State ────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-sm);
}

/* ── Toasts / Notifications ─────────────────────────────────── */

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  max-width: 340px;
  border-left: 3px solid var(--border-default);
}

.toast-ok     { border-left-color: var(--status-ok); }
.toast-warn   { border-left-color: var(--status-warn); }
.toast-danger { border-left-color: var(--status-danger); }
.toast-mythic { border-left-color: var(--relic-mythic); }

/* ── Relic Slot UI ──────────────────────────────────────────── */

.relic-slots {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.relic-slot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast);
}

.relic-slot-mythic {
  border-color: var(--relic-mythic);
  background: rgba(123,63,160,0.08);
}

.relic-slot-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-sm);
}

.relic-slot-name {
  flex: 1;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.relic-slot-empty .relic-slot-name {
  color: var(--text-muted);
  font-weight: var(--weight-normal);
}

/* ── Animations ─────────────────────────────────────────────── */

@keyframes mythic-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(123,63,160,0.4); }
  50%       { box-shadow: 0 0 20px rgba(123,63,160,0.8), 0 0 40px rgba(123,63,160,0.3); }
}

@keyframes gold-burst {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.5); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.animate-fade-in       { animation: fade-in var(--transition-normal) forwards; }
.animate-slide-in-right { animation: slide-in-right var(--transition-normal) forwards; }
.animate-mythic-pulse  { animation: mythic-pulse 2.5s ease-in-out infinite; }

/* ── Lobby Page ────────────────────────────────────────────── */

.lobby-shell {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-12) var(--space-6);
  background: var(--bg-base);
}

.lobby-container {
  width: 100%;
  max-width: 560px;
}

.lobby-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.lobby-title {
  font-family: var(--font-lore);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
  letter-spacing: 0.03em;
}

.lobby-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.lobby-create-form {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* ── Character Cards ───────────────────────────────────────── */

.character-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.character-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast);
}

.character-card:hover {
  border-color: var(--border-default);
}

.character-card-info {
  flex: 1;
  min-width: 0;
}

.character-card-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.character-card-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.character-card-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ── Admin Panel ───────────────────────────────────────────── */

.admin-input,
.admin-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  padding: var(--space-2) var(--space-3);
  outline: none;
  transition: border-color var(--transition-fast);
}

.admin-input:focus,
.admin-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold-glow);
}

.admin-input::placeholder {
  color: var(--text-muted);
}

textarea.admin-input {
  font-family: var(--font-mono);
  resize: vertical;
}

/* Tile palette swatch */
.tile-swatch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.tile-swatch:hover {
  background: var(--bg-elevated);
}

.tile-swatch.selected {
  background: var(--bg-overlay);
  color: var(--accent-gold);
  border: 1px dashed var(--accent-gold);
}

.tile-shortcut {
  margin-left: auto;
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.5;
}

.tile-count {
  font-size: 9px;
  color: var(--text-muted);
  margin-left: auto;
}

.tile-color {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.tile-label {
  white-space: nowrap;
}

/* Entity tabs */
.entity-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.entity-tab:hover {
  color: var(--text-secondary);
}

.entity-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

/* Admin list entries */
.relic-entry,
.golem-entry,
.mythic-entry,
.dungeon-room-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.relic-entry:hover,
.golem-entry:hover,
.mythic-entry:hover,
.dungeon-room-entry:hover {
  background: var(--bg-elevated);
}

/* Player table rows */
.player-row {
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.player-row:hover {
  background: var(--bg-elevated);
}

/* Upload drop zone */
.upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-gold);
  background: rgba(200, 168, 75, 0.05);
}

/* Toggle switch for feature flags */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-muted);
  border-radius: 10px;
  transition: background var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--status-ok);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Permanent trigger warning */
.permanent-warning {
  background: rgba(217, 64, 64, 0.1);
  border: 1px solid var(--status-danger);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--status-danger);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* Possession indicator */
.possess-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(123, 63, 160, 0.15);
  border: 1px solid var(--relic-mythic);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.possess-indicator .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--relic-mythic);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Admin three-panel layout */
.admin-3panel {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 0;
  height: calc(100vh - 120px);
  overflow: hidden;
}

.admin-3panel > .panel-left,
.admin-3panel > .panel-right {
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-void);
}

.admin-3panel > .panel-right {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

.admin-3panel > .panel-center {
  overflow: auto;
  display: flex;
  flex-direction: column;
}
