/* select.css - character select and the death screen (2026-10-19, the Ember
 * redesign - DESIGN.md). Both are transparent .ed-screen layers over the menu
 * backdrop the canvas draws (EmberBackdrop - its crimson tint for death). */

/* =========================================================================
 * CHARACTER SELECT (ui/CharacterSelectUI.js)
 * ========================================================================= */

.ed-charsel {
  gap: 22px;
  padding: 28px 20px 24px;
  /* The dock below sticks 24 px (the padding) above the window's edge; what
   * scrolls through that strip fades out instead of showing under the dock,
   * and whatever scrolls up past the top edge fades the same way. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 24px), transparent 100%);
}
/* Opened over the live town ([Esc] > Switch character): a scrim dims it. It
 * is its own layer under the screen (CharacterSelectUI mounts it) - drawn on
 * the screen, the edge fade above would fade it too and let the bright town
 * through at both edges. */
.ed-charsel-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 80% at 50% 40%, rgba(12, 9, 13, 0.88), rgba(4, 3, 6, 0.96));
  animation: ed-fade-in var(--ed-slow) var(--ed-ease) both;
}
/* Every click redraws the screen - a redraw does not replay its entrance. */
.ed-charsel-scrim.is-rebuilt,
.ed-charsel.is-rebuilt,
.ed-charsel.is-rebuilt *:not(.ed-spinner) { animation: none !important; }

/* ---- Header: the logo, the account and its Embers ---- */
.ed-charsel__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: ed-rise-in 420ms var(--ed-ease) both;
}
.ed-charsel__header .ed-logo { margin-bottom: 4px; }
/* what waits tomorrow (2026-11-20 - data/Tomorrow.js) */
.ed-charsel__tomorrow {
  margin: -6px 0 0;
  max-width: 560px;
  font-size: calc(14px * var(--ed-fs));
  line-height: 1.5;
  color: var(--ed-text-2);
  text-align: center;
}
.ed-charsel__account {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.ed-charsel__who { display: flex; align-items: baseline; gap: 10px; }
.ed-charsel__who .ed-eyebrow { color: var(--ed-text-3); }
.ed-charsel__who-name { font-size: calc(17px * var(--ed-fs)); font-weight: 600; color: var(--ed-text); letter-spacing: 0.01em; }
.ed-charsel__subtitle { font-size: calc(15px * var(--ed-fs)); color: var(--ed-text-2); letter-spacing: 0.01em; }
.ed-charsel__name { width: 240px; }
.ed-charsel__name .ed-input { text-align: center; }

/* (The Embers pill, .ed-embers, is in base.css.) */

/* ---- Notices: why the screen is back, a lost character, the one question ---- */
.ed-charsel__notices {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(620px, 100%);
}
.ed-charsel-notice {
  position: relative;
  box-sizing: border-box;
  max-width: 620px;
  padding: 10px 16px 10px 36px;
  border: 1px solid;
  border-radius: var(--ed-r-lg);
  font-size: calc(14px * var(--ed-fs));
  line-height: 1.45;
  animation: ed-rise-in 360ms var(--ed-ease) both;
}
.ed-charsel-notice::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.ed-charsel-notice--danger { border-color: rgba(255, 98, 87, 0.42); background: rgba(64, 14, 13, 0.62); color: #ffb4ac; }
.ed-charsel-notice--safe { border-color: rgba(99, 214, 154, 0.40); background: rgba(12, 48, 31, 0.62); color: #aaf0c9; }
/* news, not a warning - the two-slot cut's one-time notice (2026-10-19) */
.ed-charsel-notice--info { border-color: rgba(255, 176, 110, 0.42); background: rgba(56, 34, 16, 0.62); color: var(--ed-gold-200); }

.ed-charsel-ask {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  text-align: center;
}
.ed-charsel-ask__q { font-size: calc(15px * var(--ed-fs)); font-weight: 600; color: var(--ed-text); }
.ed-charsel-ask__hint { font-size: calc(13.5px * var(--ed-fs)); line-height: 1.45; color: var(--ed-text-3); max-width: 480px; }
.ed-charsel-ask__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }

/* ---- An heirloom's card (CharacterSelectUI._buildHeirloom - round 2 part 20b2) ---- */
.ed-charsel-heirloom {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  text-align: center;
  animation: ed-rise-in 360ms var(--ed-ease) both;
}
.ed-charsel.is-rebuilt .ed-charsel-heirloom { animation: none; }
.ed-charsel-heirloom__title {
  font-family: var(--ed-font-display, inherit);
  font-size: calc(17px * var(--ed-fs));
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ed-gold-200);
}
.ed-charsel-heirloom__intro { font-size: calc(14.5px * var(--ed-fs)); line-height: 1.45; color: var(--ed-text); max-width: 520px; }
.ed-charsel-heirloom__rule { font-size: calc(13px * var(--ed-fs)); line-height: 1.45; color: var(--ed-text-3); max-width: 520px; }
.ed-charsel-heirloom__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  width: 100%;
}
.ed-charsel-heirloom__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex: none;
}
.ed-charsel-heirloom__grid {
  display: grid;
  grid-template-columns: repeat(4, 44px);
  gap: 12px 8px;
  padding: 4px 4px 8px;
}
/* a piece: the game's own slot, as a button */
.ed-charsel-heirloom__cell {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ed-charsel-heirloom__cell:disabled { cursor: default; opacity: 0.6; }
.ed-charsel-heirloom__cell { outline: 2px solid transparent; outline-offset: 2px; }
/* the chosen piece: a ring outside the slot (the slot's own border is its tier's) and a mark under it - never colour alone */
.ed-charsel-heirloom__cell.is-selected { outline-color: var(--ed-gold-200, #ffeccc); }
.ed-charsel-heirloom__cell.is-selected::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 0;
  height: 0;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--ed-gold-200, #ffeccc);
}
.ed-charsel-heirloom__cell:focus-visible { outline-color: #fff; }
/* the chosen piece's own item card, in the flow (the backpack's floats) */
.ed-charsel-heirloom__card {
  position: relative;
  text-align: left;
  flex: 0 1 300px;
}
.ed-charsel-heirloom__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 2px; }
.ed-charsel-heirloom__side .ed-charsel-heirloom__row { flex-direction: column; align-items: stretch; width: 100%; }
.ed-charsel-heirloom__working { display: flex; align-items: center; gap: 8px; font-size: calc(13.5px * var(--ed-fs)); color: var(--ed-text-2); }
.ed-charsel-heirloom__warn { max-width: 520px; }

/* ---- Body: the sections ---- */
.ed-charsel__body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(968px, 100%);
}
.ed-charsel__section { display: flex; flex-direction: column; gap: 12px; }
.ed-charsel__section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 30px;
}
.ed-charsel__section-head .ed-section-title { flex: 1; min-width: 0; }
.ed-charsel__note { justify-content: center; font-size: calc(13.5px * var(--ed-fs)); }

/* The hero art, in its well (roster and class cards). */
.ed-charsel-portrait {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--ed-line-faint);
  border-radius: 10px;
  background:
    radial-gradient(ellipse 60% 26% at 50% 86%, rgba(255, 128, 48, 0.20), transparent 70%),
    linear-gradient(180deg, rgba(10, 8, 12, 0.55), rgba(4, 3, 6, 0.75));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.ed-charsel-portrait canvas {
  /* in flow, with the pointer (index.html's absolute, cursor-less rule is
   * the game canvas's alone - #game-canvas) */
  position: static;
  display: block;
  width: 72px;
  height: 72px;
  cursor: inherit;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---- The roster ---- */
.ed-charsel__roster { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.ed-charsel .character-card {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  width: calc(284px * var(--ed-fs)); /* wider with the text size */
  box-sizing: border-box;
  padding: 10px 40px 10px 10px;
  border: 1px solid var(--ed-line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(34, 27, 33, 0.94), rgba(18, 14, 19, 0.95));
  box-shadow: var(--ed-shadow-1);
  cursor: pointer;
  user-select: none;
  transition: transform var(--ed-fast) var(--ed-ease), border-color var(--ed-fast) var(--ed-ease), box-shadow var(--ed-med) var(--ed-ease);
}
.ed-charsel .character-card:hover { transform: translateY(-2px); border-color: rgba(255, 176, 110, 0.48); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 154, 82, 0.12); }
.ed-charsel .character-card.is-current { border-color: rgba(99, 214, 154, 0.50); }
.ed-charsel .character-card.is-armed { border-color: rgba(255, 98, 87, 0.80); box-shadow: 0 0 0 1px rgba(255, 98, 87, 0.35), 0 0 22px rgba(255, 98, 87, 0.22); }
.ed-charsel .character-card.is-pending,
.ed-charsel .character-card.is-retired { cursor: default; }
.ed-charsel .character-card.is-pending:hover,
.ed-charsel .character-card.is-retired:hover { transform: none; }
.ed-charsel .character-card.is-pending { opacity: 0.72; }
.ed-charsel .character-card.is-retired .ed-charsel-portrait { opacity: 0.5; }
.ed-charsel .character-card.is-retired .ed-charsel-portrait::after { content: '?'; position: absolute; font-size: calc(24px * var(--ed-fs)); font-weight: 700; color: var(--ed-text-4); }
.ed-charsel .character-card.is-retired .ed-charsel-portrait { position: relative; }
.character-card__text { display: flex; flex-direction: column; gap: 3px; flex: 1 1 0; min-width: 0; }
.character-card__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.character-card__name { font-size: calc(16px * var(--ed-fs)); font-weight: 600; color: var(--ed-text); white-space: nowrap; }
.character-card__level {
  font-size: calc(13px * var(--ed-fs));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ed-gold-300);
}
.character-card__gear {
  font-size: calc(13px * var(--ed-fs));
  color: var(--ed-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* WHAT EACH HERO WEARS AND CARRIES (2026-11-30 - CharacterSelectUI
   _rosterKit): under the portrait and the words, the four worn pieces in a
   square, then the backpack's two rows of four - small cells of the HUD's
   kind (hud.css .ed-slot), each piece's card on the pointer. */
.character-card__kit { flex-basis: 100%; display: flex; align-items: flex-start; gap: 10px; }
.character-card__worn { display: grid; grid-template-columns: repeat(2, auto); gap: 3px; padding-right: 10px; border-right: 1px solid var(--ed-line-faint); }
.character-card__pack { display: grid; grid-template-columns: repeat(4, auto); gap: 3px; }
.character-card__kit .ed-slot { width: calc(30px * var(--ed-fs)); height: calc(30px * var(--ed-fs)); }
.character-card__kit .ed-slot > canvas { width: calc(24px * var(--ed-fs)); height: calc(24px * var(--ed-fs)); }
/* A saved hero's next goal (round 3 part 27d): one quiet line over the status. */
.character-card__goal { margin-top: 3px; font-size: calc(12.5px * var(--ed-fs)); line-height: 1.3; color: var(--ed-text-3); }
.character-card__status {
  margin-top: 4px;
  font-size: calc(12.5px * var(--ed-fs));
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.character-card__status--idle { color: var(--ed-text-4); }
.ed-charsel .character-card:hover .character-card__status--idle { color: var(--ed-ember-300); }
.character-card__status--current { color: var(--ed-success); }
.character-card__status--danger { color: var(--ed-danger-text); }
.character-card__status--muted { color: var(--ed-text-3); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: calc(12.5px * var(--ed-fs)); }
.character-card__del {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: var(--ed-r);
  background: transparent;
  color: var(--ed-text-4);
  font-size: calc(16px * var(--ed-fs));
  line-height: 1;
  cursor: pointer;
  transition: color var(--ed-fast) var(--ed-ease), background-color var(--ed-fast) var(--ed-ease), border-color var(--ed-fast) var(--ed-ease);
}
.character-card__del:hover { color: var(--ed-danger-text); background: rgba(255, 98, 87, 0.10); border-color: rgba(255, 98, 87, 0.35); }
.character-card__del.is-armed {
  /* armed, it is the card's last row: CONFIRM, the full width */
  position: static;
  flex: 1 0 100%;
  height: 28px;
  padding: 0 8px;
  border-color: rgba(255, 140, 130, 0.8);
  background: linear-gradient(180deg, #ff6a5c, #c9362c);
  color: #fff;
  font-size: calc(11px * var(--ed-fs));
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 0 14px rgba(255, 98, 87, 0.35);
}

/* ---- The class cards ---- */
.ed-charsel__classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(218px * var(--ed-fs)), 1fr)); /* fewer, wider cards at a bigger text size */
  gap: 12px;
}
.ed-class-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px 12px;
  box-sizing: border-box;
  border: 1px solid var(--ed-line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(34, 27, 33, 0.94), rgba(18, 14, 19, 0.95));
  box-shadow: var(--ed-shadow-1);
  cursor: pointer;
  user-select: none;
  transition: transform var(--ed-fast) var(--ed-ease), border-color var(--ed-fast) var(--ed-ease), box-shadow var(--ed-med) var(--ed-ease), background-color var(--ed-med) var(--ed-ease);
}
.ed-class-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 176, 110, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 154, 82, 0.10);
}
.ed-class-card.is-selected {
  border-color: rgba(255, 190, 135, 0.85);
  background: linear-gradient(180deg, rgba(62, 38, 28, 0.95), rgba(26, 16, 16, 0.96));
  box-shadow: 0 0 0 1px rgba(255, 154, 82, 0.55), 0 0 30px rgba(255, 110, 40, 0.28), 0 14px 34px rgba(0, 0, 0, 0.5);
}
.ed-class-card.is-selected .ed-charsel-portrait {
  border-color: rgba(255, 176, 110, 0.30);
  background:
    radial-gradient(ellipse 66% 30% at 50% 86%, rgba(255, 128, 48, 0.42), transparent 72%),
    linear-gradient(180deg, rgba(20, 12, 10, 0.55), rgba(6, 4, 5, 0.8));
}
.ed-class-card__head { display: flex; align-items: center; gap: 12px; }
.ed-class-card__title { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
/* the class's name in the game's own face (2026-10-20: Ember, modernized) */
.ed-class-card__name { font-family: var(--ed-font-display); font-size: calc(18px * var(--ed-fs)); font-weight: 500; color: var(--ed-text); letter-spacing: 0.01em; white-space: nowrap; }
.ed-class-card__name.is-long { font-size: calc(15.5px * var(--ed-fs)); letter-spacing: 0; }
.ed-class-card__desc { margin: 0; font-size: calc(14px * var(--ed-fs)); line-height: 1.5; color: var(--ed-text-2); }
/* its name line and its ultimate (round 2 part 25l2 - data/ClassCards.js) */
.ed-class-card__names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ed-class-card__line { font-size: calc(12.5px * var(--ed-fs)); line-height: 1.3; font-style: italic; color: var(--ed-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-class-card__ult { margin: 0; padding-top: 7px; border-top: 1px solid var(--ed-line); font-size: calc(13px * var(--ed-fs)); line-height: 1.4; color: var(--ed-text-2); }
.ed-class-card__ult-label { font-weight: 600; color: var(--ed-text-3); }
.ed-class-card__ult-name { font-weight: 700; color: var(--ed-gold-200); }

/* HP / ATK / DEF against the strongest class's */
.ed-class-card__stats {
  display: grid;
  grid-template-columns: calc(30px * var(--ed-fs)) 1fr calc(28px * var(--ed-fs));
  align-items: center;
  gap: 4px 8px;
}
.ed-stat__label { font-size: calc(12px * var(--ed-fs)); font-weight: 600; letter-spacing: 0.02em; color: var(--ed-text-3); }
.ed-stat__bar { height: 6px; overflow: hidden; border-radius: 3px; background: rgba(255, 236, 214, 0.08); }
.ed-stat__fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #e2581c, #ff9a52 60%, #ffd08a); }
.ed-stat__value { font-size: calc(13px * var(--ed-fs)); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--ed-text); }

/* a locked class: a padlock in its portrait's corner */
.ed-class-card.is-locked .ed-charsel-portrait::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 11px;
  color: rgba(255, 236, 214, 0.72);
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 100% 6px no-repeat,
    radial-gradient(circle at 50% 100%, transparent 1.8px, currentColor 2px, currentColor 3.6px, transparent 3.8px) 50% 0 / 100% 6px no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

/* locked: IN COLOR (round 2 part 25l1 - the plan's screen 2: "classes on one
 * shelf, in color even when locked"). The art, the name, the words and the
 * bars of a locked class are drawn as an unlocked one's: a class you do not
 * have yet should look worth having. What says "locked" is the padlock on
 * the portrait, the darker card, the Unlock pill at the foot with its price,
 * and no mastery line. (Until this part the art was greyed and dimmed
 * (grayscale 0.85, brightness 0.62), the name and the words a step dimmer,
 * and the bars grey.) */
.ed-class-card.is-locked { background: linear-gradient(180deg, rgba(26, 21, 26, 0.92), rgba(14, 11, 15, 0.94)); }
.ed-class-card__unlock {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(255, 176, 110, 0.45);
  border-radius: var(--ed-r);
  background: linear-gradient(180deg, rgba(255, 140, 60, 0.14), rgba(255, 110, 40, 0.05));
  color: var(--ed-gold-200);
  font-size: calc(14px * var(--ed-fs));
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color var(--ed-fast) var(--ed-ease), border-color var(--ed-fast) var(--ed-ease), box-shadow var(--ed-med) var(--ed-ease);
}
/* THE STAGE (round 3 part 27g): the saved heroes standing in a row over
 * their cards, the one played last in the middle and in the light. */
.ed-charsel__stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: calc(22px * var(--ed-fs));
  margin-bottom: 12px;
  padding: 8px 20px 12px;
  overflow-x: auto;
  border: 1px solid var(--ed-line-faint);
  border-radius: var(--ed-r-lg);
  background:
    radial-gradient(ellipse 42% 78% at 50% 0%, rgba(255, 176, 104, 0.2), transparent 72%),
    linear-gradient(180deg, rgba(18, 14, 20, 0.15) 0%, rgba(18, 14, 20, 0.15) 62%, rgba(58, 42, 34, 0.55) 62%, rgba(30, 22, 20, 0.7) 100%);
}
.ed-charsel__stage-hero {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 6px 2px;
  border: 1px solid transparent;
  border-radius: var(--ed-r);
  background: none;
  color: var(--ed-text-2);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--ed-fast) var(--ed-ease), transform var(--ed-fast) var(--ed-ease);
}
.ed-charsel__stage-hero canvas { display: block; image-rendering: pixelated; opacity: 0.82; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.55)); transition: opacity var(--ed-fast) var(--ed-ease); }
/* (only the drawing of a hero at the side is dimmed: its words keep their full contrast) */
.ed-charsel__stage-hero:hover, .ed-charsel__stage-hero:focus-visible { border-color: rgba(255, 196, 140, 0.55); transform: translateY(-2px); }
.ed-charsel__stage-hero:hover canvas, .ed-charsel__stage-hero:focus-visible canvas, .ed-charsel__stage-hero.is-last canvas { opacity: 1; }
.ed-charsel__stage-hero.is-last { color: var(--ed-text); }
.ed-charsel__stage-hero.is-last canvas { filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 12px rgba(255, 176, 104, 0.4)); }
.ed-charsel__stage-hero.is-current .ed-charsel__stage-level { color: var(--ed-success); }
.ed-charsel__stage-name { font-family: var(--ed-font-display); font-size: calc(14px * var(--ed-fs)); line-height: 1.2; color: inherit; }
.ed-charsel__stage-level { font-size: calc(12px * var(--ed-fs)); line-height: 1.2; color: var(--ed-gold-200); }
/* A short window has no stage: the cards under it are what it has room for
 * (UiScale.js UI_SHORT_CLASS - in interface pixels, so it follows Interface size). */
.ed-ui-short .ed-charsel__stage { display: none; }
@media (prefers-reduced-motion: reduce) { .ed-charsel__stage-hero { transition: none; } .ed-charsel__stage-hero canvas { transition: none; } .ed-charsel__stage-hero:hover, .ed-charsel__stage-hero:focus-visible { transform: none; } }
/* Your Grudges on the class screen (round 3 part 27f): its name, then the board's line. */
.ed-charsel__grudge { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ed-charsel__grudge-name { color: #ff8094; font-weight: 700; }
.ed-charsel__grudge-line { color: var(--ed-text-2); }
/* A locked class's "Try it in the yard" (round 3 part 27e): a quiet button under the price. */
.ed-class-card__try { margin-top: 8px; min-height: 32px; width: 100%; border: 1px solid var(--ed-line); border-radius: var(--ed-r); background: rgba(0, 0, 0, 0.22); color: var(--ed-text-2); font-size: calc(13px * var(--ed-fs)); font-weight: 600; cursor: pointer; transition: background-color var(--ed-fast) var(--ed-ease), border-color var(--ed-fast) var(--ed-ease), color var(--ed-fast) var(--ed-ease); }
.ed-class-card__try:hover:not(:disabled), .ed-class-card__try:focus-visible { border-color: rgba(255, 196, 140, 0.7); color: var(--ed-gold-200); background: rgba(255, 140, 60, 0.1); }
.ed-class-card__try:disabled { opacity: 0.5; cursor: default; }
.ed-class-card.is-locked:hover .ed-class-card__unlock { border-color: rgba(255, 196, 140, 0.8); background: linear-gradient(180deg, rgba(255, 150, 70, 0.26), rgba(255, 110, 40, 0.1)); box-shadow: 0 0 16px rgba(255, 110, 40, 0.22); }
.ed-class-card.is-unaffordable .ed-class-card__unlock { border-color: var(--ed-line); background: rgba(0, 0, 0, 0.2); color: var(--ed-text-3); box-shadow: none; }
.ed-class-card.is-unaffordable .ed-class-card__unlock .ed-embers__icon { filter: grayscale(1) brightness(0.7); box-shadow: none; }
.ed-class-card.is-busy { cursor: progress; }
.ed-class-card.is-busy .ed-class-card__unlock { color: var(--ed-info); }

/* ---- Auras ---- */
.ed-charsel__auras { display: flex; flex-wrap: wrap; gap: 8px; }
/* Vows (2026-11-16 - data/Vows.js): a toggle each, its rule under its name. */
.ed-charsel__vows-note { margin: 0 0 10px; font-size: calc(14px * var(--ed-fs)); line-height: 1.5; color: var(--ed-text-2); }
.ed-charsel__vow-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-vow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; text-align: left; max-width: 340px; white-space: normal; border-radius: var(--ed-r-lg); }
.ed-vow__name { font-weight: 700; }
.ed-vow__text { font-size: calc(13px * var(--ed-fs)); color: var(--ed-text-3); }
.ed-vow.is-selected .ed-vow__text { color: var(--ed-text-2); }
.ed-charsel__vows-sum { margin: 10px 0 0; font-size: calc(14px * var(--ed-fs)); color: var(--ed-gold-300); }
.ed-aura::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aura, var(--ed-ember-400));
  box-shadow: 0 0 8px var(--aura, var(--ed-ember-400));
}
.ed-aura.is-forsale::after {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-left: -1px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff0cf, #ff9a52 50%, #c2410c);
}
.ed-aura.is-owned { color: var(--ed-text); border-color: rgba(255, 176, 110, 0.45); }
.ed-aura.is-locked { opacity: 0.55; cursor: default; }
.ed-aura.is-locked::before, .ed-aura.is-locked::after { filter: grayscale(0.7); box-shadow: none; }

/* ---- The action dock: stays in view while the screen scrolls ---- */
.ed-charsel__dock {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  width: min(968px, 100%);
  box-sizing: border-box;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--ed-line-strong);
  border-radius: 14px;
  /* opaque: the cards scrolling under it must not ghost through */
  background: linear-gradient(180deg, #241c22, #130f14);
  box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.42), var(--ed-shadow-2);
}
.ed-charsel__dock::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 170, 90, 0.75), transparent);
  pointer-events: none;
}
.ed-charsel__dock-side { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ed-charsel__dock-side--end { margin-left: auto; justify-content: flex-end; }
.ed-charsel__pick { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; margin-right: 6px; }
.ed-charsel__pick-label { font-size: calc(12.5px * var(--ed-fs)); font-weight: 600; letter-spacing: 0.01em; color: var(--ed-text-3); }
.ed-charsel__pick-name { font-family: var(--ed-font-display); font-size: calc(19px * var(--ed-fs)); font-weight: 500; color: var(--ed-gold-200); }

/* ---- The foot: the keys, and the account's way out ---- */
.ed-charsel__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(968px, 100%);
}
.ed-charsel__help {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-size: calc(13px * var(--ed-fs));
  color: var(--ed-text-3);
}
.ed-charsel__help-item { display: inline-flex; align-items: center; gap: 5px; }
.ed-charsel__help-item .ed-kbd { color: var(--ed-text-2); border-color: var(--ed-line-strong); }
.ed-charsel__delete-account.ed-btn { color: rgba(255, 160, 150, 0.82); font-size: calc(13px * var(--ed-fs)); }
.ed-charsel__delete-account.ed-btn:hover { color: var(--ed-danger-text); border-color: rgba(255, 98, 87, 0.4); background: rgba(255, 98, 87, 0.08); }
/* In a frame (the itch page) there is no delete, only where to do it
 * (2026-11-12, services/FrameGuard.js rule 2): under the roster, and at the
 * foot where Delete account was. */
.ed-charsel__framed-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: calc(13px * var(--ed-fs));
  color: var(--ed-text-3);
}
.ed-charsel__foot .ed-charsel__framed-note { margin: 0; }

/* DELETE ACCOUNT's confirm */
.ed-charsel-danger {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(440px, 100%);
  padding: 16px 20px;
  border-color: rgba(255, 98, 87, 0.45);
  background: linear-gradient(180deg, rgba(48, 16, 16, 0.95), rgba(24, 9, 10, 0.96));
  text-align: center;
  animation: ed-pop-in 220ms var(--ed-ease) both;
}
.ed-charsel-danger__title { font-size: calc(15px * var(--ed-fs)); font-weight: 700; color: #ffc6bf; }
.ed-charsel-danger__warn { font-size: calc(13.5px * var(--ed-fs)); line-height: 1.5; color: #ff9f95; }
.ed-charsel-danger__pw { width: 240px; text-align: center; }
.ed-charsel-danger__err:empty { display: none; }
.ed-charsel-danger__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* "Signing back in" (the inert screen) */
.ed-charsel__waiting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: calc(15px * var(--ed-fs));
  color: var(--ed-info);
}

@media (max-width: 700px) {
  .ed-charsel { padding: 20px 12px 24px; } /* the bottom 24 px stays: the edge fade */
  .ed-charsel .character-card { width: 100%; }
  .ed-charsel__dock { justify-content: center; }
  .ed-charsel__dock-side--end { margin-left: 0; justify-content: center; }
  .ed-charsel__pick { display: none; }
}

/* =========================================================================
 * THE DEATH SCREEN (ui/DeathScreenUI.js)
 * ========================================================================= */

.ed-death { padding: 32px 16px; }
.ed-death__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px; /* (22 until the story and what you keep came - 2026-11-14) */
  width: min(480px, 100%);
}
.ed-death__title {
  margin: 0;
  white-space: nowrap;
  font-family: var(--ed-font-display);
  font-weight: 500;
  font-size: 64px; /* a title, like the logo - it does not follow the text size */
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  background: linear-gradient(180deg, #ffe7de 0%, #ff9f8e 32%, #ef4a3a 66%, #8e1b14 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(58, 4, 4, 0.92)) drop-shadow(0 0 26px rgba(230, 40, 30, 0.45));
  animation: ed-death-in 1100ms var(--ed-ease) both;
}
@keyframes ed-death-in {
  0% { opacity: 0; transform: scale(1.06); letter-spacing: 0.12em; }
  100% { opacity: 1; transform: none; letter-spacing: 0.05em; }
}
.ed-death__sub {
  margin-top: -8px;
  font-size: calc(14px * var(--ed-fs));
  color: rgba(255, 196, 186, 0.62);
  letter-spacing: 0.02em;
  text-align: center;
  animation: ed-fade-in 700ms var(--ed-ease) 350ms both;
}
.ed-death__card {
  box-sizing: border-box;
  width: 100%;
  padding: 6px 20px;
  border-color: rgba(255, 110, 100, 0.22);
  background: linear-gradient(180deg, rgba(42, 17, 19, 0.93), rgba(20, 9, 11, 0.95));
  animation: ed-rise-in 520ms var(--ed-ease) 450ms both;
}
.ed-death__card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 16%;
  right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 110, 90, 0.75), transparent);
}
.ed-death__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 140, 130, 0.10);
  font-size: calc(15px * var(--ed-fs));
}
.ed-death__row:last-child { border-bottom: 0; }
.ed-death__key { color: rgba(255, 205, 196, 0.58); }
.ed-death__value {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ed-text);
}
.ed-death__row--embers .ed-death__value { color: var(--ed-gold-300); text-shadow: 0 0 12px rgba(255, 160, 70, 0.35); }
/* the crimson button (base.css .ed-btn--crimson) arrives after the title */
.ed-death .ed-btn--crimson { animation: ed-fade-in 600ms var(--ed-ease) 700ms both; }
@media (max-width: 720px) {
  .ed-death__title { font-size: 40px; }
}

/* The class's mastery on a class card (phase 4a - data/Mastery.js): its
 * rank and a thin bar to the next, at the card's foot. */
.ed-class-card__mastery { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.ed-class-card__mastery-label { flex: 0 0 auto; font-size: calc(13px * var(--ed-fs)); font-weight: 600; color: var(--ed-gold-300); }
.ed-class-card__mastery .ed-stat__bar { flex: 1; }

/* A GUEST (2026-11-12, the guest start): the select screen's line with its
 * Keep your hero button, the log out question, and the death screen's line. */
.ed-charsel-notice--guest {
  display: flex;
  align-items: center;
  gap: 12px;
  border-color: rgba(255, 176, 110, 0.42);
  background: rgba(56, 34, 16, 0.62);
  color: var(--ed-gold-200);
}
.ed-charsel-notice--guest .ed-btn { flex: none; }
.ed-charsel-logout { width: min(calc(520px * var(--ed-fs)), calc(var(--ed-vw, 100vw) - 32px)); }
.ed-charsel-logout .ed-modal__foot { flex-wrap: wrap; }
.ed-charsel-logout__text { margin: 0; line-height: 1.5; color: var(--ed-text-2); }
.ed-death__guest {
  margin: 0;
  font-size: calc(14px * var(--ed-fs));
  line-height: 1.5;
  color: rgba(255, 220, 200, 0.78);
  text-align: center;
}
.ed-death__ways { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* The death screen as a legacy (2026-11-14 - data/DeathStory.js): the life as
   a story, one tip, what the account keeps, Enter's hint. */
.ed-death__story {
  margin: 0;
  font-size: calc(15px * var(--ed-fs));
  line-height: 1.5;
  color: rgba(255, 226, 214, 0.88);
  text-align: center;
  animation: ed-fade-in 700ms var(--ed-ease) 450ms both;
}
.ed-death__tip {
  margin: -8px 0 0;
  font-size: calc(14px * var(--ed-fs));
  line-height: 1.5;
  color: var(--ed-gold-300);
  text-align: center;
}
.ed-death__keeps {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 20px 12px;
  border: 1px solid rgba(255, 200, 120, 0.22);
  border-radius: 12px;
  background: rgba(30, 20, 10, 0.55);
}
.ed-death__keeps-title {
  font-size: calc(13px * var(--ed-fs));
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ed-gold-300);
  margin-bottom: 4px;
}
.ed-death__keeps-line {
  font-size: calc(14px * var(--ed-fs));
  line-height: 1.5;
  color: rgba(255, 226, 214, 0.82);
}
/* what waits tomorrow (2026-11-20 - data/Tomorrow.js) */
.ed-death__tomorrow {
  margin: -8px 0 0;
  max-width: 520px;
  font-size: calc(14px * var(--ed-fs));
  line-height: 1.5;
  color: rgba(255, 226, 214, 0.82);
  text-align: center;
}
.ed-death__again {
  margin-top: -10px;
  font-size: calc(13px * var(--ed-fs));
  color: rgba(255, 196, 186, 0.62);
  text-align: center;
}

/* The wishlist line on the death screen (2026-11-20 - data/Wishlist.js). */
.ed-death__wishlist { margin-top: 10px; text-align: center; font-size: calc(13px * var(--ed-fs)); }
/* The last seconds (2026-11-20 - IMPROVEMENTS_PLAN.md item 6): what hit, for
   how much, and the HP left after each, oldest first. */
.ed-death__hits {
  width: 100%;
  margin-top: -6px;
  text-align: center;
  animation: ed-fade-in 700ms var(--ed-ease) 400ms both;
}
.ed-death__hits-title {
  font-size: calc(12px * var(--ed-fs));
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 196, 186, 0.7);
  margin-bottom: 6px;
}
.ed-death__hits-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.ed-death__hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 84px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 110, 100, 0.25);
  border-radius: 8px;
  background: rgba(42, 17, 19, 0.72);
}
.ed-death__hit-what {
  font-size: calc(13px * var(--ed-fs));
  font-weight: 700;
  color: #ffd2c8;
  white-space: nowrap;
}
.ed-death__hit-left {
  font-size: calc(12px * var(--ed-fs));
  color: rgba(255, 196, 186, 0.66);
  white-space: nowrap;
}
/* A SHORT SCREEN (round 2 part 20b2): a guest's screen (its line and a third
 * button) with the heirloom's line ran past 720 px, the Enter hint off the
 * bottom edge. Under 780 px the stack closes up; everything is still there. */
@media (max-height: 780px) {
  .ed-death { padding: 14px 16px; }
  .ed-death__stack { gap: 10px; }
  .ed-death__title { font-size: 52px; }
  .ed-death__sub { margin-top: -4px; }
  .ed-death__tip { margin-top: -4px; }
  .ed-death__again { margin-top: -4px; }
  .ed-death__ways { gap: 8px 12px; }
}
