* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0b0d10;
  color: #d9dde2;
  font-family: "Courier New", Consolas, monospace;
}

#btn-mute {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 20;
  padding: 6px 10px;
  margin: 0;
  font-size: 1.1em;
}
#btn-mute.muted { color: #5a6069; border-color: #262b32; }

#version-tag {
  position: fixed;
  bottom: 6px;
  left: 8px;
  z-index: 20;
  color: #4a4f57;
  font-size: 0.75em;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.screen { display: none; height: 100%; flex-direction: column; padding: 16px; }
.screen.active { display: flex; }

h1 {
  font-size: 1.6em;
  letter-spacing: 2px;
  color: #c9a24b;
  margin: 24px 0 4px;
  text-align: center;
}

.sub { text-align: center; color: #8a909a; margin-bottom: 32px; }

#select-list { margin-bottom: 20px; }
.char-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #15181d;
  border: 1px solid #262b32;
}
.char-row span { color: #d9dde2; }

#screen-create label { font-size: 0.9em; color: #8a909a; margin-bottom: 6px; }

#screen-create input {
  background: #15181d;
  border: 1px solid #333842;
  color: #d9dde2;
  padding: 10px;
  font-family: inherit;
  font-size: 1em;
  margin-bottom: 16px;
}

button {
  background: #1d2127;
  border: 1px solid #3a4049;
  color: #d9dde2;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95em;
  cursor: pointer;
  margin: 4px 4px 4px 0;
}

button:hover { border-color: #c9a24b; color: #c9a24b; }
button:disabled { opacity: 0.4; cursor: default; }

#hud {
  border-bottom: 1px solid #262b32;
  padding-bottom: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

#hud-name { font-weight: bold; color: #c9a24b; }
#hud-job { color: #8a909a; font-size: 0.85em; margin-bottom: 6px; }
#hud-jp { font-size: 0.85em; color: #8a909a; margin-top: 4px; }

.bar-row { display: flex; align-items: center; gap: 6px; font-size: 0.8em; margin: 2px 0; }
.bar-row span:first-child { width: 24px; color: #8a909a; }
.bar-row span:last-child { width: 70px; text-align: right; color: #8a909a; }

.bar { flex: 1; height: 8px; background: #15181d; border: 1px solid #262b32; }
.bar-fill { height: 100%; width: 0%; transition: width 0.2s; }
.bar-fill.hp { background: #a1403e; }
.bar-fill.mp { background: #3e6ea1; }
.bar-fill.xp { background: #c9a24b; }

#log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  font-size: 0.95em;
  line-height: 1.5;
}

#log p { margin: 0 0 8px; }
#log .flavor { color: #8a909a; }
#log .combat { color: #d9dde2; }
#log .dmg { color: #d08b57; }
#log .good { color: #7ab06c; }
#log .bad { color: #a1403e; }
#log .system { color: #6f8ab0; font-style: italic; }

#actions {
  border-top: 1px solid #262b32;
  padding-top: 10px;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
}

.info-btn {
  padding: 10px 12px;
  color: #8a909a;
  border-color: #262b32;
}
.info-btn:hover { border-color: #6f8ab0; color: #6f8ab0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal.hidden { display: none; }

.modal-box {
  background: #15181d;
  border: 1px solid #3a4049;
  padding: 20px;
  max-width: 320px;
  width: 90%;
}
.modal-box h3 { color: #c9a24b; margin: 0 0 4px; }
.modal-slot { color: #8a909a; font-size: 0.85em; margin: 0 0 12px; }
#modal-stats p { margin: 2px 0; color: #7ab06c; }

.clickable { cursor: pointer; }
.clickable:hover { color: #c9a24b; text-decoration: underline; }

.modal-box.char-sheet { max-width: 380px; }
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
  margin: 10px 0;
  font-size: 0.9em;
}
#char-modal-combat { margin-bottom: 12px; }
#char-modal-combat p, #char-modal-gear p { margin: 2px 0; font-size: 0.9em; }
#char-modal-gear .modal-slot { margin: 10px 0 2px; }
