:root {
  --bg: #15261f;
  --panel: #1e3329;
  --panel2: #274033;
  --text: #f2f7f0;
  --muted: #9bb5a4;
  --accent: #3d9b6e;
  --accent2: #f0b429;
  --red: #e05a4f;
  --blue: #4a9fd8;
  --green: #4caf78;
  --purple: #9b7cc4;
  --landmark: #e8b84a;
  --border: #3a5a48;
  --danger: #d96b6b;
  --felt: #1a6b45;
  --felt-dark: #0f3d28;
  --p0: #3ecf8e;
  --p1: #ff8a65;
  --p2: #64b5f6;
  --p3: #ffd54f;
  --p4: #81c784;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(61, 155, 110, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(240, 180, 41, 0.12), transparent 50%),
    linear-gradient(165deg, #0f1c17 0%, #15261f 40%, #1a2e24 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent2); }
button, input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
}
button {
  cursor: pointer;
  background: linear-gradient(180deg, #45a874, #2f7354);
  border-color: #2a6147;
  font-weight: 700;
}
button.secondary { background: var(--panel2); border-color: var(--border); font-weight: 500; }
button.danger { background: #8a3b3b; border-color: #6e2f2f; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input, select, textarea { width: 100%; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 28, 23, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-family: "Fredoka", "M PLUS Rounded 1c", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.brand span { color: var(--accent2); }
.header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 0.9rem; }

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  padding: 1rem;
  max-width: 1480px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: rgba(30, 51, 41, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}
.panel h2, .panel h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.tabs button { background: var(--panel2); }
.tabs button.active { background: linear-gradient(180deg, #45a874, #2f7354); }

.check-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem;
  background: #13241c;
}
.check-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.25rem 0.2rem;
  font-size: 0.88rem;
}
.check-item input { width: auto; margin-top: 0.2rem; }
.card-supply-row {
  align-items: center;
}
.card-supply-row .card-supply-meta { flex: 1; min-width: 0; }
.supply-qty {
  width: 3.2rem !important;
  padding: 0.2rem 0.3rem !important;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.82rem;
}
.supply-lm {
  flex-shrink: 0;
  font-size: 0.72rem;
  width: 3.2rem;
  text-align: center;
}
.chip {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}
.chip.blue { background: var(--blue); }
.chip.green { background: var(--green); }
.chip.red { background: var(--red); }
.chip.purple { background: var(--purple); }
.chip.landmark { background: var(--landmark); color: #1a1408; }

.field { margin-bottom: 0.75rem; }
.field label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.25rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 100px; }

.play-panel { padding: 0.85rem; overflow: hidden; }
.play-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.play-header h2 { margin: 0; font-family: "Fredoka", sans-serif; font-size: 1.15rem; }
.play-toolbar { margin: 0; align-items: center; }
.speed-label { display: inline-flex; align-items: center; gap: 0.35rem; }
.speed-label input { width: 120px; padding: 0; }
.turn-pill {
  font-size: 0.82rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #13241c;
  border: 1px solid var(--border);
  color: var(--accent2);
  font-weight: 700;
}

.arena {
  position: relative;
  border-radius: 18px;
  padding: 1rem 1rem 1.1rem;
  min-height: 320px;
  overflow: hidden;
  border: 2px solid #2d6b4a;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.35);
}
.arena-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.07), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(240, 180, 41, 0.1), transparent 40%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 28px,
      rgba(0, 0, 0, 0.04) 28px,
      rgba(0, 0, 0, 0.04) 29px
    ),
    linear-gradient(145deg, var(--felt) 0%, #15804e 45%, var(--felt-dark) 100%);
  pointer-events: none;
}
.arena-bg::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  pointer-events: none;
}

.dice-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.dice-pair { display: flex; gap: 0.55rem; align-items: center; justify-content: center; }
.die {
  width: 52px;
  height: 52px;
  background: linear-gradient(145deg, #fffef8, #e8e0d0);
  border-radius: 12px;
  box-shadow:
    0 4px 0 #b8a888,
    0 8px 16px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  color: #1a1a1a;
  position: relative;
}
.die.rolling { animation: die-toss 0.45s ease-out; }
@keyframes die-toss {
  0% { transform: translateY(-28px) rotate(-25deg) scale(0.9); opacity: 0.5; }
  60% { transform: translateY(4px) rotate(8deg) scale(1.05); }
  100% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}
.die .pips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 70%;
  height: 70%;
  gap: 2px;
}
.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1c1c1c;
  justify-self: center;
  align-self: center;
  opacity: 0;
}
.die[data-face="1"] .pip:nth-child(5) { opacity: 1; }
.die[data-face="2"] .pip:nth-child(1),
.die[data-face="2"] .pip:nth-child(9) { opacity: 1; }
.die[data-face="3"] .pip:nth-child(1),
.die[data-face="3"] .pip:nth-child(5),
.die[data-face="3"] .pip:nth-child(9) { opacity: 1; }
.die[data-face="4"] .pip:nth-child(1),
.die[data-face="4"] .pip:nth-child(3),
.die[data-face="4"] .pip:nth-child(7),
.die[data-face="4"] .pip:nth-child(9) { opacity: 1; }
.die[data-face="5"] .pip:nth-child(1),
.die[data-face="5"] .pip:nth-child(3),
.die[data-face="5"] .pip:nth-child(5),
.die[data-face="5"] .pip:nth-child(7),
.die[data-face="5"] .pip:nth-child(9) { opacity: 1; }
.die[data-face="6"] .pip:nth-child(1),
.die[data-face="6"] .pip:nth-child(3),
.die[data-face="6"] .pip:nth-child(4),
.die[data-face="6"] .pip:nth-child(6),
.die[data-face="6"] .pip:nth-child(7),
.die[data-face="6"] .pip:nth-child(9) { opacity: 1; }

.dice-total {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff8e0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  min-height: 1.4em;
}
.dice-total.pop { animation: total-pop 0.35s ease; }
@keyframes total-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.fx-float {
  position: absolute;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  animation: float-up 1.1s ease-out forwards;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.fx-float.gain { color: #ffe082; }
.fx-float.lose { color: #ff8a80; }
.fx-float.build { color: #b9f6ca; font-size: 1rem; }
@keyframes float-up {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  15% { opacity: 1; transform: translateY(-8px) scale(1.1); }
  100% { transform: translateY(-56px) scale(1); opacity: 0; }
}

.board.towns {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.town {
  --seat: var(--p0);
  background: linear-gradient(180deg, rgba(20, 36, 28, 0.92), rgba(12, 24, 18, 0.95));
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.7rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.town.active {
  border-color: var(--seat);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--seat) 55%, transparent),
    0 8px 22px rgba(0, 0, 0, 0.35);
  transform: translateY(-3px) scale(1.02);
  animation: town-pulse 1.6s ease-in-out infinite;
}
.town.winner {
  border-color: var(--accent2);
  box-shadow: 0 0 24px rgba(240, 180, 41, 0.45);
  animation: winner-glow 1.2s ease-in-out infinite alternate;
}
@keyframes town-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
@keyframes winner-glow {
  from { box-shadow: 0 0 12px rgba(240, 180, 41, 0.3); }
  to { box-shadow: 0 0 28px rgba(240, 180, 41, 0.65); }
}
.town-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.town-seat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
}
.seat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--seat);
  box-shadow: 0 0 8px var(--seat);
}
.town-name { font-size: 0.95rem; }
.town-strat {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coin-stack {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent2);
  background: rgba(240, 180, 41, 0.12);
  border: 1px solid rgba(240, 180, 41, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.55rem 0.15rem 0.35rem;
}
.coin-stack.bump { animation: coin-bump 0.35s ease; }
@keyframes coin-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.coin-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe082, #f0b429 55%, #c48912);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  color: #5a3d00;
  font-weight: 800;
}

.est-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 2.4rem;
  margin-bottom: 0.45rem;
}
.bldg {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #fff;
  line-height: 1.2;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.bldg.flash { animation: bldg-flash 0.55s ease; }
@keyframes bldg-flash {
  0% { transform: scale(0.5); filter: brightness(2); }
  100% { transform: scale(1); filter: brightness(1); }
}
.bldg.blue { background: linear-gradient(180deg, #5eb0e8, #2f7eb8); }
.bldg.green { background: linear-gradient(180deg, #5ec889, #2f8f5a); }
.bldg.red { background: linear-gradient(180deg, #ef6f64, #c4453c); }
.bldg.purple { background: linear-gradient(180deg, #b08ed8, #7a5aa8); }
.bldg .act {
  font-size: 0.62rem;
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  padding: 0 0.25rem;
}
.bldg .qty {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 0 0.25rem;
  font-size: 0.68rem;
}

.landmarks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}
.lm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  font-size: 0.62rem;
  padding: 0.35rem 0.15rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #7a8f80;
  text-align: center;
  min-height: 3.1rem;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}
.lm .lm-ico { font-size: 1.15rem; filter: grayscale(1); opacity: 0.45; }
.lm.on {
  background: linear-gradient(180deg, #f0d078, #d4a020);
  border: 1px solid #b8860b;
  color: #2a1c00;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(212, 160, 32, 0.4);
}
.lm.on .lm-ico { filter: none; opacity: 1; }
.lm.just-on { animation: lm-unlock 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes lm-unlock {
  0% { transform: scale(0.6) rotate(-8deg); }
  60% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

.lm-progress {
  margin-top: 0.4rem;
  height: 5px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 99px;
  overflow: hidden;
}
.lm-progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), #ffe082);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.decision-banner {
  margin: 0.7rem 0 0.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(240, 180, 41, 0.15), rgba(61, 155, 110, 0.12));
  border: 1px solid rgba(240, 180, 41, 0.35);
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 2.4rem;
}
.decision-banner.flash { animation: banner-flash 0.45s ease; }
@keyframes banner-flash {
  0% { background: rgba(240, 180, 41, 0.45); }
  100% { background: linear-gradient(90deg, rgba(240, 180, 41, 0.15), rgba(61, 155, 110, 0.12)); }
}

.feed-wrap h3 { margin-top: 0.25rem; }
.feed-log {
  max-height: 200px;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 0.82rem;
}
.feed-line {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  animation: feed-in 0.25s ease;
}
.feed-line.dice { color: #ffe082; }
.feed-line.income { color: #a5d6a7; }
.feed-line.steal { color: #ffab91; }
.feed-line.build { color: #80cbc4; }
.feed-line.decision { color: var(--accent2); }
.feed-line.turn { color: #90caf9; font-weight: 700; }
@keyframes feed-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

.winner-banner {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 700;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe082, #f0b429);
  color: #2a1c00;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: winner-pop 0.55s cubic-bezier(0.2, 1.2, 0.4, 1);
  white-space: nowrap;
}
@keyframes winner-pop {
  0% { transform: translateX(-50%) scale(0.4); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.log {
  max-height: 240px;
  overflow: auto;
  font-size: 0.78rem;
  background: #0e1a14;
  border-radius: 10px;
  padding: 0.6rem;
  border: 1px solid var(--border);
}
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.stats-table th, .stats-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  text-align: left;
}
.bar {
  height: 8px;
  background: #13241c;
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 1rem;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  width: min(420px, 100%);
}
.manual-modal {
  width: min(1080px, 100%);
  height: min(90vh, 900px);
  padding: 0.75rem 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.manual-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 0.25rem;
}
.manual-modal-bar h3 { margin: 0; font-family: "Fredoka", "M PLUS Rounded 1c", sans-serif; }
.manual-modal-bar a.man-open-tab {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.manual-frame {
  flex: 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0c1611;
  min-height: 0;
}
.hidden { display: none !important; }
#blocklyDiv { height: 360px; width: 100%; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.status-pill {
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #13241c;
  border: 1px solid var(--border);
}
.status-pill.ok { border-color: var(--accent); color: #8ddeb8; }
.status-pill.bad { border-color: var(--danger); color: #f0a0a0; }
.history-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .history-layout { grid-template-columns: 1fr; }
}
.history-list { max-height: 420px; }
.history-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  align-items: start;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
}
.history-item:hover, .history-item.active {
  background: rgba(61, 155, 110, 0.15);
}
.history-item .h-title { font-weight: 700; font-size: 0.88rem; }
.history-item .h-meta { font-size: 0.75rem; color: var(--muted); }
.insight-box {
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.35);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.export-box {
  margin: 0.65rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.1);
}
.export-box-title {
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--accent2);
}
.insight-box li { margin: 0.25rem 0; }
.analyzer-meta { margin-bottom: 0.75rem; font-size: 0.85rem; }
.histo {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  min-height: 100px;
  padding: 0.5rem 0.25rem;
  margin-bottom: 0.35rem;
}
.histo-bar {
  flex: 1;
  min-width: 18px;
  background: linear-gradient(180deg, #5ec889, #2f7354);
  border-radius: 6px 6px 2px 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.histo-bar span {
  font-size: 0.65rem;
  color: #d7ece0;
  writing-mode: horizontal-tb;
  margin-bottom: 0.15rem;
}
.histo-bar small {
  position: absolute;
  bottom: -1.15rem;
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
}

.social-subtabs { margin: 0; }
.social-list { display: flex; flex-direction: column; gap: 0.55rem; }
.social-card {
  background: rgba(30, 51, 41, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.social-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.social-comments { margin-top: 0.45rem; font-size: 0.88rem; }
.social-thread-btn {
  text-align: left;
  width: 100%;
  font-weight: 500;
  background: var(--panel2);
}
.social-thread-btn.active {
  border-color: var(--accent2);
  box-shadow: inset 0 0 0 1px rgba(240, 180, 41, 0.35);
}
.msg-thread {
  max-height: 360px;
  overflow: auto;
  margin-bottom: 0.5rem;
}
.msg-bubble {
  background: var(--panel2);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.35rem;
  max-width: 92%;
}
.msg-bubble.mine {
  margin-left: auto;
  background: rgba(61, 155, 110, 0.28);
  border: 1px solid rgba(61, 155, 110, 0.45);
}
