/* The Mystery of Silver Mountain — web front-end.
   Mirrors the warm retro palette of adventure_gui.py. */

:root {
  --bg:     #171210;   /* near-black, warm            */
  --panel:  #221a15;
  --ink:    #e9d6ab;   /* parchment                   */
  --dim:    #9c8a6b;
  --accent: #d8a657;   /* amber — items / headings    */
  --green:  #a9b665;   /* the player's own commands   */
  --red:    #ea6962;   /* danger / death              */
  --pane:   #0d0a08;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
}

body {
  display: flex;
  justify-content: center;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

#app {
  display: flex;
  flex-direction: column;
  width: min(100%, 780px);
  height: 100dvh;
}

/* ---- status bar ---------------------------------------------------------- */
#statusbar {
  display: flex;
  align-items: center;
  background: var(--panel);
  font: bold 15px "Courier New", monospace;
  flex: none;
}
#status-fields { display: flex; flex-wrap: wrap; align-items: center; }
.field { padding: 8px 14px; white-space: nowrap; }
.c0 { color: var(--ink); }
.c1 { color: var(--green); }
.c2 { color: var(--accent); }
.c3 { color: var(--dim); }

#newgame {
  margin-left: auto;
  margin-right: 10px;
  background: none;
  border: 1px solid var(--dim);
  color: var(--dim);
  font: bold 11px "Courier New", monospace;
  padding: 4px 10px;
  cursor: pointer;
}
#newgame:hover { border-color: var(--accent); color: var(--accent); }

/* ---- picture pane -------------------------------------------------------- */
#pane {
  flex: none;
  background: var(--pane);
  margin: 10px 10px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
#pano {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  cursor: grab;
  touch-action: none;
}
#pano.dragging { cursor: grabbing; }
#still {
  max-width: 100%;
  max-height: 360px;
  display: block;
}
#brief {
  color: var(--dim);
  font-style: italic;
  text-align: center;
  white-space: pre-wrap;
  padding: 24px;
  max-width: 640px;
  font-size: 15px;
}
#boot {
  color: var(--dim);
  text-align: center;
  font: 14px "Courier New", monospace;
  padding: 36px 20px;
}
.boot-title {
  color: var(--accent);
  font-weight: bold;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

/* ---- scrolling story ----------------------------------------------------- */
#story {
  flex: 1;
  overflow-y: auto;
  margin: 4px 10px;
  padding: 8px 22px;
  font-size: 17px;
  line-height: 1.45;
  scrollbar-color: var(--panel) var(--bg);
}
.line       { white-space: pre-wrap; }
.line.scene { margin-top: 12px; }
.line.see   { color: var(--accent); }
.line.msg   { color: var(--ink); }
.line.echo  {
  color: var(--green);
  font-family: "Courier New", monospace;
  font-size: 15px;
  margin-top: 8px;
}
.line.err {
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 15px;
}
.line.resume { color: var(--dim); font-style: italic; margin-top: 8px; }

/* ---- prompt + input ------------------------------------------------------ */
#inputbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  padding: 8px 12px;
}
#prompt {
  color: var(--accent);
  font: 14px "Courier New", monospace;
  white-space: nowrap;
}
#cmd {
  flex: 1;
  min-width: 60px;
  background: #2c221b;
  color: var(--ink);
  border: none;
  outline: none;
  font: 16px "Courier New", monospace;
  padding: 10px;
  caret-color: var(--ink);
}
#send {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font: bold 14px "Courier New", monospace;
  padding: 10px 18px;
  cursor: pointer;
}
#send:hover:not(:disabled) { background: var(--ink); }
#send:disabled { opacity: 0.4; cursor: default; }

#hint {
  flex: none;
  color: var(--dim);
  font: 12px "Courier New", monospace;
  padding: 5px 12px 2px;
}
#credit {
  flex: none;
  color: var(--accent);
  font: italic 12px Georgia, serif;
  padding: 2px 12px 10px;
  text-decoration: none;
}
#credit:hover { text-decoration: underline; }
