/* ui-design.css — PopBoard UI refresh (fixes, motion, toasts, polish).
   Loaded after style.css / astro-mode.css. Every animation here is gated by
   prefers-reduced-motion at the bottom of the file. */

/* ── Header: logo · board title · account, with the board nav as one
   segmented toolbar underneath (no more ragged wrapping) ─────────────── */
header { display: flex; align-items: center; flex-wrap: nowrap; gap: 16px; padding: 16px 0 24px; }
header #logo { flex: none; }
.header-right { flex-direction: row !important; flex-wrap: wrap; align-items: center !important; justify-content: flex-end; gap: 8px !important; margin-left: auto; }
.header-right button { white-space: nowrap; }
#app > header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo title account" "nav nav nav"; align-items: center; column-gap: 16px; row-gap: 16px; }
#app > header #logo { grid-area: logo; }
#app > header .header-right { display: contents; }
#app > header .header-bottom-row { grid-area: account; display: flex; gap: 8px; flex-wrap: nowrap; }
#app > header .header-top-row { grid-area: nav; justify-self: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; border-radius: 999px;
  background: var(--card-bg-translucent); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
#app > header .header-top-row:not(:has(> button:not(.hidden))) { display: none; }
#app > header .header-top-row > button { border: 0 !important; background: transparent; padding: 8px 16px; font-size: 0.875rem; }
#app > header .header-top-row > button:hover { background: var(--button-hover-bg); }
.board-title-badge {
  grid-area: title; min-width: 0; margin: 0; text-align: left;
  font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-color);
}
.board-title-badge.hidden { display: block !important; visibility: hidden; }
@media (max-width: 560px) {
  #app > header { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "logo account" "title title" "nav nav"; row-gap: 8px; }
  #app > header .header-bottom-row { justify-self: end; }
}

/* ── Sky modes: header fade spans the whole viewport, follows the sky ───── */
html[data-astro] body { overflow-x: clip; }
html[data-astro] header::before {
  left: 50% !important; right: auto !important; width: 100vw; transform: translateX(-50%);
  top: -40px !important; bottom: -24px !important;
  background: linear-gradient(180deg, rgba(6, 9, 24, .42) 0%, rgba(6, 9, 24, .18) 55%, rgba(6, 9, 24, 0) 100%) !important;
  transition: opacity .8s ease;
}
html[data-astro][data-la-mood="day"] header::before { opacity: 0; }

/* Sky-tinted glass: by day the cards take a blue tint from the sky instead
   of reading as black boxes; at night they stay deep navy. White text stays
   ≥ 4.5:1 on both. */
html[data-astro][data-la-mood="day"][data-theme="dark"] {
  --bg-secondary: rgba(22, 46, 92, .80);
  --card-bg: rgba(24, 50, 98, .84);
  --card-bg-translucent: rgba(22, 46, 92, .78);
  --card-gradient-start: rgba(28, 56, 108, .82);
  --card-gradient-end: rgba(20, 44, 90, .84);
  --text-secondary: #d6e2f5;
  --border-color: rgba(220, 235, 255, .26);
}
/* Text sitting straight on the sky gets a soft legibility backing */
html[data-astro] .portal-container > h2,
html[data-astro] .subtle-toggle-btn,
html[data-astro] .state-pill-meta,
html[data-astro] .board-title-badge { text-shadow: 0 1px 12px rgba(6, 12, 32, .55), 0 0 2px rgba(6, 12, 32, .5); }
html[data-astro] .subtle-toggle-btn { background: rgba(12, 20, 44, .42) !important; color: #eef2ff !important; border-radius: 999px; padding: 6px 12px; }
html[data-astro] .board-title-badge { color: #fff; }

/* ── Leaderboard: no stray "⋮" / empty pill when nobody has scored ─────── */
.leaderboard-card.lb-solo .lb-solo-label { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-secondary); text-align: center; }
.leaderboard-card.lb-solo .lb-bar-track { background: var(--border-color); border-radius: 999px; }
.lb-personal-row .lb-bar-track { box-shadow: inset 0 0 0 1px var(--border-color); }

/* ── Poll carousel: nothing to page through → no arrows, one toggle ───── */
#pollSection.poll-section-empty .poll-carousel-wrapper,
#pollSection.poll-view-empty .poll-carousel-wrapper,
#pollSection.poll-section-empty .poll-collapse-row { display: none !important; }
#pollCollapseBottomRow { display: none !important; } /* the top toggle is enough */

/* ── Identity card: emoji button + name field as one balanced row ───────── */
.lb-entry-box { padding: 16px 24px; }
.lb-entry-box-title { font-weight: 600; color: var(--text-color) !important; font-size: 0.95rem !important; }
.lb-entry-box .leaderboard-identity-group { gap: 8px; margin: 0 auto; }
#lbEntryEmojiCircle, #studentEditEmojiCircle, #emojiCircle { width: 48px !important; height: 48px !important; transition: transform .15s ease, border-color .15s ease; }
#lbEntryEmojiCircle:hover, #studentEditEmojiCircle:hover, #emojiCircle:hover { border-color: var(--accent) !important; transform: scale(1.05); }
#lbEntryEmojiDisplay, #studentEditEmojiDisplay, #emojiDisplay { max-width: none !important; display: flex; flex-direction: column; align-items: center; line-height: 1 !important; }
.emoji-placeholder { font-size: 1.3rem; line-height: 1; color: var(--text-secondary); }
.emoji-placeholder-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#lbEntryNicknameContainer { height: 48px !important; min-width: 220px; }
#lbEntryNicknameContainer input { height: 48px !important; line-height: 48px !important; text-align: left !important; }

/* ── Engagement panel ─────────────────────────────────────────────────── */
.daily-seat-map-widget.is-empty #dailySeatMapCanvas { min-height: 0; border-style: dashed; }
.daily-seat-map-widget.is-empty .confusion-timeline-empty { padding: 16px 8px !important; }
.daily-metrics-text { font-size: 0.875rem !important; }
.class-confusion-timeline { gap: 3px; }
.class-confusion-timeline-label { width: 120px !important; height: 14px !important; line-height: 14px !important; font-size: 0.75rem !important; }
.class-confusion-timeline-row { height: 10px !important; }
.class-confusion-timeline-emoji { font-size: 11px !important; line-height: 14px !important; }

/* ── Seating map hint ─────────────────────────────────────────────────── */
.seat-hint { text-align: center; margin: -4px auto 16px; max-width: 520px; font-size: 0.875rem; color: var(--text-secondary); }
html[data-astro] #app > header .header-top-row { background: rgba(14, 20, 44, .5); border-color: rgba(190, 205, 255, .22); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
html[data-astro] #app > header .header-top-row > button { background: transparent !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-astro] #app > header .header-top-row > button:hover { background: rgba(255, 255, 255, .10) !important; }
@media (max-width: 560px) {
  #app > header .header-top-row { flex-wrap: nowrap; overflow-x: auto; justify-self: stretch; justify-content: flex-start; border-radius: 20px; scrollbar-width: none; }
  #app > header .header-top-row > button { padding: 8px 12px; }
}
.daily-engagement-big { font-size: clamp(2rem, 7vw, 3rem) !important; }

/* ══ Toasts ══════════════════════════════════════════════════════════════ */
.ui-toast-host { position: fixed; z-index: 10000; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.ui-toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 8px; width: 100%; box-sizing: border-box;
  padding: 12px 8px 12px 16px; border-radius: 16px; font-size: 0.9375rem; line-height: 1.4;
  color: #1d1d1f; background: rgba(255, 255, 255, .94); border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: ui-toast-in .28s cubic-bezier(.2, .9, .3, 1.2);
}
.ui-toast.is-leaving { animation: ui-toast-out .2s ease forwards; }
.ui-toast-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; margin-top: 1px; }
.ui-toast-error .ui-toast-icon { color: #c4242b; } .ui-toast-success .ui-toast-icon { color: #1f8a3e; } .ui-toast-info .ui-toast-icon { color: #0060c7; }
.ui-toast-error { border-left: 4px solid #c4242b; } .ui-toast-success { border-left: 4px solid #1f8a3e; } .ui-toast-info { border-left: 4px solid #0060c7; }
.ui-toast-text { flex: 1; padding-top: 1px; }
.ui-toast-action { flex: none; border: 0; background: transparent; color: #0060c7; font-weight: 700; padding: 2px 8px; border-radius: 8px; cursor: pointer; }
.ui-toast-action:hover { background: rgba(0, 96, 199, .1); }
.ui-toast-close { flex: none; border: 0; background: transparent; color: inherit; opacity: .55; font-size: 1.25rem; line-height: 1; width: 28px; height: 28px; border-radius: 8px; padding: 0; cursor: pointer; }
.ui-toast-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
[data-theme="dark"] .ui-toast { color: #f5f5f7; background: rgba(30, 32, 44, .94); border-color: rgba(255, 255, 255, .12); }
[data-theme="dark"] .ui-toast-error .ui-toast-icon { color: #ff8a8a; } [data-theme="dark"] .ui-toast-success .ui-toast-icon { color: #6ee59a; } [data-theme="dark"] .ui-toast-info .ui-toast-icon, [data-theme="dark"] .ui-toast-action { color: #7ab8ff; }
[data-theme="dark"] .ui-toast-error { border-left-color: #ff6b6b; } [data-theme="dark"] .ui-toast-success { border-left-color: #4cd27a; } [data-theme="dark"] .ui-toast-info { border-left-color: #5aa6ff; }
@keyframes ui-toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ui-toast-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* ══ Confirm modal ═══════════════════════════════════════════════════════ */
.ui-modal-backdrop { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 12, 24, .42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: ui-fade-in .16s ease; }
.ui-modal-backdrop.is-leaving { animation: ui-fade-out .16s ease forwards; }
.ui-modal { width: min(440px, 100%); box-sizing: border-box; padding: 24px; border-radius: 24px; background: var(--card-bg, #fff); color: var(--text-color); border: 1px solid var(--border-color); box-shadow: 0 24px 64px rgba(0, 0, 0, .28); animation: ui-pop-in .22s cubic-bezier(.2, .9, .3, 1.15); }
html[data-astro] .ui-modal { background: rgba(22, 28, 54, .96); }
.ui-modal-text { margin: 0 0 24px; font-size: 1rem; line-height: 1.5; }
.ui-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes ui-fade-in { from { opacity: 0; } } @keyframes ui-fade-out { to { opacity: 0; } }
@keyframes ui-pop-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ══ Button system ═══════════════════════════════════════════════════════ */
.ui-btn { font: inherit; font-weight: 600; font-size: 0.9375rem; padding: 8px 20px; min-height: 40px; border-radius: 999px; cursor: pointer; border: 1px solid var(--button-border); background: transparent; color: var(--text-color); transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease; }
.ui-btn-primary { background: #0060c7; border-color: #0060c7; color: #fff; }
.ui-btn-danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.ui-btn:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .14); }
.ui-btn:active { transform: scale(.97); }
.ui-btn:focus-visible { outline: 3px solid rgba(10, 132, 255, .55); outline-offset: 2px; }

/* ══ Busy spinner on async buttons ═══════════════════════════════════════ */
button.is-busy { position: relative; color: transparent !important; }
button.is-busy > * { visibility: hidden; }
button.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(127, 127, 127, .35); border-top-color: var(--text-color, #1d1d1f); animation: ui-spin .7s linear infinite; }
#joinBtn.is-busy::after { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* ══ Skeleton loaders ═══════════════════════════════════════════════════ */
.ui-skeleton-list { display: flex; flex-direction: column; gap: 16px; margin: 0 auto 16px; max-width: 720px; }
.ui-skeleton-card { padding: 24px; border-radius: 24px; background: var(--card-bg-translucent, rgba(255,255,255,.7)); border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 12px; }
.ui-skeleton-card i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(127,127,127,.14) 0%, rgba(127,127,127,.26) 50%, rgba(127,127,127,.14) 100%); background-size: 200% 100%; animation: ui-shimmer 1.3s linear infinite; }
.ui-skeleton-card i:nth-child(1) { width: 28%; height: 14px; } .ui-skeleton-card i:nth-child(2) { width: 86%; } .ui-skeleton-card i:nth-child(3) { width: 54%; }
@keyframes ui-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .ui-toast, .ui-toast.is-leaving, .ui-modal, .ui-modal-backdrop, .ui-modal-backdrop.is-leaving { animation: none !important; }
  .ui-skeleton-card i { animation: none; }
  button.is-busy::after { animation-duration: 2s; }
  .ui-btn { transition: none; }
}

/* ══ Motion: posts, votes, leaderboard, hand, seats ═════════════════════ */
.post.post-live-new { animation: ui-live-glow 2.4s ease-out; }
@keyframes ui-live-glow {
  0% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0), var(--shadow-md); }
  15% { box-shadow: 0 0 0 3px rgba(10, 132, 255, .55), 0 0 28px rgba(10, 132, 255, .35); }
  100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0), var(--shadow-md); }
}
.ui-new-posts-pill {
  position: fixed; z-index: 900; left: 50%; top: 16px; transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
  padding: 8px 16px; border-radius: 999px; border: 0; font: inherit; font-size: 0.875rem; font-weight: 700;
  background: #0060c7; color: #fff; box-shadow: 0 8px 24px rgba(0, 60, 140, .35); cursor: pointer;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.2), opacity .2s ease;
}
.ui-new-posts-pill.is-shown { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.ui-new-posts-pill:hover { background: #0052ab; }
.ui-new-posts-pill:focus-visible { outline: 3px solid rgba(10, 132, 255, .55); outline-offset: 2px; }

.upvote { cursor: pointer; user-select: none; }
.upvote:focus-visible { outline: 3px solid rgba(10, 132, 255, .55); outline-offset: 2px; }
.upvote.vote-squish { animation: ui-vote-squish .42s cubic-bezier(.3, 1.6, .5, 1); }
.upvote.vote-squish-off { animation: ui-vote-off .3s ease; }
@keyframes ui-vote-squish { 0% { transform: scale(1); } 25% { transform: scale(.86, .8); } 60% { transform: scale(1.16, 1.12); } 100% { transform: scale(1); } }
@keyframes ui-vote-off { 0% { transform: scale(1); } 40% { transform: scale(.92); } 100% { transform: scale(1); } }
.upvoted-by-me .upvote, .upvote.vote-on { border-color: var(--upvote-active) !important; background: var(--upvoted-bg); }
.upvote-count { display: inline-block; min-width: 1ch; font-variant-numeric: tabular-nums; }

.lb-rank-chip { position: absolute; z-index: 3; left: 0;  top: 50%; transform: translateY(-50%); font-size: 0.75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; pointer-events: none; animation: ui-chip 2.8s ease forwards; }
.lb-rank-chip.is-up { color: #135f2c; background: #c9f2d6; } .lb-rank-chip.is-down { color: #7a1d1d; background: #ffd9d6; }
[data-theme="dark"] .lb-rank-chip.is-up { color: #c9f7d8; background: rgba(46, 160, 90, .38); } [data-theme="dark"] .lb-rank-chip.is-down { color: #ffd7d3; background: rgba(200, 60, 60, .38); }
@keyframes ui-chip { 0% { opacity: 0; transform: translateY(-50%) scale(.6); } 12% { opacity: 1; transform: translateY(-50%) scale(1.1); } 20% { transform: translateY(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.lb-row.lb-me .lb-name-text { font-weight: 800; }
.lb-row.lb-me::before { content: ""; position: absolute; inset: 4px 0; border-radius: 999px; background: rgba(10, 132, 255, .08); box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .25); pointer-events: none; }

/* Confusion bar: visible labels under the dots */
.confusion-btn, #raiseHandBtn { position: relative; }
@media (min-width: 480px) {
  #confusionIndicator { padding-bottom: 20px !important; }
  .confusion-btn[data-label]::before, #raiseHandBtn[data-label]::before {
    content: attr(data-label); position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px;
    font-size: 0.6875rem; font-weight: 600; line-height: 1; white-space: nowrap; color: var(--text-secondary); pointer-events: none;
  }
}
#raiseHandBtn.hand-is-raised .raise-hand-icon { animation: ui-hand-wave .9s ease-in-out 1; transform-origin: 70% 90%; }
@keyframes ui-hand-wave {
  0% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-6px) rotate(-16deg); } 40% { transform: translateY(-6px) rotate(14deg); }
  60% { transform: translateY(-6px) rotate(-10deg); } 80% { transform: translateY(-6px) rotate(8deg); } 100% { transform: translateY(-6px) rotate(4deg); }
}

.seat.seat-dragging { transform: scale(1.08); box-shadow: 0 12px 28px rgba(0, 0, 0, .28) !important; cursor: grabbing; }
.seat.seat-snapped { animation: ui-seat-snap .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ui-seat-snap { 0% { transform: scale(1.08); } 55% { transform: scale(.95); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .post.post-live-new { animation: none; box-shadow: 0 0 0 2px rgba(10, 132, 255, .5); }
  .ui-new-posts-pill { transition: opacity .01s; }
  .upvote.vote-squish, .upvote.vote-squish-off, .lb-rank-chip, .seat.seat-snapped { animation: none !important; }
  .lb-rank-chip { opacity: 1; }
  #raiseHandBtn.hand-is-raised .raise-hand-icon { animation: none; }
  .seat.seat-dragging { transform: none; }
  .lb-row { transition: none !important; }
}

/* ══ Type scale & 8px rhythm ════════════════════════════════════════════
   12 · 14 · 16 · 20 · 24 · 32 (rem: .75 .875 1 1.25 1.5 2); spacing in 8s. */
:root { --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.5rem; --fs-2xl: 2rem; --sp-1: 8px; --sp-2: 16px; --sp-3: 24px; --sp-4: 32px; }
.portal-container h2 { font-size: var(--fs-2xl); margin: 0 0 var(--sp-3); }
.post, .poll, .board-card, .teacher-card, .create-board-section, .leaderboard-card, .daily-dashboard-card { padding: var(--sp-3) !important; }
.post { font-size: var(--fs-md); line-height: 1.5; }
.post > strong:first-child { font-size: var(--fs-sm); letter-spacing: .01em; }
#boardsList, #studentsList { display: flex; flex-direction: column; gap: var(--sp-2); }
#boardsList > *, #studentsList > * { margin-bottom: 0 !important; }
.board-card h3, .board-card .board-name { font-size: var(--fs-lg); }
.state-pill-meta, .subtle-toggle-btn { font-size: var(--fs-xs) !important; }

/* ══ Button system: one size scale, consistent hover / press / focus ═════ */
button { transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, opacity .15s ease; }
button:focus-visible, [role="button"]:focus-visible, .board-card:focus-visible { outline: 3px solid rgba(10, 132, 255, .6); outline-offset: 2px; }
button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { button:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .10); } }
.header-right button, .create-board-section button, #addStudentBtn { padding: 8px 20px; font-size: var(--fs-sm); min-height: 40px; }
.board-card button, #studentsList button { padding: 6px 14px; font-size: var(--fs-sm); min-height: 32px; }
#createBoardBtn, #addStudentBtn, #postBtn { background: #0060c7 !important; border-color: #0060c7 !important; color: #fff !important; }
@media (hover: hover) and (pointer: fine) { #createBoardBtn:hover, #addStudentBtn:hover, #postBtn:hover { background: #0052ab !important; } }
#postBtn.is-empty { opacity: .55; }
/* Delete: outlined, readable red instead of a pale pink blob */
:root { --delete-color: rgba(196, 36, 43, .08); --delete-text-color: #a11d24; }
[data-theme="dark"] { --delete-color: rgba(255, 107, 107, .14); --delete-text-color: #ffb3ad; }
.post button.delete, .reply button.delete-btn, button.delete-poll { border-color: rgba(196, 36, 43, .38) !important; }
[data-theme="dark"] .post button.delete, [data-theme="dark"] .reply button.delete-btn, [data-theme="dark"] button.delete-poll { border-color: rgba(255, 140, 130, .4) !important; }
@media (hover: hover) and (pointer: fine) {
  .post button.delete:hover, .reply button.delete-btn:hover, button.delete-poll:hover { background: rgba(196, 36, 43, .16) !important; border-color: rgba(196, 36, 43, .6) !important; }
  [data-theme="dark"] .post button.delete:hover, [data-theme="dark"] .reply button.delete-btn:hover, [data-theme="dark"] button.delete-poll:hover { background: rgba(255, 107, 107, .24) !important; }
}

/* Class Live / Paused: a status dot instead of 🔴/🔘 */
.state-pill .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: #8e8e93; }
.state-pill.is-live .status-dot { background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); animation: ui-live-dot 1.8s ease-out infinite; }
@keyframes ui-live-dot { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 100% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); } }

/* ══ Composer ═══════════════════════════════════════════════════════════ */
#postInput { transition: height .28s cubic-bezier(.2, .8, .2, 1), min-height .28s cubic-bezier(.2, .8, .2, 1), border-radius .28s ease, padding .28s ease; }
#newPost.comment-expanded .post-options-row { animation: ui-fade-up .24s ease; }
@keyframes ui-fade-up { from { opacity: 0; transform: translateY(6px); } }
.ui-char-count { font-size: var(--fs-xs); color: var(--text-secondary); margin-right: var(--sp-1); align-self: center; font-variant-numeric: tabular-nums; }

/* ══ Mascot empty states ════════════════════════════════════════════════ */
.ui-empty { text-align: center; margin: var(--sp-4) auto; max-width: 420px; padding: var(--sp-3); color: var(--text-color); animation: ui-fade-up .4s ease; }
.ui-empty-inside { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; width: min(420px, 90%); pointer-events: none; }
.ui-empty-title { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-lg); font-weight: 700; }
.ui-empty-body { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-secondary); }
.ui-mascot { position: relative; width: 112px; height: 112px; margin: 0 auto; animation: ui-mascot-bob 3.2s ease-in-out infinite; }
.ui-mascot img { position: absolute; display: block; pointer-events: none; user-select: none; }
.ui-mascot .ui-mascot-base { inset: 0; width: 100%; height: 100%; }
.ui-mascot .ui-mascot-tassel { transform-origin: 82.7% 5.3%; animation: ui-tassel 3.2s ease-in-out infinite; }
.ui-mascot .ui-mascot-eyeL, .ui-mascot .ui-mascot-eyeR { transform-origin: 50% 55%; animation: ui-blink 4.6s infinite; }
@keyframes ui-mascot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes ui-tassel { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
@keyframes ui-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
html[data-astro] .ui-empty-title, html[data-astro] .ui-empty-body { text-shadow: 0 1px 10px rgba(6, 12, 32, .6); color: #eef2ff; }

@media (prefers-reduced-motion: reduce) {
  .ui-mascot, .ui-mascot img, .ui-empty, .state-pill.is-live .status-dot, #newPost.comment-expanded .post-options-row { animation: none !important; }
  #postInput, button { transition: none !important; }
  button:active { transform: none; }
}
/* AA: white on the live pill needs a deeper blue than the dark-theme accent */
.state-pill.is-live { background: #0060c7 !important; border-color: #0060c7 !important; color: #fff !important; }
