/* ============================================
   Endspace Theme - Countdown Page
   ============================================ */
:root {
  --endspace-bg-base: #fafafa;
  --endspace-bg-primary: #ffffff;
  --endspace-bg-secondary: #f4f4f5;
  --endspace-text-primary: #18181b;
  --endspace-text-secondary: #52525b;
  --endspace-text-muted: #a1a1aa;
  --endspace-accent-yellow: #FBFB45;
  --endspace-accent-yellow-dim: rgba(251, 21, 69, 0.35);
  --endspace-border-base: #e4e4e7;
  --endspace-border-active: #FBFB45;
  --endspace-grid-color: rgba(0, 0, 0, 0.03);
  --hud-cyan: rgba(6, 182, 212, 0.4);
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--endspace-bg-base);
  color: var(--endspace-text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--endspace-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--endspace-grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  pointer-events: none;
}

.hud {
  position: fixed;
  width: 3rem;
  height: 3rem;
  pointer-events: none;
  z-index: 50;
}

.hud-tl {
  top: 1rem;
  left: 1rem;
  border-top: 2px solid var(--hud-cyan);
  border-left: 2px solid var(--hud-cyan);
}

.hud-br {
  bottom: 1rem;
  right: 1rem;
  border-bottom: 2px solid var(--hud-cyan);
  border-right: 2px solid var(--hud-cyan);
}

.container {
  width: 100vw;
  max-width: 100vw;
  padding: 0;
  flex: 1 1 auto;
}

/* ============================================
   TitleBar
   ============================================ */
.titlebar {
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--endspace-border-base);
  background: var(--endspace-bg-base);
  padding: 3.5rem 0;
  margin: 0;
  width: 100vw;
}

.titlebar-grid {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, var(--endspace-text-muted) 2px, var(--endspace-text-muted) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, var(--endspace-text-muted) 2px, var(--endspace-text-muted) 4px);
  background-size: 100px 100px;
}

.titlebar-marquee {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0.15;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 10rem;
  line-height: 1;
  color: var(--endspace-text-primary);
  user-select: none;
  white-space: nowrap;
}

.titlebar-marquee span {
  display: inline-block;
  flex-shrink: 0;
  animation: bgMarquee 30s linear infinite;
  will-change: transform;
}

@keyframes bgMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.spectrum-bar {
  height: 2px;
  background: linear-gradient(90deg,
    var(--endspace-accent-yellow) 0%,
    var(--endspace-text-muted) 50%,
    var(--endspace-accent-yellow) 100%);
}

.titlebar-spectrum {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

/* ============================================
   Doc Line
   ============================================ */
.doc-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--endspace-text-muted);
  border-bottom: 1px solid var(--endspace-border-base);
  padding: 1.5rem 32px 0.5rem 32px;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.doc-line .doc-id {
  font-weight: 700;
  color: var(--endspace-text-primary);
}

.doc-line .online-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-line .online-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: online-pulse 2s ease-in-out infinite;
}

.doc-line .online-dot.offline {
  background: #ef4444 !important;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6) !important;
  animation: offline-pulse 2s ease-in-out infinite !important;
}

@keyframes online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.4); }
}

@keyframes offline-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.4); }
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 32px;
}

.status-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--endspace-text-muted);
  padding: 4px 12px;
  background: var(--endspace-bg-secondary);
  border: 1px solid var(--endspace-border-base);
}

.date-display {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--endspace-text-primary);
}

.divider {
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--endspace-accent-yellow), transparent);
  margin: 1rem 0;
}

/* ============================================
   Countdown Section
   ============================================ */
.countdown-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.countdown-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--endspace-text-secondary);
  text-align: center;
}

.highlight {
  color: var(--endspace-text-primary);
  font-weight: 700;
  padding: 2px 8px;
  background: var(--endspace-accent-yellow);
}

.countdown-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--endspace-bg-primary);
  border: 1px solid var(--endspace-border-base);
  padding: 1rem 1.5rem;
  min-width: 120px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-block:hover {
  border-color: var(--endspace-border-active);
  box-shadow: 0 0 0 1px var(--endspace-accent-yellow);
}

.time-value {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--endspace-text-primary);
}

.time-unit {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--endspace-text-muted);
  margin-top: 0.5rem;
}

.time-separator {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--endspace-accent-yellow);
  line-height: 1;
}

.revival-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--endspace-text-muted);
  padding: 4px 12px;
  border: 1px dashed var(--endspace-border-base);
}

/* ============================================
   Alive Section
   ============================================ */
.alive-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.alive-label {
  background: #22c55e !important;
  color: white !important;
}

.alive-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--endspace-text-primary);
  text-align: center;
}

.alive-highlight {
  background: var(--endspace-accent-yellow);
  padding: 4px 16px;
}

.alive-period {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--endspace-text-muted);
  padding: 4px 12px;
  border: 1px dashed var(--endspace-border-base);
}

.hidden {
  display: none !important;
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 767px) {
  .titlebar {
    margin: 0;
    padding: 2.5rem 0;
  }

  .titlebar-marquee {
    font-size: 4rem;
  }

  .container {
    padding: 0;
  }

  .doc-line {
    padding: 1.5rem 16px 0.5rem 16px;
  }

  .main-content {
    padding: 1.5rem 16px;
  }

  .date-display {
    font-size: 1.5rem;
  }

  .countdown-text {
    font-size: 1rem;
  }

  .countdown-display {
    gap: 0.25rem;
  }

  .time-block {
    min-width: 80px;
    padding: 0.75rem 0.5rem;
  }

  .time-value {
    font-size: 2rem;
  }

  .time-separator {
    font-size: 2rem;
  }

  .alive-text {
    font-size: 1.25rem;
  }

  .hud {
    width: 2rem;
    height: 2rem;
  }

  .hud-tl {
    top: 0.5rem;
    left: 0.5rem;
  }

  .hud-br {
    bottom: 0.5rem;
    right: 0.5rem;
  }
}
