* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { color-scheme: dark; }
body {
  min-height: 100svh; margin: 0; color: #f3ead6; font: 1rem/1.5 system-ui, sans-serif;
  background: radial-gradient(ellipse at 18% 0%, #274637, #101c18 65%);
}
.site-header {
  min-height: 4.5rem; border-bottom: 1px solid #53685b;
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem max(1.25rem, calc((100% - 65rem) / 2));
}
main { width: min(65rem, calc(100% - 2.5rem)); margin: clamp(2rem, 7vw, 5rem) auto; }
.panel, dialog {
  padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid #53685b;
  border-radius: 1rem; background: #192923; color: inherit;
}
.auth { width: min(100%, 28rem); margin-inline: auto; }
.brand { color: #e4be78; font: 1.4rem Georgia, serif; }
h1, h2 { font-family: Georgia, serif; font-weight: normal; }
h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 5vw, 3rem); }
h2 { margin: 0; font-size: 1.55rem; }
.auth form, .dashboard, .overview { display: grid; gap: .75rem; }
.dashboard, .overview { gap: 1rem; }
.overview { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.dashboard h1 { margin-bottom: .5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
input, button { font: inherit; border-radius: .5rem; padding: .65rem .85rem; }
input { background: #101e18; color: inherit; border: 1px solid #78897e; }
button { border: 1px solid transparent; background: #e4be78; color: #211b13; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
.secondary { background: transparent; color: #f3ead6; border-color: #78897e; }
.auth button { margin-top: .65rem; }
:focus-visible { outline: 2px solid #f6d692; outline-offset: 3px; }
small, .muted, dt { color: #bdc9bc; }
dl { margin-bottom: 0; }
dt { font-size: .88rem; }
dd { margin: 0 0 .85rem; overflow-wrap: anywhere; }
dd:last-child { margin-bottom: 0; }
.plan { color: #e4be78; font-size: 1.4rem; margin-bottom: .25rem; }
.plan + p { margin-top: 0; }
#status { max-width: 28rem; margin-inline: auto; }
#status:empty { display: none; }
dialog { width: min(28rem, calc(100% - 2.5rem)); }
dialog::backdrop { background: #060e0bbd; }

#character-form { display: grid; gap: .75rem; margin-top: 1rem; }
#world-description {
  width: 100%; min-width: 0; resize: vertical; font: inherit; padding: .35rem .55rem;
  border: 1px solid var(--line); border-radius: .5rem; background: var(--inset); color: inherit;
}
#character-form .section-header { justify-content: flex-start; }
#characters-list a { color: #e4be78; }
#create-status:empty { display: none; }

.site-header { justify-content: flex-start; gap: .75rem; }
.site-header #logout { margin-left: auto; }
.menu-toggle { line-height: 1; padding: .4rem .55rem; }
.drawer {
  position: fixed; inset: 0 auto 0 0; margin: 0; width: min(20rem, 85vw);
  height: 100dvh; max-height: none; border-radius: 0 1rem 1rem 0;
}
.drawer[open] { animation: slide-menu .18s ease-out; }
.drawer nav { display: grid; gap: .35rem; margin-top: 1.15rem; }
.drawer a { padding: .65rem .5rem; border-radius: .4rem; color: inherit; text-decoration: none; }
.drawer a:hover, .drawer a:focus-visible { background: #274637; }
@keyframes slide-menu { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
