/* Life tracker (life.html / life.js). Setup looks like the rest of the site; a game fills the whole screen. */

.life-page { max-width: 760px; }
.life-setup { display: flex; flex-direction: column; gap: 1rem; }
.life-setup-head h2 { font-family: var(--heading-font); color: var(--accent); font-size: 1.6rem; margin: 0; }
.life-intro { margin: 0.2rem 0 0; color: var(--muted); line-height: 1.45; }

/* Players and starting life: two rows of big chips */
.life-options { display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem; }
.life-option { display: flex; flex-direction: column; gap: 0.35rem; }
.life-option-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.life-chips-pick { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.life-chips-pick button { min-width: 3rem; min-height: 2.7rem; border-radius: 999px; font-size: 1.05rem; font-weight: 700; }
.life-chips-pick button.on { border-color: var(--accent); color: #1b1d23; background: var(--accent); }

/* The table picture: a seat per player where they sit around the phone (same order as the game) */
.life-pick { display: flex; flex-direction: column; gap: 0.5rem; }
.life-pick-table {
  display: flex; flex-direction: column; gap: 0.6rem; padding: 0.8rem; border-radius: 18px;
  background: radial-gradient(ellipse at center, #2f2b27 0%, #221f1c 70%); border: 1px solid #3a352f;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}
.life-pick-row { display: flex; gap: 0.6rem; }
.life-pick-row.bottom { flex-direction: row-reverse; }
.life-pick-phone { align-self: center; width: 3.2rem; height: 1.7rem; border-radius: 5px; border: 2px solid #5a5e6a; background: #15171c; }
.life-pick-seat {
  position: relative; flex: 1; min-width: 0; min-height: 6.5rem; padding: 0; overflow: hidden; border-radius: 12px; text-align: left;
  display: flex; align-items: flex-end; background: #2a2d36; border: 2px dashed #4a4f5c; color: var(--text);
}
.life-pick-seat.has-art { border-style: solid; border-color: #4a4f5c; background: var(--seat-art) center 30% / cover; }
.life-pick-seat.has-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 11, 14, 0.92), rgba(10, 11, 14, 0.15) 75%); }
.life-pick-seat.me { border-color: var(--accent); border-style: solid; box-shadow: 0 0 0 1px var(--accent); }
.life-pick-seat:hover { border-color: var(--accent); }
.life-pick-info { position: relative; display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.65rem; min-width: 0; width: 100%; box-sizing: border-box; }
.life-pick-info b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.life-pick-info small { color: #c9cbd3; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.life-pick-seat:not(.has-art) .life-pick-info small { color: var(--muted); }
.life-pick-info .life-pick-deck { color: var(--accent); }
.life-pick-you {
  position: absolute; top: 0.45rem; right: 0.45rem; padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800;
  background: var(--accent); color: #1b1d23;
}
.life-pick-hint { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
/* A phone held upright: the game turns the rows into columns (left one bottom-up), so the picture does too */
@media (orientation: portrait) {
  /* Shaped like the phone screen, so the seats stand up like the game's panels */
  .life-pick-table { flex-direction: row; height: min(66vh, 560px); box-sizing: border-box; }
  .life-pick-row { flex-direction: column; flex: 1; min-width: 0; }
  .life-pick-row .life-pick-seat { min-height: 0; }
  .life-pick-row.top { flex-direction: column-reverse; }
  .life-pick-row.bottom { flex-direction: column; }
  .life-pick-phone { width: 1.7rem; height: 3.2rem; }
}

/* The seat window */
.life-edit-form { display: flex; flex-direction: column; gap: 0.7rem; }
.life-me { align-self: flex-start; border-radius: 999px; padding: 0.4rem 0.9rem; font-weight: 600; white-space: nowrap; }
.life-me.on { border-color: var(--accent); color: #1b1d23; background: var(--accent); }
.life-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.life-field > span { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.life-field > input, .life-field > select, .life-field > .choice, .life-field > .life-card-input { width: 100%; box-sizing: border-box; }
.life-card-input { display: flex; min-width: 0; }
.life-card-input input { flex: 1; min-width: 0; }
.life-text, .life-setup input[type="text"], .life-setup select, .life-edit-form input[type="text"], .life-edit-form select {
  background: #15171c; color: var(--text); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 0.6rem 0.65rem; font: inherit; font-size: 1rem;
  color-scheme: dark;
}

.life-tips { color: var(--muted); font-size: 0.92rem; }
.life-tips summary { cursor: pointer; color: var(--text); font-weight: 600; }
.life-tips ul { margin: 0.5rem 0 0; padding-left: 1.2rem; line-height: 1.45; }

.life-start-bar { position: sticky; bottom: 0; z-index: 5; margin: 0 -1.25rem; padding: 0.6rem 1.25rem; background: var(--panel); }
.life-start { width: 100%; }
.life-start, .life-resume { font-size: 1.1rem; font-weight: 700; padding: 0.85rem 1rem; }
.life-resume-box {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.85rem; border-radius: 10px;
  border: 1px solid var(--accent); background: rgba(232, 130, 63, 0.1);
}
.life-resume-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.life-resume-text > b { color: var(--accent); }
.life-resume-who { font-size: 0.88rem; line-height: 1.35; }
.life-resume { flex: none; }
@media (max-width: 700px) {
  body.has-bottom-nav:not(.no-bottom-nav) .life-start-bar { bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* ---- the table: the whole screen ---- */
body.life-playing { overflow: hidden; overscroll-behavior: none; }
body.life-playing .topbar, body.life-playing .site-footer, body.life-playing #stats { display: none; }
body.life-playing .life-page { max-width: none; padding: 0; margin: 0; }
.life-table {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: #0f1013; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.life-row { flex: 1; display: flex; gap: 6px; min-height: 0; }
.life-row.bottom { flex-direction: row-reverse; } /* clockwise round the table */
.life-row.top .life-inner { transform: rotate(180deg); }
.life-panel { flex: 1; min-width: 0; position: relative; border-radius: 14px; overflow: hidden; container-type: size; }
.life-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #22252d; border-radius: 14px; isolation: isolate; border: 2px solid transparent; transition: border-color 0.2s, box-shadow 0.2s;
}
.life-inner::before {
  content: ''; position: absolute; inset: 0; z-index: -2; background: var(--art, none) center 30% / cover no-repeat; opacity: 0.95; filter: saturate(1.15);
}
/* just enough shade behind the name and number to read them; the edges show the art */
.life-inner::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at center, rgba(10, 11, 14, 0.5), rgba(10, 11, 14, 0.15) 70%, rgba(10, 11, 14, 0.3));
}
.life-half {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1; background: none; border: none; border-radius: 0; padding: 0 4%;
  display: flex; align-items: center; color: #fff; font-size: clamp(1.6rem, 6vmin, 3rem); font-weight: 700;
  -webkit-tap-highlight-color: transparent; touch-action: none;
}
/* − and + sit in a dark round badge so they stand out on any art */
.life-half > span {
  display: flex; align-items: center; justify-content: center; width: 1.35em; height: 1.35em; line-height: 1; border-radius: 999px;
  background: rgba(10, 11, 14, 0.62); border: 2px solid rgba(255, 255, 255, 0.55); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  padding-bottom: 0.08em;
}
.life-half.minus > span { color: #ffb3a8; }
.life-half.plus > span { color: #b6f0b6; }
.life-half:active > span { background: rgba(255, 255, 255, 0.25); }
.life-half.minus { left: 0; justify-content: flex-start; }
.life-half.plus { right: 0; justify-content: flex-end; }
.life-half:hover, .life-half:focus, .life-half:focus-visible { background: none; outline: none; }
.life-half:active { background: rgba(255, 255, 255, 0.07); }
.life-gear:hover { background: #22242b; }
.life-head, .life-total-wrap, .life-delta, .life-badges, .life-out { pointer-events: none; position: relative; z-index: 2; }
.life-total-wrap { position: relative; }
.life-total-wrap .life-delta { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 0.4rem; height: auto; white-space: nowrap; }
/* the map in the middle under the number (in the column, so it never covers it); out / badges float over the edge */
.life-mini-spot { position: relative; z-index: 3; margin-top: 0.35rem; }
.life-badges:empty { min-height: 0; }
.life-out:empty { display: none; }
.life-head { display: flex; flex-direction: column; align-items: center; max-width: 80%; text-align: center; }
.life-name { font-family: var(--heading-font); font-weight: 700; font-size: clamp(0.95rem, 3.4vmin, 1.4rem); color: var(--accent); text-shadow: 0 1px 6px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.life-cmdr { font-size: clamp(0.7rem, 2.3vmin, 0.9rem); color: #cfccc4; text-shadow: 0 1px 4px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.life-total { font-size: clamp(2.4rem, min(17vmin, 32cqh), 8rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 3px 14px rgba(0, 0, 0, 0.8); }
.life-delta { height: 1.4em; font-weight: 800; font-size: clamp(0.95rem, 3.6vmin, 1.5rem); }
.life-delta.down { color: #ff8a7a; }
.life-delta.up { color: #8be08b; }
.life-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: center; max-width: 86%; min-height: 1.4em; }
.life-badge { font-size: clamp(0.7rem, 2.3vmin, 0.9rem); padding: 0.05rem 0.45rem; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #e8e6e1; display: inline-flex; align-items: center; }
.life-badge .icon { height: 1em; width: 1em; }
.life-badge.hot { background: #8a2a20; }
.life-out { font-weight: 800; letter-spacing: 0.06em; color: #ff8a7a; font-size: clamp(0.8rem, 2.6vmin, 1rem); min-height: 1.2em; }
.life-panel.is-out .life-inner { filter: grayscale(0.85) brightness(0.65); }
.life-panel.is-out .life-out { filter: none; }

/* A phone lying flat in portrait: players sit along the long sides, so the two rows become a left and a right column and
   each panel's content is turned to face its side (left column 90°, right column −90°). Seats still go clockwise:
   the left column from the bottom up, the right column top down. */
@media (orientation: portrait) {
  .life-table { flex-direction: row; }
  .life-row { flex-direction: column; }
  .life-row.top { flex-direction: column-reverse; }
  .life-row.bottom { flex-direction: column; }
  .life-panel { container-type: size; }
  .life-row .life-inner {
    inset: auto; left: 50%; top: 50%; width: 100cqh; height: 100cqw;
  }
  .life-row.top .life-inner { transform: translate(-50%, -50%) rotate(90deg); }
  .life-row.bottom .life-inner { transform: translate(-50%, -50%) rotate(-90deg); }
  .life-total { font-size: clamp(2.4rem, min(30cqw, 26cqh), 8rem); }
  .life-half { font-size: clamp(1.6rem, 12cqw, 3rem); }
}

/* the middle: turns and the menu */
.life-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10; display: flex; gap: 0.35rem; align-items: center;
}
.life-table:not(:has(.life-row.top)) .life-center { top: auto; bottom: 12px; transform: translateX(-50%); }
.life-gear {
  border-radius: 999px; background: #15161b; border: 1px solid var(--accent); color: var(--text); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  width: 2.6rem; height: 2.6rem; padding: 0; font-size: 1.25rem;
}

/* the winner */
.life-winner { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.6); }
.life-winner-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; padding: 1.2rem 1.3rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.life-winner-card h2 { margin: 0; font-family: var(--heading-font); color: var(--accent); font-size: 1.7rem; }
.life-winner-crown { font-size: 2.4rem; }
.life-winner-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.life-save-status { color: var(--muted); margin: 0; min-height: 1.2em; }

/* the little map of the table on each panel (commander damage dealt by each seat); turned back so it matches the table */
.life-mini {
  display: flex; flex-direction: column; gap: 2px; width: min(4.4rem, 27cqh); height: min(4.4rem, 27cqh); padding: 3px; border-radius: 9px;
  background: rgba(10, 11, 14, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.life-mini:hover { background: rgba(10, 11, 14, 0.72); }
.life-mini-row { flex: 1; display: flex; gap: 2px; min-height: 0; }
.life-mini-row.bottom { flex-direction: row-reverse; }
.life-mini-tile {
  flex: 1; min-width: 0; border-radius: 4px; background: #3a3d47 center 30% / cover no-repeat; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.life-mini-tile::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.life-mini-tile.out { filter: grayscale(1) brightness(0.6); }
.life-mini-tile b { position: relative; font-size: 0.85rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; line-height: 1; }
.life-mini-tile.me b { font-size: 0.7rem; color: var(--accent); }
.life-mini-tile b.hot { color: #ff8a7a; }
.life-row.top .life-mini { transform: rotate(180deg); }
.life-row.top .life-mini-tile b { transform: rotate(180deg); }

/* the sheet, inside a panel (so it turns with it): tabs, then tiles */
.life-sheet {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.5rem 0.6rem;
  background: rgba(20, 21, 26, 0.97); border-radius: 12px;
}
.life-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.life-sheet-tabs { display: flex; gap: 0.3rem; min-width: 0; }
.life-sheet-tabs button { border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.9rem; white-space: nowrap; }
.life-sheet-tabs button.on { border-color: var(--accent); color: var(--accent); background: rgba(232, 130, 63, 0.12); }
.life-tiles {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
  grid-auto-rows: 4.2rem; gap: 0.35rem; align-content: start;
}
.life-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; padding: 0.2rem;
  border-radius: 10px; background: #2a2d36 center 30% / cover no-repeat; border: 1px solid rgba(255, 255, 255, 0.12); overflow: hidden;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.life-tile:hover, .life-tile:focus { background-color: #2a2d36; outline: none; }
.life-tile:active { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.12); } /* (not a filter: on a turned panel that made Chrome redraw the picture zoomed for a moment) */
.life-tile.art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.7)); }
.life-tile > * { position: relative; }
.life-tile.on { border-color: var(--accent); background-color: rgba(232, 130, 63, 0.22); box-shadow: inset 0 0 14px rgba(232, 130, 63, 0.35); }
.life-tile.hot b { color: #ff8a7a; }
.life-tile-top { display: flex; align-items: center; gap: 0.3rem; }
.life-tile-top .icon { width: 1.3rem; height: 1.3rem; }
.life-tile-sign { font-size: 1.15rem; line-height: 1; }
.life-tile-top b { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px #000; }
.life-tile-label { font-size: 0.72rem; color: #d8d5cd; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px #000; }
.life-sheet-hint { font-size: 0.72rem; color: var(--muted); text-align: center; }
.life-daynight { position: absolute; left: calc(100% + 0.35rem); padding: 0.25rem 0.6rem; border-radius: 999px; background: #15161b; border: 1px solid var(--panel-edge); font-size: 0.8rem; white-space: nowrap; }

/* Portrait (panels turned sideways): the map turns back the other way, the sheet is low and wide. */
@media (orientation: portrait) {
  .life-mini { flex-direction: row; width: min(4.4rem, 27cqw); height: min(4.4rem, 27cqw); }
  .life-mini-row.top { flex-direction: column-reverse; }
  .life-mini-row.bottom { flex-direction: column; }
  .life-row.top .life-mini { transform: rotate(-90deg); }
  .life-row.top .life-mini-tile b { transform: rotate(90deg); }
  .life-row.bottom .life-mini { transform: rotate(90deg); }
  .life-row.bottom .life-mini-tile b { transform: rotate(-90deg); }
  .life-sheet { padding: 0.35rem 0.5rem; gap: 0.3rem; }
  .life-tiles { grid-template-columns: repeat(auto-fill, minmax(4.8rem, 1fr)); grid-auto-rows: 3.6rem; }
  .life-tile-top b { font-size: 1.25rem; }
}

/* Commander damage laid out like the table (the big brother of .life-mini): the map is turned back to match the screen,
   each tile's face is turned again so it reads from the player's side. Partners share their seat. */
.life-dmg { flex: 1; min-height: 0; position: relative; container-type: size; }
.life-dmg-map { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.life-dmg-row { flex: 1; display: flex; gap: 0.35rem; min-height: 0; min-width: 0; }
.life-dmg-row.bottom { flex-direction: row-reverse; }
.life-dmg-seat { flex: 1; min-width: 0; min-height: 0; display: flex; gap: 3px; border-radius: 11px; }
.life-dmg-seat.me { box-shadow: 0 0 0 2px var(--accent); }
.life-dmg-seat.out { filter: grayscale(1) brightness(0.6); }
.life-dmg-tile {
  flex: 1; min-width: 0; position: relative; container-type: size; padding: 0; border-radius: 10px; overflow: hidden;
  background: #2a2d36; border: 1px solid rgba(255, 255, 255, 0.14); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.life-dmg-tile:hover, .life-dmg-tile:focus { background: #2a2d36; outline: none; }
.life-dmg-tile:active { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.12); }
.life-dmg-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  padding: 0.2rem; background: center 30% / cover no-repeat; isolation: isolate;
}
.life-dmg-face::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65)); }
.life-dmg-face b { font-size: clamp(1.2rem, 9cqmin, 2rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 1px 4px #000; }
.life-dmg-tile.hot .life-dmg-face b { color: #ff8a7a; }
.rot-180 .life-dmg-map, .rot-180 .life-dmg-face { transform: rotate(180deg); }
.rot-90 .life-dmg-map, .rot-270 .life-dmg-map { inset: auto; left: 50%; top: 50%; width: 100cqh; height: 100cqw; }
.rot-90 .life-dmg-face, .rot-270 .life-dmg-face { inset: auto; left: 50%; top: 50%; width: 100cqh; height: 100cqw; }
.rot-90 .life-dmg-map { transform: translate(-50%, -50%) rotate(-90deg); }
.rot-270 .life-dmg-map { transform: translate(-50%, -50%) rotate(90deg); }
.rot-90 .life-dmg-face { transform: translate(-50%, -50%) rotate(90deg); }
.rot-270 .life-dmg-face { transform: translate(-50%, -50%) rotate(-90deg); }
@media (orientation: portrait) {
  .life-dmg-map { flex-direction: row; }
  .life-dmg-row.top { flex-direction: column-reverse; }
  .life-dmg-row.bottom { flex-direction: column; }
  .life-dmg-seat { flex-direction: column; } /* (seats are tall here: partners one above the other) */
}

/* The sheet as a window over the dimmed table, turned toward its player and bigger than their panel. */
.life-overlay {
  position: absolute; inset: 0; z-index: 30; background: rgba(5, 6, 8, 0.6); overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* (centred by hand: before turning, a sideways window is wider than the screen) */
.life-sheet.life-window {
  position: absolute; inset: auto; left: 50%; top: 50%; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7); padding: 0.7rem 0.8rem; gap: 0.5rem;
  width: min(94vw, 40rem); height: min(86vh, 30rem); transform: translate(-50%, -50%);
}
.life-window.rot-180 { transform: translate(-50%, -50%) rotate(180deg); }
/* (turned sideways: its width runs along the screen's height) */
.life-window.rot-90, .life-window.rot-270 { width: min(64vh, 36rem); height: min(92vw, 30rem); }
.life-window.rot-90 { transform: translate(-50%, -50%) rotate(90deg); }
.life-window.rot-270 { transform: translate(-50%, -50%) rotate(-90deg); }
.life-window .life-tiles { grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr)); grid-auto-rows: 4.6rem; }
.life-window .life-sheet-tabs button { font-size: 1rem; padding: 0.4rem 0.9rem; }
.life-window .life-sheet-hint { font-size: 0.8rem; }
.life-add-partner { align-self: flex-start; font-size: 0.85rem; padding: 0.25rem 0.7rem; border-radius: 999px; }
.life-edit-form { display: flex; flex-direction: column; gap: 0.6rem; min-width: min(22rem, 80vw); }

/* a held commander damage tile: − value + on it */
.life-tile.editing { grid-column: 1 / -1; order: -1; flex-direction: row; justify-content: space-between; gap: 0.4rem; padding: 0.2rem 0.4rem; border-color: var(--accent); }
.life-tile.editing .life-tile-label { flex: 1; min-width: 0; text-align: left; white-space: normal; line-height: 1.15; }
.life-tile-edit { display: flex; align-items: center; gap: 0.35rem; }
.life-tile-edit button { width: 2.4rem; height: 2rem; padding: 0; font-size: 1.2rem; background: rgba(15, 16, 19, 0.85); }
.life-tile-edit b { min-width: 2ch; text-align: center; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px #000; }
.life-tile.hot .life-tile-edit b { color: #ff8a7a; }
.life-tile-ok { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.life-tile-partner { padding: 0.25rem 0.55rem; font-size: 0.78rem; background: rgba(15, 16, 19, 0.85); border-style: dashed; }
