@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&family=Press+Start+2P&display=swap');

:root {
  --magenta: #ff2a6d;
  --gold: #ffd700;
  --dark-gold: #b8860b;
  --parchment: #eae1c4;
  --parchment-dark: #c5b68d;
  --charcoal: #331a08;
  --charcoal-light: #502e15;
  --bg-dark: #090a0d;

  --font-pixel: 'Press Start 2P', cursive;
  --font-sans: 'Outfit', sans-serif;
}

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

html, body {
  min-height: 100%;
  width: 100%;
  background-color: var(--bg-dark);
  color: #fff;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: auto;
}

/* Dungeon Radial Gradient Background (Fixed to Viewport) */
.dungeon-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(
      circle at 50% 30%,
      rgba(255, 42, 109, 0.08) 0%,
      rgba(0, 0, 0, 0) 60%
    ),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.1) 20%, rgba(0, 0, 0, 0.95) 100%);
  background-color: var(--bg-dark);
}

/* Pixel Typography & Buttons */
.pixel-title {
  font-family: var(--font-pixel);
  letter-spacing: 0.1em;
  color: var(--gold);
}

.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 10px 20px;
  border: 4px solid var(--charcoal);
  background: var(--parchment);
  color: var(--charcoal);
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  outline: none;
  transition: all 0.1s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pixel-btn:hover {
  background: var(--magenta);
  color: #fff;
  border-color: #ff2a6d;
}

.pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.6);
}

.pixel-btn.magenta-pixel {
  background: var(--magenta);
  color: #fff;
  border-color: #ff558f;
}
.pixel-btn.magenta-pixel:hover {
  background: #ff558f;
  border-color: #ff88b1;
}

.pixel-btn.gold-pixel {
  background: var(--gold);
  color: var(--charcoal);
  border-color: var(--charcoal);
}
.pixel-btn.gold-pixel:hover {
  background: #fff;
}

.pixel-btn.grey-pixel {
  background: #4f535c;
  color: #fff;
  border-color: #2c2e35;
}
.pixel-btn.grey-pixel:hover {
  background: #7a7f8c;
}

/* Utility Flex Classes matching Tailwind */
.flex-1 { flex: 1 1 0%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pb-8 { padding-bottom: 2rem; }
.w-full { width: 100%; }
.gap-2 { gap: 0.5rem; }
.gap-6 { gap: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }

/* Header */
.app-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
}

/* Timeline Layout */
.timeline-container-outer {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2rem;
}

.timeline-viewport {
  min-width: 100%;
  width: max-content;
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  padding: 2rem 0;
  user-select: none;
}

/* Hide scrollbars */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.timeline-axis {
  position: relative;
  height: 34px;
  margin: 0 40px;
  margin-bottom: 10px;
}

.timeline-tick {
  position: absolute;
  width: 1px;
  height: 14px;
  background: var(--parchment-dark);
  opacity: 0.6;
}

.timeline-tick-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--parchment-dark);
  white-space: nowrap;
}

/* SINGLE UNIFORM COLOR BAND */
.timeline-band {
  position: relative;
  border-radius: 4px;
  background: var(--charcoal);
  border: 2px solid var(--charcoal-light);
  margin: 0 40px;
  overflow: hidden;
}

.timeline-subrow {
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
}

.timeline-subrow:last-child {
  border-bottom: none;
}

.timeline-subrow.major,
.timeline-subrow.minor,
.timeline-subrow.footnote {
  background: transparent;
}

.timeline-dot {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid var(--charcoal);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  outline: none;
}

.timeline-dot:hover,
.timeline-dot.active {
  transform: translate(-50%, -50%) scale(1.35);
  z-index: 10;
}

.timeline-dot.major {
  width: 26px;
  height: 26px;
  background: var(--magenta);
  box-shadow: 0 0 10px rgba(255, 42, 109, 0.7);
}

.timeline-dot.minor {
  width: 16px;
  height: 16px;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.timeline-dot.footnote {
  width: 9px;
  height: 9px;
  background: var(--parchment-dark);
}

.lore-card {
  position: absolute;
  z-index: 30;
  background: var(--parchment);
  border: 4px double var(--charcoal);
  border-radius: 4px;
  padding: 16px 18px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
  color: var(--charcoal);
  max-width: 280px;
  transform: translate(-50%, 0);
}

.lore-card-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.lore-card-date {
  font-size: 11px;
  color: var(--charcoal-light);
  margin-bottom: 8px;
  font-weight: 600;
}

.lore-card-desc {
  font-size: 13px;
  line-height: 1.5;
}

/* Admin Panel */
.login-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #121319;
  border: 4px solid var(--charcoal);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  padding: 40px;
  position: relative;
  text-align: center;
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid #222530;
  pointer-events: none;
}

.login-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.login-error {
  background: rgba(255, 56, 56, 0.15);
  border: 2px solid #ff3838;
  color: #ff8888;
  padding: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  border-radius: 4px;
  text-align: left;
}

.admin-panel {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  width: 100%;
  min-height: 100vh;
}

.admin-form {
  background: #121319;
  border: 4px solid var(--charcoal);
  padding: 24px;
  margin-bottom: 32px;
  display: grid;
  gap: 12px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  background: #1b1c24;
  border: 2px solid var(--charcoal);
  color: #fff;
  padding: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
}

.admin-form label {
  font-size: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #121319;
  border: 2px solid var(--charcoal);
  padding: 14px 16px;
  margin-bottom: 8px;
}
