* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 0; }
body.trail-frame {
  --command-side: 264px;
  --command-header: 72px;
  --frame-linen: #d8d0c4;
  --frame-linen-ink: #302b29;
  --frame-linen-accent: #672e45;
  --frame-wine-fabric: url("/game/frame/sidebar-cloth.webp") center top / 180px auto repeat;
  --frame-wine-cloth: linear-gradient(#58275955,#58275955), #4e1e32 var(--frame-wine-fabric);
  --frame-wine-control-active: linear-gradient(#873c65a0,#873c65a0), #6a2d47 var(--frame-wine-fabric);
  --w-head: Georgia, serif;
  background: #14191d;
  color: #f1e4c8;
  font: 16px/1.45 Georgia, serif;
}
.workspace {
  background: #192329 url("slate-wall.webp") left top / 850px auto repeat;
  display: grid;
  grid-template-columns: var(--command-side) minmax(0, 1fr);
  grid-template-rows: var(--command-header) minmax(0, 1fr) auto;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}
#game-frame-header {
  grid-area: 1 / 1 / 2 / -1;
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
}
.frame-location, .frame-player, .frame-site {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.frame-location-labels {
  min-width: 0;
  display: grid;
  text-align: center;
  line-height: 1.15;
  padding: 7px 16px;
  background: var(--frame-wine-cloth);
}
.frame-location-name { font-size: 15px; color: #f5e4d1; }
.frame-region-name { font: 600 16px/1.25 var(--w-head); color: #e2c4b6; }
.frame-region-emblem {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border: 0;
  background: url("menu-bezel.webp") center/contain no-repeat;
  padding: 4px;
}
.frame-region-emblem img { max-width: 100%; height: auto; }
.frame-player { justify-content: flex-end; flex: 1; }
#game-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button { cursor: pointer; font: inherit; }
button:disabled { cursor: wait; }
.frame-site a, #game-account-button, #game-login-form button {
  color: #f0ded0;
  background: var(--frame-wine-cloth);
  border: 1px solid #9e787b;
  padding: 5px 9px;
  text-decoration: none;
  white-space: nowrap;
}
.frame-site a:hover, #game-account-button:hover, #game-login-form button:hover { background: var(--frame-wine-control-active); }
a:focus-visible, button:focus-visible { outline: 2px solid #f1d58d; outline-offset: 2px; }
#trail-command-sidebar {
  grid-area: 2 / 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: auto;
  z-index: 35;
  background: var(--frame-wine-cloth);
  padding: 14px 10px 0;
}
#game-window {
  grid-area: 2 / 2;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#game-window > .page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#page-adventure .map-panel { flex: 1; width: 100%; min-height: 0; }
#community-dock { grid-area: 3 / 1 / 4 / -1; position: relative; z-index: 38; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.modal {
  width: min(460px, calc(100% - 24px));
  margin: auto;
  color: var(--frame-linen-ink);
  background: var(--frame-linen);
  padding: 18px 24px;
}
.modal::backdrop { background: #14191dbb; }
.modal h2 { margin: 0 25px 12px 0; }
.frame-close-icon {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: url("close-mark.svg") center / 24px no-repeat;
}
#game-login-form { display: grid; gap: 10px; }
#game-login-form label { display: grid; gap: 4px; }
#game-login-form input { padding: 6px; font: inherit; }
#game-login-form a { color: var(--frame-linen-accent); }
#game-account-status:empty { margin: 0; }
#game-account-status { color: var(--frame-linen-accent); }
#game-window #page-hero {
  background: #f3e4d4;
  color: #3f2a22;
  padding: 18px 16px 28px;
}
#game-window #page-hero h2 { margin: 0 0 12px; font-size: 22px; }
#game-window .hero-sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
#game-window .hero-sheet-card { background: #efe0cc; padding: 12px; display: grid; gap: 8px; }
#game-window .hero-sheet-card h3 { margin: 0; font-size: 18px; }
#game-window .hero-sheet-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
#game-window .hero-sheet-row button {
  background: #f3e4d4;
  color: #3f2a22;
  border: 1px solid #3f2a22;
  min-width: 44px;
  min-height: 32px;
  font: inherit;
}
#game-window .hero-sheet-note { margin: 0; }
@media (max-width: 1200px) { body.trail-frame { --command-side: 208px; } }
@media (max-width: 700px) {
  body.trail-frame { --command-header: 86px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  #game-window { grid-area: 2 / 1; }
  #game-frame-header { flex-wrap: wrap; padding: 5px 9px; gap: 4px 8px; align-content: center; }
  .frame-location-labels { padding: 4px 5px; }
  .frame-region-emblem { width: 38px; height: 38px; }
  .frame-site a, #game-account-button { padding: 3px 5px; font-size: 14px; }
  #trail-command-sidebar { display: none; width: min(260px, 85vw); height: 100%; }
  #trail-command-sidebar.is-open { display: block; }
}
