/* ============================================================
   Voice of Customers — "Live Broadcast Control Room"
   Warm near-black • Coca-Cola red signal • champagne gold •
   editorial serif display + clean grotesque UI • filmic grain
   ============================================================ */

@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk Variable';
  src: url('/fonts/hanken-grotesk-wght.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #100b0c;
  --bg-2: #16100f;
  --panel: #1b1413;
  --panel-2: #221917;
  --line: rgba(245, 237, 227, 0.10);
  --line-strong: rgba(245, 237, 227, 0.18);
  --ink: #f5ede3;
  --ink-dim: #b6a89b;
  --ink-faint: #7e726a;
  --red: #e2231a;
  --red-bright: #ff3b30;
  --red-deep: #9e0b12;
  --gold: #e8c39e;
  --gold-2: #c9a227;
  --pos: #57c08a;
  --neu: #c9b79c;
  --neg: #ff6b5e;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.75);
  --glow-red: 0 0 26px -2px rgba(226, 35, 26, 0.55);
  --font-display: 'Instrument Serif', 'Songti SC', 'STSong', Georgia, serif;
  --font-ui: 'Hanken Grotesk Variable', 'Hanken Grotesk', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 82% -8%, rgba(226, 35, 26, 0.16), transparent 60%),
    radial-gradient(900px 500px at 8% 0%, rgba(232, 195, 158, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
  background-attachment: fixed;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.01em;
}

/* filmic grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ---------- layout ---------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 28px 64px; }

/* ---------- masthead ---------- */
.masthead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding: 26px 28px 18px; max-width: 1440px; margin: 0 auto;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand .eyebrow {
  font-size: 11px; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--red); font-weight: 700;
}
.brand h1 {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(34px, 4.6vw, 62px); line-height: 0.94; letter-spacing: 0.005em;
}
.brand h1 .amp { font-style: italic; color: var(--gold); }
.brand .sub {
  margin-top: 6px; color: var(--ink-dim); font-size: 13px; letter-spacing: 0.04em;
}
.brand .sub b { color: var(--ink); font-weight: 600; }
.masthead .session {
  display: flex; align-items: center; gap: 14px; padding-bottom: 6px;
  font-size: 14px; color: var(--ink-dim);
}
#whoami { display: flex; align-items: center; gap: 9px; }
.pill-btn {
  font-family: var(--font-ui); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink); background: linear-gradient(180deg, var(--red), var(--red-deep));
  border: 1px solid rgba(255, 90, 80, 0.4); border-radius: 999px; padding: 9px 18px;
  cursor: pointer; box-shadow: var(--glow-red); transition: transform 0.15s, filter 0.15s;
}
.pill-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.pill-btn.ghost { background: transparent; box-shadow: none; border-color: var(--line-strong); color: var(--ink-dim); }
.pill-btn.ghost:hover { color: var(--ink); border-color: var(--gold); }

/* ---------- danmaku stage ---------- */
.stage {
  position: relative; height: 46vh; min-height: 320px; margin: 22px auto 0; max-width: 1440px;
  border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(226, 35, 26, 0.10), transparent 55%),
    linear-gradient(180deg, #0c0809, #140d0d);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow), inset 0 0 120px rgba(0, 0, 0, 0.55);
}
/* lane guides + vignette */
.stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: repeating-linear-gradient(180deg, transparent 0, transparent calc(16.66% - 1px), var(--line) calc(16.66% - 1px), var(--line) 16.66%);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 160px 40px rgba(0, 0, 0, 0.7);
}
#bullets { position: absolute; inset: 0; }

.stage-hud {
  position: absolute; top: 16px; left: 18px; right: 18px; display: flex;
  align-items: center; justify-content: space-between; pointer-events: none; z-index: 5;
}
.rec { display: flex; align-items: center; gap: 9px; font-size: 12px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ink-dim); font-weight: 700; }
.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red);
  box-shadow: var(--glow-red); animation: pulse 1.6s ease-in-out infinite; }
.stage-title { font-family: var(--font-display); font-style: italic; font-size: 19px; color: rgba(245,237,227,0.55); }
#liveCount { font-size: 13px; color: var(--gold); font-weight: 600; letter-spacing: 0.04em; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* bullets */
.bullet {
  position: absolute; white-space: nowrap; will-change: transform;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px 8px 13px; border-radius: 999px;
  background: rgba(28, 21, 20, 0.72); backdrop-filter: blur(7px);
  border: 1px solid var(--line); color: var(--ink);
  font-size: 16px; line-height: 1; box-shadow: 0 8px 26px -12px rgba(0, 0, 0, 0.8);
}
.bullet b { font-weight: 700; color: var(--gold); }
.bullet .ava {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; flex: none;
}
.bullet.s-positive { border-left: 3px solid var(--pos); }
.bullet.s-neutral  { border-left: 3px solid var(--neu); }
.bullet.s-negative { border-left: 3px solid var(--neg); }
.bullet.live {
  background: linear-gradient(180deg, rgba(226, 35, 26, 0.28), rgba(158, 11, 18, 0.34));
  border-color: rgba(255, 90, 80, 0.65); box-shadow: var(--glow-red);
  color: #fff; font-weight: 500;
}
.bullet.live b { color: #fff; }
.bullet .badge {
  font-size: 9.5px; letter-spacing: 0.16em; font-weight: 800; text-transform: uppercase;
  background: #fff; color: var(--red-deep); padding: 3px 7px; border-radius: 6px;
}

/* ---------- main grid ---------- */
.layout {
  display: grid; grid-template-columns: 360px 1fr; gap: 24px; margin-top: 24px;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

/* ---------- dashboard ---------- */
.dashboard { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 12px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700;
}
.stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.stat {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 12px;
  text-align: center; box-shadow: var(--shadow);
}
.stat .num {
  font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat .num.red { color: var(--red); }
.stat .num.gold { color: var(--gold); }
.stat .lbl { margin-top: 7px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

/* sentiment bar */
.sent-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.sent-bar .seg { height: 100%; transition: width 0.6s ease; }
.seg.s-positive { background: var(--pos); }
.seg.s-neutral  { background: var(--neu); }
.seg.s-negative { background: var(--neg); }
.sent-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--ink-dim); }
.sent-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* lists in cards */
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.barlist li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-dim); }
.barlist li b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.barlist .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ava {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; flex: none;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12px; color: var(--gold); border: 1px solid rgba(232, 195, 158, 0.3);
  border-radius: 999px; padding: 4px 10px; background: rgba(232, 195, 158, 0.06);
}
.tag i { color: var(--ink-faint); font-style: normal; margin-left: 5px; }

/* ---------- board / feed ---------- */
.board { display: flex; flex-direction: column; gap: 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  font-size: 13px; font-weight: 600; color: var(--ink-dim); cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px;
  background: var(--panel); transition: all 0.15s; white-space: nowrap;
}
.tab:hover { color: var(--ink); border-color: var(--line-strong); }
.tab.active { color: #fff; background: linear-gradient(180deg, var(--red), var(--red-deep)); border-color: rgba(255,90,80,0.5); box-shadow: var(--glow-red); }
.tab .n { opacity: 0.7; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* post box */
.postbox {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.postbox textarea {
  width: 100%; resize: vertical; min-height: 64px; font-family: var(--font-ui); font-size: 15px;
  color: var(--ink); background: #0e0a0a; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.postbox textarea:focus { outline: none; border-color: var(--gold); }
.postbox .row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.postbox select {
  font-family: var(--font-ui); font-size: 13px; color: var(--ink); background: #0e0a0a;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px;
}
.postbox .count { margin-left: auto; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.postbox.signed-out { text-align: center; color: var(--ink-dim); }
.postbox.signed-out a { color: var(--gold); border-bottom: 1px solid var(--gold); }

/* feed */
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-card {
  display: flex; gap: 14px; padding: 16px 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.feed-card:hover { transform: translateX(3px); border-left-color: var(--gold); box-shadow: var(--shadow); }
.feed-card.s-positive { border-left-color: var(--pos); }
.feed-card.s-neutral  { border-left-color: var(--neu); }
.feed-card.s-negative { border-left-color: var(--neg); }
.feed-card.fresh { animation: drop-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); border-left-color: var(--red); }
.feed-card .body { flex: 1; min-width: 0; }
.feed-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-dim); }
.feed-card .meta .name { color: var(--ink); font-weight: 700; }
.feed-card .meta .role {
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
}
.feed-card .meta .cat { font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); border-radius: 6px; padding: 3px 9px; }
.feed-card .stars { color: var(--gold); letter-spacing: 0.08em; font-size: 12px; }
.feed-card p { margin: 9px 0 8px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.feed-card .chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; font-size: 12px; color: var(--ink-faint); }
.feed-card .chip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--ink-dim); }
.feed-card time { margin-left: auto; color: var(--ink-faint); font-size: 12px; white-space: nowrap; }
.sdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sdot.s-positive { background: var(--pos); } .sdot.s-neutral { background: var(--neu); } .sdot.s-negative { background: var(--neg); }

@keyframes drop-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }

/* section heading */
.sec-head { display: flex; align-items: baseline; gap: 12px; }
.sec-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 0; }
.sec-head .hint { color: var(--ink-faint); font-size: 13px; }

/* ---------- footer ---------- */
.foot { max-width: 1440px; margin: 40px auto 0; padding: 22px 28px; border-top: 1px solid var(--line);
  color: var(--ink-faint); font-size: 12.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot .mcp { color: var(--ink-dim); }
.foot code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); }

/* entrance stagger */
.reveal { opacity: 0; transform: translateY(16px); animation: reveal 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #2a201e; border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- auth page ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.auth-card {
  width: min(440px, 100%); background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 34px 30px;
  box-shadow: var(--shadow);
}
.auth-card .eyebrow { font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.auth-card h1 { font-family: var(--font-display); font-weight: 400; font-size: 40px; margin: 6px 0 4px; }
.auth-card .lead { color: var(--ink-dim); font-size: 14px; margin-bottom: 22px; }
.auth-card label { display: block; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 16px 0 7px; }
.auth-card input {
  width: 100%; font-family: var(--font-ui); font-size: 15px; color: var(--ink); background: #0e0a0a;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
}
.auth-card input:focus { outline: none; border-color: var(--gold); }
.auth-card .full { width: 100%; justify-content: center; margin-top: 20px; padding: 13px; font-size: 15px; }
.auth-card .divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 4px; color: var(--ink-faint); font-size: 12px; letter-spacing: 0.12em; }
.auth-card .divider::before, .auth-card .divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-card .err { color: var(--neg); font-size: 13px; margin-top: 14px; min-height: 18px; }
.auth-card .back { display: inline-block; margin-top: 18px; color: var(--ink-dim); font-size: 13px; }
.auth-card .back:hover { color: var(--gold); }
.hint-box { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink-dim); font-size: 12.5px; }
.hint-box code { color: var(--gold); }

/* ---------- points + daily check-in ---------- */
.points {
  font-size: 13px; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap; padding: 4px 10px; border: 1px solid rgba(232, 195, 158, 0.3);
  border-radius: 999px; background: rgba(232, 195, 158, 0.06);
}
.checkin-btn { display: inline-flex; align-items: center; gap: 6px; }
.checkin-btn b { background: rgba(255, 255, 255, 0.22); border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 800; }
.checkin-btn.done { background: transparent; box-shadow: none; border-color: var(--line-strong); color: var(--pos); cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; z-index: 10000; box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
}
.toast.out { opacity: 0; transition: opacity 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* check-in celebration overlay (shown on every screen — web button OR MCP) */
.checkin-overlay {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
  background: rgba(8, 5, 6, 0.62); backdrop-filter: blur(6px); animation: ov-in 0.3s ease;
}
.checkin-overlay.out { opacity: 0; transition: opacity 0.45s ease; }
@keyframes ov-in { from { opacity: 0; } to { opacity: 1; } }

.checkin-card {
  position: relative; text-align: center; padding: 40px 56px; z-index: 2;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(232, 195, 158, 0.45); border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 60px -10px rgba(232, 195, 158, 0.4);
  animation: card-pop 0.6s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes card-pop { 0% { opacity: 0; transform: scale(0.7) translateY(10px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

.checkin-coin { font-size: 64px; line-height: 1; animation: coin-bounce 0.9s ease 0.1s both; }
@keyframes coin-bounce {
  0% { transform: translateY(-30px) rotateY(0); opacity: 0; }
  60% { transform: translateY(6px) rotateY(360deg); opacity: 1; }
  100% { transform: translateY(0) rotateY(360deg); }
}
.checkin-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 42px; margin: 10px 0 6px; color: var(--ink); }
.checkin-points { font-size: 30px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.checkin-points span { font-size: 14px; font-weight: 600; color: var(--ink-dim); margin-left: 8px; letter-spacing: 0.04em; }
.checkin-who { margin-top: 16px; display: inline-flex; align-items: center; gap: 9px; color: var(--ink-dim); font-size: 15px; }

.checkin-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.checkin-confetti span {
  position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px;
  animation-name: confetti-fall; animation-timing-function: ease-in; animation-iteration-count: 1; animation-fill-mode: both;
}
@keyframes confetti-fall {
  0% { transform: translateY(-10vh) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(560deg); opacity: 0; }
}
