/* the colours, type and shapes every dnd page shares; the tool pages build it into style.css, the blog into its frame sheet */

:root {
  --background: linear-gradient(135deg, rgb(34, 33, 33) 0%, rgb(28, 27, 27) 100%);
  --surface: linear-gradient(145deg, #3a3838, #2f2d2d);
  --surface-flat: #353333;
  --field: #262525;
  --text: white;
  --text-soft: rgba(255, 255, 255, 0.85);
  --muted: rgba(255, 255, 255, 0.6);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  --radius: 1.5em;
  --radius-small: 0.5em;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
    sans-serif;
}
/* the look every dnd tool page shares; built after palette.css and before each page's style.css */

:root {
  color-scheme: dark;
}

body {
  box-sizing: border-box;
  max-width: 600px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1em 20px;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

main {
  flex: 1 0 auto;
}

h1,
h2 {
  font-weight: 300;
  text-shadow: var(--text-shadow);
}

h1 {
  margin: 0.4em 0 0.2em;
  letter-spacing: 0.05em;
}

h2 {
  letter-spacing: 0.03em;
}

a {
  color: var(--text);
  text-decoration-color: var(--muted);
}

a:hover {
  text-decoration-color: var(--text);
}

button,
input[type='submit'] {
  padding: 0.6em 1em;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

button:hover,
input[type='submit']:hover {
  border-color: var(--border-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

input[type='number'],
input[type='text'],
select {
  box-sizing: border-box;
  padding: 0.3em 0.5em;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--field);
  color: var(--text);
  font: inherit;
}

input[type='checkbox'] {
  accent-color: #8a8686;
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface-flat);
}

summary {
  padding: 0.3em 0.6em;
  cursor: pointer;
}

footer {
  flex-shrink: 0;
  margin-top: 3em;
  padding: 1.5em 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9em;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--text-soft);
}

/* calculator layout shared by khorne and war-calls */

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.form-group {
  flex: 1;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
}

.form-group input,
.form-group select {
  width: 100%;
}

.abilities {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.ability-column {
  flex: 1;
}

.ability-option {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.ability-option input[type='checkbox'] {
  margin-right: 5px;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
  text-decoration: line-through;
}

#result {
  margin-top: 20px;
}

.calculation,
.final-result,
.effects {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface-flat);
}

.final-result {
  margin-top: 20px;
}

.effects ul {
  margin: 0;
  padding-left: 20px;
}

.effects li {
  margin-bottom: 5px;
}

/* chip pickers shared by animate-objects and multi-attack */

.option {
  user-select: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  height: 1em;
  padding: 0.5em;
  margin: 0.5em;
  display: inline-block;
  line-height: 1;
  color: #1c1b1b;
  cursor: pointer;
}

.config-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1em;
}

.centered-group {
  display: flex;
  gap: 20px;
}

.buffer {
  padding: 0.5em;
}
:root {
  --good: #8fc98f;
  --bad: #e08a8a;
  --crit: #e8c46a;
  --conc: #b9a3e3;
}

/* desktop first: three columns side by side, so the base sheet's 600px column is too narrow */
body {
  max-width: 1500px;
}

h2 {
  margin: 0.2em 0 0.5em;
  font-size: 1.3em;
}

h3 {
  margin: 0.8em 0 0.4em;
  font-size: 1em;
  font-weight: 500;
}

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

.small-text {
  font-size: 0.85em;
}

button.small {
  padding: 0.15em 0.6em;
  font-size: 0.85em;
}

button.primary {
  border-color: var(--border-hover);
  font-weight: 600;
}

button.link {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  text-decoration: underline;
}

.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1em;
  margin-bottom: 1em;
}

.top p {
  margin: 0;
}

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1.4em;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.stat input {
  width: 4.5em;
}

.conc {
  color: var(--conc);
}

.warn {
  color: var(--crit);
}

.pip {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.pip.full {
  background: var(--text-soft);
}

.columns {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(420px, 1.7fr) minmax(280px, 1.1fr);
  gap: 1.5em;
  align-items: start;
}

/* rows lay out by their column's width, not the window's */
section {
  min-width: 0;
  container-type: inline-size;
}

.card {
  margin-bottom: 0.6em;
  padding: 0.6em 0.8em;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.spell.on {
  border-color: var(--border-hover);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.4em;
}

.pick input {
  width: 3.5em;
  margin-left: 0.3em;
}

.active {
  margin: 0.4em 0 0;
  padding-left: 1.1em;
  font-size: 0.9em;
}

.conc-tag {
  color: var(--conc);
}

.attack-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1em;
  margin-bottom: 0.6em;
}

.attack-bar input {
  width: 4em;
}

.error {
  flex-basis: 100%;
  color: var(--bad);
}

.group h3 {
  border-bottom: 1px solid var(--border);
}

.row {
  display: grid;
  grid-template-columns: 13em 3.5em 8em 4.5em 1fr;
  grid-template-areas:
    'who ac hp delta opts'
    'extras extras extras extras extras';
  align-items: center;
  gap: 0.2em 0.6em;
  padding: 0.35em 0;
  border-bottom: 1px solid var(--border);
}

.row.loose .who {
  color: var(--bad);
}

.who {
  grid-area: who;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2em 0.4em;
  min-width: 0;
}

.who label {
  white-space: nowrap;
}

.ac {
  grid-area: ac;
  color: var(--muted);
  font-size: 0.9em;
}

.hp {
  grid-area: hp;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-variant-numeric: tabular-nums;
}

.bar {
  flex: 1;
  height: 0.45em;
  border-radius: 1em;
  background: var(--field);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--good);
}

.delta {
  grid-area: delta;
  width: 100%;
}

.opts {
  grid-area: opts;
}

.extras {
  grid-area: extras;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
}

.extras:empty {
  display: none;
}

.ask {
  grid-column: 1 / -1;
  padding: 0.3em 0.5em;
  border-radius: var(--radius-small);
  background: var(--surface-flat);
  color: var(--crit);
}

.badge {
  padding: 0 0.5em;
  border: 1px solid var(--border-hover);
  border-radius: 1em;
  font-size: 0.8em;
}

.badge.good {
  color: var(--good);
}

.badge.bad {
  color: var(--bad);
}

/* hover on desktop, tap to focus on a phone */
.tip {
  position: relative;
  display: inline-block;
  padding: 0 0.45em;
  border: 1px solid var(--border-hover);
  border-radius: 1em;
  color: var(--muted);
  font-size: 0.8em;
  cursor: help;
}

.tip:hover::after,
.tip:focus::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 10;
  right: 0;
  top: 1.6em;
  width: max-content;
  max-width: 22em;
  padding: 0.5em 0.7em;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-small);
  background: var(--surface-flat);
  box-shadow: var(--shadow);
  color: var(--text);
  white-space: pre-line;
  text-align: left;
}

.summary .big {
  font-size: 1.8em;
  font-weight: 300;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 0.4em;
}

.chip {
  padding: 0.05em 0.6em;
  border-radius: 1em;
  background: var(--field);
  font-size: 0.9em;
}

.swings {
  margin: 0;
  padding: 0;
  list-style: none;
}

.swings li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em 0.6em;
  padding: 0.3em 0;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.swings .roll {
  margin-left: auto;
}

.swings .outcome {
  width: 2.5em;
}

.swings .dmg {
  flex-basis: 100%;
  padding-left: 1em;
}

.swings .miss {
  color: var(--muted);
}

.swings .miss .dmg {
  display: none;
}

.swings .hit .outcome {
  color: var(--good);
}

.swings .crit .outcome {
  color: var(--crit);
  font-weight: 600;
}

.log {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.85em;
}

.log .good {
  color: var(--good);
}

.log .bad {
  color: var(--bad);
}

footer button {
  margin-left: 1em;
}

@media (max-width: 1000px) {
  .columns {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 680px) {
  .row {
    grid-template-columns: minmax(0, 1fr) 3.5em 8em 4.5em;
    grid-template-areas:
      'who ac hp delta'
      'opts extras extras extras';
  }
}

@container (max-width: 380px) {
  .row {
    grid-template-columns: minmax(0, 1fr) 3.5em 4.5em;
    grid-template-areas:
      'who ac delta'
      'hp hp hp'
      'opts opts opts'
      'extras extras extras';
  }
}
