/* ══════════════════════════════════════════════════════
   CookieLP Profile — Fran Bow Style
   Palette: тёмно-бордовый, пожелтевшая бумага, чернила,
            больничный белый, кровавые пятна
   ══════════════════════════════════════════════════════ */

:root {
  --bg:        #1a0a0a;
  --bg2:       #2a1010;
  --paper:     #e8dcc8;
  --paper-dim: #c4b49a;
  --ink:       #1a0505;
  --red:       #8b1a1a;
  --red-dark:  #5c0a0a;
  --red-bright:#c0392b;
  --teal:      #1a7a6e;
  --yellow:    #d4a843;
  --white:     #f0ead8;
  --stain:     rgba(120,0,0,0.18);

  --font-title: 'Creepster', cursive;
  --font-body:  'Special Elite', serif;
  --font-mono:  'Share Tech Mono', monospace;

  --border: 3px solid #5c0a0a;
  --radius: 0px;
  --shadow: 4px 4px 0 #5c0a0a;
}

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

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── Фоновые кровяные пятна ──────────────────────── */
.fb-bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.fb-stain {
  position: absolute;
  border-radius: 50%;
  background: var(--stain);
  filter: blur(60px);
}
.fb-stain--1 { width: 400px; height: 300px; top: -80px; left: -100px; }
.fb-stain--2 { width: 300px; height: 400px; bottom: 0; right: -80px; }
.fb-stain--3 { width: 200px; height: 200px; top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* ── Canvas частицы ──────────────────────────────── */
.fb-particles {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* ── Nav ─────────────────────────────────────────── */
.fb-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 10px 20px;
  background: rgba(26,5,5,0.92);
  border-bottom: 2px solid var(--red-dark);
  backdrop-filter: blur(6px);
}
.fb-nav-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--paper-dim);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.fb-nav-link:hover { color: var(--yellow); }
.fb-nav-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.fb-nav-user { font-size: 0.85rem; color: var(--yellow); }

/* ── Загрузка ────────────────────────────────────── */
.fb-loading {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.5rem;
}
.fb-loading-text {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--paper-dim);
  letter-spacing: 0.1em;
  animation: fbFlicker 1.5s infinite;
}
@keyframes fbFlicker {
  0%, 100% { opacity: 1; }
  45%       { opacity: 0.7; }
  50%       { opacity: 0.3; }
  55%       { opacity: 0.8; }
}

/* ── Общий стиль окон (как в Fran Bow — бумажные, с чернильной рамкой) ── */
.fb-window {
  position: relative;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.fb-window::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(92,10,10,0.3);
  pointer-events: none;
}

.fb-window-title {
  display: flex; align-items: center; gap: 8px;
  background: var(--red-dark);
  color: var(--paper);
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  border-bottom: 2px solid var(--red);
}
.fb-window-icon { font-size: 0.9rem; opacity: 0.8; }

.fb-window-body {
  padding: 16px;
}

/* ── Login screen ────────────────────────────────── */
.fb-login-screen {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #2a0a0a 0%, #0d0303 100%);
  padding: 20px;
}

.fb-window--login {
  max-width: 380px; width: 100%;
}

.fb-login-art {
  display: flex; justify-content: center;
  margin-bottom: 1rem;
}

.fb-login-desc {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 1.2rem;
}

.fb-tg-btn-wrap {
  display: flex; justify-content: center;
  margin-bottom: 1rem;
}

.fb-login-hint {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  line-height: 1.6;
}

/* ── Profile screen ──────────────────────────────── */
.fb-profile-screen {
  position: relative; z-index: 10;
  display: flex; gap: 2rem;
  max-width: 900px; margin: 0 auto;
  padding: 90px 20px 40px;
  min-height: 100vh;
  align-items: flex-start;
}

/* ── Left col ────────────────────────────────────── */
.fb-left-col {
  flex-shrink: 0;
  width: 200px;
  display: flex; flex-direction: column;
  align-items: center; gap: 1.2rem;
}

/* Avatar with Fran Bow frame */
.fb-avatar-wrap {
  position: relative;
  width: 160px; height: 160px;
}
.fb-avatar-frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  z-index: 3; pointer-events: none;
}
.fb-avatar-img {
  position: absolute;
  top: 20px; left: 20px;
  width: 120px; height: 120px;
  border-radius: 0;
  object-fit: cover;
  z-index: 2;
  image-rendering: auto;
}
.fb-cat-overlay {
  position: absolute;
  bottom: -10px; right: -10px;
  width: 48px; height: 48px;
  image-rendering: pixelated;
  z-index: 4;
}

/* Name */
.fb-user-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--yellow);
  text-align: center;
  text-shadow: 2px 2px 0 var(--red-dark);
  letter-spacing: 0.05em;
}
.fb-user-handle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--paper-dim);
  text-align: center;
}

/* Health bar */
.fb-health-box {
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--red-dark);
  box-shadow: 2px 2px 0 var(--red-dark);
  padding: 8px 10px;
}
.fb-health-label {
  display: flex; justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink);
  margin-bottom: 5px;
  font-weight: bold;
}
.fb-health-val { color: var(--red); }

.fb-health-bar {
  position: relative;
  height: 14px;
  background: #c0a08a;
  border: 1px solid var(--red-dark);
}
.fb-health-fill {
  height: 100%;
  background: var(--red);
  transition: width 1s ease;
  width: 0%;
}
.fb-health-pills {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  gap: 2px; padding: 0 2px;
  pointer-events: none;
}
.fb-pill-dot {
  width: 6px; height: 10px;
  background: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Pills section */
.fb-pills-section { width: 100%; }
.fb-pills-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--red);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.fb-pills-row {
  display: flex; flex-wrap: wrap;
  gap: 6px; justify-content: center;
}
.fb-pill {
  font-family: var(--font-body);
  font-size: 0.72rem;
  padding: 4px 10px;
  border: 2px solid var(--red-dark);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--red-dark);
  white-space: nowrap;
  position: relative;
}
.fb-pill::before {
  content: '💊 ';
  font-size: 0.7rem;
}
.fb-pill--locked {
  background: #c0a88a;
  color: #888;
  border-color: #888;
  box-shadow: 2px 2px 0 #888;
}
.fb-pill--locked::before { content: '🔒 '; }

/* ── Right col ───────────────────────────────────── */
.fb-right-col {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 1.4rem;
}

/* Info window */
.fb-window--info { width: 100%; }

.fb-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}
.fb-info-row {
  display: flex; justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(92,10,10,0.3);
  font-size: 0.88rem;
}
.fb-info-row:last-child { border-bottom: none; }
.fb-info-key { color: var(--red-dark); font-weight: bold; }
.fb-info-val { color: var(--ink); font-family: var(--font-mono); font-size: 0.82rem; }
.fb-info-val--title { color: var(--teal); font-style: italic; }

/* Skeletons decor */
.fb-skeletons { width: 100%; }
.fb-skeleton-canvas {
  width: 100%; max-width: 320px;
  image-rendering: pixelated;
  display: block; margin: 0 auto;
}

/* Actions */
.fb-actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.fb-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 18px;
  border: 2px solid var(--red-dark);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--red-dark);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  letter-spacing: 0.03em;
}
.fb-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--red-dark);
}
.fb-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--red-dark);
}
.fb-btn--buy {
  background: var(--red-dark);
  color: var(--paper);
  border-color: var(--red);
}
.fb-btn--logout {
  background: #c0a08a;
  color: var(--ink);
}
.fb-btn-icon { font-size: 0.85rem; }

/* Quote */
.fb-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--paper-dim);
  line-height: 1.7;
  text-align: center;
  padding: 10px 16px;
  border-left: 3px solid var(--red-dark);
  background: rgba(139,26,26,0.08);
}
.fb-quote-marks {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--red);
  vertical-align: -2px;
}

/* ── Stats grid ──────────────────────────────────── */
.fb-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.fb-stat-card {
  background: var(--bg2);
  border: 2px solid var(--red-dark);
  padding: 8px 4px;
  text-align: center;
  box-shadow: 2px 2px 0 var(--red-dark);
}
.fb-stat-num {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--yellow);
  line-height: 1;
  text-shadow: 1px 1px 0 var(--red-dark);
}
.fb-stat-lbl {
  font-size: 0.65rem;
  color: var(--paper-dim);
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* ── Referral box ────────────────────────────────── */
.fb-ref-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5eedc;
  border: 2px solid var(--red-dark);
  padding: 7px 10px;
  cursor: pointer;
  gap: 8px;
  transition: background 0.15s;
}
.fb-ref-box:hover { background: #e8ddc8; }
.fb-ref-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
  word-break: break-all;
  flex: 1;
}
.fb-ref-copy {
  font-size: 0.75rem;
  color: var(--red-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Not found screen ────────────────────────────── */
.fb-not-found {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #2a0a0a 0%, #0d0303 100%);
  padding: 20px;
}
.fb-window--warn { max-width: 360px; width: 100%; text-align: center; }
.fb-warn-text { font-size: 0.9rem; line-height: 1.7; color: var(--ink); margin: 1rem 0; }
.fb-code {
  font-family: var(--font-mono);
  background: rgba(139,26,26,0.15);
  padding: 1px 5px;
  border: 1px solid var(--red-dark);
  color: var(--red);
}
.fb-ghost-canvas { display: block; margin: 0 auto; image-rendering: pixelated; width: 80px; height: 100px; }

/* ── Hidden ──────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 680px) {
  .fb-profile-screen {
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
  }
  .fb-left-col { width: 100%; max-width: 340px; }
}
