/* =============================================================
   CHRONOLOGIC — game-specific styles
   ============================================================= */

.cr-hero {
  text-align: center;
  padding: 28px 20px 22px;
  background:
    radial-gradient(circle at 30% 20%, rgba(212,160,23,.22), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(108,92,255,.18), transparent 50%),
    linear-gradient(135deg, #2c2110 0%, #14102a 100%);
  border-radius: 18px;
  margin-bottom: 18px;
  border: 1px solid #b28644;
  position: relative;
  overflow: hidden;
}
.cr-hero::before {
  /* parchment grain */
  content:''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 10% 30%, rgba(255,255,255,.04), transparent 25%),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,.03), transparent 30%);
  pointer-events: none;
}
.cr-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(32px, 5vw, 44px);
  letter-spacing: .04em;
  margin: 0;
  background: linear-gradient(90deg, #f5d76e 0%, #d4a017 50%, #f5d76e 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(245,215,110,.25);
  position: relative;
}
.cr-tagline {
  color: var(--text-dim);
  font-style: italic;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 14px;
  margin: 4px 0 0;
  position: relative;
}
.cr-meta {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 10px;
  position: relative;
}
.cr-num {
  font-family: 'Bowlby One SC', sans-serif;
  font-size: 13px;
  color: #f5d76e;
  background: rgba(212,160,23,.18);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(212,160,23,.4);
}
.cr-date { color: var(--text-dim); font-size: 12px; align-self: center; }

/* Attempt dots */
.cr-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cr-bar-label {
  font-family: var(--font-display); font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .12em; text-transform: uppercase;
}
.cr-dots { display: flex; gap: 6px; }
.dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid var(--border);
}
.dot.used { background: var(--text-dim); }
.dot.win { background: #5cffb3; box-shadow: 0 0 8px rgba(92,255,179,.5); border-color: #2a9a60; }
.dot.miss { background: #ff4f6e; border-color: #8a1414; }

/* Message bar */
.cr-msg {
  text-align: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 15px;
  color: #e8e0c8;
  background: rgba(212,160,23,.08);
  border: 1px dashed rgba(212,160,23,.3);
  margin: 0 0 16px;
  min-height: 22px;
}
.cr-msg.hidden { display: none; }

/* Endpoints (Earliest / Latest) */
.cr-endpoints {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 0 0 8px;
  font-family: 'Cinzel', serif;
  font-weight: 700; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase;
  color: #d4a017;
}
.cr-endpoint-l { text-align: left; }
.cr-endpoint-r { text-align: right; }

/* Deck of cards (vertical list, 6 slots) */
#deck {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
  position: relative;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  background:
    linear-gradient(180deg, #fdf7e3 0%, #f5edca 100%);
  color: #2a2300;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: grab;
  user-select: none;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,.4), inset 0 0 1px rgba(0,0,0,.2);
  font-family: 'Crimson Pro', Georgia, serif;
  transition: transform .2s cubic-bezier(.5,.1,.5,1.4), box-shadow .2s;
  touch-action: none;
}
.card:active { cursor: grabbing; }
.card.dragging { opacity: .25; }
.card.drop-hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(212,160,23,.4), 0 0 0 2px #d4a017; }
.card.locked { box-shadow: 0 0 0 2px #2a9a60, 0 4px 10px rgba(92,255,179,.25); cursor: default; }
.card.status-green { box-shadow: 0 0 0 2px #2a9a60, 0 4px 10px rgba(92,255,179,.3); }
.card.status-yellow { box-shadow: 0 0 0 2px #d4a017, 0 4px 10px rgba(212,160,23,.3); }
.card.status-red { box-shadow: 0 0 0 2px #c93030, 0 4px 10px rgba(201,48,48,.3); }

.card-handle {
  color: #b28644;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -2px;
  user-select: none;
  flex-shrink: 0;
  width: 14px;
}
.card-body { flex: 1; min-width: 0; }
.card-pos {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 11px; letter-spacing: .15em;
  color: #a07028;
  margin-bottom: 1px;
}
.card-title {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: #2a1d04;
}
.card-region {
  font-size: 12px;
  color: #6a4d10;
  margin-top: 2px;
  font-style: italic;
}
.card-badge {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 14px;
  color: #fff;
}
.card-badge.ok { background: #2a9a60; box-shadow: 0 0 8px rgba(92,255,179,.5); }
.card-badge.mid { background: #d4a017; box-shadow: 0 0 8px rgba(212,160,23,.5); color: #2a1d04; }
.card-badge.bad { background: #c93030; }

/* Drag ghost (floating clone) */
.drag-ghost {
  position: fixed !important;
  z-index: 2000;
  pointer-events: none;
  transform: rotate(-1deg);
  box-shadow: 0 12px 40px rgba(0,0,0,.6), 0 0 0 2px #d4a017 !important;
  opacity: .95;
}

/* Action row */
.cr-actions {
  display: flex; gap: 10px; justify-content: center;
}
.cr-actions button { min-width: 130px; }

/* ---------- Reveal screen ---------- */
.cr-reveal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
  backdrop-filter: blur(8px);
  overflow-y: auto;
}
.cr-reveal.show { display: flex; }
.cr-reveal-card {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 2px solid #d4a017;
  border-radius: 18px;
  padding: 28px 30px;
  max-width: 540px; width: 100%;
  box-shadow: 0 18px 60px rgba(212,160,23,.35);
  animation: cr-pop .4s cubic-bezier(.5,.1,.5,1.4);
  max-height: 92vh; overflow-y: auto;
}
@keyframes cr-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cr-reveal h2 {
  font-family: 'Cinzel', serif; font-weight: 900;
  font-size: 28px;
  margin: 0 0 4px;
  background: linear-gradient(90deg, #f5d76e, #d4a017);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}
.cr-reveal-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }

.rv-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.rv-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(255,255,255,.04);
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 3px solid #d4a017;
  animation: rv-in .5s ease backwards;
}
@keyframes rv-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.rv-year {
  font-family: 'Bowlby One SC', sans-serif;
  font-size: 17px;
  color: #f5d76e;
  min-width: 72px;
  text-align: right;
  padding-top: 1px;
}
.rv-body { flex: 1; min-width: 0; }
.rv-title { font-family: 'Cinzel', serif; font-weight: 700; font-size: 15px; color: var(--text); }
.rv-ctx { font-family: 'Crimson Pro', Georgia, serif; font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-top: 4px; }

/* Stats row */
.rv-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; margin: 16px 0;
}
.rv-stat { background: var(--bg); border-radius: 10px; padding: 10px 6px; text-align: center; border: 1px solid var(--border); }
.rv-stat-v { font-family: 'Bowlby One SC', sans-serif; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.rv-stat-l { font-size: 9px; color: var(--text-dim); letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }

/* Distribution */
.rv-distribution { background: var(--bg); border-radius: 10px; padding: 12px; margin-bottom: 18px; }
.rv-dist-label {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}
.dist-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dist-label {
  width: 18px;
  font-family: 'Bowlby One SC', sans-serif;
  font-size: 13px;
  color: var(--text);
  text-align: right;
}
.dist-bar-wrap { flex: 1; }
.dist-bar {
  background: var(--bg-elev-2);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-display); font-weight: 700;
  color: var(--text);
  text-align: right;
  transition: width .5s ease, background .25s;
}
.dist-bar.current { background: linear-gradient(90deg, var(--accent), #5cffb3); color: #0b0d17; }

/* Share + countdown */
.rv-share {
  background: rgba(108,92,255,.1);
  border: 1px solid rgba(108,92,255,.3);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
#share-text {
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.rv-countdown {
  text-align: center;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 13px;
  color: var(--text-dim);
}
.rv-countdown b {
  font-family: 'Bowlby One SC', sans-serif;
  font-size: 18px;
  color: #f5d76e;
}
.rv-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Confetti */
#confetti-wrap { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 100; }
.confetti {
  position: absolute; top: -10px;
  width: 8px; height: 14px;
  animation: cr-fall 2.4s ease-in forwards;
}
@keyframes cr-fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* Toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  z-index: 300;
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
  border: 1px solid var(--accent);
}
#toast.show { opacity: 1; }
