/* =========================================
   RIALO COMMUNITY RECAP THEME
   Colors: #a9ddd3 #e8e3d5 #010101
========================================= */

:root{
  --bg: #e8e3d5;
  --text: #010101;
  --muted: rgba(1,1,1,0.65);
  --border: rgba(1,1,1,0.12);

  --primary: #a9ddd3;
  --primary-ink: #010101;

  --panel: rgba(232, 227, 213, 0.78);
  --panel-2: rgba(232, 227, 213, 0.60);

  --shadow: 0 22px 60px rgba(1,1,1,0.10);

  --font-head: "Outfit", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --ease: cubic-bezier(.16,1,.3,1);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow:hidden;
  -webkit-font-smoothing: antialiased;
}

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

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

/* Background (clean) */
.bg-void{
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}

/* Layout */
#app{ height:100%; }
.screen{
  height:100%;
  width:100%;
  display:grid;
  place-items:center;
  padding: 22px;
}
.hidden{ display:none !important; }

.opacity-70{ opacity:.7; }

/* Panels */
.glass-panel{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Brand row */
.brand-row{
  display:flex;
  align-items:center;
  gap: 12px;
}
.brand-row.mini{
  justify-content:center;
  margin-bottom: 10px;
}
.brand-logo{
  width: 42px;
  height: 42px;
  object-fit: contain;
  display:block;
}
.brand-row.mini .brand-logo{
  width: 34px;
  height: 34px;
}
.brand-text{ line-height: 1.05; }
.brand-name{
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: .02em;
}
.brand-sub{
  font-size: 12px;
  color: var(--muted);
}

/* Intro */
.intro-panel{
  width: min(720px, 100%);
  padding: 28px 26px 22px;
}
.intro-title{
  margin: 14px 0 10px;
  text-align:center;
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: .02em;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.03;
}
.text-gradient{
  background: linear-gradient(120deg, var(--text) 0%, var(--primary) 55%, var(--text) 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
}
.intro-subtitle{
  margin: 0 0 18px;
  text-align:center;
  color: var(--muted);
}

.dev-credit{
  margin-top: 14px;
  text-align:center;
  font-size: 13px;
  color: var(--muted);
}

/* Buttons */
.primary-btn, .secondary-btn{
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-weight: 700;
  cursor:pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.primary-btn{
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 12px 30px rgba(1,1,1,0.10);
}
.primary-btn:hover{ transform: translateY(-1px); box-shadow: 0 16px 36px rgba(1,1,1,0.14); }
.secondary-btn{
  background: var(--panel-2);
  color: var(--text);
}
.secondary-btn:hover{ transform: translateY(-1px); }

/* Glow effect (subtle) */
.glow-effect{
  box-shadow: 0 14px 40px rgba(169,221,211,0.35);
}

/* Intro form */
.intro-form{ margin-top: 14px; }
.input-group{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.at-symbol{
  color: var(--muted);
  font-weight: 900;
}
#handle-input{
  width:100%;
  border:none;
  outline:none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.icon-btn{
  border:none;
  background: transparent;
  cursor:pointer;
  display:grid;
  place-items:center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  transition: transform .16s var(--ease), background .16s var(--ease);
}
.icon-btn:hover{
  transform: translateX(2px);
  background: rgba(169,221,211,0.45);
}

/* Error */
.error-msg{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(1,1,1,0.18);
  background: rgba(1,1,1,0.04);
  color: rgba(1,1,1,0.85);
  font-weight: 600;
}

/* File fallback */
.file-fallback{
  margin-top: 14px;
  padding: 14px 14px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(1,1,1,0.18);
  background: rgba(1,1,1,0.03);
}
.file-title{
  font-family: var(--font-head);
  font-weight: 900;
  margin-bottom: 6px;
}
.file-hint{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.file-hint.small{ margin-top: 10px; font-size: 12px; }
.file-actions{
  display:flex;
  gap: 10px;
  align-items:center;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Loading */
.loading-panel{
  width: min(520px, 100%);
  padding: 22px 20px;
  display:flex;
  align-items:center;
  gap: 14px;
}
.loader{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(1,1,1,0.18);
  border-top-color: var(--text);
  animation: spin .85s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.loading-title{
  font-family: var(--font-head);
  font-weight: 900;
}
.loading-subtitle{
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* Slides */
.slide .slide-content{
  width: min(760px, 100%);
  padding: 26px 22px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.slide-header{
  text-align:center;
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.slide-main{
  margin-top: 14px;
  display:grid;
  place-items:center;
  gap: 8px;
}
.big-stat{
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(56px, 7vw, 86px);
  line-height: 1;
}
.stat-label{
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  text-align:center;
}
.slide-footer{
  margin-top: 16px;
  display:grid;
  place-items:center;
  gap: 10px;
}
.slide-context{
  margin:0;
  color: var(--muted);
  text-align:center;
}
.highlight{
  color: var(--text);
  background: rgba(169,221,211,0.55);
  border: 1px solid rgba(1,1,1,0.10);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
}
.archetype-title{
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(34px, 4.2vw, 52px);
  text-align:center;
}
.archetype-desc{
  max-width: 560px;
  text-align:center;
  color: var(--muted);
  line-height: 1.45;
}

/* Final screen */
.final-screen{
  padding: 18px;
  align-items: stretch;
  display:flex;
  flex-direction: column;
  gap: 12px;
}
.final-container{
  flex: 1;
  min-height: 0;
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 12px;
}
.summary-panel{
  padding: 16px;
  min-height: 0;
}
.summary-title{
  margin: 12px 0 12px;
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
  text-align:left;
}
.summary-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.s-item{
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: var(--radius-lg);
  padding: 12px;
}
.s-item.full-width{ grid-column: 1 / -1; }
.s-label{
  display:block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 900;
}
.s-item strong{
  display:block;
  margin-top: 6px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 22px;
}

/* Card wrapper */
.card-display-area{
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(232,227,213,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow:auto;
  padding: 18px;
  min-height: 0;
}
#card-wrapper{
  display:grid;
  place-items:center;
  min-height: 100%;
}

/* Action bar */
.action-bar{
  display:flex;
  justify-content:center;
  gap: 10px;
}
.icon-btn-text{
  display:flex;
  align-items:center;
  gap: 8px;
}

/* Collectible card */
.collectible-card{
  width: min(520px, 100%);
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(232,227,213,0.92);
  box-shadow: 0 18px 50px rgba(1,1,1,0.12);
  padding: 16px;
}
.cc-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 12px;
}
.cc-top-left{
  display:flex;
  align-items:center;
  gap: 10px;
}
.cc-top-left img{
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.cc-title{
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: .02em;
}
.cc-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.cc-badge{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(169,221,211,0.45);
  font-weight: 900;
}

.cc-main{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-top: 10px;
}
.cc-avatar{
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow:hidden;
  background: rgba(1,1,1,0.05);
}
.cc-avatar img{ width:100%; height:100%; object-fit: cover; }
.cc-handle{
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 22px;
}
.cc-archetype{
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.cc-metrics{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.cc-metric{
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 18px;
  padding: 10px;
}
.cc-metric .k{
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 900;
}
.cc-metric .v{
  margin-top: 6px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 18px;
}

.cc-footer{
  margin-top: 14px;
  text-align:center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 920px){
  body{ overflow:auto; }
  .final-container{
    grid-template-columns: 1fr;
  }
  .screen{ padding: 16px; }
}

/* Center START button */
#start-btn{
  display:block;
  margin: 22px auto 0;
}

/* Tweet card (Top Post slide) */
.tweet-card{
  width: min(720px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(1,1,1,.12);
  border-radius: 16px;
  padding: 16px;
  background: rgba(232,227,213,.65);
  box-shadow: 0 14px 30px rgba(1,1,1,.10);
}

.tweet-header{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 10px;
}

.tweet-avatar{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(1,1,1,.12);
}

.tweet-user{ line-height: 1.15; }
.tweet-name{ font-weight: 700; }
.tweet-meta{ opacity: .7; font-size: 13px; display:flex; align-items:center; gap:8px; }
.tweet-meta .dot{ opacity:.6; }

.tweet-text{
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-wrap;
  margin: 8px 0 12px;
}

.tweet-media{
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(1,1,1,.12);
  background: rgba(1,1,1,.04);
}

.tweet-media img{
  width: 100%;
  display:block;
  object-fit: cover;
}

.tweet-stats{
  display:flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 13px;
  opacity: .8;
}

/* ===== Top post text scroll (so slide stays fixed) ===== */
.tweet-text{
  max-height: 180px;           /* можно 160/200 — под твой дизайн */
  overflow-y: auto;
  padding-right: 8px;          /* место под скроллбар */
}

/* nicer scrollbar */
.tweet-text::-webkit-scrollbar{
  width: 8px;
}
.tweet-text::-webkit-scrollbar-thumb{
  background: rgba(1,1,1,.18);
  border-radius: 999px;
}
.tweet-text::-webkit-scrollbar-track{
  background: rgba(1,1,1,.06);
  border-radius: 999px;
}

/* fade hint at bottom */
.tweet-card{
  position: relative;
}
.tweet-card::after{
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 64px; /* примерно над tweet-stats */
  height: 28px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(232,227,213,0), rgba(232,227,213,.95));
  border-radius: 14px;
}

/* Make slide content fit screen */
.slide-content{
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Let main area shrink and scroll if needed */
.slide-main{
  flex: 1;
  min-height: 0; /* IMPORTANT for scrolling inside flex */
}

/* Tweet card becomes scroll container if too tall */
.tweet-card{
  max-height: calc(100vh - 240px); /* header+brand+footer buffer */
  overflow: auto;
}

/* Cap media height so it never pushes NEXT off screen */
.tweet-media{
  max-height: 42vh;     /* tune: 35–50vh */
  overflow: hidden;
}

.tweet-media img{
  width: 100%;
  height: 100%;
  max-height: 42vh;
  object-fit: cover;    /* keeps it nice like recap */
  display: block;
}

/* ===== Default slide layout (metric slides) ===== */
.metric-slide .slide-content{
  height: auto;                 /* отменяем "растянуть на весь экран" */
  display: block;
}

.metric-slide .slide-main{
  min-height: unset;
}

/* ===== Tweet slide keeps fixed screen layout ===== */
.tweet-slide .slide-content{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tweet-slide .slide-main{
  flex: 1;
  min-height: 0;
}

/* Tweet card scroll behavior only on tweet slide */
.tweet-slide .tweet-card{
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.tweet-slide .tweet-media{
  max-height: 42vh;
  overflow: hidden;
}

.tweet-slide .tweet-media img{
  width: 100%;
  height: 100%;
  max-height: 42vh;
  object-fit: cover;
  display: block;
}
