/* ============================================================
   Adventure XP & Payment Calculator — Tavern Ledger Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=UnifrakturMaguntia&family=IM+Fell+English:ital@0;1&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* --- Variables --- */
:root {
  --parchment-light: #f5ead2;
  --parchment-mid:   #ede0be;
  --parchment-dark:  #d4b483;
  --parchment-shadow: #b8975a;
  --ink:             #1a0f05;
  --ink-faded:       #3d2a18;
  --ink-light:       #5a3e24;
  --blood-red:       #7d2020;
  --ink-red:         #931B1B;
  --sea-green:       #2E8B57;
  --green-ink:       #097969;
  --gold:            #c9920a;
  --gold-bright:     #e8b02a;
  --vellum-border:   #9c7a3c;
  --scroll-shadow:   rgba(43, 29, 14, 0.35);

  --font-display:  'UnifrakturMaguntia', cursive;
  --font-body:     'Crimson Pro', Georgia, serif;
  --font-italic:   'IM Fell English', Georgia, serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: #3a2510;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(0,0,0,0.04) 60px,
      rgba(0,0,0,0.04) 61px
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  padding: 2rem 1.5rem;
}

/* --- Page Header --- */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tool-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--gold-bright);
  text-shadow:
    2px 2px 0 #3a1a00,
    0 0 24px rgba(232,176,42,0.4);
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.tool-header p {
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--gold);
  font-size: 1.2rem;
  margin-top: 0.4rem;
}

/* --- Split Pane Layout --- */
.split-pane-editor {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 900px) {
  .split-pane-editor {
    grid-template-columns: 1fr;
  }
}

/* --- Shared Panel Base (parchment scroll) --- */
.editor-panel {
    min-width: 700px;
  height: calc(100vh - 4rem); /* or whatever fits your layout */
  overflow-y: auto;
}
.editor-panel,
.result-panel {
  background-color: var(--parchment-light);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E"),
    linear-gradient(160deg, var(--parchment-light) 0%, var(--parchment-mid) 60%, var(--parchment-dark) 100%);
  border: 2px solid var(--vellum-border);
  border-radius: 2px;
  box-shadow:
    inset 0 0 30px rgba(180,140,80,0.2),
    4px 6px 20px var(--scroll-shadow),
    0 0 0 1px rgba(100,60,10,0.15);
  padding: 1.8rem 2rem;
  position: relative;
}

/* Decorative corner marks */
.editor-panel::before,
.editor-panel::after,
.result-panel::before,
.result-panel::after {
  content: '✦';
  position: absolute;
  font-size: 0.9rem;
  color: var(--gold);
  opacity: 0.6;
  line-height: 1;
}
.editor-panel::before,  .result-panel::before  { top:    0.5rem; left:  0.7rem; }
.editor-panel::after,   .result-panel::after   { bottom: 0.5rem; right: 0.7rem; }

/* --- Editor Panel Titles --- */
.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--blood-red);
  text-align: center;
  letter-spacing: 0.03em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  margin-bottom: 0.2rem;
}

.section-subtitle {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-light);
  text-align: center;
  margin-bottom: 1.4rem;
}

/* --- Fieldsets --- */
.adventure-form fieldset {
  border: none;
  border-top: 1.5px solid var(--parchment-shadow);
  padding: 1.1rem 0 0.6rem;
  margin-bottom: 0.8rem;
  position: relative;
}

.adventure-form fieldset + fieldset {
  border-top: 1.5px dashed var(--parchment-shadow);
}

.adventure-form legend {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold);
  padding: 0 0.6rem;
  letter-spacing: 0.06em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}

/* --- Lists inside fieldsets --- */
.adventure-form ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --- Cards --- */
.md-card,
.item-card {
  background: rgba(255, 248, 230, 0.55);
  border: 1px solid rgba(156, 122, 60, 0.35);
  border-radius: 2px;
  padding: 0.55rem 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  box-shadow: inset 0 1px 3px rgba(180,140,80,0.12);
}

/* --- Labels --- */
.editor-label {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-faded);
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Text Inputs --- */
.text-input {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: rgba(255, 252, 240, 0.8);
  border: 1px solid var(--parchment-shadow);
  border-radius: 1px;
  padding: 0.28rem 0.55rem;
  min-width: 80px;
  max-width: 180px;
  box-shadow: inset 0 1px 3px rgba(100,60,10,0.1);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow:
    inset 0 1px 3px rgba(100,60,10,0.1),
    0 0 0 2px rgba(201,146,10,0.2);
}

.text-input[readonly] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Checkbox --- */
.checkbox-input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--blood-red);
  cursor: pointer;
}

/* --- Buttons --- */
.create-button,
.delete-button {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1rem;
  border-radius: 1px;
  border: 1px solid;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  letter-spacing: 0.03em;
}

.create-button {
  background: var(--ink);
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  margin-top: 0.3rem;
  align-self: flex-start;
}

.create-button:hover {
  background: var(--ink-faded);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

.create-button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.delete-button {
  background: transparent;
  color: var(--blood-red);
  border-color: var(--blood-red);
  margin-left: auto;
}

.delete-button:hover {
  background: var(--blood-red);
  color: var(--parchment-light);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.delete-button:active {
  transform: translateY(1px);
}

/* ============================================================
   Results Panel
   ============================================================ */

.result-panel {
  position: sticky;
  top: 1.5rem;
}

.result-panel [role="group"] {
  margin-bottom: 1.4rem;
}

/* Summary heading */
#session-summary {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--blood-red);
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid var(--parchment-shadow);
}

/* Definition list */
.result-panel dl {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0.5rem;
  column-gap: 1rem;
  align-items: baseline;
}

.result-panel dt {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-faded);
}

.result-panel dd {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  text-align: right;
}

/* Divider lines between dl rows */
.result-panel dt:not(:first-child),
.result-panel dd:not(:first-child) {
  padding-top: 0.35rem;
  border-top: 1px dotted rgba(156,122,60,0.4);
}

/* Errors section */
.result-panel > div:last-child > span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--blood-red);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.result-panel > div:last-child ul {
  list-style: none;
  padding: 0;
}

.result-panel > div:last-child li {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--blood-red);
  padding: 0.25rem 0.4rem;
  background: rgba(125,32,32,0.08);
  border-left: 2px solid var(--blood-red);
  margin-bottom: 0.35rem;
}

/* ============================================================
   Scrollbar styling (Webkit)
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--parchment-mid); }
::-webkit-scrollbar-thumb {
  background: var(--vellum-border);
  border-radius: 2px;
}

/* Foretell button */
#generate-weather-button {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 1px;
  padding: 0.45rem 2rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 1.1rem;
  align-self: flex-start;
  text-shadow: 1px 1px 0 #3a1a00;
}

#generate-weather-button:hover {
  background: var(--ink-faded);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

#generate-weather-button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* --- Modal open button (top-right of summary panel) --- */
.modal-open-button {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: #d4edda;
  background: #2a5c35;
  border: 1px solid var#4a8c5c;
  border-radius: 1px;
  padding: 0.45rem 2rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 1.1rem;
  text-shadow: 2px 2px 0 #3a1a00;
}

.modal-open-button:hover {
  background: #3a7a48;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

/* --- Modal overlay (hyperscript version) --- */
#summary-modal {
  position: fixed;
  top:0px;
	bottom: 0px;
	left:0px;
	right:0px;
  z-index:1000;
  	 /*Animate when opening*/
	animation-name: fadeIn;
	animation-duration:150ms;
	animation-timing-function: ease;
}

#summary-modal.open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@keyframes closing {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

#summary-modal.closing .modal-content {
  animation: closing 0.18s ease-in forwards;
}

.modal-underlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 0, 0.72);
  z-index: -1;
}

/* --- Modal content box --- */
.modal-content {
  background-color: var(--parchment-light);
  background-image:
    url("data:image/svg+xml,..."), /* same texture as your panels */
    linear-gradient(160deg, var(--parchment-light) 0%, var(--parchment-mid) 60%, var(--parchment-dark) 100%);
  border: 2px solid var(--vellum-border);
  border-radius: 2px;
  padding: 2rem 2.4rem;
  box-shadow: inset 0 0 30px rgba(180,140,80,0.2), 6px 10px 32px rgba(43,29,14,0.55);
  width: 90vw;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

/* Corner marks */
.modal-content::before { content: '✦'; position: absolute; top: 0.5rem; left: 0.7rem; color: var(--gold); opacity: 0.6; font-size: 0.9rem; }
.modal-content::after  { content: '✦'; position: absolute; bottom: 0.5rem; right: 0.7rem; color: var(--gold); opacity: 0.6; font-size: 0.9rem; }

/* --- Pre block --- */
.modal-grid pre {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink);
  background: rgba(255, 248, 230, 0.6);
  border: 1px solid rgba(156, 122, 60, 0.35);
  border-radius: 1px;
  padding: 1rem 1.1rem;

  white-space: pre;       /* preserves all whitespace and line breaks exactly */
  overflow-x: auto;       /* horizontal scroll for long lines instead of wrapping */
  overflow-y: auto;
  max-height: 55vh;       /* scrolls vertically before the modal itself grows */

  /* thin parchment-toned scrollbars */
  scrollbar-width: thin;
  scrollbar-color: var(--vellum-border) transparent;
}

/* --- Copy button --- */
.copy-button {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--gold-bright);
  background: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 1px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  align-self: flex-start;
}

.copy-button:hover {
  background: var(--ink-faded);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

.copy-button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}


.modal-close-button {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-light);
  background-color: var(--red-ink);
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  transition: color 0.15s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);

}

.modal-close-button:hover {
  background: var(--blood-red);
  box-shadow: 3xp 3px 0 black;
  color: var(--ink);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--blood-red);
  text-align: center;
  letter-spacing: 0.03em;
  margin-bottom: 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1.5px solid var(--parchment-shadow);
}



.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}


/* --- Confirm button (green) --- */
.confirm-button {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 0.88rem;
  color: #d4edda;
  background: #2a5c35;
  border: 1px solid #4a8c5c;
  border-radius: 1px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.confirm-button:hover {
  background: #3a7a48;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

.confirm-button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* --- Delete / danger button (red) --- */
.danger-button {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 0.88rem;
  color: #f5d5d5;
  background: var(--blood-red);
  border: 1px solid #a83030;
  border-radius: 1px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.danger-button:hover {
  background: #a83030;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

.danger-button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* ============================================================
   Weather Oracle — Page & Calendar Styles
   ============================================================ */

/* ── Page shell ─────────────────────────────────────────────── */
body {
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Parameters panel (full-width card) ─────────────────────── */
#weather-controls {
  background-color: var(--parchment-light);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E"),
    linear-gradient(160deg, var(--parchment-light) 0%, var(--parchment-mid) 60%, var(--parchment-dark) 100%);
  border: 2px solid var(--vellum-border);
  border-radius: 2px;
  box-shadow:
    inset 0 0 30px rgba(180,140,80,0.2),
    4px 6px 20px var(--scroll-shadow),
    0 0 0 1px rgba(100,60,10,0.15);
  padding: 1.8rem 2.2rem 1.6rem;
  position: relative;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* corner marks */
#weather-controls::before,
#weather-controls::after {
  content: '✦';
  position: absolute;
  font-size: 0.9rem;
  color: var(--gold);
  opacity: 0.6;
  line-height: 1;
}
#weather-controls::before { top: 0.5rem; left: 0.7rem; }
#weather-controls::after  { bottom: 0.5rem; right: 0.7rem; }

/* intro text */
#weather-controls > p {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-faded);
  line-height: 1.65;
  margin-bottom: 1.3rem;
}

/* form layout */
#weather-controls form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* selects row */
#weather-controls fieldset:first-of-type {
  border: none;
  border-top: 1.5px solid var(--parchment-shadow);
  padding: 1rem 0 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem 1.4rem;
  align-items: end;
}

#weather-controls fieldset:first-of-type legend {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--blood-red);
  padding: 0 0.6rem 0 0;
  letter-spacing: 0.06em;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}

/* radio row */
#weather-controls fieldset:last-of-type {
  border: none;
  border-top: 1.5px dashed var(--parchment-shadow);
  padding: 0.9rem 0 0.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.2rem;
}

#weather-controls fieldset:last-of-type legend {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--blood-red);
  padding: 0 0.6rem 0 0;
  letter-spacing: 0.06em;
  flex-basis: 100%;
}

/* label + select pairs */
#weather-controls label {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-faded);
  display: block;
  margin-bottom: 0.2rem;
}

#weather-controls select {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 252, 240, 0.9);
  border: 1px solid var(--parchment-shadow);
  border-radius: 1px;
  padding: 0.3rem 0.55rem;
  width: 100%;
  box-shadow: inset 0 1px 3px rgba(100,60,10,0.1);
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239c7a3c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.8rem;
}

#weather-controls select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: inset 0 1px 3px rgba(100,60,10,0.1), 0 0 0 2px rgba(201,146,10,0.2);
}

/* radio inputs */
#weather-controls input[type="radio"] {
  accent-color: var(--blood-red);
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
}

#weather-controls fieldset:last-of-type label {
  display: inline;
  margin-bottom: 0;
  margin-left: 0.2rem;
}

/* Foretell button */
#generate-weather-button {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 1px;
  padding: 0.45rem 2rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 1.1rem;
  align-self: flex-start;
  text-shadow: 1px 1px 0 #3a1a00;
}

#generate-weather-button:hover {
  background: var(--ink-faded);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

#generate-weather-button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}



/* ── Calendar header ─────────────────────────────────────────── */
.calendar-header {
  text-align: center;
  max-width: 1280px;
  margin: 0 auto;
}

.calendar-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--gold-bright);
  text-shadow: 2px 2px 0 #3a1a00, 0 0 18px rgba(232,176,42,0.35);
  letter-spacing: 0.04em;
}

.calendar-header p {
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--parchment-dark);
  font-size: 1rem;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* ── Calendar grid ───────────────────────────────────────────── */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .weather-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 550px) {
  .weather-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Individual day cell ─────────────────────────────────────── */
.weather-entry {
  background-color: var(--parchment-light);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    linear-gradient(170deg, var(--parchment-light) 0%, var(--parchment-mid) 100%);
  border: 1.5px solid var(--vellum-border);
  border-radius: 2px;
  box-shadow:
    inset 0 0 14px rgba(180,140,80,0.15),
    2px 3px 10px var(--scroll-shadow);
  padding: 0.7rem 0.75rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  min-height: 180px;
}

/* day number badge */
.day-number {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--blood-red);
  letter-spacing: 0.04em;
  line-height: 1;
  border-bottom: 1px dotted rgba(156,122,60,0.5);
  padding-bottom: 0.3rem;
  margin-bottom: 0.1rem;
}

/* results dl */
.weather-entry .results dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem 0;
}

.weather-entry .results dd,
.weather-entry .results dt {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.4;
}

.weather-entry .results dd {
  font-style: italic;
  color: var(--ink-faded);
  margin: 0;
}

.weather-entry .results dt {
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.2rem 0.5rem;
}

/* ── Roll inputs ─────────────────────────────────────────────── */
.roll-input fieldset {
  border: none;
  border-top: 1px dashed rgba(156,122,60,0.4);
  padding: 0.4rem 0 0;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.roll-input legend {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--blood-red);
  padding: 0 0.3rem 0 0;
  letter-spacing: 0.05em;
}

.roll-input label {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-faded);
  margin-bottom: 0.05rem;
}

.roll-input input[type="text"] {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: rgba(255, 252, 240, 0.8);
  border: 1px solid var(--parchment-shadow);
  border-radius: 1px;
  padding: 0.18rem 0.4rem;
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(100,60,10,0.08);
  transition: border-color 0.15s;
}

.roll-input input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: inset 0 1px 2px rgba(100,60,10,0.08), 0 0 0 2px rgba(201,146,10,0.2);
}

.roll-input input[readonly] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Modifiers strip ─────────────────────────────────────────── */
.modifiers {
  border-top: 1px dashed rgba(156,122,60,0.4);
  padding-top: 0.3rem;
  margin-top: auto;
}

.modifiers dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  margin: 0;
}

.modifiers dd,
.modifiers dt {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-light);
  margin: 0;
}

.modifiers dd { font-style: italic; }
.modifiers dt { font-weight: 600; }

/* ── Precipitation colour accents ────────────────────────────── */
.weather-entry[data-precip="Rain"]  { border-left: 3px solid #4a7ea5; }
.weather-entry[data-precip="Snow"]  { border-left: 3px solid #a8c8e0; }
.weather-entry[data-precip="Storm"] { border-left: 3px solid var(--blood-red); }
.weather-entry[data-precip="Clear"] { border-left: 3px solid var(--gold); }

/* ── Calendar spacer (day-of-week offset) ────────────────────── */
.calendar-spacer { /* transparent placeholder */ }

/* ── HTMX loading indicator ──────────────────────────────────── */
#weather.htmx-request .weather-grid {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s;
}


.drag-right {
  float: right;
  margin-right: 0.5em;
}
