/* ── Cards ── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.card-title {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 1.5px;
  color: var(--text3); text-transform: uppercase;
  border-bottom: 1px solid var(--border); padding-bottom: 5px; margin-bottom: 8px;
}

/* ── Stat grid ── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat-box { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; text-align: center; padding: 6px 4px; }
.stat-val { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 20px; color: var(--blue); }
.stat-label { font-size: 9px; color: var(--text3); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 1px; }

/* ── Save rows ── */
.save-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
.save-row:last-child { border-bottom: none; }
.save-val { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 16px; color: var(--blue); }
.save-prof { font-size: 10px; color: var(--text3); display: block; text-align: right; }

/* ── Prey ── */
.prey-box {
  background: var(--bg3); border: 1px solid var(--border2); border-radius: 4px;
  padding: 8px 10px; margin-bottom: 8px; display: flex;
  align-items: center; justify-content: space-between; min-height: 36px;
}
.prey-name { font-family: 'Inter', sans-serif; font-weight: 600; color: var(--red-b); font-size: 14px; }
.prey-none { color: var(--text3); font-style: italic; font-size: 13px; }
.prey-hint { font-size: 11px; color: var(--text3); margin-top: 5px; }
.row { display: flex; gap: 6px; align-items: center; }
.text-in {
  flex: 1; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 3px; color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 15px; padding: 5px 8px;
}
.text-in:focus { outline: 2px solid var(--blue-dim); outline-offset: 1px; }

/* ── Actions ── */
.actions-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.action-pips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.action-pip {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border2); background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text3); cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s; user-select: none;
  flex: 0 0 auto;
}
.action-pip.used { background: var(--blue-muted); border-color: var(--blue); color: var(--blue); }
.action-pip.react.used { background: var(--bg4); border-color: var(--blue); color: var(--blue); }
.action-pip.quickened {
  border-style: dashed;
  color: var(--amber);
}
.action-pip.quickened.used {
  border-color: var(--amber);
  background: rgba(197, 138, 64, 0.18);
  color: var(--amber);
}
.action-pip.unavailable {
  display: none;
}
.action-budget-note {
  display: none;
  margin: -1px 0 8px;
  font-size: 11px;
  color: var(--amber);
  line-height: 1.35;
}
.action-budget-note.visible { display: block; }
.warden-row {
  min-width: 0;
}
.warden-row .tog-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ── Toggle ── */
.tog {
  width: 40px; height: 22px; border-radius: 11px; border: 1px solid var(--border2);
  background: var(--bg4); cursor: pointer; position: relative;
  transition: background 0.2s; flex-shrink: 0;
}
.tog.on { background: var(--blue-dim); border-color: var(--blue); }
.tog.on.green { background: var(--green); border-color: var(--green-b); }
.tog-knob {
  width: 18px; height: 18px; border-radius: 50%; background: var(--text2);
  position: absolute; top: 1px; left: 1px; transition: left 0.2s, background 0.2s;
}
.tog.on .tog-knob { left: 19px; background: white; }
.tog-label { font-size: 12px; color: var(--text2); }

/* ── Weapons ── */
.weapon-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; }
.weapon-card:last-child { margin-bottom: 0; }
.weapon-name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.weapon-row { display: flex; justify-content: space-between; align-items: baseline; }
.weapon-atk { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 20px; color: var(--blue); }
.weapon-dmg { font-size: 13px; color: var(--text2); }
.weapon-traits { font-size: 10px; color: var(--text3); margin-top: 3px; }
.weapon-note-good { font-size: 11px; color: var(--green-b); margin-top: 3px; }
.weapon-note-neutral { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ── Conditions ── */
.cond-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; margin-bottom: 8px; }
.cond-none { font-size: 12px; color: var(--text3); font-style: italic; align-self: center; }
.cond-badge {
  font-size: 11px; background: rgba(176,48,48,0.2); border: 1px solid var(--red);
  color: #ff9090; border-radius: 3px; padding: 3px 8px;
  display: flex; align-items: center; gap: 5px; font-family: 'Inter', sans-serif; font-weight: 600;
}
.cond-badge.good { background: rgba(58,122,48,0.2); border-color: var(--green); color: var(--green-b); }
.cond-x { cursor: pointer; font-size: 14px; opacity: 0.7; line-height: 1; }
.cond-x:active { opacity: 1; }
.cond-select {
  flex: 1; background: var(--bg3); border: 1px solid var(--border2); border-radius: 3px;
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; padding: 5px 6px;
}
.cond-select option, .cond-select optgroup { background: var(--bg2); color: var(--text); }

/* ── Skills ── */
.skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.skill-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.skill-name-wrap { display: flex; flex-direction: column; }
.skill-prof-badge { font-size: 9px; color: var(--text3); }
.skill-mod { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; color: var(--blue); }
.assurance-box { margin-top: 8px; background: var(--blue-muted); border: 1px solid var(--blue-dim); border-radius: 4px; padding: 7px 10px; font-size: 12px; color: var(--blue); }

/* ── Medic table ── */
.medic-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.medic-row:last-child { border-bottom: none; }
.medic-val { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; color: var(--blue); white-space: nowrap; text-align: right; margin-left: 8px; flex-shrink: 0; }

/* ── Companion ── */
.haki-hp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.haki-label { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12px; color: var(--text2); white-space: nowrap; }
.haki-nums { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; white-space: nowrap; }
.haki-nums .cur { color: var(--green-b); }
.haki-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.hd-row { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.hd-val { font-family: 'Inter', sans-serif; font-weight: 600; color: var(--blue); font-size: 12px; }
.ability-block { margin-bottom: 8px; }
.ability-name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12px; color: var(--blue); margin-bottom: 2px; }
.ability-desc { font-size: 13px; color: var(--text2); line-height: 1.55; }

/* ── Info ── */
.info-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-val { color: var(--text2); font-size: 13px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: 10px; background: var(--bg4); border: 1px solid var(--border2); border-radius: 2px; padding: 2px 7px; color: var(--text2); }
.feat-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.feat-row:last-child { border-bottom: none; }
.feat-row:hover, .feat-row:active { color: var(--blue); }
.feat-row.feat-described { border-left: 2px solid var(--blue-dim); padding-left: 5px; }
.feat-type { font-size: 9px; color: var(--text3); }
.feat-note { font-size: 9px; color: var(--text3); margin-left: 4px; }
.inv-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.inv-row:last-child { border-bottom: none; }
.inv-bulk { font-size: 11px; color: var(--text3); }

/* ── Notes / Resources ── */
.note-area {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 4px; color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 16px; padding: 8px 10px; min-height: 130px; resize: vertical; line-height: 1.6;
}
.note-area:focus { outline: 2px solid var(--blue-dim); outline-offset: 1px; }
.counter-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.counter-row:last-child { border-bottom: none; }
.counter-controls { display: flex; align-items: center; gap: 8px; }
.counter-val { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15px; color: var(--blue); min-width: 24px; text-align: center; }

/* ── Buttons ── */
.btn {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 12px;
  border: 1px solid var(--border2); background: var(--bg3); color: var(--text);
  padding: 5px 12px; border-radius: 3px; cursor: pointer; white-space: nowrap;
}
.btn:active { background: var(--bg4); }
.btn.gold   { border-color: var(--blue);   color: var(--blue);   }
.btn.dmg    { border-color: var(--red);    color: var(--red-b);  }
.btn.danger { border-color: var(--red);    color: var(--red-b);  }
.btn.heal   { border-color: var(--green);  color: var(--green-b);}
.btn.sm     { font-size: 11px; padding: 4px 9px; }

.div-label { font-size: 10px; color: var(--text3); letter-spacing: 0.5px; text-align: center; margin: 6px 0 5px; }
.toast { font-size: 11px; color: var(--green-b); align-self: center; opacity: 0; transition: opacity 0.3s; }
.toast.show { opacity: 1; }
/* Condition effects summary */
.cond-effects-summary {
  background: rgba(176,48,48,0.1);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 6px 8px;
  margin-bottom: 8px;
}
.cond-effect-line { font-size: 11px; color: #ff9090; padding: 1px 0; font-family: 'Inter', sans-serif; }

/* ── Utility ── */
.tap-hint  { font-size: 10px; color: var(--text3); }
.tier-header { font-size: 10px; font-weight: 700; color: var(--blue); letter-spacing: 0.06em; }

/* ── Condition level input (shown for ranked conditions) ── */
.cond-level-input {
  width: 44px;
  font-size: 16px;
  text-align: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--text);
  padding: 3px 2px;
}
.cond-add-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

/* ── Disease tracker ── */
.disease-empty { font-size: 12px; color: var(--text3); font-style: italic; padding: 4px 0; }
.disease-add-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.disease-row {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; padding: 8px 10px; margin-bottom: 6px;
}
.disease-row:last-child { margin-bottom: 0; }
.disease-row-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.disease-row-timer { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.disease-name { font-size: 13px; font-weight: 700; color: var(--red-b); }
.disease-label { font-size: 10px; color: var(--text3); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.disease-stage { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; color: var(--amber); min-width: 30px; text-align: center; }
.disease-controls { display: flex; align-items: center; gap: 4px; }
.disease-tick-btns { display: flex; gap: 3px; }
.disease-timer-input {
  width: 52px; font-size: 16px; text-align: center;
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: 3px; color: var(--text); padding: 2px 4px;
}

/* ── Inventory description in section cards ── */
.section-inv-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 3px 0 6px;
}
.section-inv-desc {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
}
.section-inv-notes {
  font-size: 10px;
  color: var(--text3);
  line-height: 1.4;
}

/* ── Item Effects ── */
.ie-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.ie-row:last-child { border-bottom: none; }
.ie-row-main { display: flex; align-items: baseline; gap: 6px; flex: 1; min-width: 0; }
.ie-source { font-size: 10px; color: var(--text3); white-space: nowrap; }
.ie-name-btn {
  background: none; border: none;
  color: var(--blue); font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  padding: 0; cursor: pointer; text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--blue-dim);
}
.ie-name-btn:hover, .ie-name-btn:active { color: var(--text); }
.ie-described .ie-name-btn { text-decoration-color: var(--blue); }

/* ── Item Effects add form ── */
.ie-add-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.ie-add-fields { display: flex; gap: 4px; flex: 1; min-width: 0; }
.ie-add-fields .text-in { flex: 1; min-width: 0; }

@media (pointer: coarse) {
  .action-pip {
    width: 44px;
    height: 44px;
  }
  .weapon-card.clickable,
  .feat-row,
  .ie-row {
    min-height: 44px;
  }
  .cond-badge {
    min-height: 36px;
    padding-right: 4px;
  }
  .cond-x {
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .disease-row-main,
  .disease-row-timer {
    flex-wrap: wrap;
  }
  .disease-controls,
  .disease-tick-btns {
    gap: 5px;
  }
  .disease-timer-input {
    min-height: 40px;
  }
}

@media (max-width: 380px) {
  .actions-card-main {
    align-items: stretch;
    flex-direction: column;
  }
  .action-pips {
    justify-content: space-between;
    width: 100%;
  }
  #reset-turn-btn {
    width: 100%;
  }
}
