/* Dungeon Master in the browser: a plain dark page around a 320x200 screen. */

:root {
  --bg: #0b0b0d;
  --panel: #16161a;
  --ink: #c8c8cc;
  --dim: #7c7c86;
  --line: #2a2a31;
  --accent: #b08d3f;
  --bad: #ff6b5e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px;
}

/* --- the screen ------------------------------------------------------ */

#stage {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#screen {
  display: block;
  background: #000;
  border: 1px solid var(--line);
  cursor: none;              /* the game draws its own pointer */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

/* --- the furniture --------------------------------------------------- */

#panel {
  width: 100%;
  max-width: 980px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px 12px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button, select {
  font: inherit;
  color: var(--ink);
  background: #22222a;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 11px;
  cursor: pointer;
}

button:hover:not(:disabled), select:hover { border-color: #47474f; }
button:disabled { opacity: .45; cursor: default; }
select { padding: 6px 8px; max-width: 16em; }
select:empty { display: none; }

.help, .legal, .status, .note {
  margin: 10px 0 0;
}

.help { color: var(--ink); }
.help b { color: var(--accent); font-weight: 600; }
.legal, .note { color: var(--dim); font-size: 12.5px; }
.status { color: var(--dim); font-size: 12.5px; min-height: 1.5em; margin-top: 6px; }

.panic {
  margin: 10px 0 0;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12.5px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--bad);
  background: #23100f;
  border: 1px solid #52211d;
  border-radius: 4px;
}

/* --- the start overlay ----------------------------------------------- */

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 8, 10, .93);
  z-index: 10;
}

#overlay[hidden] { display: none; }

.dialog {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 24px 20px;
  text-align: center;
}

.dialog h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent);
}

#ov-msg { margin: 6px 0 14px; color: var(--ink); }

#drop {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

#drop.over { border-color: var(--accent); background: #1d1c18; }
#drop[hidden] { display: none; }

.drop-title { margin: 0 0 6px; font-weight: 600; }
.drop-sub { margin: 0 0 10px; color: var(--dim); font-size: 12.5px; }

#file-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font: 12.5px/1.7 ui-monospace, Menlo, Consolas, monospace;
  text-align: left;
  display: inline-block;
}

#file-list li::before { content: "\00a0\00a0"; color: var(--dim); }
#file-list li.have { color: #79c07a; }
#file-list li.have::before { content: "\2713\00a0"; }
#file-list li.want { color: var(--dim); }

.ov-row { justify-content: center; }
#btn-play { padding: 9px 22px; font-weight: 600; }
#btn-anyway[hidden] { display: none; }

/* A bundled build's offer to use the player's own GRAPHICS.DAT. */
#own {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
#own[hidden], #btn-builtin[hidden] { display: none; }
.own-msg { margin: 0 0 10px; color: var(--dim); font-size: 12.5px; }
.own-msg.bad { color: var(--bad); }
