html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #111;
  color: #FF7F00;
  font-family: 'Courier New', Courier, monospace;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
  cursor: none;
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100vh;
  overflow-x: hidden;
}

#main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  max-width: 700px;
  margin-top: 32px;
  overflow-x: hidden;
}

pre#game {
  margin: 0;
  padding: 0 16px;
  font-size: 2.2rem;
  line-height: 1.1;
  letter-spacing: 1px;
  color: #FF7F00;
  text-shadow:
    0 0 4px #FF7F00,
    0 0 8px #FF7F00,
    0 0 16px #FF7F0044;
  background: transparent;
  border: none;
  outline: none;
  user-select: none;
  min-width: 420px;
  min-height: 220px;
  max-width: 100vw;
  font-family: 'Courier New', Courier, monospace;
  font-variant-ligatures: none;
  white-space: pre;
  overflow-x: hidden;
  box-sizing: border-box;
  word-wrap: normal;
  letter-spacing: 0px;
  tab-size: 1;
}

#story-log {
  width: 100%;
  max-width: 700px;
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  background: transparent;
  color: #FF7F00;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  margin-top: 12px;
  padding: 0 16px;
  white-space: pre-line;
  text-shadow:
    0 0 4px #FF7F00,
    0 0 8px #FF7F00,
    0 0 16px #FF7F0044;
  border: none;
  outline: none;
  user-select: none;
}

/* --- Mobile D-pad Styles --- */
.dpad-container {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  z-index: 100;
}
.dpad-btn {
  width: 56px;
  height: 56px;
  margin: 4px;
  font-size: 2.2rem;
  background: rgba(30, 20, 0, 0.7);
  color: #FF7F00;
  border: 2px solid #FF7F00;
  border-radius: 12px;
  box-shadow: 0 0 8px #FF7F0044;
  cursor: pointer;
  outline: none;
  user-select: none;
  pointer-events: auto;
  transition: background 0.2s;
}
.dpad-btn:active {
  background: #FF7F0022;
}
.dpad-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}
.dpad-spacer {
  display: inline-block;
  width: 32px;
}

/* Reset button for mobile */
.reset-btn {
  width: 56px;
  height: 40px;
  margin: 4px;
  font-size: 1.8rem;
  background: rgba(30, 20, 0, 0.7);
  color: #FF7F00;
  border: 2px solid #FF7F00;
  border-radius: 12px;
  box-shadow: 0 0 8px #FF7F0044;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: background 0.2s;
}

.reset-btn:active {
  background: #FF7F0022;
}

@media (max-width: 768px) {
  .dpad-container {
    display: flex;
  }
  /* Make story log font larger on mobile */
  #story-log {
    font-size: 1.2rem;
    padding: 0 8px;
    max-width: 95vw;
    white-space: pre-wrap;
    word-break: break-word;
  }
  /* Fix mobile layout for game map */
  #main-container {
    width: 100vw;
    max-width: 100vw;
    padding: 0;
    margin: 8px auto 0 auto;
    align-items: center;
    overflow-x: hidden;
  }
  pre#game {
    font-size: 1.5rem;
    padding: 0;
    width: 95vw;
    max-width: 95vw;
    min-width: auto;
    margin: 0 auto;
    white-space: pre;
    overflow-x: hidden;
    font-family: monospace;
    font-variant-ligatures: none;
    box-sizing: border-box;
    word-wrap: normal;
    letter-spacing: 0;
    tab-size: 1;
    text-align: center;
  }
}
@media (min-width: 769px) {
  .dpad-container {
    display: none;
  }
} 