/* crypto.ugh.fyi — page-level layout sitting on top of the datacenter
 * theme. The theme owns colors, typography, components; this file owns
 * grid layout, page chrome, the rack-grid for the live tape, and
 * tweaks for crypto-specific badges (▲▼ change indicators, severity
 * pulses on intercepts).
 *
 * Per ugh.fyi convention: no position:fixed UI chrome. The theme's
 * canvas + scanlines are fixed, but every interactive surface is
 * inline. */

/* ═══ Layout ════════════════════════════════════════════════════ */

.cp-app {
  max-width: 1700px;
  padding: 24px 20px 64px;
}

.cp-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 12px 0 14px;
}

.cp-hero-title { line-height: 1; }
.cp-hero-title .dc-title { font-size: 36px; }
.cp-hero-title .dc-subtitle { margin-top: 6px; }

/* ── Site-nav buttons (down-periscope + fullscreen) ──────────────────
 * Inline at the top of the page flow — never position:fixed. Mirrors
 * the convention established by ufc / weather / routing siblings:
 * down-periscope is a labeled link with a ▼ arrow; fullscreen is the
 * icon-only ⛶ glyph. The FS button flips amber when we're already
 * fullscreen so it's obvious another click will exit.                */
.cp-hero-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-btn {
  font-size: 10px;
  letter-spacing: 2px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.cp-btn-back > span:first-child {
  font-size: 12px;
  line-height: 1;
}
.cp-btn-fs {
  font-size: 16px;
  letter-spacing: 0;
  padding: 6px 10px;
  min-width: 36px;
  justify-content: center;
}
body.cp-is-fullscreen .cp-btn-fs {
  border-color: var(--dc-amber);
  color: var(--dc-amber);
}
body.cp-is-fullscreen .cp-btn-fs:hover {
  background: var(--dc-amber);
  color: var(--dc-bg);
}

.cp-hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 14px;
}
.cp-hero-status .dc-status-bar {
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 10px;
}
.cp-clock { color: var(--dc-cyan); }

/* ═══ Tape — rack grid ════════════════════════════════════════ */

.cp-tape-body {
  padding: 12px 14px 18px;
}

.cp-rack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.cp-rack {
  background: linear-gradient(180deg, #0A1626 0%, #060D18 100%);
  border: 1px solid var(--dc-border);
  padding: 10px 8px 8px;
  position: relative;
}

.cp-rack-label {
  font-family: var(--dc-font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--dc-cyan-dim);
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--dc-border);
  margin-bottom: 8px;
}

/* Each coin = a 1U-style row with LEDs, symbol, price, change pct */
.cp-coin {
  display: grid;
  grid-template-columns: 18px 60px 1fr 64px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 3px;
  background: linear-gradient(180deg, #111E30 0%, #0A1422 100%);
  border: 1px solid rgba(93, 216, 255, 0.08);
  border-left: 2px solid var(--dc-cyan-dim);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--dc-text-dim);
  position: relative;
  height: 26px;
  transition: background 0.4s, border-color 0.4s;
}

.cp-coin.cp-fresh {
  border-left-color: var(--dc-cyan);
  color: var(--dc-cyan);
  background: linear-gradient(180deg, #122538 0%, #0B1828 100%);
}

.cp-coin.cp-stale {
  border-left-color: var(--dc-amber-dim);
  color: var(--dc-amber-dim);
}

.cp-coin-led-row {
  display: flex;
  gap: 2px;
}
.cp-coin-led {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #1a2838;
  box-shadow: inset 0 0 1px rgba(0,0,0,0.6);
  transition: background 0.3s, box-shadow 0.3s;
}
.cp-coin-led.cp-on    { background: var(--dc-cyan);  box-shadow: 0 0 4px var(--dc-cyan); }
.cp-coin-led.cp-up    { background: var(--dc-green); box-shadow: 0 0 4px var(--dc-green); }
.cp-coin-led.cp-down  { background: var(--dc-red);   box-shadow: 0 0 4px var(--dc-red); }

.cp-coin-sym {
  font-family: var(--dc-font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--dc-cyan-bright);
  letter-spacing: 2px;
}
.cp-coin.cp-stable .cp-coin-sym { color: var(--dc-violet); }

.cp-coin-price {
  font-family: var(--dc-font-mono);
  font-size: 11px;
  color: var(--dc-text);
  text-align: right;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.cp-coin-chg {
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}
.cp-coin-chg.cp-up   { color: var(--dc-green); }
.cp-coin-chg.cp-down { color: var(--dc-red); }
.cp-coin-chg.cp-flat { color: var(--dc-text-dim); }

/* Brief tick-flash when a price update lands */
.cp-coin.cp-flash-up {
  animation: cp-flash-up 0.5s ease-out;
}
.cp-coin.cp-flash-down {
  animation: cp-flash-down 0.5s ease-out;
}
@keyframes cp-flash-up {
  0%   { background: rgba(90, 255, 171, 0.12); }
  100% { background: linear-gradient(180deg, #122538 0%, #0B1828 100%); }
}
@keyframes cp-flash-down {
  0%   { background: rgba(255, 64, 96, 0.10); }
  100% { background: linear-gradient(180deg, #122538 0%, #0B1828 100%); }
}

/* ═══ On-chain panel ════════════════════════════════════════════ */

.cp-onchain-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}

.cp-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.cp-gauge-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cp-onchain-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-blocks {
  width: 100%;
}
.cp-blocks .dc-port-grid {
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
}
.cp-blocks .dc-port {
  flex-direction: column;
  font-size: 9px;
  letter-spacing: 0.5px;
}

.cp-fee-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  padding: 10px 14px;
  background: var(--dc-panel-tint);
  border: 1px solid var(--dc-border);
}
.cp-fee-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}
.cp-fee-row .dc-field-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--dc-cyan-dim);
}

/* ═══ Intercepts ════════════════════════════════════════════════ */

.cp-alert-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 540px;
  overflow-y: auto;
}

.cp-alert {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--dc-panel-tint);
  border: 1px solid var(--dc-border);
  border-left-width: 3px;
  font-size: 12px;
  position: relative;
  animation: dc-fade-in 0.4s ease;
}
.cp-alert.cp-sev-LOW  { border-left-color: var(--dc-cyan-dim); }
.cp-alert.cp-sev-MED  { border-left-color: var(--dc-amber); }
.cp-alert.cp-sev-HIGH { border-left-color: var(--dc-amber); background: rgba(255, 179, 71, 0.06); }
.cp-alert.cp-sev-CRIT { border-left-color: var(--dc-red); background: rgba(255, 64, 96, 0.07); animation: dc-fade-in 0.4s ease, cp-crit-pulse 2.6s ease-in-out infinite; }
@keyframes cp-crit-pulse {
  0%,100% { box-shadow: 0 0 0 rgba(255, 64, 96, 0); }
  50%     { box-shadow: 0 0 12px rgba(255, 64, 96, 0.3); }
}

.cp-alert-sev {
  font-family: var(--dc-font-display);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  padding: 3px 0;
}
.cp-alert-sev.cp-sev-LOW  { color: var(--dc-cyan); }
.cp-alert-sev.cp-sev-MED  { color: var(--dc-amber); }
.cp-alert-sev.cp-sev-HIGH { color: var(--dc-amber); }
.cp-alert-sev.cp-sev-CRIT { color: var(--dc-red); text-shadow: 0 0 6px rgba(255, 64, 96, 0.7); }

.cp-alert-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cp-alert-headline {
  font-family: var(--dc-font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--dc-text);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-alert-why {
  font-size: 10px;
  color: var(--dc-text-dim);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-alert-link {
  font-size: 10px;
  color: var(--dc-cyan-dim);
  letter-spacing: 1px;
  text-decoration: none;
}
.cp-alert-link:hover { color: var(--dc-cyan); }

.cp-alert-empty {
  padding: 20px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 3px;
}

/* ═══ Footer ════════════════════════════════════════════════════ */

.cp-footer { margin-top: 22px; }
.cp-footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 12px 0 0;
}
.cp-footer a {
  color: var(--dc-cyan-dim);
  text-decoration: none;
}
.cp-footer a:hover { color: var(--dc-cyan); }

/* ═══ Responsive squeeze ═══════════════════════════════════════ */

@media (max-width: 920px) {
  .cp-hero { grid-template-columns: 1fr; }
  .cp-hero-actions { justify-content: flex-start; }
  .cp-onchain-body { grid-template-columns: 1fr; }
  .cp-app { padding: 16px 12px 48px; }
  .cp-hero-title .dc-title { font-size: 24px; letter-spacing: 2px; }
}
@media (max-width: 480px) {
  .cp-btn { padding: 6px 10px; font-size: 9px; letter-spacing: 1.5px; }
  .cp-btn-fs { padding: 5px 8px; font-size: 14px; min-width: 30px; }
}
