/* ============================================================
   home.css — the home button, the roster page, and the character cards
   ============================================================ */

/* ─── HOME BUTTON ────────────────────────────────────────── */
/* Outside #char-summary, which is hidden for a GM with nobody selected — the
   way back to your characters must never disappear with it. */
#home-btn {
  font-size: 17px;
  line-height: 1;
  margin-right: -8px; /* against the header's 20px gap: sits closer to the name */
}

/* ─── HOME SCREEN — THE CHARACTER ROSTER ─────────────────── */
/* A page in front of the app, not a panel inside it: picking a character is
   what happens before there is an inventory to look at. */
#home-screen {
  position: fixed;
  inset: 0;
  z-index: 400; /* under the modal backdrop (500) — the editor opens over it */
  background:
    radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;  /* the banner across the top, the roster under it */
  align-items: center;
}

/* ─── HOME BANNER ────────────────────────────────────────── */
/* The home screen covers the app header, settings button and all, so the app's
   name and the way into Settings are repeated here. Sticky, so a long roster
   scrolls under it rather than away from it. */
.home-banner {
  position: sticky;
  top: 0;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--border2);
  box-shadow: var(--shadow-soft);
}

.home-banner-title {
  font-family: var(--font-title);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--accent);
}

#home-settings-btn { font-size: 15px; line-height: 1; }

.home-inner {
  width: 100%;
  max-width: 980px;
  padding: 32px 28px 60px;
}

.home-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.home-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--gold-line);
  opacity: 0.8;
}

.home-header h1 {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.04em;
  /* On the page ground, not on a panel — so the ground's own ink, and no
     emboss: that highlight is a lit-surface effect and only muddies a dark
     one. The accent still leads the page, in the gold rule underneath. */
  color: var(--on-bg);
}

.home-header-actions { display: flex; align-items: center; gap: 10px; }

.home-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-soft);
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 20px;
}

.home-empty {
  /* Also directly on the ground. Dimmed from the ground's ink rather than
     reaching for --text-dim, which is a panel colour. */
  color: color-mix(in srgb, var(--on-bg) 62%, transparent);
  font-size: 13px;
  padding: 40px 0;
  text-align: center;
}

#home-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ─── CHARACTER CARDS ────────────────────────────────────── */
.char-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 16px 14px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 4px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--emboss-hi);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.char-card.selectable { cursor: pointer; }
.char-card.selectable:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-deep), inset 0 1px 0 var(--emboss-hi);
}
.char-card.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}

.char-card-name {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 400;
  font-weight: 700;
  color: var(--accent);
  padding-right: 28px; /* clear of the ⋯ button */
  overflow-wrap: anywhere;
}

.char-card-level {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.char-card-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.char-card-key {
  flex-shrink: 0;
  width: 44px;
  padding-top: 2px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.char-card-val { color: var(--text); overflow-wrap: anywhere; }

.char-card-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.char-card-badge {
  position: absolute;
  left: 16px;
  bottom: -8px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
}

.char-card-menu-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  font-size: 15px;
  line-height: 1;
  border-radius: 3px;
  color: var(--text-dim);
  transition: background 0.12s, color 0.12s;
}
.char-card-menu-btn:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

#char-card-menu {
  position: fixed;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 3px;
  box-shadow: var(--shadow-deep), inset 0 0 0 1px var(--emboss-hi);
}
#char-card-menu button {
  padding: 7px 12px;
  text-align: left;
  border-radius: 2px;
  font-size: 12px;
  transition: background 0.1s, color 0.1s;
}
#char-card-menu button:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
#char-card-menu button.danger { color: var(--danger); }
#char-card-menu button.danger:hover {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

