/* === The Corruption Detector™ — visual system === */

/* Background grain / noise texture */
.grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
}

body {
  background-color: #FAF6E8;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(139,0,0,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(184,134,11,0.05) 0%, transparent 60%);
}

/* Ticker */
.ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: tickerScroll 60s linear infinite;
}
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Satire badge */
.badge-satire {
  background: #DC143C;
  color: #FAF6E8;
  padding: 4px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  border: 2px solid #B8860B;
  display: inline-block;
  transform: rotate(-2deg);
  box-shadow: 2px 2px 0 #1a1a1a;
}

.banner-satire {
  background: repeating-linear-gradient(45deg, #DC143C, #DC143C 10px, #B8860B 10px, #B8860B 20px);
  color: #FAF6E8;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
  border: 2px solid #1a1a1a;
  text-shadow: 1px 1px 0 #1a1a1a;
}

/* === CARD === */
.card {
  background: #FFFDF5;
  border: 3px solid #1a1a1a;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 4px 4px 0 #1a1a1a;
}
.card:hover, .card:focus-visible, .card.touched {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #8B0000;
  outline: none;
}
.card.certified {
  border-color: #B8860B;
  box-shadow: 4px 4px 0 #B8860B, 0 0 0 2px #DC143C inset;
}

.card-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #e8e2cc;
  position: relative;
  overflow: hidden;
}
.card-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: sepia(15%) contrast(1.05);
  display: block;
}
.card-photo .silhouette {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; color: #8B0000; opacity: 0.4;
}

.card-photo .role-tag {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(26,26,26,0.85);
  color: #FAF6E8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 2px;
  letter-spacing: 1px;
}
.card-photo .party-tag {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  border: 2px solid #FAF6E8;
}
.party-D { background: #2563eb; }
.party-R { background: #dc2626; }
.party-I { background: #7c3aed; }
.party-NA { background: #6b7280; }

.card-body {
  padding: 12px 14px 14px;
}

.card-name {
  font-family: 'Rozha One', serif;
  font-size: 18px;
  line-height: 1.1;
  color: #1a1a1a;
  margin: 0 0 4px;
  min-height: 40px;
}

.card-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #1a1a1a99;
  margin-bottom: 10px;
}

/* === SLOT MACHINE === */
.slot-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #1a1a1a;
  border: 2px solid #B8860B;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 6px 0 10px;
  height: 56px;
  position: relative;
  overflow: hidden;
}
.slot-area::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent 30%, transparent 70%, rgba(0,0,0,0.4));
  pointer-events: none;
}
.slot-reel {
  width: 28px;
  height: 40px;
  overflow: hidden;
  position: relative;
  background: #FAF6E8;
  border-radius: 2px;
}
.slot-reel.wide {
  width: 50px;
}
.slot-reel-strip > span.ten {
  font-size: 26px;
  letter-spacing: -1px;
}
.slot-reel-strip {
  display: flex;
  flex-direction: column;
  font-family: 'Rozha One', serif;
  font-size: 32px;
  line-height: 40px;
  text-align: center;
  color: #8B0000;
  will-change: transform;
}
.slot-reel-strip > span {
  height: 40px;
  display: block;
  font-family: 'Rozha One', serif;
}
.slot-dot {
  font-family: 'Rozha One', serif;
  font-size: 32px;
  line-height: 40px;
  color: #B8860B;
  padding: 0 2px;
}
.slot-area.spinning .slot-reel-strip {
  animation: reelSpin 0.15s linear infinite;
}
@keyframes reelSpin {
  0% { transform: translateY(0); }
  100% { transform: translateY(-400px); }
}

/* === CORRUPTION METER === */
.meter-wrap {
  position: relative;
  height: 24px;
  background: #1a1a1a;
  border: 2px solid #B8860B;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.meter-fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s;
  background: #F4C430;
}
.card.lit .meter-fill { transform: scaleX(var(--score-pct, 0)); }
.meter-fill.tier-yellow  { background: linear-gradient(90deg, #F4C430, #E6B800); }
.meter-fill.tier-orange  { background: linear-gradient(90deg, #F4C430, #E67E22); }
.meter-fill.tier-red     { background: linear-gradient(90deg, #E67E22, #C0392B); }
.meter-fill.tier-crimson { background: linear-gradient(90deg, #C0392B, #DC143C);
  animation: pulseGlow 1.4s ease-in-out infinite;
  box-shadow: 0 0 12px #DC143C;
}
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 8px #DC143C; }
  50%     { box-shadow: 0 0 18px #DC143C, 0 0 30px #DC143C66; }
}
.meter-tick {
  position: absolute; top: 0; bottom: 0;
  width: 1px; background: rgba(184,134,11,0.5);
}
.meter-readout {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #1a1a1a99;
  display: flex; justify-content: space-between;
  margin-top: 4px;
}

/* === STEAM PARTICLES === */
.steam-layer {
  position: absolute;
  left: 0; right: 0; bottom: 24px;
  height: 60px;
  pointer-events: none;
  overflow: visible;
}
.steam {
  position: absolute;
  bottom: 0;
  width: 14px; height: 14px;
  background: radial-gradient(circle, rgba(255,255,255,0.85), rgba(200,200,200,0));
  border-radius: 50%;
  opacity: 0;
  filter: blur(2px);
}
.card.lit .steam { animation: steamRise 1.8s ease-out infinite; }
@keyframes steamRise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  20%  { opacity: 0.7; }
  100% { transform: translateY(-50px) scale(1.4); opacity: 0; }
}

/* CERTIFIED CORRUPT badge */
.certified-stamp {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  z-index: 5;
  background: linear-gradient(135deg, #FFD700, #B8860B);
  color: #1a1a1a;
  font-family: 'Rozha One', serif;
  font-size: 16px;
  letter-spacing: 2px;
  padding: 6px 14px;
  border: 3px double #1a1a1a;
  box-shadow: 3px 3px 0 #1a1a1a, inset 0 0 0 2px rgba(255,255,255,0.3);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s 1.4s;
}
.card.lit .certified-stamp { opacity: 1; }

/* === MODAL CONTENTS === */
.modal-photo {
  width: 120px; height: 120px;
  border: 3px solid #1a1a1a;
  border-radius: 8px;
  object-fit: cover;
  filter: sepia(15%) contrast(1.05);
}
.metric-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #1a1a1a33;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.metric-row strong { color: #8B0000; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  .meter-fill,
  .slot-area.spinning .slot-reel-strip,
  .card.lit .steam,
  .meter-fill.tier-crimson { animation: none !important; transition: none !important; }
  .meter-fill { transition: transform 0.1s linear; }
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .card-name { font-size: 16px; min-height: 36px; }
}

/* When modal open, lock body scroll */
body.locked { overflow: hidden; }
