/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; font-family: "VT323", "Courier New", monospace; }

:root {
  --green:       #39ff14;
  --green-dim:   #1c8a0a;
  --green-mid:   #28c40f;
  --red:         #ff3333;
  --amber:       #ffb300;
  --bg-panel:    rgba(4, 7, 4, 0.93);
  --bg-input:    rgba(6, 10, 6, 0.97);
  --border:      rgba(30, 55, 30, 0.6);
  --text-dim:    #2a5c2a;
  --font:        "VT323", "Courier New", monospace;
}

/* ── Full-page frame ──────────────────────────────────────── */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000 url('/background.png') center / cover no-repeat;
  font-family: var(--font);
  font-size: 14px;
  color: var(--green);
}

/* ── App container — sits inside the frame's black rectangle ─ */
/*    Tune these vh/vw values to fit the image's inner area.   */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  /* top / sides / bottom — matches the frame border thickness */
  padding: 18vh 14vw 21vh;
}

/* ── Two-panel row ────────────────────────────────────────── */
#main {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* ── Art Panel (left) ─────────────────────────────────────── */
#art-panel {
  flex: 0 0 38%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-right: none;
  padding: 16px 12px;
  position: relative;
  overflow: hidden;
}

/* scanlines removed — transparent background */

#room-title {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--green-dim);
  margin-bottom: 14px;
  text-align: center;
  position: relative;
  z-index: 2;
}

#art-display {
  font-size: 13px;
  line-height: 1.45;
  color: var(--green-mid);
  white-space: pre;
  text-align: left;
  text-shadow: 0 0 8px rgba(57,255,20,.3);
  transition: opacity .22s ease;
  position: relative;
  z-index: 2;
}

#art-display.fade { opacity: 0; }

#art-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity .22s ease;
}

/* ── Terminal Panel (right) ───────────────────────────────── */
#terminal-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

/* scanlines removed — transparent background */

#output {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 10px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  z-index: 2;
}

#output::-webkit-scrollbar { width: 5px; }
#output::-webkit-scrollbar-track { background: transparent; }
#output::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 3px; }

.line-output {
  color: var(--green);
  text-shadow: 0 0 5px rgba(57,255,20,.2);
  display: block;
  margin-bottom: 1px;
}

.line-output.cmd-echo {
  color: var(--green-dim);
  text-shadow: none;
}

.line-output.cmd-separator {
  color: var(--green-dim);
  opacity: 0.45;
  text-shadow: none;
  margin: 6px 0;
  display: block;
}

.line-output.room-info {
  color: var(--green);
  text-shadow: 0 0 5px rgba(57,255,20,.15);
}

.line-output.game-over {
  color: var(--red);
  text-align: center;
  font-size: 1.4em;
  letter-spacing: 4px;
  text-shadow: 0 0 18px rgba(255,51,51,.65);
  margin: 20px 0;
}

/* ── Input line ───────────────────────────────────────────── */
#input-row {
  display: flex;
  align-items: center;
  border-top: none;
  background: transparent;
  padding: 12px 22px 6px;
  gap: 10px;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(57, 255, 20, 0.25);
}

#input-prompt {
  color: var(--green);
  user-select: none;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(57,255,20,.7);
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font);
  font-size: 26px;
  line-height: 1;
  caret-color: var(--green);
  text-shadow: 0 0 8px rgba(255,255,255,.4);
}

#cmd-input::placeholder { color: var(--text-dim); font-size: 22px; }
#cmd-input:disabled     { opacity: .4; cursor: not-allowed; }

/* ── Status bar ───────────────────────────────────────────── */
#status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 6px 22px;
  background: transparent;
  border-top: 1px solid rgba(57, 255, 20, 0.25);
  font-size: 24px;
  color: var(--green-dim);
  letter-spacing: .4px;
  flex-shrink: 0;
}

#hp-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

#hp-label {
  color: var(--green);
  text-shadow: 0 0 8px rgba(57,255,20,.6);
}

#hp-bar-outer {
  width: 130px;
  height: 10px;
  background: transparent;
  border: 1px solid rgba(57,255,20,.4);
  border-radius: 3px;
  overflow: hidden;
}

#hp-bar-inner {
  height: 100%;
  border-radius: 2px;
  transition: width .3s, background-color .3s;
  box-shadow: 0 0 6px currentColor;
}

#hp-value {
  min-width: 72px;
  white-space: nowrap;
  color: var(--green);
  text-shadow: 0 0 8px rgba(57,255,20,.5);
}

.stat-item   { white-space: nowrap; }
.stat-value  {
  color: var(--green);
  text-shadow: 0 0 8px rgba(57,255,20,.5);
}

/* ── Art flicker on room change ───────────────────────────── */
@keyframes flicker {
  0%   { opacity: .8; }
  30%  { opacity: 1;  }
  60%  { opacity: .9; }
  100% { opacity: 1;  }
}
#art-display:not(.fade) { animation: flicker .35s ease-out; }
