/**
 * =========================================================
 * FILE: general_style.css
 * PROJECT: Skyrim Character Combat Optimization System
 * AUTHOR: C.J. Wiebe
 * DATE: April 2026
 * =========================================================
 * DESCRIPTION:
 * Sets a standard style for the entire website, ensuring a consistent look and feel.
 * =========================================================
 */

/* ===================== SKYRIM ROOT DESIGN SYSTEM ===================== */
:root {
  /* Root Colors */
  --skyrim-gold: rgb(255, 201, 26);
  --skyrim-gold-shadow: rgba(255, 201, 26, 0.4);
  --skyrim-gold-soft: #c2a46b;
  --skyrim-dark: #0f0f0f;
  --skyrim-darker: #080808;
  --skyrim-card: rgba(30, 30, 30, 0.85);
  --skyrim-glass: rgba(0, 0, 0, 0.585);
  --skyrim-danger: rgb(223, 86, 84);
  --skyrim-danger-shadow: rgba(223, 86, 84, 0.4);
  --skyrim-info: rgb(0, 217, 255, 0.856);
  --skyrim-info-shadow: rgba(0, 217, 255, 0.4);
  --skyrim-create: rgba(94, 255, 0, 0.856);
  --skyrim-create-shadow: rgba(94, 255, 0, 0.4);

  --text-main: #f5e2b2;
  --text-muted: #dbc9a6;

  /* ROOT PROPERTIES */
  --radius: 0.75rem;
  --spacing: 1.5rem;

/* ===================== FONT SIZES ===================== */

  --font-xs: 0.75rem; /* small labels */
  --font-sm: 0.875rem; /* secondary text */
  --font-md: 1rem; /* base text */
  --font-lg: 1.25rem; /* subtitles */
  --font-xl: 1.75rem; /* section titles */
  --font-xxl: 4rem; /* page titles */

  /* Optional Skyrim feel */
  --font-title: "Cinzel", serif;
  --font-body: "Segoe UI", sans-serif;
}

/* ===================== TYPOGRAPHY ===================== */

.text-xs {
  font-size: var(--font-xs);
}
.text-sm {
  font-size: var(--font-sm);
}
.text-md {
  font-size: var(--font-md);
}
.text-lg {
  font-size: var(--font-lg);
}
.text-xl {
  font-size: var(--font-xl);
}
.text-xxl {
  font-size: var(--font-xxl);
}

/* Titles */
.title-main {
  font-size: var(--font-xxl);
  font-family: var(--font-title);
  letter-spacing: 1px;
}

.title-section {
  font-size: var(--font-xl);
  font-family: var(--font-title);
}

/* Subtext */
.text-muted-custom {
  font-size: var(--font-xl);
  opacity: 0.8;
}

/* ===================== GLOBAL RESET ===================== */
body {
  background: var(--skyrim-dark);
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: var(--text-main);
  transition: 0.2s ease;
}

a:hover {
  color: var(--skyrim-gold);
}

/* ===================== LAYOUT ===================== */
.main-container {
  background: var(--skyrim-glass);
  padding: var(--spacing);
  border-radius: var(--radius);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

/* ===================== SECTION TITLES ===================== */
.section-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--skyrim-gold);
  letter-spacing: 0.5px;
}

/* ===================== CARDS ===================== */
.card,
.dashboard-card {
  background: var(--skyrim-card);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  transition: all 0.25s ease;
}

.card:hover,
.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

/* ===================== BUTTONS ===================== */
.btn {
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background: transparent;
  border: 1px solid var(--skyrim-gold);
  color: var(--skyrim-gold);
}

.btn-primary:hover {
  background: var(--skyrim-gold);
  color: black;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* ===================== NAVBAR ===================== */
.navbar {
  background: var(--skyrim-glass) !important;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Brand */
.navbar-brand {
  color: var(--skyrim-gold) !important;
  letter-spacing: 1px;
}

/* Nav Links */
.nav-link {
  color: var(--text-main) !important;
  position: relative;
  padding: 6px 10px;
  border-radius: 6px;
}

/* Hover Effect */
.nav-link:hover {
  color: var(--skyrim-gold) !important;
  background: rgba(212, 175, 55, 0.1);
}

/* Underline Animation */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--skyrim-gold);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Active Page */
.nav-link.active {
  color: var(--skyrim-gold) !important;
  font-weight: 600;
}

/* Dropdown */
.dropdown-menu {
  background: #121212;
  border: 1px solid var(--skyrim-gold-soft);
}

.dropdown-item {
  color: var(--text-main);
}

.dropdown-item:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #fff;
}

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--skyrim-glass);
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--text-muted);
}

.site-footer h5,
.site-footer h6 {
  color: var(--skyrim-gold);
}

.site-footer {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--skyrim-gold);
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

/* ===================== UTILITIES ===================== */
.shadow-soft {
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

.rounded-custom {
  border-radius: var(--radius);
}

.text-muted-custom {
  color: var(--text-muted);
}

/* ===================== NAVBAR RESPONSIVE ===================== */
@media (max-width: 768px) {
  .nav-link {
    text-align: center;
    margin: 0.25rem 0;
  }
}

/* ===================== TABLE RESPONSIVE ===================== */
table-responsive {
 border-radius: var(--radius);
 overflow: hidden;
 box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}


/* ===================== SKYRIM TABLE ===================== */

.table-skyrim {
  width: 100%;
  background: var(--skyrim-card);
  color: var(--text-main);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

/* Header */
.table-skyrim thead {
  background: rgba(0, 0, 0, 0.92);
}

.table-skyrim thead th {
  color: var(--skyrim-gold);
  font-weight: 600;
  padding: 0.9rem;
  border-bottom: 2px solid rgba(212, 175, 55, 0.35);
  border-right: 1px solid rgba(212, 175, 55, 0.15);
  letter-spacing: 0.5px;
}

/* Cells */
.table-skyrim td {
  padding: 0.75rem;
  border-right: 1px solid rgba(212, 175, 55, 0.12);
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

/* Alternating row colours */
.table-skyrim tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.table-skyrim tbody tr:nth-child(even) {
  background: rgba(212, 175, 55, 0.04);
}

/* Hover effect */
.table-skyrim tbody tr:hover {
  background: rgba(212, 175, 55, 0.12);
  box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.15);
}

/* Remove last borders */
.table-skyrim td:last-child,
.table-skyrim th:last-child {
  border-right: none;
}

/* ===================== TABLE FOOTER ===================== */

.table-skyrim tfoot {
  background: rgba(0, 0, 0, 0.9);
}

.table-skyrim tfoot td {
  padding: 0.75rem;
  font-weight: 600;
  color: var(--skyrim-gold);
  border-top: 2px solid rgba(212, 175, 55, 0.35);
}

/* ===================== SKYRIM-THEMED ACTION BUTTONS ===================== */

.skyrim-action-card {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius);
  transition: all 0.25s ease;
  text-align: center;
}

.skyrim-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

.skyrim-action-card-info {
  background: rgba(0, 0, 0, 0.75);
  border: 1px var(--skyrim-info);
  border-radius: var(--radius);
  transition: all 0.25s ease;
  text-align: center;
}

.skyrim-action-card-info:hover {
  transform: translateY(-3px);
  box-shadow: var(--skyrim-info);
}

/* Shared button style */
.skyrim-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.25s ease;
}

/* Update (gold) */
.skyrim-btn-update {
  border: 1px solid var(--skyrim-gold);
  color: var(--skyrim-gold);
  background: transparent;
}

.skyrim-btn-update:hover {
  background: var(--skyrim-gold);
  color: var(--skyrim-dark);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Info (green) */
.skyrim-btn-create {
  border: 1px solid var(--skyrim-create);
  color: var(--skyrim-create);
  background: transparent;
}


.skyrim-btn-create:hover {
  background: var(--skyrim-create);
  color: var(--skyrim-dark);
  box-shadow: 1px solid var(--skyrim-create-shadow);
}

/* Info (blue) */
.skyrim-btn-info {
  border: 1px solid var(--skyrim-info);
  color: var(--skyrim-info);
  background: transparent;
}

.skyrim-btn-info:hover {
  background: var(--skyrim-info);
  color: var(--skyrim-dark);
  box-shadow: 1px solid var(--skyrim-info-shadow);
}

/* Delete (red but muted) */
.skyrim-btn-delete {
  border: 1px solid var(--skyrim-danger);
  color: var(--skyrim-danger);
  background: transparent;
}

.skyrim-btn-delete:hover {
  background: var(--skyrim-danger);
  color: var(--skyrim-dark);
  box-shadow: 1px solid var(--skyrim-danger-shadow);
}

/* ===================== SKYRIM-THEMED SMALL BUTTONS ===================== */

.btn-skyrim-sm {
  display: inline-block;
  padding: 4px 10px;
  font-size: var(--font-xs);
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--skyrim-gold);
  background: rgba(0, 0, 0, 0.6);
}

/* Hover glow */
.btn-skyrim-sm:hover {
  background: rgba(212, 175, 55, 0.15);
  color: #fff;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

/* Variants */

/* Primary (gold) */
.btn-skyrim-sm.primary {
  border-color: var(--skyrim-gold);
}

/* Secondary (muted) */
.btn-skyrim-sm.secondary {
  border-color: rgba(200, 200, 200, 0.3);
  color: #ccc;
}

/* Danger (delete) */
.btn-skyrim-sm.danger {
  border-color: #a94442;
  color: #e57373;
}

.btn-skyrim-sm.danger:hover {
  background: #a94442;
  color: white;
  box-shadow: 0 0 6px rgba(255, 80, 80, 0.4);
}

/* ===================== SKYRIM-THEMED FILTER PANEL ===================== */

.skyrim-filter {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

/* Labels */
.skyrim-filter .form-label {
  color: var(--skyrim-gold);
  font-size: var(--font-xs);
  margin-bottom: 0.25rem;
}

/* Inputs */
.skyrim-filter .form-select {
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-main);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  font-size: var(--font-sm);
}

/* Focus */
.skyrim-filter .form-select:focus {
  border-color: var(--skyrim-gold);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

/* Button */
.skyrim-filter .btn {
  background: transparent;
  border: 1px solid var(--skyrim-gold);
  color: var(--skyrim-gold);
  font-size: var(--font-sm);
}

.skyrim-filter .btn:hover {
  background: var(--skyrim-gold);
  color: black;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* ===================== SKYRIM-THEMED TITLE SCREEN ===================== */

.skyrim-title-screen {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;

  /* your background */
  /* was skyrim_bg.jpg, which does not exist in assets/images — pointed at the
     background image that does. This class is not currently used by any page. */
  background: url('../images/skyrim_background.jpg') center/cover no-repeat;
}

.skyrim-title-container {
  display: flex;
  flex-direction: column;
  align-items: center;

  background: rgba(0, 0, 0, 0.6);
  padding: 3rem;
  border-radius: 1rem;
  backdrop-filter: blur(6px);
}

.skyrim-title-logo {
  width: 120px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 8px var(--skyrim-gold));
  animation: float 3s ease-in-out infinite;
}

.skyrim-title-main {
  font-size: var(--font-xxl);
  letter-spacing: 2px;
  color: var(--skyrim-gold);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
  margin-bottom: 0.5rem;
}

.skyrim-title-sub {
  font-size: var(--font-md);
  opacity: 0.8;
  animation: pulse 2s infinite alternate;
}

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
/* ==========================================================================
   REFINEMENTS — September 2026
   Appended rather than edited into the rules above, so the original styling
   stays intact and everything here can be removed in one block if unwanted.
   Same palette and same gold; this is spacing, hierarchy and focus work.
   ========================================================================== */

/* ---------- focus: was invisible, which made keyboard use guesswork ------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.skyrim-btn:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--skyrim-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip past the navbar with a keyboard. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--skyrim-gold);
  color: #000;
  padding: 0.6rem 1rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  color: #000;
}

/* ---------- forms: a readable column, consistent rhythm ------------------ */
.form-column {
  max-width: 44rem;
  margin-inline: auto;
}

.lede {
  font-size: 1.05rem;
  opacity: 0.85;
  margin-bottom: 1.75rem;
}

.field { margin-bottom: 1.1rem; }

/* Two fields side by side above phone width, stacked below. */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
@media (max-width: 620px) {
  .field-row { grid-template-columns: 1fr; }
}

.form-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1rem;
  color: var(--text-main);
  opacity: 0.9;
}

.field-hint {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.form-control,
.form-select {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: var(--text-main);
  padding: 0.55rem 0.75rem;
}
.form-control:focus,
.form-select:focus {
  background: rgba(0, 0, 0, 0.55);
  border-color: var(--skyrim-gold);
  color: var(--text-main);
  box-shadow: none;
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.5; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.form-footnote { margin-top: 2rem; font-size: 1rem; }

/* ---------- grouped panels: one job per panel ---------------------------- */
.inset-panel {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1.75rem 0;
}
.inset-danger { border-color: rgba(223, 86, 84, 0.35); }

.panel-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--skyrim-gold);
  margin: 0 0 0.85rem;
  padding: 0;
  float: none;
  width: auto;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 0.25rem 0 0.25rem 1.1rem; position: relative; }
.plain-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--skyrim-gold);
}

/* ---------- status pills ------------------------------------------------- */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid currentColor;
}
.status-warn { color: #e8bc4b; }
.status-good { color: #8cc79e; }

/* ---------- the destructive corner, visibly separated -------------------- */
.danger-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(223, 86, 84, 0.35);
  border-left: 3px solid var(--skyrim-danger);
  border-radius: var(--radius);
  background: rgba(223, 86, 84, 0.06);
}
.danger-zone .panel-title { color: var(--skyrim-danger); margin-bottom: 0.3rem; }

/* ---------- buttons: one loud action per view ---------------------------- */
.btn-compact { padding: 0.4rem 0.9rem; font-size: 0.95rem; }

/* A text-weight action, for "Cancel" and "Forgot your password?" — these
   were competing with the real button when styled as buttons. */
.btn-link-quiet {
  background: none;
  border: 0;
  padding: 0.35rem 0;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-link-quiet:hover { color: var(--skyrim-gold); }

/* ---------- table row actions -------------------------------------------- */
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.btn-row {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  font-size: 0.88rem;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 4px;
  color: var(--text-main);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-row:hover {
  border-color: var(--skyrim-gold);
  color: var(--skyrim-gold);
  background: rgba(212, 175, 55, 0.08);
}
.btn-row-danger { border-color: rgba(223, 86, 84, 0.45); }
.btn-row-danger:hover {
  border-color: var(--skyrim-danger);
  color: var(--skyrim-danger);
  background: rgba(223, 86, 84, 0.1);
}

/* ---------- inventory quantity stepper ----------------------------------- */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.qty-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 4px;
  background: transparent;
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.qty-btn:hover {
  border-color: var(--skyrim-gold);
  color: var(--skyrim-gold);
  background: rgba(212, 175, 55, 0.08);
}
.qty-btn-danger {
  font-size: 0.85rem;
  border-color: rgba(223, 86, 84, 0.4);
}
.qty-btn-danger:hover {
  border-color: var(--skyrim-danger);
  color: var(--skyrim-danger);
  background: rgba(223, 86, 84, 0.1);
}
.qty-value {
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 600;
}

/* ---------- tables: denser, and scrollable instead of page-breaking ------ */
.table-skyrim td,
.table-skyrim th { padding: 0.5rem 0.7rem; }
.table-skyrim td { font-size: 0.95rem; }

/* Numeric columns line up when the digits are tabular. */
.table-skyrim td:nth-child(n + 2):nth-child(-n + 6) { font-variant-numeric: tabular-nums; }

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
/* The page itself must never scroll sideways, whatever a table does. */
body { overflow-x: hidden; }

.result-count {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  color: var(--text-muted);
}
.scroll-hint {
  font-size: 0.85rem;
  opacity: 0.6;
  margin: 0 0 0.75rem;
}
@media (min-width: 992px) { .scroll-hint { display: none; } }

/* ---------- toasts ------------------------------------------------------- */
.toast-host {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(24rem, calc(100vw - 2.5rem));
}
.skyrim-toast {
  background: #14130f;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-left: 3px solid var(--skyrim-gold);
  border-radius: var(--radius);
  color: var(--text-main);
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  animation: toast-in 0.22s ease-out;
}
.skyrim-toast-danger { border-left-color: var(--skyrim-danger); }
.skyrim-toast.is-leaving { opacity: 0; transition: opacity 0.35s ease; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .skyrim-toast { animation: none; }
  .skyrim-toast.is-leaving { transition: none; }
}

/* ---------- title sizing: 4rem was overwhelming on a phone -------------- */
.title-main {
  font-size: clamp(1.9rem, 1.1rem + 3.4vw, var(--font-xxl));
  line-height: 1.12;
  text-wrap: balance;
}
.text-muted-custom { font-size: clamp(1rem, 0.92rem + 0.4vw, var(--font-lg)); }

/* Keep a gutter at every width. */
@media (max-width: 576px) {
  .main-container { padding: 1.1rem !important; }
  .container { padding-inline: 16px; }
}

/* .skyrim-btn is display:block/width:100% by design — right for the big home
   action cards, wrong inside a form, where it turns every button into a full
   width bar and erases the primary/secondary distinction. Scope it back. */
.form-actions .skyrim-btn,
.panel-head .skyrim-btn,
.danger-zone .skyrim-btn,
.btn-compact {
  display: inline-block;
  width: auto;
}

/* The primary action in a form reads as filled; the rest stay outlined. */
.form-actions .skyrim-btn-update,
.form-actions .skyrim-btn-create {
  background: var(--skyrim-gold);
  color: var(--skyrim-dark);
  border-color: var(--skyrim-gold);
  font-weight: 600;
}
.form-actions .skyrim-btn-update:hover,
.form-actions .skyrim-btn-create:hover {
  background: #ffd84d;
  border-color: #ffd84d;
  color: var(--skyrim-dark);
}

/* Except the destructive one, which stays outlined until deliberately chosen. */
.form-actions .skyrim-btn-delete,
.danger-zone .skyrim-btn-delete {
  background: transparent;
  color: var(--skyrim-danger);
  border: 1px solid var(--skyrim-danger);
  font-weight: 600;
}
.form-actions .skyrim-btn-delete:hover,
.danger-zone .skyrim-btn-delete:hover {
  background: var(--skyrim-danger);
  color: #fff;
}

/* ---------- footer profile links ----------------------------------------- */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0.6rem 0 0;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 1px;
}
.footer-links a:hover {
  color: var(--skyrim-gold);
  border-bottom-color: var(--skyrim-gold);
}

/* ==========================================================================
   CHARACTER SHEET
   ========================================================================== */

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.sheet-head h1 { margin: 0; }
.sheet-head p { margin: 0.2rem 0 0; font-size: 1rem; }
.sheet-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

.sheet-section {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.section-head .panel-title { margin-bottom: 0.4rem; }

.points-left {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--skyrim-gold);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  white-space: nowrap;
}

/* ---------- the at-a-glance strip ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius);
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--skyrim-gold);
  font-variant-numeric: tabular-nums;
}
.stat-foot { font-size: 0.8rem; color: var(--text-muted); opacity: 0.8; }

/* ---------- attributes ---------- */
.attr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.attr-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius);
}

/* ---------- carry meter ---------- */
.carry-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  margin: 0.75rem 0 0.4rem;
}
.carry-over { color: var(--skyrim-danger); font-weight: 600; }
.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.25);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: var(--skyrim-gold);
  transition: width 0.25s ease;
}
.meter-fill.is-over { background: var(--skyrim-danger); }
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } }

/* ---------- skills ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.5rem 1.25rem;
  margin-top: 1rem;
}
.skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
/* The five skills that actually drive weapon and armour numbers. */
.skill-row-combat {
  border-color: rgba(212, 175, 55, 0.22);
  background: rgba(212, 175, 55, 0.04);
}
.skill-name { margin: 0; display: flex; align-items: baseline; gap: 0.45rem; }
.race-bonus {
  font-size: 0.72rem;
  color: var(--skyrim-gold);
  opacity: 0.85;
  white-space: nowrap;
}
.skill-input {
  width: 4.5rem;
  text-align: right;
  padding: 0.25rem 0.45rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 4px;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* ---------- perks ---------- */
.perk-tree { margin-top: 1.5rem; }
.perk-tree-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--skyrim-gold);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
}
.perk-tree-title .text-m { font-size: 0.85rem; }
.perk-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 0.5rem;
}
.perk {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
}
.perk.is-taken {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.07);
}
.perk-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.perk-name { font-weight: 600; }
.perk-rank {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--skyrim-gold);
  font-variant-numeric: tabular-nums;
}
.perk-desc { font-size: 0.88rem; color: var(--text-muted); }
.perk-req { font-size: 0.78rem; color: var(--text-muted); opacity: 0.7; }

.cell-strong { font-weight: 700; color: var(--skyrim-gold); font-variant-numeric: tabular-nums; }

.sheet-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.sheet-save .skyrim-btn { display: inline-block; width: auto; }
.sheet-save .skyrim-btn-update {
  background: var(--skyrim-gold);
  color: var(--skyrim-dark);
  font-weight: 600;
}
.sheet-save .skyrim-btn-delete { margin-left: auto; }

/* .tablewrap is the sheet's scroll container for wide tables. Without it the
   gear tables pushed the whole page sideways on a phone. */
.tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  margin-top: 0.6rem;
}

/* auto-fit tracks keep their minimum even when the container is narrower than
   it, which overflows on a phone. min() lets the track shrink instead. */
.stat-strip { grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); }
.attr-grid  { grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); }
.skill-grid { grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.perk-list  { grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }

@media (max-width: 520px) {
  .sheet-save .skyrim-btn-delete { margin-left: 0; }
  .perk { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .perk .qty-control { justify-content: flex-end; }
}

/* ==========================================================================
   MY CHARACTERS — the roster, as cards rather than a wide table
   ========================================================================== */

.roster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 1rem;
}
.roster-head h1 { margin: 0; }
.roster-head p { margin: 0.25rem 0 0; font-size: 1rem; }
.roster-head .skyrim-btn { display: inline-block; width: auto; }

/* The sort controls sit on one line and wrap, rather than filling a grid row. */
.roster-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 1.5rem 0 1.75rem;
}
.roster-tool { display: flex; flex-direction: column; gap: 0.25rem; }
.roster-tool .form-label { margin: 0; }
.roster-tool .form-select { min-width: 12rem; }
.roster-tools .btn-row { padding: 0.5rem 1.1rem; }

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: 1.1rem;
}

.char-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.15rem 1.25rem 1.25rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.char-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .char-card { transition: none; }
  .char-card:hover { transform: none; }
}

.char-card-head { display: flex; flex-direction: column; gap: 0.3rem; }

/* Number and race are the quiet line; the name is what you scan for. */
.char-card-id {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.char-number {
  padding: 0.08rem 0.4rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.char-race { letter-spacing: 0.08em; }

.char-name {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--skyrim-gold);
  overflow-wrap: anywhere;
}

.char-vitals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 0;
}
.char-vitals .vital {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.2rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 6px;
}
.char-vitals dt {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
}
.char-vitals dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}
.char-vitals .vital-level dd   { color: var(--skyrim-gold); }
.char-vitals .vital-health dd  { color: #e08d8b; }
.char-vitals .vital-magicka dd { color: #8fc7e8; }
.char-vitals .vital-stamina dd { color: #9fcf9f; }

/* One way in, so the card has a single obvious action. */
.char-open {
  display: block;
  margin-top: auto;
  padding: 0.5rem 0.9rem;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  color: var(--skyrim-gold);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.06);
}
.char-open:hover {
  color: var(--skyrim-dark);
  background: var(--skyrim-gold);
  border-color: var(--skyrim-gold);
  box-shadow: 0 0 12px var(--skyrim-gold-shadow);
}

.char-empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border: 1px dashed rgba(212, 175, 55, 0.25);
  border-radius: var(--radius);
}
.char-empty .skyrim-btn { display: inline-block; width: auto; }

@media (max-width: 380px) {
  .char-vitals { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- the character sheet's own "add an item" row ------------------ */
.inv-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.inv-add .form-label { margin: 0 0 0.25rem; }
.inv-add-item { flex: 1 1 18rem; min-width: 0; }
.inv-add-qty  { flex: 0 0 6rem; }
.inv-add .skyrim-btn { display: inline-block; width: auto; }

/* ==========================================================================
   REFERENCES PAGE
   ========================================================================== */

/* The lede sits under the title and stays narrow so it reads as one thought. */
.ref-lede {
  max-width: 60ch;
  margin: 0.75rem auto 0;
  text-align: center;
}

/* Jump chips: five groups is enough that scanning beats scrolling. */
.ref-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.75rem 0 0.5rem;
}
.ref-jump a {
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ref-jump a:hover,
.ref-jump a:focus-visible {
  color: var(--skyrim-gold);
  border-color: var(--skyrim-gold);
}

/* Each group is a titled band, matching the character sheet's section rhythm. */
.ref-group { scroll-margin-top: 5rem; }
.ref-group-note {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr));
  gap: 1.1rem;
}

.ref-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.15rem 1.25rem 1.2rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.ref-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .ref-card { transition: none; }
  .ref-card:hover { transform: none; }
}

/* A quiet uppercase tag tells you what kind of source this is at a glance. */
.ref-kind {
  align-self: flex-start;
  padding: 0.1rem 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ref-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--skyrim-gold);
  overflow-wrap: anywhere;
}

.ref-byline {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-main);
}

.ref-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.75;
}

/* The link is the card's one action, pinned to the bottom so cards align. */
.ref-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--skyrim-gold);
  overflow-wrap: anywhere;
}
.ref-link span { border-bottom: 1px solid rgba(212, 175, 55, 0.35); }
.ref-link:hover span,
.ref-link:focus-visible span { border-bottom-color: var(--skyrim-gold); }
.ref-link::after {
  content: "\2197";
  font-size: 0.9em;
  opacity: 0.7;
}

/* ==========================================================================
   HOME PAGE  (appended 2026-09-14)
   The landing page used to be two buttons on an empty field. It now has to
   explain what the site is, so it needs a hero, a numbered sequence, and a
   row of destinations. Nothing above this block was edited.
   ========================================================================== */

/* ---------- hero ---------------------------------------------------------- */
.home-hero {
  text-align: center;
  max-width: 46rem;
  margin: 0 auto 3rem;
}

/* A quiet line above the title, so the h1 can be the name of the tool
   rather than the name of the game plus the name of the tool. */
.home-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--skyrim-gold-soft);
}

.home-hero .title-main { margin: 0; }

.home-lede {
  margin: 1.1rem auto 0;
  max-width: 40rem;
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-main);
  text-wrap: pretty;
}

.home-cta { margin-top: 1.9rem; }

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* .skyrim-btn is a full-width block by design; here the actions sit side by
   side, so they size to their text like every other inline action. */
.home-cta .skyrim-btn {
  display: inline-block;
  width: auto;
  padding: 0.55rem 1.4rem;
  font-size: 1rem;
}

/* The site's convention: the one primary action is filled gold, whatever its
   colour class; everything beside it stays outlined. */
.home-cta .home-cta-primary {
  background: var(--skyrim-gold);
  border-color: var(--skyrim-gold);
  color: var(--skyrim-dark);
  font-weight: 600;
}
.home-cta .home-cta-primary:hover {
  background: #ffd84d;
  border-color: #ffd84d;
  color: var(--skyrim-dark);
}

.home-welcome {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.home-cta-aside {
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.home-cta-aside a { color: var(--skyrim-gold); }

.home-byline {
  margin: 1.6rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.75;
}

/* ---------- sections ------------------------------------------------------ */
.home-section { margin-top: 2.75rem; }
.home-section > .panel-title { margin-bottom: 1.1rem; }

/* ---------- the four steps ------------------------------------------------ */
.step-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1.1rem;
  counter-reset: none;
}

.step {
  position: relative;
  padding: 1.15rem 1.25rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius);
}

/* The number is decoration — the reading order already carries the sequence,
   because the list is an <ol>. */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  margin-bottom: 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--skyrim-gold);
  background: rgba(212, 175, 55, 0.08);
}

.step-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.step-body {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ---------- destination tiles --------------------------------------------- */
.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: 1.1rem;
}

/* The whole tile is the link, so there is no small target to hunt for. */
.home-tile {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.2rem 1.3rem 1.3rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.home-tile:hover,
.home-tile:focus-visible {
  border-color: rgba(212, 175, 55, 0.45);
  transform: translateY(-2px);
  text-decoration: none;
}

.home-tile-meta {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--skyrim-gold-soft);
}

.home-tile-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--skyrim-gold);
}

.home-tile-body {
  margin: 0;
  flex-grow: 1;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.home-tile-go {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.home-tile:hover .home-tile-go { color: var(--skyrim-gold); }

/* ---------- the closing note ---------------------------------------------- */
.home-note {
  margin: 2.5rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .home-tile { transition: none; }
  .home-tile:hover { transform: none; }
}

/* ---------- spells: the add row, then one block per school -------------- */
.spell-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.spell-add .form-label { margin: 0 0 0.25rem; }
.spell-add-pick { flex: 1 1 22rem; min-width: 0; }
/* Long spell names must not widen the select past the page on a phone —
   this does not lean on Bootstrap's own .form-select width. */
.spell-add-pick .form-select { width: 100%; max-width: 100%; }
.spell-add .skyrim-btn { display: inline-block; width: auto; }

/* A quick read on the spellbook before the per-school detail. */
.spell-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.school-block {
  margin-bottom: 1.75rem;
  padding: 1rem 1rem 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-left: 3px solid var(--skyrim-gold-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
}
.school-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}
.school-head h3 {
  margin: 0;
  font-size: var(--font-lg);
  color: var(--skyrim-gold);
}
.school-count {
  font-size: var(--font-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.school-blurb {
  margin: 0 0 0.75rem;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

/* Tier badge, so a table row reads at a glance. */
.spell-tier {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  color: var(--text-muted);
  white-space: nowrap;
}
.spell-tier-master { color: var(--skyrim-gold); border-color: var(--skyrim-gold); }

.spell-dlc {
  margin-left: 0.35rem;
  font-size: 0.68rem;
  color: var(--skyrim-info);
}

/* A cost the half-cost perk has already paid for. */
.cost-halved { color: var(--skyrim-create); }

/* Too low a skill to have been taught this tier yet. */
.spell-locked { color: var(--skyrim-danger); }

.spell-empty {
  padding: 0.75rem 0;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

/* The working behind a cost, kept quiet so the number reads first. */
.cost-note {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-muted);
  opacity: 0.8;
  white-space: nowrap;
}

/* ==========================================================================
   BROWSE PAGES  (All Items, All Spells)
   A search field, a filter bar that reflows instead of overflowing, and a
   card view for phones — where a ten-column table is not readable at all.
   ========================================================================== */

/* The inner panel used to be a flat .p-5, which is 3rem of padding on a
   360px screen. Scale it with the viewport instead. */
.browse-panel {
  padding: clamp(1rem, 0.35rem + 2.6vw, 3rem);
}

/* ---------- filter bar ---------------------------------------------------- */

/* Flex rather than fixed columns: the items page has four controls and the
   spells page five, and both need to end up one-per-row on a phone. */
.browse-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem 1rem;
  margin: 1.5rem 0 1.25rem;
}

/* Each dropdown claims an equal share of whatever row it lands in, and drops to
   its own row rather than shrinking below a readable width. */
.filter-field { flex: 1 1 11rem; min-width: 0; }

/* Search gets its own full-width row above the dropdowns. */
.filter-field-search { flex: 1 1 100%; }

/* Reset is a button, not a field — it should not take a field's share. */
.filter-field-action { flex: 0 1 9rem; }

.browse-filter .form-label { margin-bottom: 0.25rem; }

.filter-hint {
  margin: 0.35rem 0 0;
  font-size: var(--font-xs);
  color: var(--text-muted);
  opacity: 0.75;
}

/* ---------- the search field --------------------------------------------- */

.search-wrap {
  position: relative;
  display: block;
}

.skyrim-filter .search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-main);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  font-size: var(--font-md);
  /* 16px minimum, or iOS zooms the whole page when the field takes focus. */
  min-height: 2.75rem;
  padding: 0.45rem 2.4rem 0.45rem 0.75rem;
}

.skyrim-filter .search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.55;
}

.skyrim-filter .search-input:focus {
  background: rgba(0, 0, 0, 0.75);
  color: var(--text-main);
  border-color: var(--skyrim-gold);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

/* WebKit draws its own clear button; ours is the one that keeps the state in
   step, so hide theirs rather than showing two. */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.search-clear {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  line-height: 1;
  font-size: 1.35rem;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
}
.search-clear:hover { color: var(--skyrim-gold); background: rgba(212, 175, 55, 0.12); }

/* ---------- the phone card view ------------------------------------------ */

.record-cards {
  display: grid;
  gap: 0.75rem;
}

.record-card {
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-left: 3px solid var(--skyrim-gold-soft);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
}

.record-card-name {
  margin: 0 0 0.4rem;
  font-family: var(--font-title);
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--skyrim-gold);
}

.record-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}

.record-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Stats sit in as many columns as fit, so a dagger with three numbers does not
   leave five empty slots. */
.record-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.75rem, 1fr));
  gap: 0.5rem 0.85rem;
  margin: 0;
}

.record-stat dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.75;
}
.record-stat dd {
  margin: 0;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

/* Perk and upgrade material are reference, not stats — below the rule. */
.record-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0.7rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.record-card-note {
  margin: 0.7rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  font-size: var(--font-sm);
  line-height: 1.45;
  color: var(--text-muted);
}

.record-empty {
  margin: 0;
  padding: 1.25rem 0;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- spell table --------------------------------------------------- */

/* The effect line rides under the name instead of claiming a column of its own,
   which would have pushed the table another 20rem wide. */
.spell-name {
  display: block;
  font-weight: 600;
}
.spell-effect {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--font-sm);
  line-height: 1.35;
  color: var(--text-muted);
  opacity: 0.85;
}
.spell-table th:first-child,
.spell-table td:first-child { min-width: 18rem; }

/* "/ sec" is a unit, not a number — keep it out of the way of the figure. */
.rate {
  font-size: var(--font-xs);
  color: var(--text-muted);
  opacity: 0.8;
  white-space: nowrap;
}

.browse-note {
  margin: 1.25rem 0 0;
  font-size: var(--font-sm);
  line-height: 1.5;
  opacity: 0.7;
}

/* ---------- which view shows at which width ------------------------------ */

/* The sideways-scroll hint only makes sense while the table is on screen:
   above the phone breakpoint, and below the width the table fits at. */
@media (max-width: 767.98px) {
  .scroll-hint { display: none; }
  .browse-filter { margin-top: 1.25rem; }
  /* One finger, one control: stacked, and tall enough to hit. */
  .browse-filter .form-select { min-height: 2.75rem; font-size: var(--font-md); }
  .browse-filter .btn { min-height: 2.75rem; }
  .result-count { font-size: 0.95rem; }
}

/* ---------- footer navigation -------------------------------------------- */

/* Six links read better as two short columns than one long one, and the pair
   of columns stays balanced whether the signed-in links are there (six) or
   not (four). */
.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.1rem 1rem;
}

/* ---------- navbar brand on a phone --------------------------------------- */

/* Bootstrap keeps .navbar-brand on one line, and this brand is six words long:
   below the lg breakpoint it ran past the right edge and pushed the toggler
   onto a second row. Let it wrap and sit beside the toggler instead. */
@media (max-width: 991.98px) {
  .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: 0.5px;
    margin-right: 0.5rem;
  }
  .navbar-brand img {
    width: 32px;
    height: 32px;
  }
}

/* ==========================================================================
   LEGAL PAGES  (legal/terms.html, legal/privacy.html)
   Long-form prose rather than panels of numbers, so the column narrows and
   the clause numbers are generated - adding or moving a clause never means
   renumbering by hand, and the anchors stay stable because they are names.
   ========================================================================== */

.legal-body { counter-reset: legal-section; }

/* Effective / updated dates, sitting quietly under the lede. */
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.5rem;
  margin: 1rem 0 0;
  font-size: var(--font-sm);
  color: var(--text-muted);
  opacity: 0.8;
}

/* Each clause is a titled band, matching the reference page's section rhythm. */
.legal-section { scroll-margin-top: 5rem; }

.legal-section > .panel-title { counter-increment: legal-section; }
.legal-section > .panel-title::before {
  content: counter(legal-section) ". ";
  color: var(--skyrim-gold-soft);
}

/* Past about 75 characters the eye loses its place on the return sweep. */
.legal-section p,
.legal-section ul,
.legal-section ol,
.legal-section .legal-note,
.legal-section .legal-table { max-width: 75ch; }

.legal-section p { margin-bottom: 0.9rem; }

.legal-section ul,
.legal-section ol {
  margin-bottom: 1.15rem;
  padding-left: 1.3rem;
}
.legal-section li { margin-bottom: 0.45rem; }
.legal-section ul.plain-list { padding-left: 0; }

.legal-section h3 {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text-main);
  margin: 1.5rem 0 0.65rem;
}

/* The notices a reader must not skim past. */
.legal-note {
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-left: 3px solid var(--skyrim-gold);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.95rem;
}
.legal-note ul { margin-bottom: 0; }

/* What is collected, and why, reads as pairs rather than as a paragraph. */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4rem 0 1.3rem;
  font-size: 0.95rem;
}
.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.legal-table thead th {
  color: var(--skyrim-gold);
  font-weight: 600;
  border-bottom-color: rgba(212, 175, 55, 0.35);
}
.legal-table tbody th {
  color: var(--text-main);
  font-weight: 600;
}
.legal-table tbody tr:last-child th,
.legal-table tbody tr:last-child td { border-bottom: none; }

/* Same reasoning as .browse-panel: a flat 3rem of padding is most of a phone
   screen. Scale it with the viewport instead of overriding Bootstrap's p-5. */
.legal-panel { padding: clamp(1rem, 0.35rem + 2.6vw, 3rem); }

@media (max-width: 575.98px) {
  .legal-table { font-size: 0.88rem; }
  .legal-table th,
  .legal-table td { padding: 0.45rem 0.4rem; }
}

/* ---------- footer legal strip ------------------------------------------- */

.footer-legal a { white-space: nowrap; }
.footer-legal span { margin: 0 0.5rem; opacity: 0.5; }

.footer-disclaimer {
  max-width: 62ch;
  margin-inline: auto;
  font-size: var(--font-xs);
  color: var(--text-muted);
  opacity: 0.7;
}
