:root {
  --bg: #171e1c;
  --panel: #202925;
  --text: #ebece1;
  --muted: #a8b4a8;
  --accent: #d6bd7e;
  --danger: #e09383;
  --line: #39443c;
  --green: #a2b79b;
  --inset: #1b231f;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  scrollbar-color: #59685a var(--bg);
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: var(--text);
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 4px;
  min-height: 44px;
  padding: 10px 16px;
  transition:
    background 0.18s,
    border-color 0.18s;
}
button:hover:not(:disabled) {
  background: #344034;
  border-color: #7d8c71;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #24291d;
  font-weight: 600;
}
button.primary:hover:not(:disabled) {
  background: #e3cb92;
}
button.danger {
  color: var(--danger);
  border-color: #8b554a;
}
button.text-button {
  border: 0;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #4b5549;
  border-radius: 4px;
  background: #19211c;
  color: var(--text);
  padding: 12px 13px;
  min-height: 46px;
}
textarea {
  resize: none;
  line-height: 1.65;
  min-height: 92px;
}
input::placeholder,
textarea::placeholder {
  color: #7f8e80;
}
input[aria-invalid="true"] {
  border-color: var(--danger);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 500;
}
small {
  font-size: 11px;
}
::selection {
  background: #b2a373;
  color: #18201a;
}
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #59685a;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #849477;
}
::-webkit-scrollbar-thumb:active {
  background: var(--accent);
}
.topbar {
  height: 78px;
  padding: 0 4%;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  letter-spacing: 3px;
  font-family: var(--serif);
  font-size: 20px;
}
.brand-mark {
  width: 35px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 21px;
  clip-path: polygon(0 0, 100% 0, 100% 84%, 84% 100%, 0 100%);
}
.brand small {
  display: block;
  font: 9px var(--mono);
  letter-spacing: 3.2px;
  margin-top: 4px;
  color: var(--muted);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 12px;
  color: var(--muted);
}
.signal {
  display: flex;
  gap: 8px;
  align-items: center;
}
.signal i,
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}
.home-link:hover {
  color: var(--accent);
}
.icon-button {
  width: 44px;
  padding: 4px;
  font-size: 19px;
}
.topbar .icon-button {
  width: 32px;
  border: 0;
}
.loading {
  padding: 60px;
  text-align: center;
}
.eyebrow {
  font: 11px var(--mono);
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.creation {
  max-width: 1440px;
  margin: 38px auto 60px;
  display: grid;
  grid-template-columns: 43% 57%;
  padding: 0 4%;
}
.creation-art {
  position: relative;
  min-height: 790px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  overflow: hidden;
  background: #334b3d;
}
.city-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.art-caption {
  position: absolute;
  inset: 32px 30px auto;
  display: flex;
  justify-content: space-between;
  font: 10px var(--mono);
  letter-spacing: 2px;
  color: #f2ebd1;
}
.art-caption span:first-child {
  border: 1px solid #cad0ae77;
  padding: 8px 10px;
  background: #263a3277;
}
.art-coordinates {
  position: absolute;
  right: 28px;
  top: 112px;
  writing-mode: vertical-rl;
  font: 10px var(--mono);
  letter-spacing: 2px;
  color: #d2d7bb;
}
.art-title {
  position: absolute;
  left: 36px;
  right: 25px;
  bottom: 45px;
}
.art-title .eyebrow {
  font-size: 10px;
}
.art-title h1 {
  font-family: var(--serif);
  font-size: 68px;
  line-height: 1.3;
  letter-spacing: 8px;
  margin: 14px 0 17px;
  text-shadow: 0 2px 25px #132315;
}
.art-title p {
  color: #c2cbb8;
  font-size: 13px;
  line-height: 2.2;
  letter-spacing: 1px;
}
.art-title .art-rule {
  width: 46px;
  height: 1px;
  background: var(--accent);
  margin: 26px 0;
}
.registration {
  padding: 37px 40px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}
.registration-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.file-number {
  font: 10px var(--mono);
  color: #899584;
  letter-spacing: 1px;
}
.registration h2 {
  font: 30px var(--serif);
  letter-spacing: 2px;
  margin: 15px 0 12px;
}
.registration .intro {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}
.form-section {
  border: 0;
  padding: 0;
  margin: 26px 0 0;
  min-width: 0;
}
.form-section legend {
  font-size: 12px;
  letter-spacing: 1px;
  width: 100%;
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
  margin-bottom: 14px;
  color: var(--accent);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 18px;
}
.field label {
  font-size: 12px;
  color: #c7cebd;
  display: block;
  margin: 0 0 7px;
}
.field input {
  font-size: 13px;
  min-height: 43px;
  padding: 10px 12px;
}
.field.wide {
  grid-column: 1/-1;
}
.field-error {
  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
}
.field-error:not(:empty) {
  padding-top: 5px;
}
.registration-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.registration-actions .primary {
  flex: 1;
}
.clock-note {
  margin-top: 15px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.form-feedback {
  min-height: 21px;
  font-size: 12px;
  color: var(--danger);
  padding-top: 8px;
}
.resume-strip {
  background: #313b2a;
  border: 1px solid #617052;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 23px;
  font-size: 13px;
  line-height: 1.8;
}
.resume-strip button {
  margin-top: 10px;
}
.draft-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 15px;
}
.game {
  max-width: 1540px;
  margin: auto;
  padding: 0 3% 28px;
}
.worldbar {
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.world-date {
  display: flex;
  align-items: center;
  gap: 22px;
}
.day-label {
  font: 12px var(--mono);
  color: var(--accent);
  letter-spacing: 1px;
}
.world-date strong {
  font: 30px var(--mono);
  letter-spacing: 1px;
}
.weather {
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 22px;
  line-height: 1.8;
}
.world-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.save-status {
  font-size: 11px;
  color: var(--muted);
  margin-right: 10px;
}
.game-grid {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr) 262px;
  gap: 22px;
  align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.panel-heading {
  font-size: 12px;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--line);
  padding: 17px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-heading small {
  font: 10px var(--mono);
  letter-spacing: 0;
  color: var(--muted);
}
.profile {
  padding: 22px 19px 17px;
}
.profile-avatar {
  width: 46px;
  height: 46px;
  background: #354232;
  border: 1px solid #5c6c52;
  display: grid;
  place-items: center;
  font: 23px var(--serif);
  color: var(--accent);
  border-radius: 50%;
  margin-bottom: 15px;
}
.profile h2 {
  font: 23px var(--serif);
  margin-bottom: 7px;
  overflow-wrap: anywhere;
}
.profile p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.status-pill {
  margin-top: 13px;
  display: inline-block;
  padding: 5px 8px;
  border: 1px solid #566449;
  color: var(--green);
  font-size: 10px;
  border-radius: 3px;
}
.vitals {
  padding: 18px 19px;
  border-top: 1px solid var(--line);
}
.stat {
  margin-bottom: 17px;
}
.stat:last-child {
  margin-bottom: 0;
}
.stat-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: #b7c2b1;
  margin-bottom: 7px;
}
.stat-label b {
  font: 11px var(--mono);
  font-weight: 400;
  color: var(--text);
}
.stat-track {
  height: 3px;
  background: #3b4537;
}
.stat-track i {
  display: block;
  height: 100%;
  background: var(--green);
}
.stat-track i.bad {
  background: var(--danger);
}
.stat-track i.warn {
  background: var(--accent);
}
.minor-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 8px;
  border-top: 1px solid var(--line);
  padding: 18px 19px;
}
.minor-stats dt {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}
.minor-stats dd {
  margin: 0;
  font: 12px var(--mono);
}
.equipment {
  padding: 15px 19px;
  border-top: 1px solid var(--line);
}
.equipment h3 {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 9px;
}
.equipment p {
  font-size: 12px;
  line-height: 1.9;
}
.side-buttons {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.side-buttons button {
  font-size: 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
}
.sidebar-foot {
  font-size: 10px;
  color: #95a38f;
  padding: 16px 4px;
  line-height: 1.9;
}
.journal {
  min-width: 0;
}
.journal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
}
.journal-heading h2 {
  font: 22px var(--serif);
  letter-spacing: 2px;
}
.journal-heading span {
  font: 10px var(--mono);
  color: var(--muted);
}
.location-banner {
  height: 154px;
  position: relative;
  overflow: hidden;
  border: 1px solid #485745;
  border-radius: 6px;
  margin-bottom: 22px;
  background: #334b3d;
}
.location-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  opacity: 0.64;
}
.location-banner:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #18251de8, transparent);
}
.location-label {
  position: absolute;
  z-index: 1;
  left: 23px;
  bottom: 22px;
}
.location-label span {
  font: 9px var(--mono);
  color: #d4d6ba;
  letter-spacing: 2px;
}
.location-label h3 {
  font: 25px var(--serif);
  margin-top: 8px;
  letter-spacing: 3px;
}
.location-label small {
  font: 11px sans-serif;
  letter-spacing: 0;
  margin-left: 13px;
  color: #c2cbb8;
}
.entries {
  max-height: 535px;
  overflow: auto;
  padding: 1px 12px 15px 0;
  scroll-behavior: smooth;
}
.entry {
  position: relative;
  border-left: 1px solid #46503f;
  padding: 0 0 26px 23px;
  margin-left: 5px;
}
.entry:last-child {
  padding-bottom: 5px;
}
.entry:before {
  content: "";
  position: absolute;
  left: -4px;
  top: 4px;
  width: 7px;
  height: 7px;
  background: #718467;
  border-radius: 50%;
}
.entry:first-child:before {
  background: var(--accent);
}
.entry-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font: 10px var(--mono);
  color: var(--muted);
  margin-bottom: 12px;
}
.entry-meta .log-kind {
  font: 10px sans-serif;
  color: var(--accent);
  letter-spacing: 1px;
}
.entry h3 {
  font: 19px var(--serif);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.entry .prose {
  font-size: 14px;
  line-height: 2.1;
  color: #cbd2c1;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.player-action {
  padding: 9px 12px;
  border-left: 2px solid #647553;
  background: #242e24;
  margin-bottom: 13px;
  font-size: 12px;
  line-height: 1.8;
  color: #b8c4ae;
  overflow-wrap: anywhere;
}
.changes {
  font-size: 11px;
  color: var(--accent);
  line-height: 1.8;
  margin-top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.changes span {
  padding: 2px 7px;
  background: #30362a;
  border: 1px solid #484e38;
  border-radius: 3px;
}
.observation {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  padding: 12px 0 0;
}
.observation b {
  color: #b1bda5;
  font-size: 10px;
  letter-spacing: 1px;
  display: block;
  font-weight: 400;
  margin-bottom: 5px;
}
.composer {
  border: 1px solid #637252;
  background: var(--panel);
  border-radius: 6px;
  padding: 15px 16px;
  margin-top: 20px;
}
.composer label {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--accent);
  display: block;
  margin-bottom: 9px;
}
.composer textarea {
  border: 0;
  padding: 4px 0;
  background: transparent;
  min-height: 68px;
  max-height: 160px;
  font-size: 13px;
}
.composer textarea:focus-visible {
  outline-offset: 2px;
}
.composer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.composer-bottom small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
}
.composer .primary {
  font-size: 12px;
  min-width: 100px;
}
.action-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.8;
}
.action-error:not(:empty) {
  padding: 10px 0;
}
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}
.suggestions button {
  font-size: 11px;
  padding: 6px 10px;
  min-height: 36px;
}
.journal-footer {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-top: 13px;
  line-height: 1.9;
}
.region-panel {
  overflow: hidden;
}
.map {
  height: 208px;
  position: relative;
  background: #1d2921;
  background-image:
    linear-gradient(#4b5d3833 1px, transparent 1px),
    linear-gradient(90deg, #4b5d3833 1px, transparent 1px);
  background-size: 28px 28px;
}
.map svg {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
}
.map-label {
  position: absolute;
  font-size: 9px;
  color: #b2c2a3;
}
.map-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid #555f3e;
  box-shadow: 0 0 0 5px #c9bb8122;
}
.map-caption {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: #a6b299;
}
.region-description {
  padding: 16px 19px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}
.region-description strong {
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
  display: block;
  margin-bottom: 5px;
}
.region-description button {
  font-size: 11px;
  width: 100%;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
}
.section-space {
  margin-top: 17px;
}
.bag-preview {
  padding: 6px 18px 12px;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  min-width: 0;
}
.item-row:last-child {
  border: 0;
}
.item-icon {
  width: 28px;
  height: 28px;
  border: 1px solid #4b5941;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
}
.item-name {
  flex: 1;
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.item-name small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 10px;
}
.item-quantity {
  font: 11px var(--mono);
  color: #c4cbb9;
}
.full-width {
  width: 100%;
}
.bag-bottom {
  padding: 0 18px 16px;
}
.bag-bottom button {
  font-size: 11px;
  min-height: 38px;
}
.world-note {
  padding: 18px;
  font-size: 12px;
  line-height: 2;
  color: #b5bfa9;
}
.world-note:before {
  content: "“";
  display: block;
  font: 30px var(--serif);
  line-height: 20px;
  color: var(--accent);
}
.world-note small {
  display: block;
  color: #94a28b;
  font-size: 10px;
  margin-top: 10px;
}
.notice {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translateX(-50%);
  padding: 12px 20px;
  z-index: 10;
  background: #34422f;
  border: 1px solid #788668;
  border-radius: 5px;
  box-shadow: 0 8px 30px #0003;
  font-size: 13px;
  max-width: 90vw;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.notice.show {
  opacity: 1;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #667354;
  border-radius: 8px;
  width: min(650px, calc(100vw - 32px));
  padding: 25px;
  max-height: 85dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #090f0bd6;
  backdrop-filter: blur(4px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.dialog-top h2 {
  font: 26px var(--serif);
  letter-spacing: 1px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.dialog-copy {
  font-size: 13px;
  line-height: 2;
  color: #c2ccba;
}
.dialog-copy p {
  margin: 0 0 13px;
}
.dialog-copy h3 {
  font-size: 15px;
  color: var(--accent);
  margin: 22px 0 9px;
}
.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 15px;
}
.detail-card h3 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}
.detail-card p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}
.detail-card button {
  margin-top: 12px;
  font-size: 11px;
  width: 100%;
}
.inventory-list .item-row {
  padding: 15px 0;
}
.inventory-list .item-row button {
  font-size: 11px;
  padding: 6px 10px;
}
.skill-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.memory-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.9;
  color: #c2ccba;
}
.empty {
  padding: 22px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}
.death {
  border: 1px solid #a67059;
  background: #382d26;
  padding: 25px;
  border-radius: 6px;
  margin-bottom: 20px;
}
.death h2 {
  font: 30px var(--serif);
  color: var(--danger);
  margin-bottom: 12px;
}
.death p {
  line-height: 2;
  font-size: 13px;
}
.conflict-banner {
  border: 1px solid var(--accent);
  padding: 14px 20px;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.8;
}
.conflict-banner button {
  margin-left: 10px;
}
.world-running {
  color: var(--green);
}
@media (min-width: 1600px) {
  .creation {
    margin-top: 55px;
  }
  .creation-art {
    min-height: 825px;
  }
}
@media (max-width: 1180px) {
  .game-grid {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .right-sidebar {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
  }
  .right-sidebar .section-space {
    margin-top: 0;
  }
  .registration {
    padding: 30px 26px;
  }
  .art-title {
    left: 28px;
  }
  .art-title h1 {
    font-size: 54px;
  }
  .creation {
    grid-template-columns: 40% 60%;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 68px;
    padding: 0 20px;
  }
  .brand {
    font-size: 18px;
  }
  .header-right {
    gap: 10px;
  }
  .signal {
    display: none;
  }
  .home-link {
    font-size: 11px;
  }
  .creation {
    display: block;
    padding: 0 16px;
    margin: 20px auto 30px;
  }
  .creation-art {
    min-height: 255px;
    height: 255px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
  }
  .city-art {
    object-position: center 45%;
  }
  .art-caption {
    inset: 17px 20px auto;
    font-size: 8px;
  }
  .art-coordinates {
    display: none;
  }
  .art-title {
    bottom: 21px;
    left: 23px;
  }
  .art-title h1 {
    font-size: 42px;
    letter-spacing: 7px;
    margin: 4px 0 9px;
  }
  .art-title .art-rule,
  .art-title p,
  .art-title > .eyebrow {
    display: none;
  }
  .registration {
    border-radius: 0 0 6px 6px;
    padding: 26px 20px;
  }
  .registration h2 {
    font-size: 26px;
  }
  .registration .intro {
    font-size: 12px;
  }
  .form-grid {
    gap: 14px 12px;
  }
  .file-number {
    font-size: 8px;
  }
  .registration-actions {
    flex-wrap: wrap;
  }
  .registration-actions .primary {
    flex-basis: 100%;
    order: -1;
  }
  .game {
    padding: 0 16px 25px;
  }
  .worldbar {
    padding: 18px 0;
    flex-wrap: wrap;
  }
  .world-date {
    gap: 15px;
  }
  .world-date strong {
    font-size: 26px;
  }
  .weather {
    padding-left: 15px;
    font-size: 10px;
  }
  .world-actions {
    width: 100%;
    justify-content: space-between;
  }
  .save-status {
    font-size: 10px;
  }
  .game-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .left-sidebar {
    width: 100%;
  }
  .profile {
    padding: 16px;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 2px 12px;
    align-items: center;
  }
  .profile-avatar {
    width: 38px;
    height: 38px;
    margin: 0;
    grid-row: 1/3;
  }
  .profile h2 {
    font-size: 20px;
    margin: 0;
  }
  .profile p {
    font-size: 10px;
  }
  .profile .status-pill {
    position: absolute;
    right: 33px;
    margin-top: 0;
    max-width: 100px;
    white-space: normal;
  }
  .vitals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px 20px;
    padding: 16px;
  }
  .stat {
    margin: 0;
  }
  .minor-stats {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 0;
  }
  .minor-stats dt {
    font-size: 9px;
  }
  .minor-stats dd {
    font-size: 11px;
  }
  .equipment {
    display: none;
  }
  .side-buttons {
    display: flex;
    gap: 6px;
  }
  .side-buttons button {
    font-size: 10px;
    flex: 1;
    padding: 8px 10px;
  }
  .sidebar-foot {
    display: none;
  }
  .journal {
    width: 100%;
  }
  .journal-heading {
    margin-bottom: 13px;
  }
  .location-banner {
    height: 130px;
  }
  .entries {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .entry .prose {
    font-size: 14px;
  }
  .right-sidebar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .right-sidebar > .world-note {
    grid-column: 1/-1;
  }
  .panel-heading {
    padding: 14px 13px;
    font-size: 11px;
  }
  .bag-preview {
    padding: 5px 12px 10px;
  }
  .item-name {
    font-size: 11px;
  }
  .item-icon {
    width: 24px;
    height: 24px;
  }
  .region-description {
    padding: 13px;
    font-size: 11px;
  }
  .bag-bottom {
    padding: 0 12px 12px;
  }
  .map {
    height: 165px;
  }
  .map-label {
    font-size: 8px;
  }
  .composer {
    padding: 13px;
  }
  .composer-bottom small {
    max-width: 160px;
  }
  .journal-footer {
    gap: 12px;
    font-size: 9px;
  }
  .dialog-grid {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 20px;
    max-height: 88dvh;
  }
  .dialog-top h2 {
    font-size: 23px;
  }
  .inventory-list .item-row {
    flex-wrap: wrap;
  }
  .inventory-list .item-row button {
    margin-left: auto;
  }
  .world-note {
    font-size: 12px;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  :root {
    scrollbar-color: auto;
  }
  .stat-track {
    border: 1px solid CanvasText;
  }
  .stat-track i {
    background: Highlight;
  }
  .map-pin {
    border: 3px solid Highlight;
  }
}

[hidden] {
  display: none !important;
}
.entry .prose {
  font-size: 16px;
}

.ai-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  gap: 10px;
}
.ai-feedback {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}
.ai-feedback:not(:empty) {
  padding: 10px 0;
}
.ai-feedback button {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  text-align: left;
}
.ai-narration {
  margin-top: 15px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}
.ai-narration summary {
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  min-height: 28px;
}
.ai-narration p {
  font-size: 14px;
  line-height: 2;
  color: var(--muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ai-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.ai-switch input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

/* The desktop play screen owns its viewport; creation and mobile keep document scrolling. */
@media (min-width: 1024px) and (min-height: 600px) {
  body.playing {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.playing .topbar {
    height: 60px;
    flex: 0 0 60px;
  }
  body.playing #app {
    flex: 1;
    min-height: 0;
  }
  .playing .game {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: 14px;
  }
  .playing .worldbar {
    flex: none;
    padding: 12px 0;
  }
  .playing .world-date strong {
    font-size: 26px;
  }
  .playing .conflict-banner {
    flex: none;
    margin-bottom: 10px;
  }
  .playing .game-grid {
    flex: 1;
    min-height: 0;
    grid-template-columns: 205px minmax(0, 1fr) 238px;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 18px;
  }
  .playing .left-sidebar,
  .playing .right-sidebar {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .playing .right-sidebar {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .playing .right-sidebar > * {
    flex: none;
  }
  .playing .right-sidebar .section-space {
    margin-top: 0;
  }
  .playing .profile {
    padding: 13px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 5px 10px;
    align-items: center;
  }
  .playing .profile-avatar {
    width: 36px;
    height: 36px;
    margin: 0;
    grid-row: 1/3;
    font-size: 20px;
  }
  .playing .profile h2 {
    font-size: 20px;
    margin: 0;
  }
  .playing .profile p {
    line-height: 1.6;
  }
  .playing .status-pill {
    grid-column: 1/-1;
    justify-self: start;
    margin-top: 4px;
  }
  .playing .vitals {
    padding: 14px 13px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px 14px;
  }
  .playing .stat {
    margin: 0;
  }
  .playing .stat-label {
    flex-wrap: wrap;
    gap: 4px;
  }
  .playing .stat-label b {
    font-size: 10px;
  }
  .playing .minor-stats {
    margin: 0;
    padding: 13px;
    gap: 12px;
  }
  .playing .equipment {
    padding: 12px 13px;
  }
  .playing .equipment h3 {
    margin-bottom: 5px;
  }
  .playing .side-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
  }
  .playing .side-buttons button {
    padding: 7px 9px;
    font-size: 11px;
  }
  .playing .sidebar-foot {
    padding: 10px 2px;
  }
  .playing .journal {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .playing .journal-heading {
    flex: none;
    margin-bottom: 10px;
  }
  .playing .location-banner {
    flex: none;
    height: 86px;
    margin-bottom: 14px;
  }
  .playing .location-label {
    left: 18px;
    bottom: 14px;
  }
  .playing .location-label h3 {
    font-size: 22px;
    margin-top: 5px;
  }
  .playing .entries {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    padding-bottom: 5px;
    scrollbar-gutter: stable;
  }
  .playing .entries:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: -1px;
  }
  .playing .composer {
    flex: none;
    margin-top: 12px;
    padding: 10px 13px;
    max-height: 45%;
    overflow: auto;
  }
  .playing .composer textarea {
    min-height: 46px;
    max-height: 100px;
  }
  .playing .composer label {
    margin-bottom: 5px;
  }
  .playing .ai-controls {
    margin-top: 3px;
  }
  .playing .ai-controls .text-button {
    min-height: 30px;
    padding: 4px 0;
  }
  .playing .composer-bottom {
    margin-top: 3px;
  }
  .playing .journal-footer {
    flex: none;
    margin-top: 3px;
    align-items: center;
  }
  .playing .journal-footer .text-button {
    min-height: 30px;
    padding: 4px 0;
  }
  .playing .suggestions {
    flex: none;
    margin: 5px 0;
    max-height: 80px;
    overflow: auto;
  }
  .playing .death {
    flex: none;
    max-height: 30%;
    overflow: auto;
    padding: 14px;
    margin-bottom: 10px;
  }
  .playing .panel-heading {
    padding: 12px 14px;
  }
  .playing .map {
    height: 108px;
  }
  .playing .region-description {
    padding: 12px 14px;
    font-size: 11px;
    line-height: 1.7;
  }
  .playing .region-description button {
    margin-top: 9px;
  }
  .playing .bag-preview {
    padding: 0 14px 6px;
  }
  .playing .item-row {
    padding: 8px 0;
  }
  .playing .bag-bottom {
    padding: 0 14px 12px;
  }
  .playing .world-note {
    padding: 12px 14px;
    font-size: 11px;
  }
  .playing .world-note:before {
    display: none;
  }
  .playing .world-note small {
    margin-top: 5px;
  }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 750px) {
  .playing .location-banner {
    height: 64px;
    margin-bottom: 10px;
  }
  .playing .map {
    height: 80px;
  }
  .playing .journal-heading h2 {
    font-size: 20px;
  }
  .playing .composer label {
    font-size: 11px;
  }
}

.item-operations {
  display: grid;
  gap: 14px;
}
.item-operation button {
  width: 100%;
  text-align: left;
  min-height: 44px;
  line-height: 1.7;
}
.item-operation p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin: 6px 0 0;
}
.item-operation button:disabled {
  opacity: 0.55;
}
