/* ==========================================================================
   Caster's Codex theme.

   How the colors are organized:
   1. PALETTE: a color set (Ember = red and gold, the default; Grove = green and
      silver; Storm = blue and grey; Twilight = purple and yellow). Each set
      gives its house color, its metal color, and the background tints for
      dark and light mode. Picked per device with the palette button in the
      banner (<html data-palette="grove">).
   2. MODE: dark (the default) or light. Each mode turns the chosen palette
      into the colors pages actually use (background, text, links, buttons...).
   Colors that keep a meaning (danger red, revealed green,
   stat blocks, the Claude button) stay the same in every palette.
   ========================================================================== */

:root {
  --font-heading: "Cinzel", Georgia, serif;
  --font-body: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 8px;
}

/* 1. PALETTES. Ember (red and gold) is the default. */
:root, :root[data-palette="ember"] {
  --house-deep: #5c0f12;        /* header band (dark mode) */
  --house-deep-light: #6e1316;  /* header band (light mode) */
  --house: #8e1a1d;             /* buttons (dark mode) */
  --house-hover: #a52226;
  --house-light: #7f1518;       /* buttons, headings, links (light mode) */
  --metal: #e8c463;             /* bright gold: text on dark */
  --metal-line: #c9a24a;        /* gold for borders and ornaments */
  --metal-dim: #7a6230;         /* quiet gold lines on dark */
  --metal-deep: #8a6516;        /* logo page lines */
  --on-house: #fbecc4;          /* text on the house color */
  --on-metal: #3a0a0c;          /* text on a metal badge */
  /* dark mode tints */
  --dark-bg: #15100c; --dark-surface: #211912; --dark-sunk: #1a140f;
  --dark-text: #ece2cc; --dark-muted: #b3a588; --dark-border: #4d3b22; --dark-border-inner: #3a2c1c;
  --dark-header-text: #f3e7c9; --dark-secondary-border: #6b5530;
  /* light mode tints */
  --light-bg: #f3ead6; --light-surface: #fbf6ea; --light-sunk: #fffdf7;
  --light-text: #2a1d14; --light-muted: #6b5a44; --light-border: #d6c08f; --light-border-inner: #ece0c2;
  --light-header-text: #fbefd2; --light-brand: #f0cf74; --light-button-hover: #962024;
  --light-metal: #a87c1f;       /* metal dark enough for text and borders on light backgrounds */
  --light-metal-line: #c9a96a;  /* quiet metal lines on light backgrounds */
  --dark-dm-tint: #2b1614; --dark-player-tint: #18221a; --light-dm-tint: #f3e1dc; --light-player-tint: #e4ecdc;  /* DM-only and player boxes */
}

:root[data-palette="grove"] {  /* green and silver */
  --house-deep: #12381f; --house-deep-light: #163f24; --house: #1d5a32; --house-hover: #24703e; --house-light: #1b5230;
  --metal: #dde3e8; --metal-line: #aab3bb; --metal-dim: #56615b; --metal-deep: #56606a;
  --on-house: #eef3ef; --on-metal: #12381f;
  --dark-bg: #0e1411; --dark-surface: #17201b; --dark-sunk: #111915;
  --dark-text: #e3e8e4; --dark-muted: #a6b2ab; --dark-border: #34443b; --dark-border-inner: #26322c;
  --dark-header-text: #e8efe9; --dark-secondary-border: #4f5a55;
  --light-bg: #e9eee8; --light-surface: #f6f8f5; --light-sunk: #fdfefd;
  --light-text: #18221b; --light-muted: #536158; --light-border: #b9c6bc; --light-border-inner: #dde5de;
  --light-header-text: #eef3ef; --light-brand: #e4e9ee; --light-button-hover: #236a3d;
  --light-metal: #59656f; --light-metal-line: #a9b4ad;
  --dark-dm-tint: #173022; --dark-player-tint: #20262b; --light-dm-tint: #d8eadc; --light-player-tint: #e4e8ec;  /* DM-only and player boxes */
}

:root[data-palette="storm"] {  /* blue and grey */
  --house-deep: #13294b; --house-deep-light: #17315a; --house: #1f4a85; --house-hover: #2a5ea3; --house-light: #1e4278;
  --metal: #cfd7e1; --metal-line: #9aa6b4; --metal-dim: #4f5b69; --metal-deep: #4d5866;
  --on-house: #eef3fa; --on-metal: #13294b;
  --dark-bg: #0d121a; --dark-surface: #161d28; --dark-sunk: #111720;
  --dark-text: #e2e7ee; --dark-muted: #a3adbb; --dark-border: #313d4f; --dark-border-inner: #232d3b;
  --dark-header-text: #e6ebf2; --dark-secondary-border: #4a5566;
  --light-bg: #e8edf3; --light-surface: #f5f7fa; --light-sunk: #fdfefe;
  --light-text: #161d28; --light-muted: #505b6a; --light-border: #b8c3d1; --light-border-inner: #dce3ec;
  --light-header-text: #eef3fa; --light-brand: #dfe6ee; --light-button-hover: #255290;
  --light-metal: #56626f; --light-metal-line: #a7b2c0;
  --dark-dm-tint: #152640; --dark-player-tint: #24282e; --light-dm-tint: #d9e4f3; --light-player-tint: #e6e8eb;  /* DM-only and player boxes */
}

:root[data-palette="twilight"] {  /* purple and yellow */
  --house-deep: #2e1748; --house-deep-light: #3a1d5c; --house: #4b2a7a; --house-hover: #5e3696; --house-light: #45246f;
  --metal: #f2d45c; --metal-line: #d4b23c; --metal-dim: #75652a; --metal-deep: #8a6d0c;
  --on-house: #fbf3d0; --on-metal: #2e1748;
  --dark-bg: #130f1a; --dark-surface: #1e1828; --dark-sunk: #18131f;
  --dark-text: #ebe4f0; --dark-muted: #b0a6bb; --dark-border: #43375a; --dark-border-inner: #30283f;
  --dark-header-text: #f1ebf5; --dark-secondary-border: #6a5a2c;
  --light-bg: #efeaf3; --light-surface: #f9f7fb; --light-sunk: #fefdff;
  --light-text: #1f1628; --light-muted: #5c5167; --light-border: #cbbfd9; --light-border-inner: #e6dff0;
  --light-header-text: #f8f2fb; --light-brand: #f5d968; --light-button-hover: #53308a;
  --light-metal: #765d08; --light-metal-line: #c8b56e;
  --dark-dm-tint: #2b1a40; --dark-player-tint: #2a2412; --light-dm-tint: #e8ddf3; --light-player-tint: #f5eed3;  /* DM-only and player boxes */
}

/* 2. MODE: dark is the default */
:root, :root[data-theme="dark"] {
  --bg: var(--dark-bg);
  --bg-glow: color-mix(in srgb, var(--metal) 7%, transparent);
  --surface: var(--dark-surface);
  --surface-sunk: var(--dark-sunk);   /* inputs, copy boxes */
  --text: var(--dark-text);
  --muted: var(--dark-muted);
  --border: var(--dark-border);
  --border-inner: var(--dark-border-inner);
  --heading: var(--metal);
  --link: var(--metal);
  --header-bg: var(--house-deep);
  --header-text: var(--dark-header-text);
  --brand: var(--metal);
  --button: var(--house);
  --button-hover: var(--house-hover);
  --button-text: var(--on-house);
  --button-border: var(--metal-line);
  --secondary-text: var(--metal);
  --secondary-border: var(--dark-secondary-border);
  --ornament: var(--metal-line);
  --ornament-line: var(--metal-dim);
  --focus: var(--metal);
  --danger: #f08a80;
  --revealed: #8fd19e;
  --hidden: var(--dark-muted);
  --dm-tint: var(--dark-dm-tint);
  --player-tint: var(--dark-player-tint);
  --gold: var(--metal-line);
  --gold-text: var(--metal-line);  /* gold used for words (dates, "waiting") */
}

:root[data-theme="light"] {
  --bg: var(--light-bg);
  --bg-glow: color-mix(in srgb, var(--light-metal) 10%, transparent);
  --surface: var(--light-surface);
  --surface-sunk: var(--light-sunk);
  --text: var(--light-text);
  --muted: var(--light-muted);
  --border: var(--light-border);
  --border-inner: var(--light-border-inner);
  --heading: var(--house-deep-light);
  --link: var(--house-light);
  --header-bg: var(--house-deep-light);
  --header-text: var(--light-header-text);
  --brand: var(--light-brand);
  --button: var(--house-light);
  --button-hover: var(--light-button-hover);
  --button-text: var(--on-house);
  --button-border: var(--light-metal);
  --secondary-text: var(--house-deep-light);
  --secondary-border: var(--light-metal-line);
  --ornament: var(--light-metal);
  --ornament-line: var(--light-metal-line);
  --focus: var(--house-light);
  --danger: #a51d1d;
  --revealed: #2f6b3a;
  --hidden: var(--light-muted);
  --dm-tint: var(--light-dm-tint);
  --player-tint: var(--light-player-tint);
  --gold: var(--light-metal);
  --gold-text: color-mix(in srgb, var(--light-metal) 78%, #000);  /* darker, so words pass 4.5:1 */
}

/* Metal see-through lines on the banner (the same in both modes) */
:root {
  --banner-line: color-mix(in srgb, var(--metal) 45%, transparent);
  --banner-line-faint: color-mix(in srgb, var(--metal) 25%, transparent);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, var(--bg-glow), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 .5em; color: var(--heading); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; margin-top: 1.25em; }
h3 { font-size: 1.05rem; }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
/* The banner and menu get more room than the page text, so the whole menu fits on one line. */
.site-header .wrap { max-width: 1200px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.inline { display: inline; }

/* Gold divider with a diamond under page titles */
main h1::after {
  content: "◆"; display: block; width: min(240px, 100%); margin-top: 8px;
  font-size: 9px; line-height: 1; text-align: center; color: var(--ornament);
  background:
    linear-gradient(var(--ornament-line), var(--ornament-line)) left center / calc(50% - 10px) 1px no-repeat,
    linear-gradient(var(--ornament-line), var(--ornament-line)) right center / calc(50% - 10px) 1px no-repeat;
}
.card.narrow h1::after, .login-hero h1::after { margin-left: auto; margin-right: auto; }

/* ---------- Header ---------- */
.site-header { background: var(--header-bg); border-bottom: 2px solid var(--metal-line); color: var(--header-text); }
/* Three columns: name on the left, logo in the middle, buttons on the right. */
.header-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 8px; }
.header-row .brand { justify-self: start; }
.header-row .header-tools { justify-self: end; }
.site-logo { display: block; width: 52px; height: 52px; }
.logo-spark { fill: var(--brand); }
.logo-page { fill: var(--header-text); stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.logo-lines { fill: none; stroke: var(--metal-deep); stroke-width: 1.6; stroke-linecap: round; }
@media (max-width: 699px) {  /* phones: the name keeps its width, the logo sits in the space left over */
  .header-row { grid-template-columns: auto 1fr auto; }
  .header-row .brand { font-size: 1.15rem; white-space: nowrap; }
  .site-logo { width: 34px; height: 34px; justify-self: center; }
}
@media (max-width: 339px) { .site-logo { display: none; } }  /* very narrow phones: room for the name and buttons */
.brand { font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; letter-spacing: .04em; color: var(--brand); text-decoration: none; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .menu-toggle {
  background: none; border: 1px solid var(--banner-line); color: var(--brand);
  border-radius: 999px; height: 40px; cursor: pointer; font: inherit;
}
.theme-toggle { width: 40px; font-size: 1.1rem; }

/* The site admin's notification bell (waiting campaign requests) and its drop-down list */
.notify { position: relative; }
.notify-button {
  list-style: none; position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--banner-line); border-radius: 999px; color: var(--brand); cursor: pointer;
}
.notify-button::-webkit-details-marker { display: none; }
.notify-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notify-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--metal); color: var(--on-metal); font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center;
}
.notify-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(300px, 88vw); padding: 8px 0;
  background: var(--surface); color: var(--text); border: 1px solid var(--gold); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.notify-title { margin: 0; padding: 4px 14px 8px; font-family: var(--font-heading); color: var(--heading); border-bottom: 1px solid var(--border-inner); }
.notify-item { display: block; padding: 8px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-inner); }
.notify-item strong { display: block; color: var(--link); }
.notify-item span { color: var(--muted); }
.notify-item:hover, .notify-item:focus-visible { background: var(--surface-sunk); }
.notify-empty { margin: 0; padding: 10px 14px; color: var(--muted); }
.notify-more { display: block; padding: 8px 14px 4px; text-align: right; font-weight: 500; color: var(--link); text-decoration: none; }
/* Everyone's bell: new ones get a gold dot; "Mark all as read" is a plain link-style button */
.notify-item.unread strong::before { content: "● "; color: var(--gold); font-size: .8em; }
.notify-read { margin: 0; }
.notify-read .notify-more { width: 100%; background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; }
.notify-read .notify-more:hover, .notify-read .notify-more:focus-visible { text-decoration: underline; }
@media (max-width: 699px) {  /* phones: the bell isn't at the far right, so the list hangs from the banner's right edge */
  .header-row { position: relative; }
  .notify { position: static; }
  .notify-menu { right: 12px; top: calc(100% + 4px); }
}
/* The color picker uses the bell's button and list styles. It needs JavaScript, so it's hidden without it. */
.palette-picker { display: none; }
.js .palette-picker { display: block; }
.palette-picker .notify-button svg .dot { fill: currentColor; stroke: none; }
.palette-menu { width: min(260px, 88vw); }
.palette-choice {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px; font: inherit; text-align: left;
  color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--border-inner); cursor: pointer;
}
.palette-choice:last-child { border-bottom: 0; }
.palette-choice:hover, .palette-choice:focus-visible { background: var(--surface-sunk); }
.palette-choice strong { color: var(--heading); }
.palette-choice .small { color: var(--muted); }
.palette-choice[aria-pressed="true"] strong::after { content: " ✓"; color: var(--text); }
.palette-swatch { flex: none; position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid; }
.palette-mode { display: none; }
.palette-mode-icon { display: flex; align-items: center; justify-content: center; border-color: var(--border); color: var(--text); font-size: 1.1rem; }
@media (max-width: 479px) {  /* small phones: ◐ moves into the color list to make room in the banner */
  .js .header-tools > .theme-toggle { display: none; }
  .js .palette-mode { display: flex; }
  .header-row:has(.notify:not(.palette-picker)) .site-logo { display: none; }  /* the bell button needs the logo's space */
}
.palette-swatch span { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); }
.menu-toggle { display: none; padding: 0 14px; font-weight: 500; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; padding-bottom: 10px; }
.site-nav a, .link-button { color: var(--header-text); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .link-button:hover { color: var(--brand); }
.site-nav a.active { color: var(--brand); border-bottom-color: var(--metal-line); }
.nav-spacer { flex: 1; }
.link-button { background: none; border-top: 0; border-left: 0; border-right: 0; font: inherit; cursor: pointer; }

/* Campaign bar: which campaign you're in and your role there */
.campaign-bar { background: rgba(0, 0, 0, .18); border-top: 1px solid var(--banner-line-faint); border-bottom: 1px solid var(--banner-line-faint); }
.campaign-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding-top: 6px; padding-bottom: 6px; font-size: .9rem; }
.campaign-switch { display: flex; align-items: center; gap: 8px; }
.campaign-switch label { color: var(--header-text); opacity: .85; }
.campaign-switch select { width: auto; max-width: 60vw; padding: 4px 8px; background: rgba(0, 0, 0, .25); color: var(--brand); border-color: var(--banner-line); }
/* The open list: plain readable colors (gold on grey was hard to read), the chosen one in the house red. */
.campaign-switch select option { background: var(--surface); color: var(--text); font-weight: 500; }
.campaign-switch select option:checked { background: var(--button); color: var(--button-text); }
.campaign-name { font-family: var(--font-heading); color: var(--brand); }
.role-tag { color: var(--header-text); font-size: .8rem; border: 1px solid var(--banner-line); border-radius: 999px; padding: 1px 10px; }
.campaign-extras { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.campaign-new { color: var(--header-text); font-size: .8rem; opacity: .85; }
.campaign-new:hover { color: var(--brand); opacity: 1; }

/* "Choose a campaign" after logging in: one big button per campaign */
.campaign-choices { display: grid; gap: 10px; margin-top: 12px; }
.campaign-choice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; width: 100%;
  padding: 14px 16px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--radius);
}
.campaign-choice:hover, .campaign-choice:focus-visible { border-color: var(--gold); }
.campaign-choice-name { font-family: var(--font-heading); font-size: 1.1rem; color: var(--heading); }
.campaign-choice .role-tag { color: var(--muted); border-color: var(--border); }
.campaign-choice-about { flex-basis: 100%; }
.count-badge { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--metal); color: var(--on-metal); font-size: .8rem; font-weight: 700; text-align: center; }
.request-status { font-size: .9rem; }
.request-waiting { color: var(--gold-text); }
.request-approved { color: var(--revealed); }
.request-declined { color: var(--muted); }

/* Manage campaign: the people list */
.member-list { list-style: none; margin: 0 0 12px; padding: 0; }
.member { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.member-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.member-name .tag { margin-left: 0; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.member-actions form { margin: 0; }
.add-member { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; }
.add-member .field { flex: 1 1 180px; }
.add-member .button { margin-bottom: 14px; }

/* Menu groups (World / Story / DM tools): a dropdown on computers, headings on phones */
.nav-group { position: relative; }
.nav-group-label { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--header-text); font: inherit; font-weight: 500; padding: 6px 0; cursor: pointer; }
.nav-group.active > .nav-group-label { color: var(--brand); border-bottom-color: var(--metal-line); }
.nav-menu a { display: block; }
/* The search box sits on the red header in both modes, so it keeps the dark look in light mode too
   (the general input style below would otherwise turn it cream with faint text). */
.site-nav .nav-search input[type="search"] { width: 150px; padding: 5px 10px; font-size: .9rem; background: rgba(0, 0, 0, .25); color: var(--header-text); border-color: var(--banner-line); }
.site-nav .nav-search input[type="search"]::placeholder { color: var(--header-text); opacity: .75; }
.nav-user { color: var(--header-text); opacity: .85; font-size: .9rem; white-space: nowrap; }
.nav-user::before { content: "◆ "; color: var(--metal-line); font-size: .7em; vertical-align: middle; }
@media (min-width: 700px) and (max-width: 1239px) {  /* smaller laptop windows: tighter menu spacing, so it still fits on one line */
  .site-nav { column-gap: 12px; }
  .site-nav .nav-search input[type="search"] { width: 110px; }
}
@media (min-width: 700px) {
  .nav-menu {
    display: none; position: absolute; top: 100%; left: -12px; z-index: 20; min-width: 170px; padding: 6px 0;
    background: var(--header-bg); border: 1px solid var(--metal-line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  }
  .nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { display: block; }
  .site-nav .nav-menu a { padding: 8px 14px; border-bottom: 0; white-space: nowrap; }
  .site-nav .nav-menu a:hover, .site-nav .nav-menu a.active { background: rgba(0, 0, 0, .2); }
}
@media (max-width: 699px) {
  .nav-group-label { cursor: default; padding-top: 12px; font-family: var(--font-heading); color: var(--brand); }
  .nav-group-label span { display: none; }
  .site-nav.open .nav-menu a { padding-left: 14px; }
  .site-nav .nav-search input[type="search"] { width: 100%; }
  .site-nav.open .nav-search { padding: 10px 0; }
  .site-nav.open .nav-user { padding: 10px 0 4px; }
}

/* Phones: the links fold away behind a Menu button (only when JavaScript is on). */
@media (max-width: 699px) {
  .js .menu-toggle { display: inline-flex; align-items: center; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav.open a, .site-nav.open .link-button, .site-nav.open form { padding: 10px 0; border-bottom: 1px solid var(--banner-line-faint); text-align: left; width: 100%; }
  .site-nav.open form .link-button { padding: 0; border: 0; }
  .site-nav.open .nav-spacer { display: none; }
}

/* ---------- Cards, buttons, badges ---------- */
.card {
  display: block; background: var(--surface); color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px var(--border-inner); /* thin double border */
  padding: 16px; margin-bottom: 12px;
}
a.card { text-decoration: none; }
a.card:hover { border-color: var(--gold); }
.card.narrow { max-width: 440px; margin: 24px auto; }

.button {
  display: inline-block; background: var(--button); color: var(--button-text);
  border: 1px solid var(--button-border); border-radius: var(--radius);
  padding: 10px 16px; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  min-height: 44px; /* comfortable tap target on phones */
}
.button:hover { background: var(--button-hover); }
.button.secondary { background: transparent; color: var(--secondary-text); border-color: var(--secondary-border); }
.button.secondary:hover { border-color: var(--gold); }
.button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
/* Claude actions: black in light mode, the reverse (light on dark) in dark mode. */
.button.claude { background: #f4efe4; color: #141210; border-color: #f4efe4; }
.button.claude:hover { background: #ffffff; border-color: #ffffff; }
:root[data-theme="light"] .button.claude { background: #141210; color: #ffffff; border-color: #141210; }
:root[data-theme="light"] .button.claude:hover { background: #2e2a26; border-color: #2e2a26; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.badge { border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 500; border: 1px solid; background: transparent; cursor: pointer; font-family: inherit; }
.badge.revealed { color: var(--revealed); }
.badge.hidden { color: var(--hidden); }
.tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--surface-sunk); border: 1px solid var(--border); font-size: .75rem; color: var(--muted); }

.flash { background: var(--surface); border: 1px solid var(--gold); border-left-width: 4px; border-radius: 0; padding: 10px 14px; margin-bottom: 16px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat strong { display: block; font-family: var(--font-heading); font-size: 1.6rem; color: var(--heading); }
.plain-list { padding-left: 1.2em; }
.list-item h3 { margin-bottom: .2em; }
.list-item p { margin: 0; }

/* ---------- Login ---------- */
.login-hero { text-align: center; margin: 32px auto 8px; }
.login-hero .brand-big { font-family: var(--font-heading); font-weight: 700; font-size: 2.2rem; letter-spacing: .05em; color: var(--heading); margin: 0; }
.login-hero p { margin: 6px 0 0; }
.login-hero .ornament { margin: 10px auto 4px; }
.ornament {
  width: 200px; margin: 8px auto 0; font-size: 9px; line-height: 1; color: var(--ornament);
  background:
    linear-gradient(var(--ornament-line), var(--ornament-line)) left center / calc(50% - 10px) 1px no-repeat,
    linear-gradient(var(--ornament-line), var(--ornament-line)) right center / calc(50% - 10px) 1px no-repeat;
}
.card.narrow h1 { text-align: center; }
.full-width { width: 100%; }
.center { text-align: center; }

/* ---------- Forms ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.filters input, .filters select { flex: 1 1 160px; }
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: 2px solid var(--focus); outline-offset: 0; }
input[type="checkbox"] { accent-color: var(--button); width: 18px; height: 18px; }
textarea { resize: vertical; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 500; margin-bottom: 4px; }
.field-checkbox > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-checkbox label { margin: 0; }
.field .helptext { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.errorlist { color: var(--danger); margin: 4px 0; padding-left: 1.2em; }
fieldset { border-radius: var(--radius); border: 1px solid var(--border); margin: 0 0 16px; padding: 12px 16px; }
legend { font-family: var(--font-heading); font-weight: 700; padding: 0 6px; color: var(--heading); }

/* Visual hint of who can see what */
.player-box { background: var(--player-tint); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
.dm-box { background: var(--dm-tint); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
.player-box h2, .dm-box h2 { margin-top: 0; font-size: 1rem; }
.dm-box h3 { margin-top: 1em; }

/* ---------- Home page ---------- */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.home-grid .card { margin: 0; }
.home-grid h2 { margin-top: 0; font-size: 1.1rem; }
.home-grid p { margin: 0 0 .5em; }

/* ---------- Sessions ---------- */
.session-row .npc-card-link { display: flex; align-items: center; gap: 14px; }
.session-number {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; color: var(--heading); border: 2px solid var(--gold);
}

/* ---------- Timeline: a gold line with a dot per event ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--ornament-line); }
.timeline-event { position: relative; padding: 0 0 22px 18px; }
.timeline-dot { position: absolute; left: -31px; top: 4px; width: 16px; height: 16px; transform: rotate(45deg); background: var(--surface); border: 2px solid var(--gold); }
.timeline-date { margin: 0; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-text); }
.timeline-event h3 { margin: 2px 0 4px; }
.timeline-event h3 a { color: inherit; text-decoration: none; }
.timeline-event.is-hidden { opacity: .7; }

/* ---------- Lists without pictures (quests) ---------- */
.stack { display: grid; gap: 10px; }
.row-card { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; }
.row-card .npc-card-link { flex: 1 1 200px; }
.row-card h3, .row-card p { margin: 0; }

/* ---------- NPCs ---------- */
.npc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.npc-card { text-align: center; margin: 0; }
.npc-card-link { color: inherit; text-decoration: none; display: block; }
.npc-card h3 { margin: 8px 0 2px; color: var(--text); }
.npc-card p { margin: 0 0 8px; }
.portrait {
  width: 100px; height: 100px; object-fit: cover; border-radius: 50%; display: block; margin: 0 auto;
  border: 2px solid var(--gold); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--ornament-line); /* gold ring */
}
.portrait.large { width: 180px; height: 180px; margin-bottom: 12px; }
.portrait.placeholder { display: flex; align-items: center; justify-content: center; background: var(--surface-sunk); font-family: var(--font-heading); font-size: 2.2rem; color: var(--gold-text); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.facts dt { font-weight: 500; }
.facts dd { margin: 0; }
.prose p { margin: 0 0 .8em; }

/* ---------- Tables, paging, footer ---------- */
.table-card { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-inner); }
.data-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom-color: var(--border); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.site-footer { border-top: 1px solid var(--border); padding: 16px 0 32px; }
.site-footer p { margin: 0; }

/* ---------- Forms in grids (stat block form) ---------- */
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.field-grid .wide { grid-column: 1 / -1; }

/* ---------- Stat block: classic book look, always parchment, in both themes ---------- */
.statblock {
  --sb-bg: #fdf1dc; --sb-text: #1f1a14; --sb-red: #7a200d; --sb-shade: #ead9b8;
  background: var(--sb-bg); color: var(--sb-text);
  border: 1px solid #d4b98a; border-top: 4px solid #e69a28; border-bottom: 4px solid #e69a28;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  padding: 14px 16px; margin: 12px 0; font-size: .95rem; line-height: 1.45;
}
.statblock p { margin: 0 0 .45em; }
.statblock a { color: var(--sb-red); }
.sb-name { font-family: var(--font-heading); color: var(--sb-red); font-size: 1.5rem; margin: 0; letter-spacing: .02em; }
.sb-type { font-style: italic; margin: 2px 0 0; }
.sb-rule, .statblock h3 { border: 0; border-bottom: 2px solid var(--sb-red); }
.sb-rule { margin: 8px 0; }
.statblock b { color: var(--sb-red); }
.statblock h3 { font-family: var(--font-heading); color: var(--sb-red); font-size: 1.1rem; font-weight: 600; padding-bottom: 2px; margin: 14px 0 8px; }
.statblock section p { margin-bottom: .7em; }
.sb-abilities { border-collapse: collapse; margin: 8px 0; width: 100%; max-width: 420px; font-size: .9rem; text-align: center; }
.sb-abilities thead th { font-size: .65rem; text-transform: uppercase; color: #6b5a44; font-weight: 600; }
.sb-abilities tbody th { text-align: left; padding-left: 6px; }
.sb-abilities tbody th, .sb-abilities td { background: var(--sb-shade); padding: 3px 4px; border: 2px solid var(--sb-bg); }
.sb-abilities tbody td:nth-child(4) { border-right-width: 10px; }
.sb-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 900px) {
  .sb-body { column-count: 2; column-gap: 28px; }
  .sb-body > * { break-inside: avoid-column; }
  .sb-body section p { break-inside: avoid; }
}

/* ---------- Copy for D&D Beyond ---------- */
.copy-box { border: 1px solid var(--border-inner); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; background: var(--surface-sunk); }
.copy-box.empty { opacity: .55; }
.copy-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.copy-label { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.copy-value { margin-top: 4px; white-space: normal; }
.copy-value.rich p { margin: 0 0 .6em; }
.small-button { min-height: 32px; padding: 4px 12px; font-size: .85rem; }

/* ---------- Print page ---------- */
.print-page { background: #fff; max-width: 900px; margin: 0 auto; padding: 16px; }
.print-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.print-credit { font-size: .75rem; color: #555; }
@media print {
  .print-controls { display: none; }
  .print-page { padding: 0; }
  .statblock { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (min-width: 640px) {
  .npc-detail.with-image { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
  h1 { font-size: 2rem; }
}

/* ---------- Recaps, story styles, AI usage ---------- */
.flash.error { border-color: var(--danger); }
.flash.warning { border-color: var(--metal-line); border-style: dashed; border-left-style: solid; }
.busy-message { font-weight: 500; color: var(--heading); }
.big-number { font-family: var(--font-heading); font-size: 2rem; margin: 0; color: var(--heading); }
.table-wrap { overflow-x: auto; }
.usage-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.usage-table th, .usage-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-inner); white-space: nowrap; }
.usage-table th { color: var(--muted); font-weight: 500; }
.button:disabled, .button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- House rules ---------- */
.rule-meta, .rule-preview { display: block; }
.rule-preview { margin-top: 2px; }
.facts + .prose { margin-top: 14px; }

/* ---------- Rulebook search ---------- */
.passage-title { margin: 0 0 2px; font-size: 1.15rem; }
.passage-text { font-size: .95rem; }

/* ---------- Chats (rules helper, story brainstorm) ---------- */
.chat-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .chat-layout { grid-template-columns: 240px 1fr; align-items: start; } }
.chat-list summary { cursor: pointer; font-family: var(--font-heading); color: var(--heading); margin-bottom: 6px; }
.chat-link { display: block; padding: 6px 0; border-bottom: 1px solid var(--border-inner); text-decoration: none; }
.chat-link.active { font-weight: 700; }
.chat-message { margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); }
.chat-message.user { background: var(--surface-sunk); }
.chat-message.assistant { background: var(--surface); }
.chat-who { margin: 0 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chat-form textarea { width: 100%; }
.chat-form.dropping textarea { outline: 2px dashed var(--metal-line); outline-offset: 2px; }
/* Pictures: waiting to be sent (with an × each), and inside sent messages. */
.chat-picture-tray { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; }
.chat-picture-tray li { position: relative; }
.chat-picture-tray img, .chat-pictures img { display: block; width: auto; height: auto; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.chat-picture-tray img { max-height: 80px; }
.chat-picture-tray .icon-button { position: absolute; top: -8px; right: -8px; background: var(--surface); border-color: var(--border); border-radius: 50%; padding: 2px 7px; font-size: 1rem; }
.chat-pictures { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chat-pictures img { max-height: 220px; }
.chat-add-picture { cursor: pointer; }
.chat-add-picture:focus-within { outline: 2px solid var(--metal-line); outline-offset: 2px; }
/* Pictures of NPCs, places and factions a brainstorm reply mentions. */
.chat-site-pictures { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.chat-site-pictures figure { margin: 0; width: 120px; }
.chat-site-pictures img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.chat-site-pictures figcaption { font-size: .85rem; margin-top: 4px; }
.chat-message .sources a { white-space: normal; }
.passages-checked { margin-top: 8px; }
.passages-checked summary { cursor: pointer; color: var(--muted); }
.passages-checked .passage { border-top: 1px solid var(--border-inner); padding-top: 8px; margin-top: 8px; }
.text-button { background: none; border: 0; padding: 0; font: inherit; color: var(--danger); text-decoration: underline; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-error { color: var(--danger); font-weight: 500; }
.chat-message.pending .prose:empty::before { content: attr(data-waiting); color: var(--muted); font-style: italic; }
.chat-message.pending .prose:empty::after { content: "…"; display: inline-block; animation: chat-dots 1.2s steps(4, end) infinite; width: 0; overflow: hidden; vertical-align: bottom; color: var(--muted); }
@keyframes chat-dots { to { width: 1.2em; } }
.chat-link-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border-inner); }
.chat-link-row .chat-link { flex: 1; border-bottom: 0; min-width: 0; overflow-wrap: anywhere; }
.chat-link-row form { margin: 0; }
.icon-button { background: none; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 4px 8px; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { color: var(--danger); border-color: var(--danger); }

/* ---------- Character sheets ---------- */
.sheet-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.sheet-stat, .sheet-ability { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin: 0; }
.sheet-stat-label { font-family: var(--font-heading); color: var(--heading); font-size: .85rem; }
.sheet-stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.sheet-abilities { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.sheet-ability { border: 1px solid var(--border-inner); border-radius: var(--radius); padding: 8px; }
.sheet-skills { list-style: none; padding: 0; margin: 0; columns: 2 220px; }
.sheet-skills li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--border-inner); break-inside: avoid; }
.sheet-warnings { border-color: var(--metal-line); }
.sheet-source .actions { flex-wrap: wrap; }
.sheet-rolls { margin: 6px 0 0; padding-left: 20px; }
.sheet-views { display: flex; gap: 8px; margin: 0 0 14px; }
.sheet-views .button[aria-pressed="true"] { background: var(--button); color: var(--button-text); border-color: var(--button-border); }
.sheet[data-view="table"] .sheet-all-only { display: none; }
.sheet-status-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.sheet-passives { margin-top: 10px; }
.sheet-list dt { font-weight: 700; margin-top: 8px; }
.sheet-list dd { margin: 2px 0 0 14px; }
.sheet-rolls li { margin: 4px 0; }
.sheet-feature { border-bottom: 1px solid var(--border-inner); padding: 6px 0; }
.sheet-feature summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.sheet-feature-text { padding: 2px 0 6px 14px; }

/* The DM's party page: one card per character, side by side on wide screens. */
.party { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 14px 0; }
.party-card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.party-card h2 { margin: 0; font-size: 1.3rem; }
.party-card h2 a { color: inherit; text-decoration: none; }
.party-card h2 a:hover, .party-card h2 a:focus-visible { text-decoration: underline; }
.party-card header p, .party-card p { margin: 0; }
.party-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; margin: 0; }
.party-stats div { border: 1px solid var(--border-inner); border-radius: var(--radius); padding: 6px; text-align: center; }
.party-stats dt { font-family: var(--font-heading); color: var(--heading); font-size: .75rem; }
.party-stats dd { margin: 0; font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.party-stats dd .small { display: block; font-weight: 400; }
.party-saves { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.party-save.proficient { font-weight: 700; text-decoration: underline; text-decoration-color: var(--metal-line); }
.party-card .sheet-rolls { margin: 0; }
.party-footer { margin-top: auto !important; padding-top: 6px; border-top: 1px solid var(--border-inner); }
.party-add summary { cursor: pointer; }
.party-add summary h2 { display: inline; margin: 0; }
.party-add form { margin-top: 10px; }
.sheet-feature-text p { margin: 6px 0; }

/* Reward counters (Inspiration points, Bonus d6) on party cards and character sheets */
.sheet-rewards h2 { margin-top: 0; }
.rewards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.reward { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 1px solid var(--border-inner); border-radius: var(--radius); padding: 8px 6px; }
.reward-name { font-family: var(--font-heading); color: var(--heading); font-size: .8rem; }
.reward-counter { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; }
.reward-step { min-width: 40px; min-height: 40px; padding: 0; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-sunk); color: var(--brand); font-size: 1rem; cursor: pointer; }
.reward-step:hover, .reward-step:focus-visible { border-color: var(--brand); }
.reward-count { width: 3.2em; min-height: 40px; text-align: center; font-size: 1.3rem; font-weight: 700; padding: 2px 4px;
  -moz-appearance: textfield; appearance: textfield; }
.reward-count::-webkit-inner-spin-button, .reward-count::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.reward-count-text { width: auto; min-width: 1.5em; min-height: 0; display: inline-block; }
.reward-what { line-height: 1.25; }
.reward-status:empty { display: none; }
.reward-status.error { color: var(--danger); }

/* The site admin's Switch Account list (in Admin Tools) and the gold strip shown while switched */
.nav-menu-heading { margin: 6px 0 0; padding: 8px 14px 2px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--header-text); opacity: .7; border-top: 1px solid var(--banner-line-faint); }
.nav-switch { margin: 0; }
.nav-switch button { display: block; width: 100%; padding: 8px 14px; background: none; border: 0; font: inherit; font-weight: 500;
  text-align: left; color: var(--header-text); cursor: pointer; white-space: nowrap; }
.nav-switch button:hover, .nav-switch button:focus-visible { color: var(--brand); background: rgba(0, 0, 0, .2); }
@media (max-width: 699px) { .nav-menu-heading { padding-left: 0; border-top: 0; } .site-nav.open .nav-switch button { padding: 0 0 0 14px; } }
.switch-strip { background: var(--metal); color: var(--on-metal); }
.switch-strip-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; padding-top: 6px; padding-bottom: 6px; }
.switch-strip form { margin: 0; }

/* ==========================================================================
   Bubbly layout (Dec 4, 2026): rounder corners, pill-shaped buttons and boxes,
   soft shadows instead of hard double borders, a little more breathing room.
   Kept together here so it can be tuned (or removed) in one place.
   Stat blocks keep their square book look.
   ========================================================================== */
:root {
  --radius: 14px;          /* small boxes: copy boxes, ability scores, pictures */
  --radius-card: 20px;     /* cards, panels, chat messages */
  --radius-pill: 999px;    /* buttons and one-line boxes */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 32px rgba(0, 0, 0, .34);
}
:root[data-theme="light"] {
  --shadow-card: 0 1px 2px rgba(40, 30, 20, .06), 0 6px 20px rgba(40, 30, 20, .09);
  --shadow-lift: 0 2px 4px rgba(40, 30, 20, .08), 0 12px 28px rgba(40, 30, 20, .14);
}

/* Cards: soft shadow and a faint edge instead of the thin double border */
.card {
  border-radius: var(--radius-card); border-color: var(--border-inner);
  box-shadow: var(--shadow-card); padding: 20px;
}
a.card { transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.home-grid, .stack, .npc-grid, .party { gap: 16px; }
.table-card { padding: 0; }
.data-table th:first-child, .data-table td:first-child { padding-left: 20px; }

/* Buttons and one-line boxes are pills; bigger boxes are rounded */
.button, .badge, .tag, .role-tag, .count-badge { border-radius: var(--radius-pill); }
.button { padding: 10px 20px; }
.small-button { padding: 4px 14px; }
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"], select {
  border-radius: var(--radius-pill); padding-left: 16px; padding-right: 16px;
}
textarea { border-radius: 18px; padding: 12px 16px; }
input:focus, select:focus, textarea:focus { outline-offset: 1px; }
.reward-count { border-radius: var(--radius); padding-left: 4px; padding-right: 4px; }
.reward-step { border-radius: 50%; }
.icon-button { border-radius: var(--radius-pill); }

/* Panels, boxes and messages */
fieldset { border-radius: var(--radius-card); padding: 16px 20px; }
.player-box, .dm-box { border-radius: 18px; padding: 16px 20px; }
.flash { border-radius: var(--radius); border-left-width: 1px; box-shadow: inset 5px 0 0 var(--gold); padding: 12px 16px 12px 20px; }
.flash.error { box-shadow: inset 5px 0 0 var(--danger); }
.flash.warning { border-style: dashed; }
.chat-message { border-radius: var(--radius-card); padding: 14px 18px; }
.chat-message.user { border-bottom-right-radius: 6px; }      /* a speech-bubble tail on your messages */
.chat-message.assistant { border-bottom-left-radius: 6px; box-shadow: var(--shadow-card); border-color: var(--border-inner); }
.campaign-choice { border-radius: 18px; padding: 16px 20px; }
.copy-box, .sheet-ability, .party-stats div, .reward { border-radius: var(--radius); }

/* Drop-down lists in the banner */
.notify-menu { border-radius: 18px; overflow: hidden; }
@media (min-width: 700px) {
  .nav-menu { border-radius: 16px; overflow: hidden; padding: 6px; }
  .site-nav .nav-menu a, .nav-switch button { border-radius: 10px; }
  .nav-menu-heading { margin-left: -6px; margin-right: -6px; }
}

/* Stat blocks stay square, like the books */
.statblock, .statblock * { border-radius: 0; }
