@font-face {
  font-family: 'Gloock';
  src: url('/client/assets/gloock-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/client/assets/work-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/client/assets/work-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
}
#starterGuide {position:fixed;z-index:4;left:1rem;top:5rem;max-width:min(21rem,85vw);background:#20332def;color:#fff3de;border:1px solid #9a9369;border-radius:.4rem;}
#starterGuide summary {cursor:pointer;padding:.35rem .8rem;}
#starterGuide section {padding:.25rem .8rem .8rem;}
#starterGuide p {margin:.35rem 0 .65rem;}
:root {
  color-scheme: light;
  --forest: #293d30;
  --deep: #1d2a23;
  --paper: #f3efe4;
  --ink: #232e26;
  --muted: #5f685b;
  --line: #c8c9b8;
  --brass: #e4bc74;
  --serif: 'Gloock', Georgia, 'Times New Roman', serif;
  --sans: 'Work Sans', 'Segoe UI', sans-serif;
  font: 400 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--deep);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  min-height: 100%;
  margin: 0;
}
body {
  min-width: 280px;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
summary,
select,
input[type='color'],
input[type='checkbox'],
input[type='range'] {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: #f7f5eb;
  color: var(--ink);
  padding: 0.52rem 0.85rem;
  font-weight: 600;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: #e2e4d6;
  border-color: #8c9a83;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
summary:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #b37e31;
  outline-offset: 3px;
}
button:focus:not(:focus-visible),
canvas:focus {
  outline: none;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
}
svg {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  vertical-align: middle;
}
svg:has(use[href^='/client/assets/marks.svg']) {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
input:not([type='checkbox']):not([type='radio']):not([type='range']),
textarea,
select {
  width: 100%;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  color: var(--ink);
  background: #faf8f1;
  border: 1px solid #b9bead;
  border-radius: 0.23rem;
}
input::placeholder,
textarea::placeholder {
  color: #798071;
  opacity: 1;
}
label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
}
input,
select,
textarea {
  font-weight: 400;
}
option {
  color: var(--ink);
  background: var(--paper);
}
textarea {
  resize: vertical;
}
.entry-screen,
.editor-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.masthead {
  height: 68px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 3vw, 3.5rem);
  background: var(--deep);
  color: #f5f1e5;
  position: relative;
  z-index: 3;
  border-bottom: 1px solid #66715c;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  user-select: none;
}
.wordmark .brand-mark {
  width: 39px;
  height: 39px;
  color: var(--brass);
}
.wordmark span {
  font-family: var(--serif);
  font-size: 1.03rem;
  letter-spacing: 0.045em;
  line-height: 1;
}
.controls-help {
  position: relative;
}
.controls-help summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #e3e3d1;
  line-height: 2;
  font-size: 0.82rem;
  list-style: none;
}
.controls-help summary::-webkit-details-marker {
  display: none;
}
.controls-help summary svg {
  font-size: 1.04rem;
  color: var(--brass);
}
.key-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.7rem);
  padding: 1rem 1.15rem;
  width: 250px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 34px #12190e38;
}
.key-list strong {
  display: block;
  margin-bottom: 0.4rem;
}
.key-list p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  font-size: 0.83rem;
}
kbd {
  font: 500 0.72rem/1.4 var(--sans);
  border: 1px solid var(--line);
  background: #faf9f2;
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0.14rem 0.35rem;
  color: var(--ink);
}
.entry-layout,
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(345px, 1fr);
  flex: 1;
}
.evolution {
  display: flex;
  flex-direction: column;
  background: #182820;
  color: #faf4df;
  min-width: 0;
}
.era-portraits {
  margin: 0;
  position: relative;
  background: #19251f;
}
.era-portraits img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62svh;
  object-fit: cover;
  object-position: 50% 34%;
}
.era-labels {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  padding-top: 2.5rem;
  background: linear-gradient(transparent, #101d18eb);
}
.era-labels span {
  padding: .65rem .15rem;
  text-align: center;
  font: 600 clamp(.65rem,.9vw,.88rem)/1.25 var(--sans);
  letter-spacing: .04em;
  color: #fff9e9;
  border-bottom: 3px solid #bc8756;
}
.era-labels span:nth-child(2) { border-color: #d1bb85; }
.era-labels span:nth-child(3) { border-color: #81c9c7; }
.evolution-title {
  flex: 1;
  display: grid;
  align-content: center;
  gap: .8rem;
  padding: clamp(1.2rem,2.5vw,2.8rem) clamp(1.3rem,3.6vw,4rem);
}
.evolution-title h1 {
  font-size: clamp(2.5rem,4.2vw,5.4rem);
  line-height: 1;
  letter-spacing: -.035em;
}
.evolution-title em {
  display: block;
  font-style: normal;
  color: #e6c48e;
}
#returningPlayer { margin-top: 1.7rem; }
.evolution-title p { color: #e1e4d9; font-size: clamp(.9rem,1.05vw,1.1rem); }
.compass-rule span { height: 1px; }
.entry-sheet {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 6rem) clamp(1.45rem, 4.2vw, 5rem);
  background-color: var(--paper);
  background-image: radial-gradient(ellipse at 100% 0%, #dfddc966, transparent 60%);
  position: relative;
}
.sheet-content {
  width: min(100%, 27rem);
}
.compass-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #8e6e37;
  margin-bottom: 1.15rem;
}
.compass-rule svg {
  height: 1.62rem;
  width: 1.62rem;
}
.compass-rule span {
  width: 3.25rem;
  background: #a58d60;
}
.entry-sheet h1,
.entry-sheet h2 {
  font-size: clamp(2.5rem, 3.1vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
}
.auth-switch {
  display: flex;
  align-items: stretch;
  margin: 1.75rem 0 1.6rem;
  border-bottom: 1px solid #c8cbbb;
}
.auth-switch button {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.25rem 0.78rem;
  font-size: 0.88rem;
}
.auth-switch button.active,
.auth-switch button[aria-selected='true'],
.auth-switch:has(+ #loginForm[hidden]) #showRegister {
  color: var(--forest);
  box-shadow: inset 0 -3px var(--forest);
}
.auth-switch:has(+ #loginForm[hidden]) #showLogin {
  color: var(--muted);
  box-shadow: none;
}
.auth-switch button:hover:not(:disabled) {
  background: #e6e5d8;
}
.entry-form {
  display: grid;
  gap: 1.13rem;
}
.entry-form label {
  font-size: 0.84rem;
  line-height: 1.4;
  letter-spacing: 0.005em;
  gap: 0.48rem;
}
.input-wrap {
  position: relative;
  display: block;
  font-size: 1rem;
}
.input-wrap svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #697464;
  width: 17px;
  height: 17px;
  pointer-events: none;
}
.entry-form input:not([type='checkbox']) {
  height: 47px;
  font-size: 0.91rem;
}
#auth .input-wrap input {
  padding-left: 2.7rem;
}
.primary,
.primary:visited,
button.primary {
  background: var(--forest);
  border-color: var(--forest);
  color: #faf5e4;
}
button.primary:hover:not(:disabled) {
  background: #38563e;
  border-color: #38563e;
}
.enter-button {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 48px;
  padding-inline: 1.15rem;
  font-size: 0.91rem;
}
.enter-button svg {
  color: var(--brass);
  width: 1.17rem;
  height: 1.17rem;
}
.save-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-top: 1.1rem;
}
.save-note svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.error {
  color: #8e3026;
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: 1rem;
}
.error:empty {
  display: none;
}
.editor-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(345px, 1fr);
}
.portrait-stage {
  isolation: isolate;
  position: relative;
  min-height: 420px;
  background: radial-gradient(ellipse at 50% 30%, #737f65, #3c5140 72%);
}
#portrait {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#characterForm {
  margin-top: 1.65rem;
}
.twin,
.grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.entry-form input[type='color'] {
  padding: 0.27rem;
}
#game,
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#world {
  display: block;
  touch-action: none;
  outline: 0;
}
#hud,
#vitals,
#hotbar,
.hud-actions,
#target,
#crosshair,
#toast {
  position: fixed;
}
#hud,
#vitals,
#target {
  pointer-events: none;
  color: #f6f3df;
  text-shadow: 0 1px 3px #172017;
}
#hud {
  top: 1.25rem;
  left: 1.25rem;
  max-width: calc(100% - clamp(116px, 14vw, 172px) - 3rem);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}
#hud:not(:empty),
#vitals:not(:empty),
#target:not(:empty) {
  background: #202a23e6;
  border: 1px solid #dedabb55;
  border-radius: 3px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
}
.hud-actions {
  right: 1.25rem;
  top: 1.25rem;
  display: flex;
  gap: 0.45rem;
}
.hud-actions button,
#panelClose {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
}
.hud-actions button {
  background: #202a23e6;
  color: #f5e7c8;
  border-color: #dedabb66;
}
.hud-actions button:hover:not(:disabled) {
  background: #344835;
}
#minimap {
  position: fixed;
  top: calc(1.25rem + 48px);
  right: 1.25rem;
  width: clamp(116px, 14vw, 172px);
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  pointer-events: none;
}
#homeMap {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #25362d;
  box-shadow: 0 2px 8px #14201877;
}
#homeDistance {
  padding: 3px 9px;
  border-radius: 3px;
  color: #ffe3a3;
  background: #202a23ec;
  font-size: .78rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#crosshair {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border: 1px solid #24282077;
  background: #fffde4;
  border-radius: 100%;
  box-shadow: 0 0 3px #162619;
  pointer-events: none;
}
#target {
  top: calc(50% + 1.6rem);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
#vitals {
  bottom: 1.25rem;
  left: 1.25rem;
  max-width: 25vw;
}
#hotbar {
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.35rem;
}
#hotbar button,
.slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 45px;
  padding: 0.4rem 0.65rem;
  border: 1px solid #ead8ae80;
  border-radius: 0.2rem;
  color: #f4efde;
  background: #233025ed;
  font-size: 0.82rem;
}
#hotbar button.active,
#hotbar button.selected,
.slot.selected,
#hotbar [aria-pressed='true'] {
  border-color: #ffcf75;
  box-shadow: inset 0 -3px #dbb169;
}
#hotbar button:hover:not(:disabled) {
  background: #3f543f;
}
#overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: clamp(0.35rem, 3vw, 2.5rem);
  background: #101a14a8;
  backdrop-filter: blur(3px);
}
.panel-window {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  width: min(100%, 960px);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid #8b926e;
  border-radius: 0.4rem;
  box-shadow: 0 24px 80px #08100970;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--deep);
  color: var(--paper);
}
.panel-head h2 {
  font-size: 1.75rem;
  line-height: 1.15;
}
#panelClose {
  width: 34px;
  height: 34px;
  border-color: #c2c6ae55;
  background: transparent;
  color: var(--paper);
}
#tabs {
  display: flex;
  gap: 0.33rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.25rem;
  background: #e7e7d8;
  border-bottom: 1px solid var(--line);
}
#tabs button {
  padding: 0.34rem 0.65rem;
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.8rem;
  white-space: nowrap;
}
#tabs button:hover:not(:disabled) {
  background: #d5dbc8;
}
#tabs button.active,
#tabs button.selected,
#tabs button[aria-selected='true'] {
  background: var(--forest);
  color: var(--paper);
}
#panelBody {
  padding: 1.25rem 1.5rem 1.5rem;
  min-height: 9rem;
  overflow: auto;
  overscroll-behavior: contain;
}
#panelBody h3 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0.5rem 0;
}
#panelBody h4 {
  font-size: 0.96rem;
  margin: 0.4rem 0;
}
#panelBody p {
  margin: 0.4rem 0;
}
#panelBody button,
#panelBody input,
#panelBody select,
#panelBody textarea {
  font-size: 0.85rem;
}
#panelBody button {
  white-space: normal;
}
#panelBody form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
  margin: 0.55rem 0;
}
#panelBody form > input,
#panelBody form > textarea,
#panelBody form > select {
  width: auto;
  flex: 1 1 130px;
}
#panelBody form > label {
  flex: 1 1 130px;
}
#panelBody progress,
.stat progress {
  accent-color: var(--forest);
  max-width: 100%;
}
#panelBody table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
#panelBody th,
#panelBody td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
#panelBody svg,
#panelBody canvas,
#panelBody img {
  max-width: 100%;
}
#panelBody svg:not([width]):not([class]) {
  width: auto;
  height: auto;
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.stack {
  display: grid;
  gap: 0.7rem;
}
.card {
  padding: 0.9rem 1rem;
  background: #faf8ef;
  border: 1px solid #cdd0bc;
  border-radius: 0.3rem;
  overflow-wrap: anywhere;
}
.muted,
.small {
  color: var(--muted);
  font-size: 0.85rem;
}
.secondary {
  background: #f8f6ed;
  border-color: var(--line);
}
.pill,
.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.pill {
  padding: 0.15rem 0.55rem;
  border-radius: 2rem;
  background: #dce2cd;
  font-size: 0.75rem;
  color: #42583d;
}
.item-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  vertical-align: middle;
  background-image: url('/client/assets/items.svg');
  background-repeat: no-repeat;
  background-size: 600% 100%;
}
#hotbar .item-icon:is([data-item='knife'],[data-item='spear'],[data-item='bow'],[data-item='club'],[data-item='sword'],[data-item='rod']) {
  background-image: url('/client/assets/field-tools.svg');
  background-size: 600% 100%;
}
#hotbar .energy-icon {background-image:url('/client/assets/energy-tools.svg');background-size:700% 100%}
.item-icon[data-item='spear'] { background-position: 20% 0; }
.item-icon[data-item='bow'] { background-position: 40% 0; }
.item-icon[data-item='club'] { background-position: 60% 0; }
.item-icon[data-item='sword'] { background-position: 80% 0; }
.item-icon[data-item='rod'] { background-position: 100% 0; }
.item-icon[data-item='axe'] {
  background-position: 0 0;
}
.item-icon[data-item='pickaxe'] {
  background-image: url('/client/assets/pickaxe.svg');
  background-size: contain;
}
.item-icon[data-item='tent'] {
  background-position: 20% 0;
}
.item-icon[data-item='wood'] {
  background-position: 40% 0;
}
.item-icon[data-item='stone'] {
  background-position: 60% 0;
}
.item-icon[data-item='fiber'] {
  background-position: 80% 0;
}
.item-icon[data-item='food'] {
  background-position: 100% 0;
}
#toast {
  z-index: 12;
  bottom: clamp(5.5rem, 12vh, 8rem);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(92%, 36rem);
  background: var(--deep);
  color: #ffefc8;
  box-shadow: 0 4px 20px #12201745;
  border: 1px solid #a29c76;
  border-radius: 4px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  text-align: center;
  pointer-events: none;
}
#enableSound {position:fixed;z-index:7;bottom:.65rem;right:.65rem;padding:.4rem .65rem;color:#f5edd8;background:#263b32;border:1px solid #adb69c;border-radius:.35rem;}
#toast:empty {
  display: none;
}
@media (min-width: 1650px) {
  .entry-layout {
    grid-template-columns: 1.7fr 1fr;
  }
}
@media (max-width: 900px) {
  .entry-layout {
    grid-template-columns: minmax(0, 1.17fr) minmax(320px, 1fr);
  }
  #vitals {
    bottom: 5rem;
    max-width: 80vw;
  }
}
@media (max-width: 680px) {
  .masthead {
    height: 54px;
    padding-inline: 1.05rem;
  }
  .wordmark .brand-mark {
    width: 31px;
    height: 31px;
  }
  .wordmark span {
    font-size: 0.86rem;
  }
  .entry-layout,
  .editor-layout {
    display: flex;
    flex-direction: column;
  }
  .evolution-title h1 { font-size: clamp(1.85rem,6.7vw,2.8rem); }
  .evolution-title h1 em { display: inline; }
  .evolution-title { padding: 1.05rem 1.15rem 1.2rem; gap: .45rem; }
  .era-labels { padding-top: 1rem; }
  .era-labels span { padding-block: .4rem; }
  .masthead .wordmark span { letter-spacing: .02em; }
  .masthead .wordmark { gap: .4rem; }
  .entry-sheet {
    flex: 1;
    padding: 1.65rem 1.4rem 2rem;
  }
  .sheet-content {
    width: min(100%, 30rem);
  }
  .entry-sheet h1,
  .entry-sheet h2 {
    font-size: 2.2rem;
  }
  .compass-rule {
    margin-bottom: 0.55rem;
  }
  .compass-rule svg {
    width: 1.2rem;
    height: 1.2rem;
  }
  .auth-switch {
    margin: 0.8rem 0 1rem;
  }
  .entry-form {
    gap: 0.9rem;
  }
  .save-note {
    margin-top: 1.35rem;
  }
  .portrait-stage {
    min-height: clamp(220px, 38svh, 320px);
  }
  #hud {
    top: 0.6rem;
    left: 0.6rem;
  }
  .hud-actions {
    top: 0.6rem;
    right: 0.6rem;
  }
  #minimap { top: calc(.6rem + 40px); right: .6rem; width: clamp(92px, 19vw, 125px); }
  #hud { max-width: calc(100% - clamp(92px, 19vw, 125px) - 1.8rem); }
  .hud-actions button {
    width: 34px;
    height: 34px;
  }
  #hotbar {
    max-width: 98%;
    width: max-content;
    gap: 0.15rem;
    bottom: 0.45rem;
  }
  #hotbar button {
    min-width: 0;
    padding: 0.25rem;
    font-size: 0.7rem;
  }
  #vitals {
    left: 0.6rem;
  }
  .panel-head {
    padding: 0.75rem 1rem;
  }
  #panelBody {
    padding: 0.8rem;
  }
  #tabs {
    padding: 0.45rem;
    gap: 0.1rem;
  }
  #tabs button {
    padding: 0.27rem 0.4rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
