:root {
  --bg: #080908;
  --surface: #101110;
  --surface2: #171615;
  --line: #343331;
  --text: #e9e6df;
  --muted: #85827d;
  --accent: #d6c5b2;
  --accent2: #f1e9dc;
  --brown: #553b33;
  --brown-soft: #382a26;
  --danger: #b98278;
}

body {
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    #080908;
  background-size: 100% 34px;
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

button,
.button {
  border: 1px solid #3a3835;
  border-radius: 5px;
  background: #ded6ca;
  color: #171614;
  box-shadow: none;
  font-size: 13px;
  letter-spacing: .04em;
}

.secondary,
.quiet {
  border-color: #393735;
  background: transparent;
  color: #b7b1a9;
}

.topbar {
  height: 68px;
  border-bottom: 1px solid #393735;
  background: rgba(8, 9, 8, .96);
}

.topbar h1 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .16em;
}

.eyebrow {
  color: #6f6c68;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

main {
  padding: 22px;
}

.library {
  max-width: 1060px;
}

.library-head {
  padding: 26px 0 34px;
  border-bottom: 1px solid #343331;
}

.library-head h2 {
  margin: 5px 0 2px;
  color: #f1eee8;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: .08em;
}

.library-head p {
  margin: 0;
  color: #77746f;
}

.section-title {
  margin: 38px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid #343331;
}

.section-title > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-title span,
.section-title small {
  color: #6d6964;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  letter-spacing: .12em;
}

.section-title h2 {
  color: #cbc6be;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .12em;
}

.loading-card {
  width: 100%;
  padding: 22px;
  border: 1px solid #2d2c2a;
  color: #77736e;
  text-align: center;
}

.error-card {
  color: #bc8a80;
}

.save-list {
  gap: 8px;
}

.save-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  padding: 16px 18px;
  border: 1px solid #302f2d;
  border-radius: 7px;
  background: #0e0f0e;
  box-shadow: none;
  transition: border-color .18s ease, background .18s ease;
}

.save-card:hover {
  border-color: #514b46;
  background: #121211;
}

.save-number {
  color: #57534f;
  font-family: Georgia, serif;
  font-size: 27px;
}

.save-copy {
  min-width: 0;
}

.save-kicker {
  margin-bottom: 6px;
  color: #6d6964;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  letter-spacing: .15em;
}

.save-card h3 {
  overflow: hidden;
  color: #eee9e0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-meta {
  color: #76716c;
}

.card-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.pack-card {
  min-height: 250px;
  padding: 22px;
  border: 1px solid #302f2d;
  border-radius: 7px;
  background:
    linear-gradient(160deg, rgba(83, 58, 49, .22), transparent 48%),
    #0e0f0e;
  box-shadow: none;
}

.archive-index {
  margin-bottom: 20px;
  color: #66544d;
  font-family: Georgia, serif;
  font-size: 34px;
}

.pack-card h3 {
  margin-top: 7px;
  color: #ece6dd;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 21px;
  font-weight: 500;
}

.pack-card p {
  color: #817c76;
  line-height: 1.7;
}

body.playing main {
  padding: 0 16px 14px;
}

.play {
  height: calc(100vh - 14px);
  max-width: 1100px;
}

.play-head {
  min-height: 72px;
  padding: 10px 0 12px;
  border-color: #343331;
}

.save-heading h2 {
  color: #f0ece4;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .08em;
}

.save-heading p {
  color: #6e6a66;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .06em;
}

.messages {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 4px 44px;
}

.message {
  padding: 18px 21px;
  border-radius: 4px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.86;
}

.message.assistant {
  border: 0;
  border-left: 2px solid #54443d;
  background: transparent;
  color: #d5d1c9;
}

.message.user {
  border: 1px solid #4b3630;
  background: #2d211e;
  color: #e8ded3;
}

.game-dock {
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
}

.dock-panel {
  padding: 9px 12px;
  border-color: #413833;
  border-radius: 6px;
  background: #171312;
  box-shadow: none;
}

.dock-title {
  margin-bottom: 5px;
  color: #8b7e76;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.status-strip .field-row {
  min-width: 98px;
  padding: 5px 8px;
  border-radius: 3px;
  background: rgba(255,255,255,.025);
}

.status-strip .field-row strong {
  color: #ded4c9;
}

.inventory-strip .item-row {
  padding: 4px 8px;
  border: 1px solid #463933;
  border-radius: 4px;
  background: #211916;
  color: #cfc3b8;
}

.composer {
  padding: 9px;
  border-color: #3b3936;
  border-radius: 6px;
  background: #0d0e0d;
  box-shadow: 0 -14px 34px rgba(0,0,0,.24);
}

.composer textarea {
  color: #dedad3;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.composer textarea::placeholder {
  color: #4f4c48;
}

dialog {
  border-color: #3e3935;
  border-radius: 7px;
  background: #111211;
}

.dialog-card {
  background: #111211;
}

input,
textarea,
select {
  border-color: #3a3835;
  border-radius: 4px;
  background: #090a09;
}

.character-dialog-card {
  background:
    linear-gradient(160deg, rgba(83,58,49,.14), transparent 42%),
    #111211;
}

.character-person {
  padding: 4px 16px 12px;
  border-left: 1px solid #443a35;
}

.character-sheet .character-owner {
  color: #d6c5b2;
}

.toast {
  border: 1px solid #59483f;
  border-radius: 4px;
  background: #2c211e;
  color: #e2d7cb;
}

@media (max-width: 700px) {
  main {
    padding: 14px;
  }

  .library-head {
    align-items: flex-start;
    padding: 18px 0 24px;
  }

  .library-head h2 {
    font-size: 27px;
  }

  .library-head p {
    max-width: 240px;
    font-size: 12px;
  }

  .save-card {
    grid-template-columns: 36px 1fr;
  }

  .save-card .card-actions {
    grid-column: 2;
  }

  .save-number {
    font-size: 21px;
  }

  .play-head {
    grid-template-columns: auto minmax(80px, 1fr) auto;
  }

  .play-actions button {
    padding: 6px;
    font-size: 11px;
  }

  .messages {
    padding-top: 20px;
  }

  .message {
    font-size: 15px;
  }

  .game-dock {
    grid-template-columns: 1fr;
  }
}
