/* ---------- Live on-chain feed (js/live.js) ---------- */

.live-feed {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 44px);
  z-index: 29;
  width: 280px;
  font-family: "Michroma", Arial, sans-serif;
  pointer-events: none;
}

.live-feed[hidden] { display: none; }

body:has(.desktop:not([hidden])) .live-feed,
body:has(.patch:not([hidden])) .live-feed,
body:has(.logo-sequence:not([hidden])) .live-feed,
body:has(.credits:not([hidden])) .live-feed { display: none; }

.lf-head {
  display: flex;
  white-space: nowrap;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #ff5a64;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.lf-head i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff2a3a;
  box-shadow: 0 0 8px #ff2a3a;
  animation: lf-blink 1.2s steps(2) infinite;
}

.live-feed.demo .lf-head::after { content: "DEMO"; margin-left: 4px; color: #8a8f8c; }
.lf-cap { color: #d6ffe4; }

@keyframes lf-blink { 50% { opacity: 0.2; } }

.lf-row {
  margin-top: 5px;
  padding: 5px 9px;
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #e9f3ee;
  background: linear-gradient(90deg, rgba(8, 12, 16, 0.85), rgba(8, 12, 16, 0.4));
  border-left: 3px solid #555;
  animation: lf-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: opacity 1.2s;
}

.lf-row.old { opacity: 0.45; }
.lf-row b { font-weight: 700; margin-right: 6px; }
.lf-row .ico { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
/* WHALE BUY milestone banner (js/crypto.js showMilestone) */
.ms-head .ms-ico { width: 1.15em; height: 1.15em; margin-right: 0.2em; vertical-align: -0.22em; filter: drop-shadow(0 3px 0 #000); }
.lf-row span { color: #8fa59a; margin-left: 6px; }
.lf-row.buy { border-left-color: #2fe07a; }
.lf-row.buy b { color: #2fe07a; }
.lf-row.sell { border-left-color: #ff3b4a; }
.lf-row.sell b { color: #ff3b4a; }
.lf-row.whale { box-shadow: 0 0 18px rgba(255, 210, 26, 0.25); }
.lf-row.whale b { color: #ffd21a; }
.lf-row.milestone { border-left-color: #ffd21a; }
.lf-row.milestone b { color: #ffd21a; }

@keyframes lf-in { from { transform: translateX(-24px); opacity: 0; } }

@media (max-width: 979px) {
  /* Phones: one fresh line under the top HUD strip, no stacked list over the board. */
  .live-feed {
    left: 50%;
    bottom: auto;
    top: calc(max(8px, env(safe-area-inset-top)) + 90px);
    width: min(420px, calc(100vw - 16px));
    transform: translateX(-50%);
  }
  .lf-head { display: none; }
  .lf-row { margin-top: 0; font-size: 12px; padding: 3px 8px; text-align: center; }
  .lf-row:nth-child(n + 2) { display: none; }
  .lf-row.old { opacity: 0; transition: opacity 0.6s; }
}

/* ---------- LIVE BOARD in game (js/liveBoard.js, js/main.js) ---------- */

/* GOLD cells: an opened whale-buy candle keeps a gold tint. */
.cell.open.gold { background: linear-gradient(180deg, #ffe680, #e0a800) !important; }
body.rtx .cell.open.gold { background: radial-gradient(circle at 50% 40%, rgba(255, 220, 90, 0.95), rgba(190, 130, 0, 0.9)) !important; }
.cell.gold-pop { z-index: 3; animation: gold-pop 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes gold-pop {
  0% { box-shadow: 0 0 0 0 rgba(255, 210, 26, 0.95); transform: scale(1); }
  25% { box-shadow: 0 0 26px 10px rgba(255, 210, 26, 0.85); transform: scale(1.18); }
  100% { box-shadow: 0 0 0 0 rgba(255, 210, 26, 0); transform: scale(1); }
}
.game-frame.gold-flash { animation: gold-flash 0.8s ease-out; }
@keyframes gold-flash {
  0% { filter: none; }
  20% { filter: brightness(1.35) sepia(0.6) saturate(2.2) hue-rotate(-12deg); }
  100% { filter: none; }
}
.pnl.gold {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold, #ffd21a);
  font-size: 26px;
  animation-duration: 1.6s;
}

/* CHART REVEAL: every cell becomes its candle (green/red, intensity = candle size, filler grey). */
.cell.cr {
  --cr-rgb: 47, 224, 122;
  overflow: hidden;
  animation: cr-in 0.55s var(--cr-d, 0ms) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cell.cr.cr-dn { --cr-rgb: 255, 59, 74; }
.cell.cr.cr-f { --cr-rgb: 120, 132, 128; }
body .board .cell.cr::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(var(--cr-rgb), calc(var(--cr-a, 0.6) * 0.85));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  filter: none;
  transform: none;
  opacity: 0;
  animation: cr-fill 0.55s var(--cr-d, 0ms) ease-out forwards;
}
.cell.cr > svg { opacity: 0.25; transition: opacity 0.4s var(--cr-d, 0ms); }
.cr-k { position: absolute; inset: 0; z-index: 2; opacity: 0; animation: cr-fill 0.4s calc(var(--cr-d, 0ms) + 200ms) ease-out forwards; }
.cr-k b { position: absolute; left: 50%; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.8); }
.cr-k s { position: absolute; left: 30%; right: 30%; min-height: 2px; background: #fff; box-shadow: 0 0 6px rgba(var(--cr-rgb), 1); text-decoration: none; }
.cell.cr.cr-dn .cr-k s { background: #ffd6da; }
.cell.cr.cr-up .cr-k s { background: #d9ffe9; }
.cell.cr.cr-f .cr-k { opacity: 0.5; }
@keyframes cr-in { 0% { transform: scale(1); } 40% { transform: scale(0.82); } 100% { transform: scale(1); } }
@keyframes cr-fill { to { opacity: 1; } }

.cr-caption {
  position: fixed;
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 18px 12px;
  text-align: center;
  white-space: nowrap;
  background: rgba(4, 8, 6, 0.86);
  box-shadow: inset 0 0 0 1px rgba(47, 224, 122, 0.55), 0 12px 40px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -100%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cr-caption.in { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.cr-caption small { font-family: "Michroma", Arial, sans-serif; font-size: 9px; letter-spacing: 0.3em; color: #9fb3a8; }
.cr-caption b {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-weight: 400;
  font-size: clamp(18px, 3.4vw, 34px);
  letter-spacing: 0.02em;
  color: #eaffef;
  text-shadow: 0 0 22px rgba(47, 224, 122, 0.6);
}
@media (max-width: 600px) {
  .cr-caption { white-space: normal; max-width: calc(100vw - 32px); }
}

/* GOLD BY <wallet>: chart reveal + gold float; YOUR BUY IS ON THE BOARD banner */
.cr-caption .cr-goldby-line { color: #ffd21a; letter-spacing: 0.16em; }
.cell.cr.cr-goldby { box-shadow: inset 0 0 0 2px #ffd21a; }
.pnl .gold-by { display: block; font-size: 10px; letter-spacing: 0.12em; opacity: 0.9; }
.lv-yourbuy {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px;
  margin: 0 0 6px; padding: 6px 10px; text-align: center;
  font-family: "Michroma", Arial, sans-serif; font-size: 10px; letter-spacing: 0.14em; color: #1a1300;
  background: linear-gradient(90deg, #ffd21a, #ffe98a, #ffd21a);
  animation: lv-yourbuy 1.6s ease-in-out 3;
}
.lv-yourbuy b { font-weight: 400; font-size: 11px; }
.lv-yourbuy span { font-size: 9px; opacity: 0.8; }
@keyframes lv-yourbuy { 50% { filter: brightness(1.15); } }
