/* Pagina Archivio Previsioni */
.pred-page {
  min-height: 100vh;
  background: linear-gradient(165deg, #283442 0%, #2a3544 100%);
  padding-bottom: 3rem;
}

.pred-header {
  border-bottom: 1px solid rgba(107, 159, 212, 0.2);
  background: rgba(18, 26, 38, 0.65);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.pred-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
}
.pred-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
}
.pred-header nav a { color: #8fa3b8; text-decoration: none; }
.pred-header nav a:hover, .pred-header nav a.is-here { color: #5dbfa0; }
.pred-user { font-family: var(--mono); font-size: 0.62rem; color: #5dbfa0; }

.pred-main { padding-top: 1.5rem; }
.pred-hero { margin-bottom: 1.5rem; }
.pred-hero h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--heading);
  margin: 0 0 0.35rem;
}
.pred-hero p { color: #9eb0c4; font-size: 0.88rem; max-width: 42rem; margin: 0; }

.pred-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  margin: 1.25rem 0;
}
.pred-stat {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(18, 26, 38, 0.55);
  border: 1px solid rgba(107, 159, 212, 0.22);
  text-align: center;
}
.pred-stat b {
  display: block;
  font-size: 1.45rem;
  color: #5dbfa0;
  line-height: 1.1;
}
.pred-stat b.warn { color: #d4ae72; }
.pred-stat b.bad { color: #d48989; }
.pred-stat span {
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a92a8;
}

.pred-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.pred-filter {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.pred-filter button {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 159, 212, 0.28);
  background: rgba(12, 18, 28, 0.45);
  color: #8fa3b8;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.pred-filter button.active {
  background: rgba(93, 191, 160, 0.15);
  border-color: rgba(93, 191, 160, 0.35);
  color: #5dbfa0;
}
.pred-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(93, 191, 160, 0.9), rgba(75, 165, 140, 0.95));
  color: #0f1a14;
}
.pred-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pred-btn-ghost {
  background: transparent;
  border: 1px solid rgba(107, 159, 212, 0.35);
  color: #b8c5d4;
}

.pred-chart-wrap {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(12, 18, 28, 0.5);
  border: 1px solid rgba(107, 159, 212, 0.2);
}
.pred-chart-wrap h3 {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: #5dbfa0;
}
.pred-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding-top: 0.5rem;
}
.pred-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}
.pred-chart-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #5dbfa0, #1f9d6a);
  min-height: 4px;
  transition: height 0.4s ease;
}
.pred-chart-bar.low { background: linear-gradient(180deg, #d48989, #a85555); }
.pred-chart-bar.mid { background: linear-gradient(180deg, #d4ae72, #b8924a); }
.pred-chart-label {
  font-family: var(--mono);
  font-size: 0.48rem;
  color: #6d8094;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 48px;
  overflow: hidden;
}

.pred-insights {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(93, 191, 160, 0.08);
  border: 1px solid rgba(93, 191, 160, 0.2);
  font-size: 0.8rem;
  color: #b8c5d4;
}
.pred-insights ul { margin: 0; padding-left: 1.1rem; }
.pred-insights li { margin-bottom: 0.3rem; }

.pred-list { display: flex; flex-direction: column; gap: 1rem; }

.pred-card {
  border-radius: 14px;
  background: rgba(18, 26, 38, 0.6);
  border: 1px solid rgba(107, 159, 212, 0.25);
  overflow: hidden;
}
.pred-card.checked { border-color: rgba(93, 191, 160, 0.3); }
.pred-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(107, 159, 212, 0.12);
  background: rgba(12, 18, 28, 0.35);
}
.pred-card-meta time { font-family: var(--mono); font-size: 0.72rem; color: #dce8f4; }
.pred-card-sum {
  font-family: var(--mono);
  font-size: 0.68rem;
  margin-top: 0.2rem;
}
.pred-card-sum.good { color: #5dbfa0; }
.pred-card-sum.low { color: #d48989; }
.pred-card-sum.pend { color: #8fa3b8; }

.pred-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
  padding: 0.85rem 1rem 1rem;
}

.pred-pick {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(12, 18, 28, 0.5);
  border: 1px solid rgba(70, 95, 125, 0.3);
}
.pred-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.pred-pick-head strong {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--heading);
}
.pred-badge {
  font-family: var(--mono);
  font-size: 0.58rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}
.pred-badge.hit, .pred-badge.exact { background: rgba(93, 191, 160, 0.2); color: #5dbfa0; }
.pred-badge.close { background: rgba(212, 174, 114, 0.2); color: #d4ae72; }
.pred-badge.miss { background: rgba(212, 137, 137, 0.2); color: #d48989; }
.pred-badge.pend { background: rgba(107, 159, 212, 0.15); color: #8fa3b8; }

.pred-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #8fa3b8;
  margin-bottom: 0.45rem;
}
.pred-bars b { color: #dce8f4; }

.pred-viz {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 52px;
  margin-top: 0.35rem;
}
.pred-viz-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}
.pred-viz-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
}
.pred-viz-bar.pred { background: rgba(212, 174, 114, 0.75); }
.pred-viz-bar.real.hit { background: #5dbfa0; }
.pred-viz-bar.real.close { background: #d4ae72; }
.pred-viz-bar.real.miss { background: #d48989; }
.pred-viz-lbl { font-size: 0.48rem; color: #6d8094; }

.pred-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #8fa3b8;
  font-size: 0.9rem;
}
.pred-empty a { color: #5dbfa0; }

/* ── Overlay confronto mercato ── */
.pred-compare-overlay {
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.25rem;
  border-radius: 14px;
  background: rgba(12, 18, 28, 0.72);
  border: 1px solid rgba(93, 191, 160, 0.35);
  box-shadow: 0 16px 48px rgba(8, 12, 20, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.pred-compare-overlay:not([hidden]) { display: block; }
.pred-compare-overlay.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.pred-compare-stage { text-align: center; max-width: 28rem; margin: 0 auto; }
.pred-compare-viz { margin-bottom: 1rem; }
.pred-candles {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.45rem;
  height: 3.5rem;
  margin-bottom: 0.65rem;
}
.pred-candle {
  width: 0.65rem;
  height: var(--h, 40%);
  border-radius: 2px 2px 0 0;
  position: relative;
  animation: predCandlePulse 1.2s ease-in-out infinite;
}
.pred-candle::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 140%;
  top: -20%;
  background: inherit;
  opacity: 0.55;
}
.pred-candle.up {
  background: linear-gradient(180deg, #5dbfa0, #1f9d6a);
  box-shadow: 0 0 10px rgba(93, 191, 160, 0.35);
}
.pred-candle.dn {
  background: linear-gradient(180deg, #e07070, #a85555);
  box-shadow: 0 0 10px rgba(224, 112, 112, 0.3);
  animation-delay: 0.2s;
}
.pred-candle:nth-child(2) { animation-delay: 0.15s; }
.pred-candle:nth-child(4) { animation-delay: 0.35s; }
.pred-candle:nth-child(6) { animation-delay: 0.5s; }
@keyframes predCandlePulse {
  0%, 100% { transform: scaleY(0.85); opacity: 0.75; }
  50% { transform: scaleY(1.08); opacity: 1; }
}
.pred-tape-wrap {
  overflow: hidden;
  border-radius: 6px;
  background: rgba(8, 12, 20, 0.65);
  border: 1px solid rgba(107, 159, 212, 0.22);
  margin-bottom: 0.55rem;
}
.pred-tape {
  display: flex;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: #9eb0c4;
  white-space: nowrap;
  animation: predTapeScroll 14s linear infinite;
}
.pred-tape span:nth-child(3n) { color: #5dbfa0; }
.pred-tape span:nth-child(5n) { color: #e07070; }
@keyframes predTapeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.pred-scale {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.pred-bull { color: #5dbfa0; font-size: 0.85rem; animation: predBullNod 1.8s ease-in-out infinite; }
.pred-bear { color: #e07070; font-size: 0.85rem; animation: predBearNod 1.8s ease-in-out infinite; animation-delay: 0.9s; }
@keyframes predBullNod {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes predBearNod {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
.pred-scale-beam {
  width: 5.5rem;
  height: 4px;
  border-radius: 999px;
  background: rgba(107, 159, 212, 0.25);
  position: relative;
  overflow: visible;
}
.pred-scale-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--gold, #d4ae72);
  box-shadow: 0 0 12px rgba(212, 174, 114, 0.55);
  animation: predScaleSwing 2.4s ease-in-out infinite;
}
@keyframes predScaleSwing {
  0%, 100% { left: 28%; }
  50% { left: 72%; }
}
.pred-compare-title {
  font-size: 1rem;
  color: var(--heading, #e8eef4);
  margin: 0 0 0.35rem;
}
.pred-compare-msg {
  font-size: 0.78rem;
  color: #9eb0c4;
  line-height: 1.45;
  min-height: 2.2em;
  margin: 0 0 0.75rem;
}
.pred-compare-progress-wrap {
  height: 7px;
  border-radius: 999px;
  background: rgba(30, 40, 52, 0.9);
  border: 1px solid rgba(107, 159, 212, 0.28);
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.pred-compare-progress {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f9d6a, #5dbfa0, #d4ae72);
  background-size: 200% 100%;
  animation: predCompareBarShine 1.6s linear infinite;
  transition: width 0.4s ease;
}
@keyframes predCompareBarShine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.pred-compare-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #7a92a8;
  margin: 0 0 0.4rem;
}
.pred-compare-tip {
  font-size: 0.66rem;
  color: #6d8094;
  margin: 0;
  line-height: 1.4;
}

.pred-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
}
.pred-gate[hidden] { display: none !important; }
.pred-gate-card {
  max-width: 26rem;
  padding: 1.5rem 1.35rem;
  border-radius: 14px;
  background: rgba(18, 26, 38, 0.75);
  border: 1px solid rgba(107, 159, 212, 0.28);
  box-shadow: 0 12px 40px rgba(8, 12, 20, 0.35);
}
.pred-gate-status {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 0.5rem;
}
.pred-gate-hint {
  font-size: 0.78rem;
  color: #8fa3b8;
  line-height: 1.45;
  margin: 0 0 1rem;
}
.pred-gate-card p { color: #9eb0c4; margin-bottom: 1rem; font-size: 0.82rem; line-height: 1.5; }
.pred-gate-form { text-align: left; }
.pred-gate-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}
.pred-gate-field span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a92a8;
}
.pred-gate-field input {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(107, 159, 212, 0.35);
  background: rgba(12, 18, 28, 0.8);
  color: var(--heading);
  font-size: 0.85rem;
}
.pred-gate-form .pred-btn { width: 100%; margin-bottom: 0.5rem; }
.pred-empty-rich {
  text-align: left;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(18, 26, 38, 0.45);
  border: 1px dashed rgba(107, 159, 212, 0.25);
}
.pred-empty-rich h3 { color: var(--heading); font-size: 1rem; margin: 0 0 0.5rem; }
.pred-empty-rich ul { margin: 0.5rem 0 1rem; padding-left: 1.2rem; color: #9eb0c4; font-size: 0.82rem; }
.pred-empty-rich li { margin-bottom: 0.35rem; }
.pred-empty-rich .pred-btn { margin-top: 0.5rem; display: inline-block; }

@media (max-width: 600px) {
  .pred-picks { grid-template-columns: 1fr; }
}