/* Card system (spec §3): every significant entity behaves like a played
   card — ornate corner marks, one accent border, mono numbers. Reused
   across Lobby's character grid, the turn banner, and the initiative
   roll widget. */

.ornate {
  position: relative;
}

.ornate::before,
.ornate::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
}

.ornate::before {
  top: -4px;
  left: -4px;
}

.ornate::after {
  bottom: -4px;
  right: -4px;
}

/* ---- pips: shared language for any limited resource ---- */

.pips {
  display: flex;
  gap: 5px;
}

.pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.4px solid var(--accent);
  flex-shrink: 0;
}

.pip.filled {
  background: var(--accent);
}

/* ---- chip: condition / role / status tags ---- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
}

.chip.accent {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ---- game-card: character / party-slot card (spec §3.2, adapted) ---- */

.game-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-card .card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}

.game-card .card-type {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-transform: uppercase;
}

.card-line {
  width: 100%;
  height: 1px;
  background: var(--border);
  position: relative;
  margin: 2px 0;
}

.card-line::after {
  content: "◆";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 7px;
  color: var(--accent);
  background: var(--surface);
  padding: 0 6px;
}

/* ---- vitals row: HP / AC, reused on character + turn banner ---- */

.vitals-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.vital {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
}

.vital .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.vital.hp {
  color: var(--accent);
}

.vital.ac {
  color: var(--blue);
}

.hp-track {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
  flex-shrink: 0;
}

.hp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
}

/* ---- turn hero: active-combatant banner, a tinted "played card" ---- */

.turn-hero {
  background: var(--accent-bg);
  border: 2px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.turn-hero .eyebrow {
  color: var(--accent);
  letter-spacing: 2px;
}

.turn-hero h3 {
  font-size: 19px;
}

/* ---- stat grid: 3x2 ability scores ---- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}

.stat-cell .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-faint);
}

.stat-cell .v {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  margin: 3px 0 1px;
}

.stat-cell .m {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ---- roll widget: physical-dice input, same frame language ---- */

.roll-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.roll-widget .icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.roll-widget input {
  width: 54px;
  text-align: center;
  padding: 8px 4px;
}

/* ---- combatant row: compact turn-order list ---- */

.combatant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.combatant-row.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

.combatant-row .name {
  font-weight: 500;
  font-size: 13.5px;
}

.combatant-row .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* ---- combatant block: row + DM drawer underneath ---- */

.combatant-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.combatant-block .dm-actions {
  padding-left: 2px;
}

/* ---- hp widget: quick ΔHP edit (combat + character sheet) ---- */

.hp-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.hp-widget input {
  width: 72px;
  flex: 0 0 auto;
}

.hp-widget button {
  flex: 1 1 auto;
  padding: 10px 14px;
  min-height: 44px;
}

/* ---- chip variants ---- */

.chip.mono {
  font-family: var(--font-mono);
}

/* ---- qr-card: DM join QR code (spec §7 join step) ---- */

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.qr-card .section-label {
  align-self: flex-start;
}

#qr-join {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 10px;
  width: min(220px, 100%);
  display: flex;
  justify-content: center;
}

#qr-join svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-card .hint {
  margin: 0;
}

.chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.chip-row .hint {
  flex: 1 1 auto;
  text-align: right;
}

/* ---- ability/spell list row ---- */

.ability-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.ability-row .name {
  font-weight: 500;
  font-size: 13.5px;
}

.ability-row .meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

.ability-row .row-actions {
  flex-shrink: 0;
}

/* ---- event log row ---- */

.event-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.event-type {
  font-weight: 600;
  font-size: 13px;
}

.event-payload {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.event-time {
  font-size: 11px;
  color: var(--text-faint);
}

/* ---- point-buy cell: stat number + stepper ---- */

.point-buy-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.point-buy-cell .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-faint);
}

.point-buy-cell .v {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
}

.point-buy-cell .m {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.point-buy-cell .stepper {
  margin-top: 6px;
}

/* ---- computed value (auto-HP preview) ---- */

.mono.computed {
  color: var(--blue);
  font-size: 14px;
}

/* ---- pending roll panel: pinned over content ---- */

.roll-panel {
  border-color: var(--accent);
}

.roll-panel button {
  margin-top: 2px;
}
