/* ═══════════════════════════════════════════════════════════════════════════
   FAMESHIRE — the live layer (fameshire.com)
   ---------------------------------------------------------------------------
   Everything the public feed writes into: the header pill, the pulse, the map,
   the boards and tables, the join card and the sticky play bar. Loads after
   style.css, which owns the general chrome.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Header status pill ──────────────────────────────────────────────────── */
.live-pill {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); color: var(--green);
}
.live-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s ease-in-out infinite; }
.live-pill.off { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.08); color: var(--red); }
.live-pill.off .live-pill-dot { background: var(--red); box-shadow: 0 0 10px var(--red); }

.live-num { font-variant-numeric: tabular-nums; transition: color 0.3s; }

/* ── The pulse (all 20,000, in five bands) ───────────────────────────────── */
.pulse-label {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--dim); margin-bottom: 12px;
}
.pulse-total { color: var(--cyan); font-weight: 700; }
.pulse-bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: rgba(148, 163, 184, 0.1); border: 1px solid var(--line); }
.pulse-bar span { display: block; height: 100%; min-width: 0; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }
.pulse-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.lg { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.6px; color: var(--dim); }
.lg i { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ring-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }

/* ── Card shell ──────────────────────────────────────────────────────────── */
/* Paired sections: two live cards side by side, collapsing to one column on
   phones. The grid lives here (not in style.css) because it only ever wraps
   live cards. */
.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.card-grid-2 .live-card { margin-bottom: 0; }
@media (max-width: 960px) { .card-grid-2 { grid-template-columns: 1fr; } }
.live-card {
  position: relative; overflow: hidden; margin-bottom: 24px;
  background: linear-gradient(180deg, var(--surface), rgba(8, 12, 24, 0.72));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px; box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.live-card:hover { border-color: var(--line-2); }
.live-card--feature { border-color: rgba(34, 211, 238, 0.28); box-shadow: var(--shadow-card), 0 0 60px rgba(34, 211, 238, 0.08); }
.live-card--violet { border-color: rgba(168, 85, 247, 0.3); box-shadow: var(--shadow-card), 0 0 60px rgba(168, 85, 247, 0.08); }
.live-card--amber { border-color: rgba(251, 191, 36, 0.28); box-shadow: var(--shadow-card), 0 0 60px rgba(251, 191, 36, 0.07); }
.live-card--green { border-color: rgba(52, 211, 153, 0.28); box-shadow: var(--shadow-card), 0 0 60px rgba(52, 211, 153, 0.08); }
.live-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.06), transparent 42%, rgba(168, 85, 247, 0.05));
}
.live-card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 18px;
}
.live-card-head--sub { margin-top: 26px; }
.live-chip {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--cyan); background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.3); border-radius: 999px; padding: 4px 13px; white-space: nowrap;
}

/* ── The map (district rings on the population fabric) ───────────────────── */
.map-frame { position: relative; }
#ringMap {
  width: 100%; height: auto; display: block;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(34, 211, 238, 0.05), transparent 70%),
    rgba(4, 6, 12, 0.45);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.map-cap { font-family: var(--font-mono); font-size: 11px; color: var(--dim); margin-top: 10px; line-height: 1.55; }
.map-hint { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dimmer); margin-top: 12px; }
#ringMap .ringl { transition: opacity 0.25s; cursor: crosshair; outline: none; }
#ringMap .ringl:hover, #ringMap .ringl:focus-visible { opacity: 1; }
#ringMap .ringl:hover circle[r], #ringMap .ringl:focus-visible circle[r] { stroke: rgba(34, 211, 238, 0.7); }
#ringMap text { pointer-events: none; }
/* The spawned-now halo breathes, so "alive" is visible without reading a number. */
#ringMap .ring-halo { animation: haloPulse 2.4s ease-in-out infinite; }
@keyframes haloPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── The census tooltip (hover / keyboard focus on a district) ───────────── */
.map-tip {
  position: absolute; z-index: 5; min-width: 190px; max-width: 260px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(6, 10, 20, 0.96); border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(34, 211, 238, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  pointer-events: none; font-size: 12px; line-height: 1.5;
}
.map-tip[hidden] { display: none; }
.tip-name { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--text); margin-bottom: 3px; }
.tip-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); margin-bottom: 8px; }
.tip-live { color: var(--green); }
.tip-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.tip-row i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 2px; }
.tip-row span { flex: 1 1 auto; color: var(--dim); font-size: 11.5px; }
.tip-row b { font-family: var(--font-mono); font-size: 11px; color: var(--text); }

/* ── Boards (spawned now / zones) ────────────────────────────────────────── */
.live-board { display: flex; flex-direction: column; gap: 10px; max-height: 430px; overflow: auto; }
.live-row {
  display: flex; gap: 10px; align-items: baseline; font-size: 13px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(4, 5, 10, 0.3);
  animation: slideIn 0.45s ease;
}
.live-row b { color: var(--text); font-weight: 600; }
.live-row .c { margin-left: auto; font-family: var(--font-mono); color: var(--cyan); font-weight: 700; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.zone-rows { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.zone-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; font-size: 13px;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(4, 5, 10, 0.3);
}
.zone-row .m { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); }

/* ── Ranked bars (treasury, documents, duty) ─────────────────────────────── */
.race-bars { display: flex; flex-direction: column; gap: 14px; }
.race-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; }
.race-row > span:first-child { font-size: 13.5px; color: var(--text); }
.race-row .val { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); font-weight: 700; }
.race-row .track { grid-column: 1 / -1; height: 9px; border-radius: 999px; background: rgba(148, 163, 184, 0.1); overflow: hidden; }
.race-row .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1); }

/* ── Elections ───────────────────────────────────────────────────────────── */
.el-card { padding: 28px; }
.el-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.el-head h3 { font-family: var(--font-display); font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight: 700; letter-spacing: -0.5px; }
.el-meta { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; color: var(--dim); margin-bottom: 22px; }
.cand-bars { display: flex; flex-direction: column; gap: 14px; }
.cand { margin-bottom: 4px; }
.cand em { font-style: normal; font-size: 11px; color: var(--dim); margin-left: 6px; }
.cand-line { margin: 3px 0 10px; font-size: 12.5px; line-height: 1.55; color: var(--dim); border-left: 2px solid rgba(34, 211, 238, 0.45); padding-left: 10px; }

/* ── Docket / statutes / gazette ─────────────────────────────────────────── */
.bill-list { display: flex; flex-direction: column; gap: 10px; }
.bill { padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(4, 5, 10, 0.3); font-size: 13.5px; }
.bill b { font-family: var(--font-mono); font-weight: 700; color: var(--cyan); }
.stat-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.stat-chip {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.3px; color: var(--text);
  background: rgba(148, 163, 184, 0.07); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
}
.gaz-list { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--dim); }
.gaz-list div { padding-left: 14px; border-left: 2px solid rgba(168, 85, 247, 0.4); }

/* ── Money in motion ─────────────────────────────────────────────────────── */
.money-feed { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.money-row {
  display: flex; align-items: baseline; gap: 12px; font-size: 13px; padding: 9px 13px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(4, 5, 10, 0.3);
}
.money-row .amt { font-family: var(--font-mono); font-weight: 700; min-width: 92px; }
.money-row .amt.pos { color: var(--green); }
.money-row .amt.neg { color: var(--red); }

/* ── Cabinet ─────────────────────────────────────────────────────────────── */
.cabinet-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cabinet-list > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: rgba(4, 5, 10, 0.3); font-size: 13.5px;
}
.cabinet-list > div span { color: var(--text); }

/* ── Join: the three steps ───────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 26px; }
.step-card {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 30px 26px; box-shadow: var(--shadow);
}
.step-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(150deg, rgba(34, 211, 238, 0.07), transparent 45%); }
.step-num {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; margin-bottom: 18px;
  font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #04121a;
  background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: var(--glow-cyan);
}
.step-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.step-card p { font-size: 13.8px; line-height: 1.65; color: var(--dim); }

/* ── Join: the connect card ──────────────────────────────────────────────── */
.connect-card {
  display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 30px; margin-bottom: 26px; box-shadow: var(--shadow);
}
.connect-label { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 2px; color: var(--dimmer); margin-bottom: 12px; }
.connect-addr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.connect-addr code { font-family: var(--font-mono); font-size: 16px; color: var(--text); background: rgba(4, 5, 10, 0.65); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 11px 18px; }
.copy-btn {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cyan); background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 999px; padding: 9px 17px; cursor: pointer; transition: var(--transition);
}
.copy-btn:hover { background: rgba(34, 211, 238, 0.18); }
.connect-hint { margin-top: 12px; font-size: 12.5px; color: var(--dim); max-width: 420px; }

/* ── Join: the server card ───────────────────────────────────────────────── */
.server-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.server-fact { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(4, 5, 10, 0.34); }
.server-fact-value { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 700; }
.server-fact-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }

/* ── Join: roles + why this city is different ────────────────────────────── */
.join-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.role-chip { font-size: 13px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: rgba(148, 163, 184, 0.06); }
.muted-note { margin-top: 16px; font-size: 12.5px; color: var(--dim); }
.why-list { display: flex; flex-direction: column; gap: 16px; }
.why-item { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid rgba(34, 211, 238, 0.4); padding-left: 15px; }
.why-item b { font-family: var(--font-display); font-size: 15px; }
.why-item span { font-size: 13.2px; line-height: 1.6; color: var(--dim); }

/* ── Economy: the city fund ──────────────────────────────────────────────── */
.fund-value {
  font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; margin-bottom: 18px;
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.privacy-body { max-width: 900px; margin: 0 auto; font-size: 1rem; line-height: 1.8; color: var(--dim); }

/* ── Sticky play bar ─────────────────────────────────────────────────────── */
.sticky-play {
  position: fixed; right: 22px; bottom: 58px; z-index: 95; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-radius: 999px; background: rgba(4, 5, 10, 0.9); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 13px; transition: transform 0.3s;
}
.sticky-play:hover { transform: translateY(-3px); }
.sticky-play-city { font-family: var(--font-display); font-weight: 700; letter-spacing: 1px; }
.sticky-play-online { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); }
.sticky-play-online b { color: var(--green); }
.sticky-play-cta { background: linear-gradient(90deg, var(--green), var(--cyan)); color: #032018; font-weight: 800; border-radius: 999px; padding: 9px 17px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .join-two { grid-template-columns: 1fr; }
  .server-grid { grid-template-columns: repeat(3, 1fr); }
  .connect-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
  .server-grid { grid-template-columns: 1fr 1fr; }
  .sticky-play { left: 0; right: 0; bottom: 44px; justify-content: space-between; border-radius: 0; border-left: 0; border-right: 0; }
  .cta-btn--big { width: 100%; text-align: center; }
  /* Keep the status light but drop its word on phones, so the header fits. */
  .live-pill { padding: 6px 10px; }
  #livePillText { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-play { transition: none; }
  #ringMap .ring-halo { animation: none; }
}

/* ── Right-to-left mirrors for the live layer ────────────────────────────── */
/* style.css owns the general chrome; these are the live components whose rules
   used a physical left edge (an accent bar, a chip margin). The map, the bars
   and the boards need nothing — they are symmetric or flex-driven. */
[dir="rtl"] .why-item { border-left: 0; border-right: 2px solid rgba(34, 211, 238, 0.4); padding-left: 0; padding-right: 15px; }
[dir="rtl"] .cand-line { border-left: 0; border-right: 2px solid rgba(34, 211, 238, 0.45); padding-left: 0; padding-right: 10px; }
[dir="rtl"] .cand em { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .gaz-list div { border-left: 0; border-right: 2px solid rgba(168, 85, 247, 0.4); padding-left: 0; padding-right: 14px; }
[dir="rtl"] .live-row .c { margin-left: 0; margin-right: auto; }
[dir="rtl"] .sticky-play { right: auto; left: 22px; }
