:root {
  color-scheme: dark;
  --bg: #020307;
  --bg-card: #050814;
  --bg-card-soft: #0a1020;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text: #f5f5f7;
  --text-soft: #a0a4b0;
  --accent: #0065e9;
  --accent-soft: rgba(0, 101, 233, 0.18);
  --danger: #e50914;
  --radius-lg: 18px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
  --transition-fast: 160ms ease-out;
  --transition-med: 220ms ease;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4fa;
  --bg-card: #ffffff;
  --bg-card-soft: #f7f7ff;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --text: #161616;
  --text-soft: #55596a;
  --accent-soft: rgba(0, 101, 233, 0.08);
}

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

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, #11192b 0, #020307 46%, #000 100%);
  color: var(--text);
}

/* Marquee Qibla++ */

.marquee-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 12px;
  background: linear-gradient(90deg, #000000, #061023 40%, #000000);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.marquee-chip {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(0, 180, 255, 0.4);
  box-shadow: 0 0 18px rgba(0, 180, 255, 0.35);
  overflow: hidden;
}

.marquee-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}

.marquee-text {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: marquee-slide 12s linear infinite;
}

@keyframes marquee-slide {
  0% {
    transform: translateX(12%);
  }
  100% {
    transform: translateX(-110%);
  }
}

/* Blood overlay */

.bloodOnScreen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: screen;
  z-index: 1;
  
}
.sadOverlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.40;         /* tu peux monter/descendre (ex: 0.08, 0.2, etc.) 0.12 de base */ 
  mix-blend-mode: soft-light;  /* tu peux tester 'screen' ou 'overlay' aussi */
  z-index: 3;            /* derrière le sang, mais au-dessus du fond */
}

/* Layout */

.safe {
  position: relative;
  z-index: 2;
  padding: 24px 12px 48px;
}

.wrap {
  max-width: 840px;
  margin: 0 auto;
}

/* Header */

.header {
  margin-bottom: 18px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-wrap {
  position: relative;
  width: 54px;
  height: 54px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #0ddf5b;
  box-shadow: 0 0 0 0 rgba(13, 223, 91, 0.7);
  border: 2px solid #020307;
  animation: pulse 1.7s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 223, 91, 0.7);
  }
  70% {
    transform: scale(1.22);
    box-shadow: 0 0 0 9px rgba(13, 223, 91, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 223, 91, 0);
  }
}

.title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.handle {
  font-size: 13px;
  color: var(--text-soft);
}

/* Actions */

.actions {
  display: flex;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
}

.theme-toggle:active {
  transform: translateY(0);
  box-shadow: none;
}

.theme-toggle .icon {
  width: 16px;
  height: 16px;
}

/* Card / section */

.card {
  margin-top: 10px;
  margin-bottom: 18px;
  padding: 18px 16px 16px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #15192c 0, #050814 46%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.section-head {
  margin-bottom: 12px;
}

.section-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.section-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* Date / time */

.datetime {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

#time {
  font-weight: 600;
}

/* List items */

.list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  text-decoration: none;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--text);
  background: var(--bg-card-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast), background var(--transition-fast);
}

.item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 101, 233, 0.7);
  background: radial-gradient(circle at top left, var(--accent-soft), #050814);
}

.icon-lg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.grow {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 15px;
  font-weight: 600;
}

.item-sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.emoji-right {
  font-size: 18px;
}

/* Back link */

.back-wrap {
  margin-top: 16px;
  text-align: right;
}

.back-link {
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.5);
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.back-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

/* Blood controls */

.blood-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.blood-range {
  flex: 1;
  accent-color: var(--danger);
}

.blood-value {
  font-size: 12px;
  color: var(--text-soft);
}

/* Buttons génériques */

.btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast),
    transform var(--transition-fast), border-color var(--transition-fast);
}

.btn-mini {
  padding: 4px 10px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.26);
}

/* Footer */

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}

.footer-text {
  margin: 0 0 8px;
}

.footer-line {
  height: 1px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.32),
    transparent
  );
  margin-bottom: 8px;
}

.copyright {
  margin: 0;
}

/* Responsive */

@media (max-width: 640px) {
  .safe {
    padding-inline: 10px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .datetime {
    align-items: flex-start;
  }
}
