/* ============================================================
   CREW ACTIVATION — components: cards, crew board, slots,
   bars, rules table, scoring, log
   ============================================================ */

/* ================= Trojan cards ================= */
.tcard {
  position: relative;
  width: 72px; height: 102px;
  margin: 0 -7px;
  background: linear-gradient(165deg, #131c2e, #0c1220);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  display: flex; flex-direction: column;
  padding: 6px 7px;
  user-select: none;
  cursor: grab;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  flex-shrink: 1;
}
.tcard:active { cursor: grabbing; }
.tcard:hover { transform: translateY(-9px); z-index: 5; box-shadow: 0 10px 24px rgba(0,0,0,0.5); }
.tcard.selected {
  transform: translateY(-18px);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(255,215,94,0.35), 0 12px 26px rgba(0,0,0,0.55);
  z-index: 6;
}
.tcard.selected:hover { transform: translateY(-21px); }
.tcard.placed { opacity: 0.35; pointer-events: none; }
.tcard .tc-rank { font-family: var(--mono); font-size: 19px; font-weight: 700; line-height: 1; }
.tcard .tc-suit { font-size: 13px; line-height: 1.25; }
.tcard .tc-big {
  position: absolute; right: 7px; top: 32px;
  font-size: 26px; opacity: 0.3;
}

.tcard.hearts   .tc-rank, .tcard.hearts   .tc-suit, .tcard.hearts   .tc-big { color: var(--hearts); }
.tcard.diamonds .tc-rank, .tcard.diamonds .tc-suit, .tcard.diamonds .tc-big { color: var(--diamonds); }
.tcard.clubs    .tc-rank, .tcard.clubs    .tc-suit, .tcard.clubs    .tc-big { color: var(--clubs); }
.tcard.spades   .tc-rank, .tcard.spades   .tc-suit, .tcard.spades   .tc-big { color: var(--spades); }

/* ================= Score bar ================= */
#crew-board-area { margin: 8px 0; }

#score-bar {
  display: flex; gap: 0; justify-content: center;
  margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden;
}
.score-block {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 20px; min-width: 100px;
  background: var(--bg2);
}
.score-block-main {
  flex: 1; min-width: 140px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(16,24,42,0.7);
}
.score-label {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 4px;
}
.score-block:nth-child(1) .score-label { color: var(--cyan); }
.score-block:nth-child(3) .score-label { color: var(--orange); }
.score-block-main .score-label { color: var(--faint); }
.score-value {
  font-family: var(--mono); font-size: 26px; font-weight: 800;
  color: var(--text); line-height: 1;
}
#score-power { color: var(--cyan); }
#score-combo { color: var(--orange); }
.score-value.stat-pop {
  animation: statPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes statPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); color: var(--gold); }
  100% { transform: scale(1); }
}

/* ================= Crew board (columns: crew chip + card slot) ================= */
#crew-board {
  display: flex; gap: 8px; justify-content: center;
}
.crew-slot-col {
  display: flex; flex-direction: column; align-items: center;
  width: 125px; gap: 6px;
}
.crew-card-chip {
  width: 125px; height: 110px; padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; text-align: center;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.crew-card-chip.has-crew {
  cursor: grab;
}
.crew-card-chip.has-crew:active { cursor: grabbing; }
.crew-card-chip.has-crew:hover { border-color: var(--gold-deep); transform: translateY(-2px); }
.crew-card-chip.no-crew {
  opacity: 0.45;
}
.crew-chip-name {
  font-size: 13px; font-weight: 800; margin-bottom: 2px;
}
.crew-card-chip.no-crew .crew-chip-name { color: var(--faint); }
.crew-chip-action {
  font-family: var(--mono); font-size: 10px; color: var(--cyan);
  margin-bottom: 1px; font-weight: 700;
}
.crew-chip-bonus {
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  margin-bottom: 1px;
}
.crew-chip-bonus-result {
  font-family: var(--mono); font-size: 10px; color: var(--gold);
  margin-bottom: 1px; font-weight: 700;
}
.crew-chip-role {
  font-family: var(--mono); font-size: 8px; color: var(--dim);
  letter-spacing: 0.06em;
}

.card-slot {
  width: 72px; height: 102px;
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.card-slot.slot-empty {
  border: 1px dashed var(--line);
  background: rgba(13,19,32,0.35);
  cursor: pointer;
}
.card-slot.slot-empty:hover {
  border-color: var(--line-bright);
  background: rgba(16,24,42,0.45);
}
.slot-empty-text {
  font-family: var(--mono); font-size: 12px; color: var(--faint);
  font-weight: 700; letter-spacing: 0.06em;
}
.slot-empty-sub {
  font-family: var(--mono); font-size: 9px; color: var(--faint);
}

.card-slot.slot-card {
  border: 1px solid var(--line-bright);
  background: linear-gradient(165deg, #131c2e, #0c1220);
  cursor: pointer;
}
.card-slot.slot-card.used {
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(65,245,143,0.2);
}
.card-slot.slot-card.ignored {
  border-color: var(--faint);
  opacity: 0.7;
}

.slot-card-rank {
  font-family: var(--mono); font-size: 20px; font-weight: 800; line-height: 1;
}
.slot-card-rank.hearts   { color: var(--hearts); }
.slot-card-rank.diamonds { color: var(--diamonds); }
.slot-card-rank.clubs    { color: var(--clubs); }
.slot-card-rank.spades   { color: var(--spades); }
.slot-card-suit {
  font-size: 13px; line-height: 1;
}
.slot-card-suit.hearts   { color: var(--hearts); }
.slot-card-suit.diamonds { color: var(--diamonds); }
.slot-card-suit.clubs    { color: var(--clubs); }
.slot-card-suit.spades   { color: var(--spades); }
.slot-card-status {
  font-family: var(--mono); font-size: 8px;
  padding: 1px 5px; border-radius: 4px;
  margin-top: 2px;
}
.card-slot.used .slot-card-status {
  background: #0a2a1c; color: var(--green); border: 1px solid #1d5c3c;
}
.card-slot.ignored .slot-card-status {
  background: var(--bg0); color: var(--faint); border: 1px solid var(--line);
}

/* Scoring highlights on card slots */
.card-slot.scoring-glow {
  border-color: var(--green) !important;
  box-shadow: 0 0 16px rgba(65,245,143,0.4) !important;
}
.card-slot.ignored-glow {
  border-color: var(--faint) !important;
  box-shadow: 0 0 8px rgba(118,131,155,0.3) !important;
}
.card-slot.resolving {
  border-color: var(--gold) !important;
  box-shadow: 0 0 12px rgba(255,215,94,0.3) !important;
}

/* ================= Firewall bar ================= */
.bar {
  height: 18px; background: var(--bg0);
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; position: relative;
  margin: 6px 0;
}
.bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--red), var(--orange));
  width: 100%; transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; color: var(--text);
}
.fw-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.fw-type { font-size: 10px; color: var(--dim); margin-left: 6px; }

/* ================= Preview panel ================= */
#preview-main { font-family: var(--mono); font-size: 12px; }
.pv-empty {
  width: 100%; text-align: center; color: var(--faint);
  font-size: 12px; padding: 12px 0;
}
.pv-row { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.pv-hand {
  font-size: 16px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--gold); padding: 2px 10px;
  background: rgba(255,215,94,0.08);
  border: 1px solid var(--gold-deep); border-radius: 6px;
}
.pv-used-label { font-size: 10px; color: var(--green); }
.pv-ignored-label { font-size: 10px; color: var(--orange); }
.pv-bhp { font-size: 13px; color: var(--dim); }
.pv-bhp b { color: var(--text); }

.pv-slot-breakdown { margin: 4px 0; }
.pv-slot-line { font-size: 10px; color: var(--dim); padding: 1px 0; }
.pv-slot-line.ok { color: var(--text); }
.pv-slot-line b { font-weight: 700; }

.pv-totals {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--line);
}
.pv-total-row { font-size: 11px; color: var(--dim); }
.pv-total-row b { color: var(--text); }
.pv-total-row.power-row b { color: var(--cyan); }
.pv-total-row.combo-row b { color: var(--orange); }
.pv-total-row.pv-final {
  font-size: 14px; font-weight: 700; color: var(--text);
  padding-top: 4px; margin-top: 4px;
  border-top: 1px solid var(--line);
}

/* ================= Rules table ================= */
.rules-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 10px;
  margin: 8px 0 12px;
}
.rules-table th {
  text-align: left; color: var(--gold);
  border-bottom: 1px solid var(--line);
  padding: 4px 6px; font-size: 9px; letter-spacing: 0.08em;
}
.rules-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(29,41,66,0.5);
  color: var(--dim);
}
.rules-table td b { color: var(--text); }
#rules-content h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--cyan); margin: 12px 0 4px;
}
#rules-content p { font-family: var(--mono); font-size: 10px; color: var(--dim); line-height: 1.5; }
#rules-content p b { color: var(--text); }

/* ================= Controls row ================= */
.controls-row { text-align: center; margin-bottom: 8px; }

/* ================= Zone labels ================= */
.zone-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--faint); padding: 4px 0 2px; text-align: center;
}
.zone-hint { color: var(--faint); font-size: 9px; letter-spacing: normal; }

/* ================= Phase banner ================= */
.phase-ribbon {
  width: 100%; padding: 12px 20px;
  text-align: center;
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.ribbon-pop { animation: ribbonPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.ribbon-damage { color: var(--red); background: rgba(255,77,94,0.06); }
.ribbon-gold { color: var(--gold); background: rgba(255,215,94,0.06); }
@keyframes ribbonPop {
  0% { transform: scale(0.95); opacity: 0; }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

/* ================= Log ================= */
#log-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 8px 12px; }
#log-panel .panel-title { margin-bottom: 4px; }
#event-log { flex: 1; min-height: 0; overflow-y: auto; }
.log-entry {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 4px; border-bottom: 1px solid rgba(29,41,66,0.3);
}
.log-t { color: var(--faint); margin-right: 6px; }
.log-sys { color: var(--dim); }
.log-dmg { color: var(--orange); }
.log-win { color: var(--green); font-weight: 700; }

/* ================= NEXT button (step mode) ================= */
#btn-step-next {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  z-index: 100;
  font-family: var(--mono); font-size: 16px; font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold); background: linear-gradient(180deg, #443411, #2c210a);
  border: 1px solid var(--gold-deep); border-radius: 10px;
  padding: 14px 36px; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 18px rgba(255,215,94,0.35), 0 8px 24px rgba(0,0,0,0.5);
  animation: pulse-glow 1.6s ease-in-out infinite;
}
#btn-step-next:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 0 28px rgba(255,215,94,0.5); }
#btn-step-next.hidden { display: none !important; }
#btn-step-next span { font-size: 11px; color: var(--faint); margin-left: 10px; }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 18px rgba(255,215,94,0.35), 0 8px 24px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 0 30px rgba(255,215,94,0.55), 0 8px 24px rgba(0,0,0,0.5); }
}
.resolving .tcard { pointer-events: none; }

/* ================= Selection screen ================= */
#screen-selection .game-body { grid-template-columns: 1fr; }
#screen-selection #center { padding: 0 40px; }

.select-header { text-align: center; margin: 12px 0 8px; }
.select-header h2 { font-family: var(--mono); font-size: 22px; font-weight: 800; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }
.select-header p { font-size: 13px; color: var(--dim); }

.select-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 14px 20px; width: 100%; margin: 0 auto; }
.select-crew-card {
  min-width: 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px;
  width: 100%;
  background: var(--bg2); cursor: pointer; position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.select-crew-card:hover { border-color: var(--line-bright); transform: translateY(-2px); }
.select-crew-card.selected { border-color: var(--gold-deep); box-shadow: 0 0 0 1px var(--gold-deep), 0 0 12px rgba(255,215,94,0.14); }
.select-crew-card.selected::before { content: "✓"; position: absolute; top: 8px; right: 10px; color: var(--gold); font-size: 16px; font-weight: 700; }
.select-crew-name { font-size: 17px; font-weight: 800; margin-bottom: 3px; }
.select-crew-role { font-size: 11px; color: var(--dim); font-family: var(--mono); margin-bottom: 6px; }
.select-crew-action { font-size: 12px; color: var(--dim); font-family: var(--mono); margin-bottom: 2px; }
.select-crew-action b { color: var(--cyan); font-size: 13px; }
.select-crew-bonus { font-size: 12px; color: var(--dim); font-family: var(--mono); margin-bottom: 3px; }
.select-crew-result { font-size: 13px; color: var(--gold); font-family: var(--mono); margin-bottom: 8px; font-weight: 700; }
.select-crew-level { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.select-level-drop { background: var(--bg0); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; margin-left: 4px; font-family: var(--mono); font-size: 12px; cursor: pointer; }
#select-bar { margin: 8px 20px !important; }
.select-bar-header { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--cyan); margin-bottom: 6px; }
.select-chip { display: inline-block; font-family: var(--mono); font-size: 11px; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; margin: 3px; color: var(--text); }

.suit-color { font-weight: 700; }
.suit-color.hearts   { color: var(--hearts); }
.suit-color.diamonds { color: var(--diamonds); }
.suit-color.clubs    { color: var(--clubs); }
.suit-color.spades   { color: var(--spades); }

/* ================= Shop screen ================= */
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; max-width: 660px; margin: 0 auto; }
.shop-offer-card {
  width: 180px; padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); text-align: center;
}
.shop-offer-name { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.shop-offer-desc { font-size: 9px; color: var(--dim); font-family: var(--mono); margin-bottom: 8px; line-height: 1.3; }
.shop-offer-cost { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--gold); margin-bottom: 10px; }
.shop-buy-btn { width: 100%; }
#shop-crew-bar { margin: 8px 16px !important; }

#shop-slots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.shop-slot-card {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px;
  min-width: 140px; text-align: center;
}
.shop-slot-card b { font-weight: 700; }

/* ================= Credits counter ================= */
.counter-gold .counter-label { color: var(--gold-deep); }
.counter-gold { border-left: 1px solid var(--gold-deep); padding-left: 10px; }
sed -i '/^\/\* ================= Selection header ================= \*\//,/^CSSEOF/d' crew-activation-power-combo-prototype/css/components.css
# Actually, the grid styles were added in 2 places. Let me just fix what's there now.
echo "fixing"
