/* ================================================
   webposts.live — Stylesheet
   ================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --indigo:       #6366f1;
  --indigo-dark:  #4f46e5;
  --indigo-light: #818cf8;
  --indigo-pale:  #eef2ff;
  --pink:         #ec4899;
  --pink-pale:    #fce7f3;
  --amber:        #f59e0b;
  --amber-pale:   #fffbeb;
  --green:        #10b981;
  --green-pale:   #d1fae5;
  --red:          #ef4444;
  --red-pale:     #fee2e2;

  --gray-50:  #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
  --gray-300: #cbd5e1; --gray-400: #94a3b8; --gray-500: #64748b;
  --gray-600: #475569; --gray-700: #334155; --gray-800: #1e293b;
  --gray-900: #0f172a;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.1), 0 8px 24px rgba(0,0,0,.06);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-2xl: 32px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: .18s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { font-family: var(--font); }
svg { display: block; flex-shrink: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-body  { padding-top: 48px; padding-bottom: 64px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--indigo); color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.btn-primary:hover {
  background: var(--indigo-dark); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); border-color: var(--gray-300); }
.btn-danger {
  background: var(--red); color: #fff;
  box-shadow: 0 4px 14px rgba(239,68,68,.3);
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: var(--r-lg); }
.btn-full { width: 100%; justify-content: center; }

/* ── Flash Messages ── */
.messages-wrap { padding: 12px 0 0; }
.alert {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 18px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; margin-bottom: 8px;
}
.alert-success { background: var(--green-pale); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error, .alert-danger { background: var(--red-pale); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--amber-pale); color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: var(--indigo-pale); color: var(--indigo-dark); border: 1px solid var(--indigo-light); }
.alert-close {
  background: none; border: none; cursor: pointer; opacity: .6;
  font-size: 15px; line-height: 1; padding: 2px 4px; transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ================================================
   HEADER
   ================================================ */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(248,250,252,.9);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--gray-200);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; gap: 24px;
}
.logo { font-size: 20px; font-weight: 800; letter-spacing: -.6px; flex-shrink: 0; }
.logo-name { color: var(--gray-900); }
.logo-dot  { color: var(--indigo); }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 7px 13px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--gray-500);
  transition: all var(--transition);
}
.nav-link:hover  { color: var(--gray-900); background: var(--gray-100); }
.nav-link.active { color: var(--indigo); background: var(--indigo-pale); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Nav authenticated user chip */
.nav-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-lg);
  background: var(--gray-100); transition: background var(--transition);
}
.nav-user:hover { background: var(--gray-200); }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-user span { font-size: 13px; font-weight: 600; color: var(--gray-700); }

/* ================================================
   HERO
   ================================================ */
.hero {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: 72px 0 0; overflow: hidden; position: relative;
}
.hero::before {
  content: ''; position: absolute; top: -80px; left: -120px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,.07) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; top: -60px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(236,72,153,.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { max-width: 680px; position: relative; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; background: var(--indigo-pale); color: var(--indigo-dark);
  border-radius: 100px; font-size: 13px; font-weight: 600; margin-bottom: 22px;
}
.hero-pill-dot {
  width: 8px; height: 8px; background: var(--green); border-radius: 50%;
  animation: softPulse 2.2s ease-in-out infinite;
}
@keyframes softPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.55;transform:scale(.75)} }

.hero-heading {
  font-size: clamp(38px, 5.5vw, 68px); font-weight: 900;
  line-height: 1.07; letter-spacing: -2.5px; color: var(--gray-900); margin-bottom: 22px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--pink) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc { font-size: 18px; color: var(--gray-500); max-width: 500px; line-height: 1.75; margin-bottom: 36px; }
.hero-cta  { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.hero-stats {
  display: flex; align-items: center;
  border-top: 1px solid var(--gray-100); padding: 28px 0; position: relative;
}
.hero-stat { display: flex; flex-direction: column; gap: 3px; padding: 0 36px 0 0; }
.hero-stat:first-child { padding-left: 0; }
.hero-stat-val   { font-size: 26px; font-weight: 800; letter-spacing: -1px; color: var(--gray-900); line-height: 1; }
.hero-stat-label { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.hero-stat-divider { width: 1px; height: 36px; background: var(--gray-200); margin: 0 36px 0 0; flex-shrink: 0; }

/* ================================================
   SECTION EYEBROW / LIVE BADGE
   ================================================ */
.section-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  background: var(--red-pale); color: var(--red);
  border-radius: 100px; font-size: 11px; font-weight: 700; letter-spacing: .8px;
  margin-top: 1.5em;
  margin-bottom: -1em;
}
.live-dot {
  width: 7px; height: 7px; background: var(--red); border-radius: 50%;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.4)} 50%{box-shadow:0 0 0 5px rgba(239,68,68,0)} }
.eyebrow-text { font-size: 15px; font-weight: 600; color: var(--gray-600); }

/* ================================================
   LIVE CARD
   ================================================ */
.live-section { margin-bottom: 60px; }
.live-card {
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.live-card-glow {
  position: absolute; inset: 0; border-radius: inherit; padding: 2px;
  background: linear-gradient(135deg, #6366f1, #ec4899, #818cf8, #6366f1);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; 
  /* animation: gradientShift 5s linear infinite; */
  /* will-change: transform; */
}
@keyframes gradientShift { 
	/* from { transform: translateX(0); } */
	/* to { transform: translateX(-50%); } */
	0%{background-position:0% 50%} 
	50%{background-position:100% 50%} 
	100%{background-position:0% 50%} 
}

.live-card-top {
  display: grid; grid-template-columns: 1fr auto;
  gap: 40px; padding: 40px 40px 36px; align-items: start;
}
.post-build-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.post-num  { font-size: 13px; font-weight: 700; color: var(--gray-400); letter-spacing: .4px; }
.round-badge {
  display: inline-flex; align-items: center; padding: 3px 11px;
  background: var(--indigo-pale); color: var(--indigo);
  border-radius: 100px; font-size: 12px; font-weight: 700;
}
.round-hint { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.post-text {
  font-size: clamp(22px, 2.8vw, 32px); font-weight: 800;
  letter-spacing: -.8px; color: var(--gray-900); line-height: 1.45; margin-bottom: 24px;
}
.word          { margin-right: .22em; display: inline; }
.word.done     { color: var(--gray-900); }
.word.pending-word { color: var(--indigo); animation: blink 1.1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.word-crumbs   { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crumb {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 100px; font-size: 12px; font-weight: 500;
}
.crumb.confirmed { background: var(--gray-100); color: var(--gray-600); }
.crumb.voting { background: var(--indigo-pale); color: var(--indigo); font-weight: 700; animation: softPulse 2s ease-in-out infinite; }

/* Timer */
.timer-wrap    { display: flex; flex-direction: column; align-items: center; gap: 14px; flex-shrink: 0; }
.timer-ring    { position: relative; width: 148px; height: 148px; }
.timer-svg     { width: 100%; height: 100%; }
.timer-track   { fill: none; stroke: var(--gray-100); stroke-width: 9; }
.timer-arc     { fill: none; stroke: url(#timerGrad); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-center  { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.timer-val     { font-size: 30px; font-weight: 900; letter-spacing: -1.5px; color: var(--gray-900); line-height: 1; font-variant-numeric: tabular-nums; }
.timer-label   { font-size: 11px; color: var(--gray-400); font-weight: 500; }
.timer-caption { font-size: 12px; color: var(--gray-400); text-align: center; line-height: 1.5; max-width: 130px; }

.card-divider  { height: 1px; background: var(--gray-100); margin: 0 40px; }

/* Suggestions */
.suggestions        { padding: 28px 40px 36px; }
.suggestions-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.suggestions-title  { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.suggestions-count  { font-size: 13px; color: var(--gray-400); font-weight: 500; }
.suggestion-list    { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.suggestion-item {
  display: grid; grid-template-columns: 36px 1fr auto auto;
  align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--r-md); background: var(--gray-50);
  border: 1.5px solid transparent; transition: all var(--transition);
}
.suggestion-item:hover      { background: #fff; border-color: var(--gray-200); box-shadow: var(--shadow-sm); }
.suggestion-item.leading    { background: var(--indigo-pale); border-color: rgba(99,102,241,.2); }
.suggestion-item.leading:hover { border-color: rgba(99,102,241,.4); }
.suggestion-item.eop-item   { background: var(--amber-pale); border-color: rgba(245,158,11,.2); }
.suggestion-item.eop-item:hover { border-color: rgba(245,158,11,.4); }
.s-rank { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.rank-gold   { background: var(--indigo); color: #fff; }
.rank-silver { background: var(--gray-300); color: var(--gray-700); }
.rank-bronze { background: #cd7f32; color: #fff; }
.rank-eop    { width: auto; height: auto; padding: 3px 7px; border-radius: 6px; background: var(--amber); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .5px; }
.s-info      { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-word      { font-size: 15px; font-weight: 700; color: var(--gray-900); letter-spacing: -.3px; }
.eop-label   { color: var(--amber); }
.s-author    { font-size: 12px; color: var(--gray-400); }
.s-author strong { color: var(--gray-600); font-weight: 600; }
.s-bar-wrap  { width: 80px; height: 6px; background: var(--gray-200); border-radius: 100px; overflow: hidden; flex-shrink: 0; }
.s-bar       { height: 100%; background: linear-gradient(90deg, var(--indigo-light), var(--indigo)); border-radius: 100px; transition: width .6s ease; }
.eop-bar     { background: linear-gradient(90deg, #fcd34d, var(--amber)); }
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--r-sm); border: 1.5px solid var(--gray-200);
  background: #fff; color: var(--gray-500);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); flex-shrink: 0; user-select: none;
}
.vote-btn svg { width: 14px; height: 14px; }
.vote-btn:hover { border-color: var(--pink); color: var(--pink); background: var(--pink-pale); transform: scale(1.03); }
.vote-btn:active { transform: scale(.97); }
.vote-btn.voted  { background: var(--pink-pale); border-color: var(--pink); color: var(--pink); }
.vote-btn.eop-vote { border-color: #fcd34d; color: #b45309; background: var(--amber-pale); }
.vote-btn.eop-vote:hover,.vote-btn.eop-vote.voted { border-color: var(--amber); background: #fef3c7; color: #92400e; }
.word-input-row { display: flex; flex-direction: column; gap: 8px; }
.word-input-box {
  display: flex; align-items: center; border: 1.5px solid var(--gray-200);
  border-radius: var(--r-lg); overflow: hidden; background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.word-input-box:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.word-input-icon { padding: 0 14px; color: var(--indigo); font-size: 13px; flex-shrink: 0; }
.word-input {
  flex: 1; border: none; outline: none; padding: 14px 8px;
  font-family: var(--font); font-size: 14px; color: var(--gray-900); background: transparent;
}
.word-input::placeholder { color: var(--gray-400); }
.word-submit {
  padding: 14px 24px; background: var(--indigo); color: #fff;
  border: none; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--transition); flex-shrink: 0;
}
.word-submit:hover { background: var(--indigo-dark); }
.word-hint { font-size: 12px; color: var(--gray-400); padding-left: 4px; }
.word-hint strong { color: var(--gray-600); }

/* ================================================
   POSTS SECTION (HOME FEED)
   ================================================ */
.posts-section { margin-bottom: 48px; }
.posts-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}
.posts-title { font-size: 22px; font-weight: 800; letter-spacing: -.6px; color: var(--gray-900); }
.filter-tabs {
  display: flex; align-items: center; gap: 3px; background: #fff;
  padding: 4px; border-radius: var(--r-md); border: 1.5px solid var(--gray-200);
}
.filter-tab {
  padding: 6px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  color: var(--gray-500); background: transparent; border: none; cursor: pointer; transition: all var(--transition);
}
.filter-tab:hover  { color: var(--gray-800); }
.filter-tab.active { background: var(--indigo); color: #fff; }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card {
  background: #fff; border-radius: var(--r-lg); padding: 24px;
  border: 1.5px solid var(--gray-200); box-shadow: var(--shadow-xs);
  transition: all var(--transition); display: flex; flex-direction: column;
  gap: 16px; position: relative; overflow: hidden;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.post-card.featured { border-color: rgba(99,102,241,.25); background: linear-gradient(145deg, #fff 60%, rgba(99,102,241,.04) 100%); }
.featured-ribbon {
  position: absolute; top: 0; right: 0;
  background: linear-gradient(135deg, var(--indigo), var(--pink));
  color: #fff; font-size: 10px; font-weight: 700; padding: 5px 13px;
  border-radius: 0 var(--r-lg) 0 var(--r-lg); letter-spacing: .4px;
}
.post-card-header { display: flex; align-items: center; justify-content: space-between; }
.post-card-labels { display: flex; align-items: center; gap: 8px; }
.pnum  { font-size: 12px; font-weight: 700; color: var(--gray-400); letter-spacing: .4px; }
.ptag  { display: inline-flex; align-items: center; padding: 2px 9px; background: var(--indigo-pale); color: var(--indigo); border-radius: 100px; font-size: 11px; font-weight: 600; }
.ptime { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.post-quote {
  font-size: 15px; line-height: 1.65; color: var(--gray-700);
  font-style: italic; border-left: 3px solid var(--indigo-light);
  padding-left: 14px; flex: 1;
}
.post-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.post-stats { display: flex; align-items: center; gap: 12px; }
.pstat { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--gray-500); }
.pstat svg { width: 14px; height: 14px; }
.pstat.heart { color: var(--pink); }
.pstat.heart svg { fill: var(--pink); }
.pstat.comment svg { color: var(--gray-400); }
.prounds { font-size: 12px; color: var(--gray-400); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--gray-200); }
.share-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1.5px solid var(--gray-200); background: transparent;
  color: var(--gray-400); cursor: pointer; transition: all var(--transition);
}
.share-btn svg { width: 15px; height: 15px; }
.share-btn:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-pale); }
.load-more { display: flex; justify-content: center; margin-top: 32px; }
.load-more-btn {
  padding: 12px 32px; background: #fff; border: 1.5px solid var(--gray-200);
  border-radius: var(--r-lg); font-size: 14px; font-weight: 600; color: var(--gray-600);
  cursor: pointer; transition: all var(--transition);
}
.load-more-btn:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-pale); }

/* ================================================
   PAGE HERO (inner pages)
   ================================================ */
.page-hero {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: 40px 0; margin-bottom: 40px;
}
.page-hero-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-hero-title { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -1px; color: var(--gray-900); margin-bottom: 6px; }
.page-hero-sub { font-size: 15px; color: var(--gray-500); }
.page-hero-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-400); margin-bottom: 12px; }
.breadcrumb a { color: var(--indigo); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { font-size: 12px; }

/* ================================================
   POST DETAIL — CLOSED
   ================================================ */
.post-detail-card {
  background: #fff; border-radius: var(--r-xl); padding: 48px;
  box-shadow: var(--shadow-md); border: 1.5px solid var(--gray-200); margin-bottom: 24px;
}
.post-detail-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.post-detail-num  { font-size: 13px; font-weight: 700; color: var(--gray-400); }
.post-detail-tag  { display: inline-flex; padding: 3px 11px; background: var(--indigo-pale); color: var(--indigo); border-radius: 100px; font-size: 12px; font-weight: 600; }
.post-detail-date { font-size: 13px; color: var(--gray-400); }
.post-detail-rounds { font-size: 13px; color: var(--gray-500); }

/* Word-by-word attribution text */
.post-attributed-text { font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; letter-spacing: -.5px; line-height: 1.55; color: var(--gray-900); margin-bottom: 32px; }
.word-token {
  display: inline; position: relative; cursor: default;
  border-bottom: 2px solid transparent; margin-right: .22em;
  transition: border-color var(--transition);
}
.word-token:hover { border-bottom-color: var(--indigo); }
.word-author {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--gray-900); color: #fff; padding: 4px 9px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 10;
}
.word-author::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--gray-900);
}
.word-token:hover .word-author { display: block; }

.post-detail-actions { display: flex; align-items: center; gap: 12px; padding-top: 24px; border-top: 1px solid var(--gray-100); }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  background: var(--pink-pale); color: var(--pink); border: 1.5px solid var(--pink);
  border-radius: var(--r-md); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.like-btn svg { width: 16px; height: 16px; }
.like-btn:hover { background: var(--pink); color: #fff; }

/* Contributors */
.contributors-section { background: #fff; border-radius: var(--r-xl); padding: 32px; box-shadow: var(--shadow-sm); border: 1.5px solid var(--gray-200); }
.contributors-title { font-size: 16px; font-weight: 700; color: var(--gray-800); margin-bottom: 20px; }
.contributors-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.contributor-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--gray-50); border-radius: var(--r-md); border: 1px solid var(--gray-200);
  transition: all var(--transition);
}
.contributor-chip:hover { background: var(--indigo-pale); border-color: rgba(99,102,241,.2); }
.contributor-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contributor-name  { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.contributor-words { font-size: 11px; color: var(--gray-400); }

/* ================================================
   FORM ELEMENTS
   ================================================ */
.form-group   { display: flex; flex-direction: column; gap: 7px; }
.form-label   { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.form-control {
  width: 100%; padding: 12px 14px; font-family: var(--font); font-size: 14px;
  color: var(--gray-900); background: #fff; border: 1.5px solid var(--gray-200);
  border-radius: var(--r-md); outline: none; transition: all var(--transition);
}
.form-control:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-control.error { border-color: var(--red); }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.form-control::placeholder { color: var(--gray-400); }
.form-error   { font-size: 12px; color: var(--red); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.form-hint    { font-size: 12px; color: var(--gray-400); }
.form-stack   { display: flex; flex-direction: column; gap: 20px; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--gray-400); margin-bottom: 4px; }
.form-card {
  background: #fff; border-radius: var(--r-xl); padding: 40px;
  box-shadow: var(--shadow-md); border: 1.5px solid var(--gray-200);
}
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 8px; border-top: 1px solid var(--gray-100); }

/* ================================================
   AUTH PAGES
   ================================================ */
body.auth-page {
  background: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%);
  min-height: 100vh; display: flex; flex-direction: column;
}
.auth-page .header {
  background: rgba(255,255,255,.8);
  border-bottom: 1px solid rgba(226,232,240,.6);
}
.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px;
}
.auth-card {
  background: #fff; border-radius: var(--r-2xl); padding: 48px 40px;
  box-shadow: var(--shadow-xl); border: 1.5px solid var(--gray-200); width: 100%; max-width: 440px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo { font-size: 24px; display: inline-block; }
.auth-heading { font-size: 26px; font-weight: 800; letter-spacing: -.8px; color: var(--gray-900); margin-bottom: 6px; }
.auth-sub     { font-size: 14px; color: var(--gray-500); margin-bottom: 28px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider span { font-size: 12px; color: var(--gray-400); white-space: nowrap; }
.auth-divider-line { flex: 1; height: 1px; background: var(--gray-200); }
.auth-footer  { margin-top: 24px; text-align: center; font-size: 14px; color: var(--gray-500); }
.auth-footer a { color: var(--indigo); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ================================================
   LEADERBOARD
   ================================================ */
.leaderboard-section { max-width: 800px; }
.lb-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 32px; }
.lb-podium-card {
  background: #fff; border-radius: var(--r-xl); padding: 28px 20px;
  text-align: center; border: 1.5px solid var(--gray-200); box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.lb-podium-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lb-podium-card.gold-card   { border-color: #fbbf24; background: linear-gradient(145deg, #fff 50%, #fffbeb); }
.lb-podium-card.silver-card { border-color: var(--gray-300); }
.lb-podium-card.bronze-card { border-color: #d97706; background: linear-gradient(145deg, #fff 50%, #fffbeb 100%); }
.lb-medal  { font-size: 32px; margin-bottom: 12px; display: block; }
.lb-podium-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--indigo); color: #fff;
  font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.lb-podium-name  { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.lb-podium-score { font-size: 22px; font-weight: 900; letter-spacing: -1px; color: var(--indigo); }
.lb-podium-label { font-size: 11px; color: var(--gray-400); }

.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-item {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  background: #fff; border-radius: var(--r-lg); border: 1.5px solid var(--gray-200);
  transition: all var(--transition);
}
.lb-item:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.lb-rank-num  { font-size: 15px; font-weight: 800; color: var(--gray-400); width: 28px; text-align: center; flex-shrink: 0; }
.lb-avatar    { width: 40px; height: 40px; border-radius: 50%; background: var(--indigo); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lb-info      { flex: 1; min-width: 0; }
.lb-username  { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.lb-joined    { font-size: 12px; color: var(--gray-400); }
.lb-stats     { display: flex; gap: 20px; flex-shrink: 0; }
.lb-stat-item { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.lb-stat-val  { font-size: 16px; font-weight: 800; color: var(--gray-800); }
.lb-stat-lbl  { font-size: 10px; color: var(--gray-400); font-weight: 500; white-space: nowrap; }
.lb-score-badge {
  background: var(--indigo-pale); color: var(--indigo); border-radius: var(--r-md);
  padding: 4px 12px; font-size: 14px; font-weight: 800; flex-shrink: 0;
}

/* ================================================
   USER PROFILE
   ================================================ */
.profile-hero {
  background: #fff; border-bottom: 1px solid var(--gray-200); padding: 48px 0 40px;
}
.profile-hero-inner { display: flex; align-items: flex-start; gap: 28px; }
.profile-avatar-lg {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--pink));
  color: #fff; font-size: 32px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-username { font-size: 28px; font-weight: 800; letter-spacing: -.8px; color: var(--gray-900); margin-bottom: 4px; }
.profile-handle   { font-size: 15px; color: var(--gray-400); margin-bottom: 12px; }
.profile-bio      { font-size: 14px; color: var(--gray-600); max-width: 480px; line-height: 1.6; margin-bottom: 16px; }
.profile-joined   { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-400); }
.profile-joined svg { width: 14px; height: 14px; }
.profile-actions  { display: flex; align-items: flex-start; gap: 10px; flex-shrink: 0; }
.profile-stats-row { display: flex; align-items: center; gap: 0; margin-top: 24px; border-top: 1px solid var(--gray-100); padding-top: 24px; }
.pstat-item       { display: flex; flex-direction: column; gap: 2px; padding: 0 28px 0 0; }
.pstat-item:first-child { padding-left: 0; }
.pstat-val        { font-size: 22px; font-weight: 800; letter-spacing: -1px; color: var(--gray-900); }
.pstat-lbl        { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.pstat-divider    { width: 1px; height: 32px; background: var(--gray-200); margin: 0 28px 0 0; flex-shrink: 0; }

.activity-section { margin-top: 40px; }
.activity-title   { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 16px; }
.contribution-list { display: flex; flex-direction: column; gap: 10px; }
.contribution-item {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  background: #fff; border-radius: var(--r-lg); border: 1.5px solid var(--gray-200);
  transition: all var(--transition);
}
.contribution-item:hover { border-color: var(--indigo-light); background: var(--indigo-pale); }
.contrib-word { font-size: 17px; font-weight: 800; color: var(--indigo); min-width: 80px; letter-spacing: -.3px; }
.contrib-context { flex: 1; font-size: 13px; color: var(--gray-500); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-post { font-size: 12px; color: var(--gray-400); font-weight: 500; flex-shrink: 0; }
.contrib-likes { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--pink); flex-shrink: 0; }
.contrib-likes svg { width: 13px; height: 13px; fill: var(--pink); }

/* ================================================
   DANGER / DELETE CONFIRMATION
   ================================================ */
.danger-section { max-width: 560px; margin: 0 auto; }
.danger-card {
  background: #fff; border-radius: var(--r-xl); padding: 48px 40px;
  text-align: center; box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--red-pale);
}
.danger-icon  { font-size: 48px; margin-bottom: 20px; display: block; }
.danger-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: var(--gray-900); margin-bottom: 12px; }
.danger-desc  { font-size: 15px; color: var(--gray-500); line-height: 1.6; margin-bottom: 32px; max-width: 380px; margin-left: auto; margin-right: auto; }
.danger-subject {
  background: var(--red-pale); border-radius: var(--r-md); padding: 16px 20px;
  font-size: 14px; color: #991b1b; font-style: italic; margin-bottom: 32px; text-align: left;
  border-left: 3px solid var(--red);
}
.danger-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
  text-align: center; padding: 80px 24px;
  background: #fff; border-radius: var(--r-xl); border: 1.5px dashed var(--gray-300);
}
.empty-state-icon  { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state-title { font-size: 20px; font-weight: 700; color: var(--gray-700); margin-bottom: 8px; }
.empty-state-desc  { font-size: 14px; color: var(--gray-400); max-width: 300px; margin: 0 auto 24px; line-height: 1.6; }

/* ================================================
   FOOTER
   ================================================ */
.footer { background: var(--gray-900); color: #fff; padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 64px; padding-bottom: 48px; }
.footer-logo { display: inline-block; margin-bottom: 12px; }
.footer-logo .logo-name { color: #fff; }
.footer-logo .logo-dot  { color: var(--indigo-light); }
.footer-tagline { font-size: 14px; color: var(--gray-500); margin-bottom: 22px; line-height: 1.6; }
.footer-socials { display: flex; gap: 8px; }
.social-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--gray-800); color: var(--gray-500); transition: all var(--transition); }
.social-btn svg { width: 17px; height: 17px; }
.social-btn:hover { background: var(--indigo); color: #fff; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-600); margin-bottom: 16px; }
.footer-col a  { display: block; font-size: 14px; color: var(--gray-400); font-weight: 500; margin-bottom: 10px; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--gray-800); padding: 20px 0; display: flex; align-items: center; justify-content: space-between; }
.footer-bottom p { font-size: 13px; color: var(--gray-600); }

/* ================================================
   CLICKABLE WORD TOKENS (live post)
   ================================================ */

/* Words in .post-text become interactive buttons */
.token-clickable {
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 3px;
  outline: none;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.token-clickable:hover,
.token-clickable:focus-visible {
  background: var(--indigo-pale);
  color: var(--indigo);
}
.token-clickable:focus-visible { outline: 2px solid rgba(99,102,241,.4); outline-offset: 2px; }

/* Tooltip shown on hover */
.token-clickable::after {
  content: 'Click to act on this word';
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--gray-900); color: #fff;
  padding: 4px 9px; border-radius: 6px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity .15s ease; z-index: 5;
}
.token-clickable:hover::after { opacity: 1; }

/* Crumb version — same interaction, no extra tooltip */
.crumb.token-clickable::after { display: none; }
.crumb.token-clickable:hover  { background: var(--indigo-pale); color: var(--indigo); }

/* ── Suggestion-item owner controls ──────────────────────────── */
/* Wraps the vote form + optional edit/withdraw links in one flex cell */
.s-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.s-owner-btn {
  display: inline-flex; align-items: center; padding: 5px 10px;
  border-radius: var(--r-sm); font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--gray-200); background: transparent;
  color: var(--gray-500); cursor: pointer; text-decoration: none;
  transition: all var(--transition); white-space: nowrap;
}
.s-owner-btn:hover { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-300); }
.s-owner-btn.danger:hover { background: var(--red-pale); color: var(--red); border-color: var(--red); }

/* ================================================
   TOKEN ACTION MODAL
   ================================================ */

.t-modal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(15,23,42,.52);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.t-modal-overlay.open { opacity: 1; visibility: visible; }

.t-modal {
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200);
  width: 100%; max-width: 460px; overflow: hidden;
  transform: translateY(16px) scale(.97);
  transition: transform .24s cubic-bezier(.34,1.56,.64,1);
}
.t-modal-overlay.open .t-modal { transform: translateY(0) scale(1); }

.t-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 28px 20px; border-bottom: 1px solid var(--gray-100);
}
.t-modal-titles { flex: 1; }
.t-modal-title  { font-size: 17px; font-weight: 800; color: var(--gray-900); margin-bottom: 2px; }
.t-modal-sub    { font-size: 13px; color: var(--gray-400); }

.t-modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: none; background: transparent;
  color: var(--gray-400); cursor: pointer; flex-shrink: 0; margin-left: 12px;
  transition: all var(--transition);
}
.t-modal-close svg { width: 16px; height: 16px; }
.t-modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

.t-modal-body { padding: 24px 28px; }

/* Selected word chip */
.t-selected-token {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--indigo-pale);
  border-radius: var(--r-md); border: 1.5px solid rgba(99,102,241,.2);
  margin-bottom: 22px;
}
.t-selected-word { font-size: 22px; font-weight: 900; color: var(--indigo); letter-spacing: -.5px; line-height: 1; }
.t-selected-meta { font-size: 12px; color: var(--indigo); opacity: .65; font-weight: 500; }

/* Action section heading */
.t-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--gray-400); margin-bottom: 10px; display: block;
}

/* Insert / Delete toggle */
.t-action-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.t-action-btn {
  padding: 16px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--gray-200); background: var(--gray-50);
  cursor: pointer; text-align: left; transition: all var(--transition);
  display: flex; flex-direction: column; gap: 3px;
}
.t-action-btn:hover { border-color: var(--gray-300); background: #fff; box-shadow: var(--shadow-sm); }
.t-action-btn-icon  { font-size: 22px; line-height: 1; display: block; margin-bottom: 6px; }
.t-action-btn-label { font-size: 14px; font-weight: 700; color: var(--gray-800); display: block; }
.t-action-btn-desc  { font-size: 11px; color: var(--gray-400); display: block; line-height: 1.4; }

.t-action-btn.active.insert {
  border-color: var(--indigo); background: var(--indigo-pale);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.t-action-btn.active.insert .t-action-btn-label { color: var(--indigo); }
.t-action-btn.active.delete {
  border-color: var(--red); background: var(--red-pale);
  box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}
.t-action-btn.active.delete .t-action-btn-label { color: var(--red); }

/* Insert: new token input (revealed when Insert is selected) */
.t-insert-wrap { display: none; margin-bottom: 8px; }
.t-insert-wrap.visible { display: block; }
.t-insert-label { font-size: 12px; font-weight: 600; color: var(--gray-600); display: block; margin-bottom: 8px; }

/* Inline validation error */
.t-error { display: none; font-size: 12px; color: var(--red); font-weight: 500; padding: 6px 0 0; }
.t-error.visible { display: block; }

.t-modal-footer {
  padding: 16px 28px 24px;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* Responsive: modal goes full-width on mobile */
@media (max-width: 480px) {
  .t-modal { border-radius: var(--r-lg); }
  .t-modal-body { padding: 20px 20px; }
  .t-modal-header { padding: 20px 20px 16px; }
  .t-modal-footer { padding: 12px 20px 20px; }
  .t-action-btns { grid-template-columns: 1fr; }
}

/* ================================================
   COMMENT INPUT — Live Classification Badge
   ================================================ */

/* Wrapper that sits between the text input row and the hint line */
.input-classify-wrap {
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 0;
  min-height: 22px; /* reserve space so layout doesn't jump */
}

.classify-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  user-select: none;
}
/* Token — single votable word */
.classify-badge.is-token {
  background: var(--indigo-pale); color: var(--indigo);
  border: 1px solid rgba(99,102,241,.25);
}
/* EOP — special end-of-post token */
.classify-badge.is-eop {
  background: var(--amber-pale); color: #92400e;
  border: 1px solid rgba(245,158,11,.3);
}
/* Comment — plain discussion message */
.classify-badge.is-comment {
  background: var(--gray-100); color: var(--gray-500);
  border: 1px solid var(--gray-200);
}
/* Hidden until user starts typing */
.classify-badge.hidden { display: none; }

/* ================================================
   DISCUSSION COMMENTS SECTION
   ================================================ */

.discussion-section { padding: 0 40px 36px; }

.discussion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 20px; margin-bottom: 14px;
  border-top: 1px solid var(--gray-100);
}
.discussion-title { font-size: 14px; font-weight: 700; color: var(--gray-600); }
.discussion-count { font-size: 12px; color: var(--gray-400); font-weight: 500; }

.discussion-list { display: flex; flex-direction: column; gap: 8px; }

.discussion-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  background: var(--gray-50); border-radius: var(--r-md);
  border: 1px solid var(--gray-200); transition: border-color var(--transition);
}
.discussion-item:hover { border-color: var(--gray-300); }

/* Avatar circle (initials) */
.discussion-av {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--gray-200); color: var(--gray-500);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.discussion-body   { flex: 1; min-width: 0; }
.discussion-meta   { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.discussion-author { font-size: 12px; font-weight: 700; color: var(--gray-700); }
.discussion-time   { font-size: 11px; color: var(--gray-400); }
.discussion-text   {
  font-size: 13px; color: var(--gray-700);
  line-height: 1.55; word-break: break-word;
}

/* Shown when there are no discussion comments yet */
.discussion-empty {
  font-size: 13px; color: var(--gray-400);
  text-align: center; padding: 16px 0; font-style: italic;
}

/* ================================================
   ACTION AREA — Suggest / Insert / Delete tabs
   ================================================ */

.action-divider { height: 1px; background: var(--gray-100); margin: 0 40px; }
.action-area    { padding: 24px 40px 32px; }

/* Tab row */
.action-tabs {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px; background: var(--gray-50);
  border: 1.5px solid var(--gray-200); border-radius: var(--r-lg);
  margin-bottom: 20px;
}
.action-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--gray-500);
  transition: all var(--transition); white-space: nowrap; user-select: none;
}
.action-tab:hover { color: var(--gray-900); background: #fff; }
.action-tab.active {
  background: #fff; color: var(--indigo);
  box-shadow: var(--shadow-xs); border: 1px solid var(--gray-200);
}
.action-tab.delete-tab.active { color: var(--red); }
.action-tab .tab-icon { font-size: 14px; }

/* Panels */
.action-panel         { display: none; }
.action-panel.active  { display: block; }

/* "Select a word" row heading */
.target-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--gray-400);
  display: block; margin-bottom: 10px;
}

/* Horizontally scrollable word chip row */
.word-chips-scroll {
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent;
}
.word-chips-scroll::-webkit-scrollbar { height: 3px; }
.word-chips-scroll::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* Individual word chip */
.word-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 7px 13px; border-radius: var(--r-md);
  border: 1.5px solid var(--gray-200); background: #fff;
  cursor: pointer; transition: all var(--transition);
  font-size: 13px; font-weight: 700; color: var(--gray-700);
  box-shadow: var(--shadow-xs);
}
.word-chip:hover { border-color: var(--gray-400); background: var(--gray-50); box-shadow: var(--shadow-sm); }

/* Position badge inside chip */
.chip-pos {
  font-size: 10px; font-weight: 600; color: var(--gray-400);
  background: var(--gray-100); border-radius: 4px;
  padding: 1px 5px; line-height: 1.5; flex-shrink: 0;
}

/* Special "after last word" chip */
.word-chip.end-chip { border-style: dashed; color: var(--gray-500); font-weight: 600; }
.word-chip.end-chip .chip-pos { display: none; }

/* Selected chip: Insert (indigo) */
.word-chip.selected-insert {
  border-color: var(--indigo); background: var(--indigo-pale);
  color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.word-chip.selected-insert .chip-pos { background: rgba(99,102,241,.15); color: var(--indigo); }

/* Selected chip: Delete (red) */
.word-chip.selected-delete {
  border-color: var(--red); background: var(--red-pale);
  color: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.word-chip.selected-delete .chip-pos { background: rgba(239,68,68,.15); color: var(--red); }

/* No confirmed words message */
.no-words-msg {
  font-size: 13px; color: var(--gray-400); font-style: italic;
  padding: 10px 0; flex-shrink: 0;
}

/* Target preview summary (shown after chip selection) */
.target-preview {
  display: none; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-md);
  margin-bottom: 14px; font-size: 13px; border: 1px solid var(--gray-200);
  background: var(--gray-50); color: var(--gray-600);
}
.target-preview.visible { display: flex; }
.target-preview svg { width: 14px; height: 14px; flex-shrink: 0; }
.target-preview.insert-preview {
  background: var(--indigo-pale); border-color: rgba(99,102,241,.25);
  color: var(--indigo-dark);
}
.target-preview.delete-preview {
  background: var(--red-pale); border-color: rgba(239,68,68,.25);
  color: #991b1b;
}
.target-preview strong { font-weight: 800; }

/* Disabled input state (Insert: before a target is chosen) */
.word-input.locked { opacity: .45; pointer-events: none; }

/* Delete submit row */
.delete-submit-row { margin-top: 8px; }

/* Unauthenticated fallback */
.action-signin-prompt {
  display: flex; flex-direction: column; gap: 8px;
}
.action-signin-prompt .word-hint a { color: var(--indigo); font-weight: 600; }
.action-signin-prompt .word-hint a:hover { text-decoration: underline; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .lb-podium  { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links   { display: none; }
  .live-card-top { grid-template-columns: 1fr; padding: 28px; }
  .timer-wrap  { flex-direction: row; align-items: center; gap: 20px; }
  .timer-ring  { width: 88px; height: 88px; }
  .timer-val   { font-size: 22px; }
  .card-divider { margin: 0 28px; }
  .suggestions  { padding: 24px 28px 28px; }
  .s-bar-wrap   { display: none; }
  .suggestion-item { grid-template-columns: 36px 1fr auto; }
  .discussion-section { padding: 0 28px 28px; }
  .action-divider { margin: 0 28px; }
  .action-area    { padding: 20px 28px 28px; }
  .action-tabs    { width: 100%; }
  .posts-grid   { grid-template-columns: 1fr; }
  .posts-header { flex-direction: column; align-items: flex-start; }
  .footer-grid  { grid-template-columns: 1fr; gap: 40px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .hero-cta     { flex-direction: column; align-items: flex-start; }
  .hero-stats   { flex-wrap: wrap; }
  .hero-stat-divider { display: none; }
  .hero-stat    { padding-right: 28px; }
  .form-row     { grid-template-columns: 1fr; }
  .profile-hero-inner { flex-direction: column; align-items: flex-start; }
  .profile-stats-row  { flex-wrap: wrap; gap: 16px 0; }
  .pstat-divider      { display: none; }
  .pstat-item         { padding-right: 24px; }
  .lb-podium          { grid-template-columns: 1fr; }
  .lb-stats           { display: none; }
  .post-detail-card   { padding: 28px; }
}
@media (max-width: 480px) {
  .container  { padding: 0 16px; }
  .nav-actions .btn-ghost { display: none; }
  .page-body  { padding-top: 32px; padding-bottom: 40px; }
  .live-card-top { padding: 22px; }
  .card-divider  { margin: 0 22px; }
  .suggestions   { padding: 20px 22px 24px; }
  .auth-card          { padding: 36px 24px; }
  .discussion-section { padding: 0 22px 24px; }
  .action-divider     { margin: 0 22px; }
  .action-area        { padding: 16px 22px 24px; }
  .action-tab         { padding: 7px 10px; font-size: 12px; gap: 4px; }
  .footer-links  { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .danger-card   { padding: 36px 24px; }
  .danger-actions { flex-direction: column; }
  .danger-actions .btn { width: 100%; justify-content: center; }
}
