/* The town on screen (M5 batch 3): the view fills the window; panels sit
   over it as plain HTML, the words a player reads in a column at the side
   (T6), the time and place along the top. */

/* Hidden means hidden, whatever display a panel's own rule gives it (the
   box's flex overrode it, found on screen in M5 batch 4's build). */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #16181d;
  color: #e8e4da;
  font-family: system-ui, sans-serif;
  overflow: hidden;
}

/* The view stops at the words column, so the walker is centered in what
   the player can see. */
#game {
  position: fixed;
  inset: 0 22rem 0 0;
}

#top {
  position: fixed;
  top: 0;
  left: 0;
  right: 22rem;
  display: flex;
  gap: 1.2rem;
  padding: 0.5rem 0.9rem;
  background: rgba(16, 18, 24, 0.72);
  font-size: 0.95rem;
}

#status {
  margin-left: auto;
  color: #c9b98f;
}

/* The player's own bars (M6 batch 7): a word, a track, and the number. */
#bars {
  display: flex;
  gap: 0.9rem;
}

#bars .bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#bars .track {
  width: 6rem;
  height: 0.55rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #3a3e4a;
}

#bars .fill {
  display: block;
  height: 100%;
  background: #b5443c;
}

/* Colours by a bar's place in the world's list, nothing more. */
#bars .bar:nth-child(2) .fill {
  background: #3c6fb5;
}

#bars .bar:nth-child(3) .fill {
  background: #4f9a4a;
}

#bars .barnumber {
  font-variant-numeric: tabular-nums;
  color: #c9c3b5;
}

#words {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 22rem;
  overflow-y: auto;
  background: rgba(16, 18, 24, 0.82);
  border-left: 1px solid #2c2f38;
}

#feed {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

#feed li {
  padding: 0.2rem 0;
  border-bottom: 1px solid #23262e;
}

#roads {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
}

#roads button,
#join button {
  font: inherit;
  padding: 0.4rem 0.8rem;
  background: #3b3326;
  color: #f3e6c8;
  border: 1px solid #8a7347;
  border-radius: 4px;
  cursor: pointer;
}

#join {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(12, 13, 17, 0.94);
}

#join[hidden],
#roads[hidden] {
  display: none;
}

#join input {
  font: inherit;
  padding: 0.4rem;
  width: 14rem;
}

#looks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 30rem;
  justify-content: center;
}

.look {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #23262e;
  cursor: pointer;
  overflow: hidden;
}

.look.chosen {
  border-color: #e0c070;
}

.frame {
  width: 16px;
  height: 16px;
  transform: scale(3);
  transform-origin: top left;
  image-rendering: pixelated;
  background-repeat: no-repeat;
}

/* The conversation box (M5 batch 4, D1): along the bottom of the view, its
   person's face, the words between you, and what you can do toward them. */
#box {
  position: fixed;
  left: 1rem;
  right: 23rem;
  bottom: 1rem;
  max-height: 45%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  background: rgba(24, 21, 16, 0.94);
  border: 2px solid #8a7347;
  border-radius: 6px;
  font-size: 0.92rem;
}

#box header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#box .face {
  position: relative;
  width: 76px;
  height: 76px;
  flex: none;
  background: #101114;
  border: 1px solid #5b4d33;
}

#portrait {
  width: 76px;
  height: 76px;
  image-rendering: pixelated;
}

#mood {
  position: absolute;
  right: -10px;
  top: -10px;
  width: 28px;
  height: 26px;
  image-rendering: pixelated;
}

#feels {
  color: #c9b98f;
  font-style: italic;
}

#boxclose {
  margin-left: auto;
}

#said {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 8rem;
}

#said li.narrated {
  color: #bdb6a6;
  font-style: italic;
}

#choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* A group's word in a box (the occasions, Leo's own play, 2026-11-08): its
   own line, above the group's buttons. */
#choices .choice-group {
  width: 100%;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #c9b98f;
}

#choices .choose,
#panel .choose {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

#boxstate {
  margin: 0;
  color: #c9b98f;
}

#box button,
#panel button,
#paneltoggle {
  font: inherit;
  padding: 0.25rem 0.6rem;
  background: #3b3326;
  color: #f3e6c8;
  border: 1px solid #8a7347;
  border-radius: 4px;
  cursor: pointer;
}

#box button:disabled,
#panel button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* The player's own panel (M5 batch 4, D4): meters, places, belongings,
   what lies here, and what they know. */
#paneltoggle {
  position: fixed;
  top: 2.6rem;
  left: 1rem;
}

#panel {
  position: fixed;
  top: 4.8rem;
  left: 1rem;
  width: 19rem;
  max-height: calc(100% - 6rem);
  overflow-y: auto;
  padding: 0.6rem 0.8rem;
  background: rgba(16, 18, 24, 0.94);
  border: 1px solid #2c2f38;
  border-radius: 6px;
  font-size: 0.9rem;
}

#panel h3 {
  margin: 0.6rem 0 0.3rem;
  font-size: 0.85rem;
  color: #c9b98f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#panel .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.2rem 0;
}

#panel .meter {
  margin-right: 0.8rem;
}

#panel .meter.changed {
  color: #ffd27a;
}

#feed li.mine {
  color: #f6e7c1;
}

/* While the box is open, the roads at an exit sit above it, and the panel
   stops short of it. */
body.talking #roads {
  bottom: calc(45% + 2rem);
}

body.talking #panel {
  max-height: calc(55% - 6.5rem);
}

/* The credit each picture's license asks for (the M5 close review). */
#credits {
  position: fixed;
  left: 8px;
  bottom: 4px;
  margin: 0;
  font-size: 11px;
  color: rgba(255, 248, 232, 0.6);
  pointer-events: none;
}
