/* =========================================================
   Facebook 2 — Styles
   Faithfully Facebook-blue, with strategic Comic Sans gags.
   ========================================================= */

:root {
  --fb-blue:        #1877F2;
  --fb-blue-dark:   #166FE5;
  --fb-blue-hover:  #1657BF;
  --fb-bg:          #F0F2F5;
  --fb-card:        #FFFFFF;
  --fb-text:        #050505;
  --fb-text-2:      #65676B;
  --fb-text-3:      #8A8D91;
  --fb-border:      #CED0D4;
  --fb-divider:     #DADDE1;
  --fb-hover:       #F2F2F2;
  --fb-input-bg:    #F0F2F5;
  --fb-green:       #42B72A;
  --fb-green-dark:  #36A420;

  --gag-red:        #EB1923;
  --gag-yellow:     #FFD700;
  --gag-pink:       #FF3E8F;

  --shadow-card:    0 1px 2px rgba(0,0,0,.10);
  --shadow-pop:     0 12px 28px rgba(0,0,0,.20), 0 2px 4px rgba(0,0,0,.10);

  --radius-card:    8px;
  --radius-pill:    999px;

  --header-h:       56px;
  --bottom-h:       56px;

  --font-system:    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-comic:     "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Marker Felt", cursive;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--fb-bg);
  color: var(--fb-text);
  font-family: var(--font-system);
  font-size: 15px;
  line-height: 1.33;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: var(--fb-blue); text-decoration: none; }
img { display: block; max-width: 100%; }

/* =========================================================
   The Mark — "facebook²" gag wordmark
   ========================================================= */
.fb2-mark {
  display: inline-flex; align-items: center; gap: 2px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.fb2-mark .word {
  font-size: 24px; color: var(--fb-blue);
  font-family: var(--font-system);
  font-style: italic;
}
.fb2-mark .two {
  display: inline-block;
  font-family: var(--font-comic);
  color: var(--gag-red);
  font-size: 28px;
  transform: rotate(-8deg) translateY(-2px);
  text-shadow: 1.5px 1.5px 0 #000;
  margin-left: 2px;
}
.fb2-mark.on-blue .word { color: #fff; }
.fb2-mark.lg .word { font-size: 44px; }
.fb2-mark.lg .two { font-size: 56px; margin-left: 4px; }
.fb2-mark.xl .word { font-size: 64px; }
.fb2-mark.xl .two  { font-size: 80px; margin-left: 6px; }

/* =========================================================
   Splash
   ========================================================= */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--fb-blue);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  transition: opacity .25s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-mark { display: flex; align-items: center; }
.splash-mark .f {
  font-size: 80px; font-weight: 900; color: #fff;
  font-family: var(--font-system); font-style: italic;
}
.splash-mark .two {
  font-family: var(--font-comic);
  font-size: 96px; color: var(--gag-red);
  margin-left: 8px;
  transform: rotate(-10deg) translateY(-6px);
  text-shadow: 3px 3px 0 #000, 0 0 30px var(--gag-yellow);
}
.splash-tagline { color: rgba(255,255,255,.85); font-size: 13px; }

/* =========================================================
   Auth screens
   ========================================================= */
.auth-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 32px 20px; background: var(--fb-bg);
}
.auth-card {
  width: 100%; max-width: 396px; background: var(--fb-card);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 16px; margin-top: 16px;
}
.auth-mark { margin: 16px 0 24px; text-align: center; }
.auth-tagline {
  color: var(--fb-text-2); font-size: 17px; text-align: center;
  margin-top: -8px; margin-bottom: 24px;
}
.auth-input {
  width: 100%; padding: 14px 16px;
  font-size: 17px;
  border: 1px solid var(--fb-border);
  border-radius: 6px;
  background: var(--fb-card);
  margin-bottom: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus { border-color: var(--fb-blue); box-shadow: 0 0 0 2px rgba(24,119,242,.2); }
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--fb-blue); color: #fff;
  border: none; border-radius: 6px;
  font-size: 20px; font-weight: 700;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--fb-blue-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-green {
  background: var(--fb-green); color: #fff;
  border: none; padding: 12px 16px; border-radius: 6px;
  font-size: 17px; font-weight: 700;
}
.btn-green:hover { background: var(--fb-green-dark); }
.auth-divider {
  height: 1px; background: var(--fb-divider); margin: 20px 0;
}
.auth-link {
  display: block; text-align: center; margin-top: 8px;
  font-size: 14px; color: var(--fb-blue); font-weight: 600;
}
.auth-error {
  background: #FFEBEE; color: #C62828;
  padding: 10px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 12px;
}
.auth-toggle-row {
  display: flex; gap: 8px; margin-bottom: 16px;
  background: var(--fb-input-bg); padding: 4px; border-radius: 8px;
}
.auth-toggle-row button {
  flex: 1; padding: 10px; border: none; background: transparent;
  font-weight: 600; color: var(--fb-text-2); border-radius: 6px;
  font-size: 15px;
}
.auth-toggle-row button.active {
  background: var(--fb-card); color: var(--fb-text);
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* =========================================================
   App shell + Header
   ========================================================= */
.app-shell {
  min-height: 100vh;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}
.header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--fb-card);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  box-shadow: var(--shadow-card);
  z-index: 50;
  padding-top: env(safe-area-inset-top);
}
.header.with-safe { height: calc(var(--header-h) + env(safe-area-inset-top)); }
.header .fb2-mark { flex-shrink: 0; }
.header-search {
  flex: 1; min-width: 0;
  background: var(--fb-input-bg);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
}
.header-search svg { flex-shrink: 0; opacity: .55; }
.header-search input {
  flex: 1; min-width: 0;
  border: none; background: transparent; outline: none;
  font-size: 15px;
}
.header-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--fb-input-bg);
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.header-icon:hover { background: #E4E6E9; }
.header-icon .badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--gag-red); color: #fff;
  font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--fb-card);
}

/* =========================================================
   Bottom nav (mobile)
   ========================================================= */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: var(--fb-card);
  display: flex; align-items: stretch;
  border-top: 1px solid var(--fb-divider);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 40;
}
.bottom-nav button {
  flex: 1; border: none; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--fb-text-2);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.bottom-nav button.active {
  color: var(--fb-blue);
  border-bottom-color: var(--fb-blue);
}
.bottom-nav button .badge {
  position: absolute; top: 8px; right: 26%;
  background: var(--gag-red); color: #fff;
  font-size: 11px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* =========================================================
   Feed + Stories + Composer
   ========================================================= */
.feed { max-width: 590px; margin: 0 auto; padding: 0; }
@media (min-width: 600px) { .feed { padding: 12px 12px 24px; } }

.story-bar {
  display: flex; gap: 8px; padding: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.story-bar::-webkit-scrollbar { display: none; }
.story-card {
  flex: 0 0 110px; aspect-ratio: 110/180;
  border-radius: 12px; overflow: hidden; position: relative;
  scroll-snap-align: start;
  background: linear-gradient(180deg, #aaa, #666);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}
.story-card.create { background: var(--fb-card); border: 1px solid var(--fb-divider); }
.story-card .img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.story-card .gradient {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.6));
}
.story-card .author-avatar {
  position: absolute; top: 8px; left: 8px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 4px solid var(--fb-blue);
  background: #ddd center/cover no-repeat;
}
.story-card .author-avatar.viewed { border-color: var(--fb-text-3); }
.story-card .label {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  color: #fff; font-size: 13px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  line-height: 1.2;
}
.story-card.create .add {
  position: absolute; left: 50%; bottom: 50px;
  transform: translateX(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--fb-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--fb-card);
  font-size: 24px; font-weight: 700;
}
.story-card.create .label { color: var(--fb-text); text-shadow: none; text-align: center; }
.story-card.create .img { background: linear-gradient(180deg, #e7e9ed, #fff); }

.composer {
  background: var(--fb-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 12px;
  margin-bottom: 8px;
}
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer-input {
  flex: 1; padding: 10px 14px;
  background: var(--fb-input-bg);
  border-radius: var(--radius-pill);
  border: none;
  font-size: 16px;
  color: var(--fb-text-2);
  text-align: left;
}
.composer-input:hover { background: #E4E6E9; }
.composer-actions {
  display: flex; align-items: center; justify-content: space-around;
  border-top: 1px solid var(--fb-divider);
  margin-top: 10px; padding-top: 6px;
}
.composer-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: none; background: transparent;
  border-radius: 6px; font-weight: 600; color: var(--fb-text-2);
  font-size: 13px;
}
.composer-action:hover { background: var(--fb-hover); }
.composer-action .dot {
  width: 22px; height: 22px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.composer-action.live  .dot { background: #F3425F; }
.composer-action.photo .dot { background: #45BD62; }
.composer-action.feel  .dot { background: #F7B928; }

/* =========================================================
   Post card
   ========================================================= */
.post {
  background: var(--fb-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 8px;
  overflow: hidden;
}
.post-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 0;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #ddd center/cover no-repeat;
  flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; }
.avatar.lg { width: 72px; height: 72px; }
.avatar.xl { width: 168px; height: 168px; border: 4px solid var(--fb-card); }
.avatar.placeholder {
  background: linear-gradient(135deg, #e0e0e0, #b0b0b0);
  color: #666;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.post-head-meta { flex: 1; min-width: 0; }
.post-author {
  font-weight: 600; font-size: 15px; color: var(--fb-text);
  display: block; line-height: 1.2;
}
.post-author .feeling { color: var(--fb-text-2); font-weight: 400; }
.post-time {
  color: var(--fb-text-2); font-size: 12px;
  display: flex; align-items: center; gap: 4px;
  margin-top: 2px;
}
.post-menu {
  border: none; background: transparent;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--fb-text-2); font-size: 22px; line-height: 1;
}
.post-menu:hover { background: var(--fb-hover); }
.post-content {
  padding: 8px 16px 12px;
  white-space: pre-wrap; word-wrap: break-word;
  font-size: 15px; line-height: 1.4;
}
.post-content.text-only {
  padding: 24px 16px;
  text-align: center;
  font-size: 24px; font-weight: 600;
  color: #fff; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.post-image {
  width: 100%; max-height: 600px; object-fit: cover;
  background: #000;
}
.post-stats {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  font-size: 13px; color: var(--fb-text-2);
}
.post-stats .reactions {
  display: inline-flex; align-items: center; gap: 4px;
}
.post-stats .reaction-stack {
  display: inline-flex;
}
.post-stats .reaction-emoji {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fb-card);
  margin-left: -4px;
  font-size: 13px;
  border: 1.5px solid var(--fb-card);
}
.post-stats .reaction-stack .reaction-emoji:first-child { margin-left: 0; }

.post-actions {
  display: flex;
  border-top: 1px solid var(--fb-divider);
  padding: 4px;
}
.post-action {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 6px;
  border: none; background: transparent;
  font-weight: 600; color: var(--fb-text-2); font-size: 14px;
  border-radius: 6px;
  position: relative;
}
.post-action:hover { background: var(--fb-hover); }
.post-action.reacted {
  color: var(--fb-blue);
}
.post-action.reacted.love { color: #F33E58; }
.post-action.reacted.haha,
.post-action.reacted.cheers,
.post-action.reacted.goat { color: #F7B928; }
.post-action.reacted.clown { color: #C44569; }
.post-action.reacted.dead { color: #65676B; }

/* Reaction picker popover */
.reaction-picker {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) scale(0);
  background: var(--fb-card);
  border-radius: 999px;
  padding: 6px;
  display: flex; gap: 4px;
  box-shadow: var(--shadow-pop);
  transform-origin: bottom center;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1);
  z-index: 10;
}
.reaction-picker.open { transform: translateX(-50%) scale(1); }
.reaction-picker button {
  width: 44px; height: 44px;
  border: none; background: transparent;
  border-radius: 50%;
  font-size: 28px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.reaction-picker button:hover {
  transform: translateY(-8px) scale(1.3);
}
.reaction-picker .label {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .12s;
}
.reaction-picker button:hover .label { opacity: 1; }
.reaction-picker .gag-tag {
  position: absolute; top: -10px; right: -8px;
  background: var(--gag-red); color: #fff;
  font-family: var(--font-comic);
  font-size: 9px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  transform: rotate(15deg);
  pointer-events: none;
}

/* =========================================================
   Comments
   ========================================================= */
.comments { padding: 0 16px 12px; }
.comment {
  display: flex; gap: 8px; margin-top: 8px;
}
.comment-bubble {
  background: var(--fb-input-bg);
  padding: 8px 12px;
  border-radius: 16px;
  flex: 1; min-width: 0;
}
.comment-bubble .name {
  font-weight: 600; font-size: 13px; color: var(--fb-text);
}
.comment-bubble .text {
  font-size: 15px; color: var(--fb-text);
  word-wrap: break-word;
}
.comment-meta {
  display: flex; gap: 12px;
  font-size: 12px; color: var(--fb-text-2);
  padding-left: 12px; margin-top: 2px;
}
.comment-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 12px;
}
.comment-input {
  flex: 1;
  background: var(--fb-input-bg);
  border-radius: var(--radius-pill);
  border: none;
  padding: 8px 14px;
  font-size: 15px;
}
.comment-input:focus { outline: none; }

/* =========================================================
   Profile page
   ========================================================= */
.profile {
  background: var(--fb-card);
  margin-bottom: 8px;
}
.profile-cover {
  height: 180px;
  background: linear-gradient(135deg, #1877F2, #00C6FF);
  background-size: cover; background-position: center;
  position: relative;
}
.profile-info {
  position: relative;
  padding: 0 16px 16px;
  margin-top: -84px;
  text-align: center;
}
.profile-info .avatar {
  margin: 0 auto 8px;
}
.profile-name {
  font-size: 24px; font-weight: 800; color: var(--fb-text);
  margin: 8px 0 4px;
}
.profile-bio {
  color: var(--fb-text-2); font-size: 15px;
  margin-bottom: 16px;
}
.profile-stats {
  display: flex; justify-content: center; gap: 16px;
  font-size: 14px; color: var(--fb-text-2);
  padding-bottom: 12px;
}
.profile-stats b { color: var(--fb-text); font-weight: 700; }
.profile-actions {
  display: flex; gap: 8px; padding: 0 16px 16px;
  border-bottom: 1px solid var(--fb-divider);
}
.profile-actions button {
  flex: 1;
  padding: 8px;
  border-radius: 6px; border: none;
  font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-fb-blue { background: var(--fb-blue); color: #fff; }
.btn-fb-blue:hover { background: var(--fb-blue-dark); }
.btn-fb-gray { background: var(--fb-input-bg); color: var(--fb-text); }
.btn-fb-gray:hover { background: #E4E6E9; }

.profile-section {
  background: var(--fb-card);
  margin-bottom: 8px;
  padding: 16px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.profile-section h3 {
  font-size: 17px; font-weight: 700; margin: 0 0 12px;
}
.profile-section .row {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; padding: 6px 0;
  color: var(--fb-text);
}
.profile-section .row .ico { color: var(--fb-text-2); }

.friends-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.friend-tile {
  text-align: left; cursor: pointer;
  border: none; background: transparent; padding: 0;
}
.friend-tile .pic {
  width: 100%; aspect-ratio: 1/1;
  background: #ddd center/cover no-repeat;
  border-radius: 8px;
}
.friend-tile .pic.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e0e0e0, #b0b0b0);
  color: #666; font-weight: 700; font-size: 24px;
}
.friend-tile .name {
  font-size: 14px; font-weight: 600;
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* =========================================================
   Friends page
   ========================================================= */
.list-card {
  background: var(--fb-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 8px;
  overflow: hidden;
}
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fb-divider);
}
.list-row:last-child { border-bottom: none; }
.list-row .body { flex: 1; min-width: 0; }
.list-row .name { font-weight: 600; font-size: 15px; }
.list-row .sub { color: var(--fb-text-2); font-size: 13px; }
.list-row .actions { display: flex; gap: 8px; flex-shrink: 0; }
.list-row .actions button {
  padding: 6px 12px;
  border: none; border-radius: 6px;
  font-weight: 600; font-size: 14px;
}
.section-title {
  padding: 12px 16px 6px;
  font-size: 17px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}

/* =========================================================
   Notifications
   ========================================================= */
.notif-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--fb-divider);
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: rgba(24,119,242,.08); }
.notif-row .body { flex: 1; min-width: 0; }
.notif-row .text { font-size: 15px; color: var(--fb-text); line-height: 1.3; }
.notif-row .time { font-size: 13px; color: var(--fb-blue); font-weight: 600; margin-top: 2px; }
.notif-row .icon-pip {
  position: absolute; transform: translate(28px, 28px);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
  border: 2px solid var(--fb-card);
}

/* =========================================================
   Modals + popovers
   ========================================================= */
.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--fb-card);
  border-radius: 12px;
  width: 100%; max-width: 500px; max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: scaleIn .2s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fb-divider);
}
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--fb-input-bg);
  font-size: 20px; line-height: 1;
}
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--fb-divider);
  display: flex; gap: 8px; justify-content: flex-end;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* Story viewer (full screen) */
.story-viewer {
  position: fixed; inset: 0; z-index: 200;
  background: #000;
  display: flex; flex-direction: column;
}
.story-viewer-bars {
  display: flex; gap: 4px; padding: 12px 12px 0;
}
.story-viewer-bars .bar {
  flex: 1; height: 3px; border-radius: 999px;
  background: rgba(255,255,255,.4);
  overflow: hidden;
}
.story-viewer-bars .bar .fill {
  height: 100%; background: #fff;
  width: 0;
}
.story-viewer-bars .bar.done .fill { width: 100%; }
.story-viewer-bars .bar.active .fill {
  animation: storyFill 5s linear forwards;
}
@keyframes storyFill { to { width: 100%; } }
.story-viewer-head {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; color: #fff;
}
.story-viewer-head .name { font-weight: 600; }
.story-viewer-head .close {
  margin-left: auto;
  border: none; background: transparent; color: #fff;
  font-size: 28px; line-height: 1;
}
.story-viewer-content {
  flex: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 0 16px;
}
.story-viewer-content img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.story-viewer-content .text-story {
  width: 100%; max-width: 400px; min-height: 60vh;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  font-size: 28px; font-weight: 700; color: #fff;
}
.story-tap-zones {
  position: absolute; inset: 0; z-index: 3;
  display: flex;
}
.story-tap-zones div { flex: 1; }

/* =========================================================
   Misc
   ========================================================= */
.empty {
  text-align: center; padding: 32px 16px;
  color: var(--fb-text-2);
}
.empty .big { font-size: 56px; margin-bottom: 8px; }
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid rgba(0,0,0,.1);
  border-top-color: var(--fb-blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.center-spinner {
  display: flex; justify-content: center; padding: 32px;
}

.toast {
  position: fixed; bottom: calc(var(--bottom-h) + 16px); left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff;
  padding: 10px 16px; border-radius: 999px;
  font-size: 14px; z-index: 300;
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.gag-banner {
  background: linear-gradient(90deg, #1877F2, #1657BF);
  color: #fff;
  font-family: var(--font-comic);
  text-align: center; padding: 6px 12px;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.gag-banner b { color: var(--gag-yellow); }

/* form helpers */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--fb-text-2); margin-bottom: 4px;
}
textarea.auth-input { min-height: 90px; resize: vertical; }
.invite-help {
  background: #FFF8E1; border-left: 3px solid var(--gag-yellow);
  padding: 10px 12px; border-radius: 6px;
  font-size: 13px; color: #5D4E20;
  margin-bottom: 12px;
}

.fab {
  position: fixed; bottom: calc(var(--bottom-h) + 16px); right: 16px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--fb-blue); color: #fff;
  border: none; box-shadow: var(--shadow-pop);
  font-size: 28px; line-height: 1;
  z-index: 30;
}

@media (min-width: 720px) {
  .feed { padding-top: 16px; }
}
