*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #000;
  color: #AAAAAA;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

#game-wrapper {
  display: flex;
  flex-direction: column;
  width: 640px;
  height: 100vh;
  max-height: 760px;
}

#status-bar {
  background: #000055;
  color: #FFFF55;
  padding: 3px 8px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #5555FF;
  flex-shrink: 0;
}

canvas#game-canvas {
  display: block;
  width: 640px;
  height: 400px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-bottom: 2px solid #5555FF;
  flex-shrink: 0;
}

#text-output {
  flex: 1;
  overflow-y: auto;
  background: #000022;
  padding: 6px 10px;
  color: #AAAAAA;
  font-size: 13px;
  line-height: 1.6;
  min-height: 100px;
}

#text-output p          { margin: 1px 0; }
#text-output p.system   { color: #55FFFF; }
#text-output p.success  { color: #55FF55; }
#text-output p.error    { color: #FF5555; }
#text-output p.narrate  { color: #FFFF55; font-style: italic; }
#text-output p.score    { color: #FF55FF; }
#text-output p.dialogue { color: #FFFFFF; }

#inventory-strip {
  background: #000044;
  border-top: 1px solid #5555FF;
  border-bottom: 1px solid #5555FF;
  padding: 3px 10px;
  font-size: 12px;
  color: #55FFFF;
  flex-shrink: 0;
  white-space: nowrap;
  overflow-x: auto;
}

button.inv-item {
  background: transparent;
  border: none;
  color: #55FFFF;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: underline dotted;
}

button.inv-item:hover {
  color: #FFFFFF;
}

#input-bar {
  display: flex;
  background: #000033;
  padding: 5px 6px;
  flex-shrink: 0;
}

#input-bar span { color: #FFFF55; padding: 4px 6px; user-select: none; }

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  caret-color: #FFFFFF;
}

#screen-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', Courier, monospace;
  color: #FFFF55;
  padding: 40px;
  text-align: center;
}

#screen-overlay h1 { font-size: 28px; color: #FF55FF; margin-bottom: 16px; }
#screen-overlay h2 { font-size: 20px; color: #FFFF55; margin-bottom: 12px; }
#screen-overlay p  { font-size: 14px; color: #AAAAAA; max-width: 560px; line-height: 1.8; margin: 6px 0; }
#screen-overlay .btn {
  margin-top: 20px;
  padding: 8px 24px;
  background: #000055;
  color: #FFFF55;
  border: 2px solid #5555FF;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  cursor: pointer;
}
#screen-overlay .btn:hover { background: #0000AA; }
