/* ------------------------------------------------------------- codenames */
/* Companion widget to style.css's console — same shell/dock/segmented/
   history/toast chrome, swapped out for a "classified dossier" card
   instead of the handheld console (there's no artwork to reuse here, the
   whole point of a codename is that nothing's been drawn yet). */

.dossier-wrap { order: 1; perspective: 1200px; }

.dossier {
  position: relative;
  width: clamp(260px, 78vw, 360px);
  min-height: clamp(200px, 46vw, 240px);
  padding: 0.9rem 1.1rem 1.2rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 40%),
    var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: hidden;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
  touch-action: pan-y;
}

.dossier.is-on {
  border-color: rgba(255, 106, 213, 0.4);
  box-shadow: 0 18px 40px -16px rgba(248, 63, 199, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Hazard-stripe edge along the top — the one bit of "classified folder"
   costume, drawn as a gradient rather than an image. */
.dossier::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--gold) 0, var(--gold) 10px,
    #1a1a20 10px, #1a1a20 20px
  );
  opacity: 0.85;
}

.dossier-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 0.35rem;
}

.dossier-classification {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.3s ease;
}
.dossier.is-on .dossier-classification { color: var(--pink-soft); }

.dossier-index {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.dossier-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  container-type: size;
  container-name: dossier;
}

.dossier-hint {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.codename {
  display: block;
  width: 100%;
  font-family: 'Black Ops One', 'Titillium Web', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.6rem;                       /* fallback */
  font-size: calc(var(--fit, 7) * 1cqw);   /* --fit is measured and set in codenames-app.js */
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.codename.break { overflow-wrap: break-word; word-break: break-word; }

.codename.pop { animation: codename-pop 0.42s cubic-bezier(0.2, 1.4, 0.4, 1); }

@keyframes codename-pop {
  0%   { transform: translateY(7px) scale(0.9); }
  100% { transform: none; }
}

.dossier-style {
  padding: 0.3em 0.85em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 106, 213, 0.35);
  color: var(--pink-soft);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dossier-stripes {
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--teal) 0, var(--teal) 10px,
    #1a1a20 10px, #1a1a20 20px
  );
  opacity: 0.55;
}

/* -------------------------------------------------------------- responsive */

@media (max-height: 700px) {
  .dossier { min-height: clamp(170px, 34vh, 210px); }
}

@media (max-height: 520px) and (min-width: 600px) {
  .dossier-wrap { order: 1; }
  .dossier { width: clamp(220px, 40vh, 280px); min-height: clamp(150px, 30vh, 190px); }
}

@media (prefers-reduced-motion: reduce) {
  .dossier { transition: none; }
}
