/* ============================================================
   S.E.K.S. TRAINING — the card.
   Paper mode, not fullscreen: the player is looking AT him, not
   out of his eyes. Fullscreen belongs to combat. Same skeleton
   for all four drills; only the middle of the card changes.
   ============================================================ */

.tr-wrap {
  position: fixed; inset: 0;
  z-index: 1000080;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 120% 100% at 50% 40%,
    rgba(30, 24, 26, 0.72) 0%, rgba(12, 9, 10, 0.92) 100%);
  animation: trIn 0.28s ease both;
}
@keyframes trIn { from { opacity: 0; } to { opacity: 1; } }

.tr-card {
  /* --vw100 is 100vw pre-divided by the game's zoom (see
     fbi-document-style.css); raw vw would be 125% of the
     window on a narrow screen. */
  width: min(520px, calc(var(--vw100, 100vw) * 0.92));
  background: #EBE6D8;
  border: 1px solid #8E7F7F;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  padding: 0 0 18px;
  font-family: 'Courier New', Courier, monospace;
  color: #5F5449;
  transform: translateY(10px);
  animation: trUp 0.34s cubic-bezier(.22,1,.36,1) both;
}
@keyframes trUp { to { transform: translateY(0); } }

.tr-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(142, 127, 127, 0.5);
  background: rgba(142, 127, 127, 0.12);
}
.tr-place { font-size: 11px; letter-spacing: 2px; color: #3A3238; }
.tr-x {
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: #8E7F7F;
  font-family: inherit; padding: 0 2px;
}
.tr-x:hover { color: #8B0000; }

.tr-attr {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
}
/* The stamp, in the skills' own ink. It develops as the attribute
   climbs — which is the progress bar, minus the number. */
.tr-stamp {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: block; position: relative;
}
.tr-stamp img {
  width: 100%; height: 100%; display: block;
  transition: opacity 0.5s ease, filter 0.5s ease;
}
.tr-stamp.tr-press { animation: trPress 0.38s cubic-bezier(.2,.9,.3,1) both; }
@keyframes trPress {
  0%   { transform: scale(1.14) rotate(-2deg); }
  45%  { transform: scale(0.97) rotate(0.6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.tr-name { flex: 1 1 auto; letter-spacing: 3px; font-size: 13px; color: #3A3238; }
.tr-score { font-size: 15px; color: #5F5449; letter-spacing: 1px; }
.tr-score i { color: #8E7F7F; font-style: normal; padding: 0 3px; }
.tr-after.tr-up { color: #4a7c59; }
.tr-after.tr-flat { color: #8E7F7F; }

.tr-stage {
  margin: 4px 16px 14px;
  min-height: 132px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(58, 50, 56, 0.05);
  border: 1px solid rgba(142, 127, 127, 0.35);
  padding: 14px 12px;
}

/* ── rep slots ───────────────────────────────────────────── */
.tr-slots { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.tr-slots i {
  width: 58px; height: 10px;
  border: 1px dashed #8E7F7F;
  font-style: normal; font-size: 8px; line-height: 10px;
  text-align: center; letter-spacing: 2px; color: transparent;
}
.tr-slots i.tr-perfect { border: 1px solid #4a7c59; background: #4a7c59; color: #EBE6D8; }
.tr-slots i.tr-solid   { border: 1px solid #c4a87a; background: #c4a87a; color: #3A3238; }
.tr-slots i.tr-weak    { border: 1px solid #8B0000; background: #8B0000; color: #EBE6D8; }

/* ── the one button ──────────────────────────────────────── */
.tr-act {
  display: block; margin: 0 auto;
  min-width: 190px; padding: 11px 22px;
  background: #3A3238; color: #EBE6D8;
  border: 1px solid #8E7F7F; cursor: pointer;
  font-family: inherit; font-size: 13px; letter-spacing: 3px;
  transition: background 0.15s ease, transform 0.06s ease;
  touch-action: none; user-select: none;
}
.tr-act:hover { background: #4a4048; }
.tr-act:active { transform: translateY(1px); }
.tr-act.tr-live { background: #8B0000; border-color: #8B0000; }
.tr-act.tr-passive { opacity: 0.45; }

.tr-line {
  margin: 12px 18px 0;
  min-height: 2.6em;
  text-align: center; font-size: 12.5px; font-style: italic;
  color: #5F5449; line-height: 1.45;
}

/* ── S · the bar ─────────────────────────────────────────── */
.tr-bar {
  position: relative; width: 100%; height: 42px;
  background: rgba(58, 50, 56, 0.12);
  border: 1px solid rgba(142, 127, 127, 0.6);
  overflow: hidden;
}
.tr-zone { position: absolute; top: 0; bottom: 0; }
.tr-solid   { background: rgba(196, 168, 122, 0.45); }
.tr-perfect { background: rgba(74, 124, 89, 0.55); }
.tr-centre  { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(58, 50, 56, 0.5); }
.tr-marker {
  position: absolute; top: -3px; bottom: -3px; width: 4px;
  margin-left: -2px; background: #8B0000;
  box-shadow: 0 0 6px rgba(139, 0, 0, 0.6);
}
.tr-weight { margin-top: 10px; font-size: 11px; letter-spacing: 2px; color: #8E7F7F; }

/* ── E · the breath meter ────────────────────────────────── */
.tr-meter {
  position: relative; width: 54px; height: 118px;
  border: 1px solid rgba(142, 127, 127, 0.6);
  background: rgba(58, 50, 56, 0.1);
  overflow: hidden;
}
.tr-band { position: absolute; left: 0; right: 0; background: rgba(196, 168, 122, 0.5); }
.tr-band::after {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  margin-top: -1px; background: rgba(74, 124, 89, 0.85);
}
.tr-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(to top, rgba(139, 0, 0, 0.75), rgba(139, 0, 0, 0.35));
}
.tr-lamps { position: absolute; right: 3px; top: 6px; bottom: 6px; display: flex; flex-direction: column; justify-content: space-between; }
.tr-lamps i { width: 4px; height: 4px; border-radius: 50%; background: rgba(196, 168, 122, 0.7); }

/* ── K · the page ────────────────────────────────────────── */
.tr-page {
  font-size: 13px; line-height: 1.85; text-align: left;
  color: rgba(95, 84, 73, 0.9);
  max-width: 100%;
}
.tr-word { color: #3A3238; opacity: 0.12; padding: 0 1px; }
.tr-word.tr-active { cursor: pointer; border-bottom: 1px solid rgba(139, 0, 0, 0.5); }
.tr-word.tr-kept { opacity: 1; color: #4a7c59; border-bottom: none; }
.tr-word.tr-lost { opacity: 0.18; text-decoration: line-through; border-bottom: none; }

/* ── S · the mirror ──────────────────────────────────────── */
.tr-mirror { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.tr-her { font-size: 12.5px; font-style: italic; color: #5F5449; text-align: center; min-height: 1.4em; }
.tr-you { font-size: 12.5px; color: #8B0000; text-align: center; min-height: 1.4em; }
.tr-ring { width: 74px; height: 74px; transform: rotate(-90deg); }
.tr-ring-bed { fill: none; stroke: rgba(142, 127, 127, 0.35); stroke-width: 4; }
.tr-ring-arc { fill: none; stroke: #8B0000; stroke-width: 4; stroke-linecap: round; }

@media (max-width: 520px) {
  .tr-card { width: calc(var(--vw100, 100vw) * 0.96); }
  .tr-slots i { width: 44px; }
}
