:root {
  --void: #070b1a;
  --void-2: #0d1430;
  --panel: rgba(20, 28, 60, 0.62);
  --panel-solid: #141d3c;
  --card: rgba(14, 22, 52, 0.72);
  --text: #e2e7f7;
  --text-soft: #97a1c8;
  --gold: #e8b84b;
  --gold-dim: #b98f2f;
  --cyan: #4fd6e0;
  --violet: #a487e0;
  --forest: #46c88a;
  --danger: #ff4d5e;
  --danger-deep: #8f1420;
  --border: rgba(120, 150, 220, 0.28);
  --glow: rgba(79, 214, 224, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(90, 50, 150, 0.35), transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(20, 90, 130, 0.35), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(70, 40, 120, 0.28), transparent 60%),
    linear-gradient(160deg, var(--void), var(--void-2));
  background-attachment: fixed;
  min-height: 100vh;
}

/* Drifting starfield overlay (tiled, layered dots of varying brightness). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #ffffff, transparent),
    radial-gradient(1px 1px at 90px 60px, rgba(255,255,255,0.75), transparent),
    radial-gradient(1.5px 1.5px at 150px 120px, rgba(220,235,255,0.9), transparent),
    radial-gradient(1px 1px at 60px 170px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 200px 200px, rgba(180,220,255,0.85), transparent),
    radial-gradient(1px 1px at 250px 90px, rgba(255,255,255,0.5), transparent);
  background-size: 280px 280px;
  opacity: 0.6;
}

.container, .topbar { position: relative; z-index: 1; }

h1, h2, h3, .brand {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(7, 11, 26, 0.85);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 24px rgba(79, 214, 224, 0.12);
  backdrop-filter: blur(6px);
}

.brand {
  color: var(--gold) !important;
  text-decoration: none;
  font-size: 1.3rem;
  text-shadow: 0 0 12px rgba(232, 184, 75, 0.4);
}

.user-box { display: flex; align-items: center; gap: 0.75rem; }
.who { font-family: 'Cinzel', serif; font-size: 0.95rem; color: var(--text-soft); }
.tag {
  margin-left: 0.4rem;
  background: var(--gold);
  color: var(--void);
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-family: 'Crimson Text', serif;
}

.tag-active {
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--forest);
  box-shadow: 0 0 8px rgba(70, 200, 138, 0.4);
}

.flash-box {
  background: linear-gradient(120deg, rgba(232,184,75,0.12), rgba(79,214,224,0.1));
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 18px rgba(232, 184, 75, 0.12);
}
.flash-box p { margin: 0.25rem 0; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 5rem 1rem;
}
.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 24px rgba(232, 184, 75, 0.35);
}
.hero p { color: var(--text-soft); margin-bottom: 2rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(160, 190, 255, 0.06);
  backdrop-filter: blur(8px);
}

.panel h2 {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  text-shadow: 0 0 14px rgba(232, 184, 75, 0.25);
}

.muted { color: var(--text-soft); font-style: italic; }
code { color: var(--cyan); background: rgba(79,214,224,0.1); padding: 0.05rem 0.3rem; border-radius: 4px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.char-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.char-card h3 { margin: 0 0 0.25rem; font-size: 1rem; color: var(--violet); }
.char-card p { margin: 0; color: var(--text-soft); font-size: 0.9rem; }

.quest-card, .suggestion-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}
.suggestion-card { border-left-color: var(--cyan); }

.quest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.quest-head h3 { margin: 0; color: var(--text); }

.status {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}
.status-open { background: rgba(79,214,224,0.18); color: var(--cyan); border: 1px solid var(--cyan); }
.status-completed { background: rgba(232,184,75,0.18); color: var(--gold); border: 1px solid var(--gold-dim); }
.status-gathering { background: rgba(120,150,220,0.15); color: #9fb2e6; border: 1px solid rgba(120,150,220,0.5); }
.status-ready { background: rgba(70,200,138,0.18); color: var(--forest); border: 1px solid var(--forest); box-shadow: 0 0 10px rgba(70,200,138,0.4); }
.status-title-active { background: rgba(164,135,224,0.18); color: var(--violet); border: 1px solid var(--violet); }
.status-title-maintenance_due { background: rgba(232,140,60,0.2); color: #ffb066; border: 1px solid #e08a3c; box-shadow: 0 0 10px rgba(232,140,60,0.35); }
.status-title-lapsed { background: rgba(255,77,94,0.2); color: #ff7784; border: 1px solid var(--danger); box-shadow: 0 0 12px rgba(255,77,94,0.45); }

.type-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.14rem 0.5rem;
  border-radius: 4px;
  border: 1px solid currentColor;
}
.type-craft { color: var(--gold); }
.type-quest { color: var(--cyan); }
.type-title { color: var(--violet); }

/* Left-border accent per type / state so the board is scannable at a glance. */
.quest-craft { border-left: 4px solid var(--gold); }
.quest-quest { border-left: 4px solid #6f86c8; }
.quest-quest.quest-ready {
  border-left-color: var(--forest);
  box-shadow: 0 0 20px rgba(70, 200, 138, 0.28);
  background: rgba(30, 60, 48, 0.55);
}
.quest-title.title-active { border-left: 4px solid var(--violet); }
.quest-title.title-maintenance_due {
  border-left: 4px solid #e08a3c;
  background: rgba(60, 40, 20, 0.6);
  box-shadow: 0 0 18px rgba(232, 140, 60, 0.25);
}
.quest-title.title-lapsed {
  border-left: 4px solid var(--danger);
  background: rgba(70, 18, 28, 0.62);
  box-shadow: 0 0 22px rgba(255, 77, 94, 0.35);
}
.quest-title.title-lapsed h3 { color: #ff9aa3; }

.quest-desc { margin: 0.5rem 0; }

.quest-meta {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.quest-meta li { margin-bottom: 0.15rem; }
.quest-meta strong { color: var(--text); font-weight: 600; }

.quest-party {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.quest-party li { margin-bottom: 0.15rem; }

.queue-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 0 0 1.5rem;
  color: var(--text-soft);
}
.queue-list li { margin-bottom: 0.6rem; }
.queue-list strong { color: var(--text); }
.queue-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.quest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; }

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 480px;
}
.stacked-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stacked-form input,
.stacked-form textarea,
.stacked-form select,
.quest-actions select {
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 11, 26, 0.7);
  color: var(--text);
}
.stacked-form input:focus,
.stacked-form textarea:focus,
.stacked-form select:focus,
.quest-actions select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--glow);
}
.stacked-form textarea { resize: vertical; }
.stacked-form option, .quest-actions option { background: var(--panel-solid); color: var(--text); }

.btn {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--void);
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.05s ease;
  font-weight: 600;
}
.btn:hover { box-shadow: 0 0 16px rgba(232, 184, 75, 0.5); }
.btn:active { transform: translateY(1px); }
.btn-lg { font-size: 1rem; padding: 0.85rem 2rem; }
.btn-sm { font-size: 0.75rem; padding: 0.4rem 0.85rem; }
.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
}
.btn-ghost:hover { background: rgba(79, 214, 224, 0.12); box-shadow: 0 0 12px var(--glow); }
.btn-danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-deep));
  color: #fff;
}
.btn-danger:hover { box-shadow: 0 0 14px rgba(255, 77, 94, 0.5); }
