/* Wombatworld — parchment & ink theme
   Palette: warm creams, sepia, dark brown ink. */
:root {
  --cream: #f6ecd6;
  --parchment: #efe0bf;
  --parchment-dark: #e2cc9f;
  --sepia: #8b5e34;
  --sepia-light: #b88a55;
  --ink: #3b2a1a;
  --ink-soft: #5c4530;
  --rust: #8a3b22;
  --moss: #4f6b3a;
  --edge: rgba(91, 61, 31, 0.35);
  --shadow: 0 2px 10px rgba(59, 42, 26, 0.18), inset 0 0 60px rgba(139, 94, 52, 0.15);
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-fell: 'IM Fell English', Georgia, serif;
  --font-body: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --radius: 6px;
  --gap: clamp(1rem, 2.5vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 106.25%; }

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--ink);
  background-color: #d9c39a;
  background-image:
    radial-gradient(ellipse at top, rgba(255, 248, 230, 0.6), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(110, 72, 36, 0.25), transparent 70%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--rust); }
a:hover, a:focus-visible { color: var(--ink); }
:focus-visible { outline: 2px dashed var(--rust); outline-offset: 3px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--cream); padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, #4a3220, #3b2a1a);
  color: var(--cream);
  border-bottom: 3px double var(--sepia-light);
}
.site-header__inner {
  max-width: 1200px; margin: 0 auto; padding: 1rem var(--gap);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand__title {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: .08em; color: #f3dfb0;
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.brand__subtitle { margin: .1rem 0 0; font-family: var(--font-fell); color: #e0c897; font-size: 1.05rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-family: var(--font-display); font-size: .9rem; letter-spacing: .05em; }
.site-nav a { color: #f0dcb0; text-decoration: none; padding: .25rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--sepia-light); color: #fff3d6; }
.site-nav__login { border: 1px solid var(--sepia-light) !important; padding: .25rem .75rem !important; border-radius: var(--radius); }

/* ---------- Layout ---------- */
.layout {
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--gap);
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; align-content: start;
}

.parchment {
  background-color: var(--parchment);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.35), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(139,94,52,.18), transparent 45%);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 2rem);
}

/* ---------- Adventure log ---------- */
.adventure__meta {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--font-display); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sepia);
}
.scene-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: .3rem 0 1rem; color: var(--ink); border-bottom: 2px solid var(--edge); padding-bottom: .4rem;
}
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.log__entry p { margin: 0 0 .5rem; }
.log__entry--narration { font-size: 1.12rem; }
.log__entry--player {
  font-family: var(--font-fell); font-style: italic; color: var(--ink-soft);
  border-left: 3px solid var(--sepia-light); padding-left: 1rem; margin-left: .5rem;
}
.log__who { display: block; font-family: var(--font-display); font-style: normal; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sepia); }
.log__entry--system {
  font-size: .95rem; color: var(--moss); background: rgba(79,107,58,.08);
  border: 1px dashed rgba(79,107,58,.4); border-radius: var(--radius); padding: .5rem .75rem;
}
.log__entry--system p { margin: 0; }
.log__roll { font-size: .9rem; color: var(--rust); font-variant: small-caps; letter-spacing: .03em; }
.dropcap::first-letter {
  float: left; font-family: var(--font-display); font-size: 3.4rem; line-height: .9;
  padding: .15rem .5rem 0 0; color: var(--rust);
}

.choices { margin-top: 1.75rem; }
.choices__title { font-family: var(--font-display); font-size: 1rem; letter-spacing: .06em; color: var(--sepia); margin: 0 0 .6rem; }
.choices__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.choice {
  font: inherit; font-family: var(--font-fell); font-size: 1rem; color: var(--ink);
  background: var(--cream); border: 1px solid var(--sepia-light); border-radius: 999px;
  padding: .35rem 1rem; cursor: pointer; transition: background .15s, transform .15s;
}
.choice:hover, .choice:focus-visible { background: #fff6e0; transform: translateY(-1px); }

.act-form { margin-top: 1.25rem; display: flex; gap: .6rem; align-items: stretch; }
.act-form textarea {
  flex: 1; font: inherit; font-size: 1.05rem; color: var(--ink); resize: vertical; min-height: 3rem;
  background: var(--cream); border: 1px solid var(--edge); border-radius: var(--radius); padding: .6rem .8rem;
}
.btn {
  font-family: var(--font-display); font-weight: 700; letter-spacing: .08em; font-size: .95rem;
  color: var(--cream); background: var(--rust); border: 1px solid #5e2614; border-radius: var(--radius);
  padding: .6rem 1.4rem; cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: #6f2e19; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- Character sheet ---------- */
.sheet { position: sticky; top: var(--gap); }
.sheet__title { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .08em; text-align: center; margin: 0 0 .75rem; color: var(--sepia); }
.sheet__identity { text-align: center; border-bottom: 1px solid var(--edge); padding-bottom: .75rem; margin-bottom: .9rem; }
.sheet__name { font-family: var(--font-fell); font-size: 1.6rem; margin: 0; line-height: 1.2; }
.sheet__kin { margin: .2rem 0 0; color: var(--ink-soft); font-size: .95rem; }
.sheet__heading {
  font-family: var(--font-display); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sepia); margin: 1.2rem 0 .5rem; display: flex; align-items: center; gap: .5rem;
}
.sheet__heading::after { content: ""; flex: 1; height: 1px; background: var(--edge); }

.bar { margin-bottom: .75rem; }
.bar__label { display: flex; justify-content: space-between; font-size: .95rem; font-weight: 600; }
.bar__track { height: .55rem; background: var(--parchment-dark); border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; }
.bar__fill { height: 100%; }
.bar__fill--hp { background: linear-gradient(90deg, #8a3b22, #b0563a); }
.bar__fill--ap { background: linear-gradient(90deg, #8b5e34, #c69a5e); }
.bar__note { margin: .2rem 0 0; font-size: .85rem; color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: 0; }
.stat {
  text-align: center; background: var(--cream); border: 1px solid var(--edge); border-radius: var(--radius); padding: .35rem 0;
}
.stat dt { font-family: var(--font-display); font-size: .7rem; letter-spacing: .1em; color: var(--sepia); }
.stat dd { margin: 0; font-size: 1.3rem; font-weight: 600; line-height: 1.2; }

.inventory, .objectives { list-style: none; margin: 0; padding: 0; }
.inventory li { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dotted var(--edge); }
.inventory .qty { color: var(--sepia); font-variant-numeric: tabular-nums; }
.objectives li { padding: .2rem 0 .2rem 1.5rem; position: relative; }
.objectives li::before { content: "\2610"; position: absolute; left: 0; color: var(--sepia); }
.objectives li.done { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--sepia-light); }
.objectives li.done::before { content: "\2611"; }

/* ---------- Footer ---------- */
.site-footer {
  background: #3b2a1a; color: #e0c897; text-align: center; padding: 1.25rem var(--gap);
  border-top: 3px double var(--sepia-light); font-size: .95rem;
}
.site-footer p { margin: .2rem 0; }
.site-footer code { background: rgba(255,255,255,.08); padding: 0 .3rem; border-radius: 3px; }
.site-footer__small { font-size: .8rem; opacity: .8; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }   /* sheet stacks under the log */
  .sheet { position: static; }
}
@media (max-width: 520px) {
  html { font-size: 100%; }
  .site-header__inner { flex-direction: column; align-items: flex-start; }
  .act-form { flex-direction: column; }
  .btn { width: 100%; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Playable client additions ---------- */
[hidden] { display: none !important; }
.notice {
  background: rgba(138,59,34,.08); border: 1px solid rgba(138,59,34,.4); color: var(--rust);
  border-radius: var(--radius); padding: .6rem .9rem; margin-bottom: 1rem;
}
.start-form label { display: block; font-family: var(--font-display); font-size: .85rem; letter-spacing: .08em; color: var(--sepia); margin: 1rem 0 .35rem; }
.start-form__row { display: flex; gap: .6rem; flex-wrap: wrap; }
.start-form input {
  flex: 1; min-width: 12rem; font: inherit; font-family: var(--font-fell); font-size: 1.15rem; color: var(--ink);
  background: var(--cream); border: 1px solid var(--edge); border-radius: var(--radius); padding: .5rem .8rem;
}
.site-nav__btn {
  font: inherit; color: #f0dcb0; background: transparent; cursor: pointer;
  border: 1px solid var(--sepia-light); padding: .25rem .75rem; border-radius: var(--radius);
}
.site-nav__btn:hover { background: rgba(255,255,255,.08); }
.foe { font-family: var(--font-fell); color: var(--rust); margin: -.4rem 0 1rem; }
.log { max-height: 60vh; overflow-y: auto; padding-right: .4rem; }
.log__entry--scene { font-size: 1.08rem; border-top: 1px solid var(--edge); padding-top: .75rem; }
.log__entry--scene strong { font-family: var(--font-display); display: block; color: var(--sepia); letter-spacing: .05em; }
.sheet__empty { text-align: center; font-style: italic; color: var(--ink-soft); }
.bar__fill { transition: width .4s ease; }
@media (max-width: 900px) { .log { max-height: none; } }
