:root {
  --bg: #e8ddcb; /* Sun-bleached sand */
  --fg: #3d312a; /* Dark faded brown */
  --fg-dim: #7d6b5e; /* Dusty taupe */
  --fg-highlight: #a65134; /* Terracotta */
  --sys: #ab3e3e; /* Faded brick */
  --scan: #386f7f; /* Dusty teal */
  --success: #638241; /* Dry olive */
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.4;
  touch-action: none;
}

#game-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 15px;
  box-sizing: border-box;
  z-index: 10;
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

#promo-banner {
  background: var(--sys);
  color: var(--bg);
  padding: 15px;
  text-align: center;
  border: 2px solid var(--fg);
  margin-bottom: 15px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 4px 4px 0px rgba(61, 49, 42, 0.2);
  line-height: 1.6;
}

#promo-banner a {
  background: var(--bg);
  color: var(--sys);
  padding: 2px 6px;
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid var(--bg);
}

#promo-banner a:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

#log {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.log-entry { margin-bottom: 10px; word-wrap: break-word; }
.user-cmd { color: var(--fg-highlight); font-weight: bold; }
.sys-msg { color: var(--sys); }
.scan-msg { color: var(--scan); }
.success-msg { color: var(--success); }

a { color: inherit; text-decoration: underline; cursor: pointer; font-weight: bold; }
a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

#input-line {
  display: flex;
  align-items: center;
  border-top: 1px dashed var(--fg-dim);
  padding-top: 15px;
  margin-bottom: 15px;
}

#prompt { margin-right: 10px; font-weight: bold; color: var(--fg-highlight); }

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--fg-highlight);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  caret-color: var(--fg);
  min-width: 0;
  font-weight: bold;
}

#cmd-input::placeholder {
  color: var(--fg-dim);
  font-weight: normal;
}

#mobile-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: env(safe-area-inset-bottom, 15px);
}

button {
  flex: 1 1 calc(25% - 8px);
  background: rgba(255, 255, 255, 0.3);
  color: var(--fg);
  border: 1px solid var(--fg-dim);
  padding: 12px;
  font-family: inherit;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.1s;
  touch-action: manipulation;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.05);
}

button:active {
  background: var(--fg);
  color: var(--bg);
  box-shadow: none;
  transform: translate(2px, 2px);
}

.scanlines {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0) 50%, rgba(139, 115, 85, 0.1) 50%), 
              linear-gradient(90deg, rgba(166, 81, 52, 0.03), rgba(255, 255, 255, 0), rgba(56, 111, 127, 0.03));
  background-size: 100% 4px, 4px 100%;
  pointer-events: none;
  z-index: 100;
  opacity: 0.6;
}

body {
  position: relative;
}
body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle, transparent 40%, rgba(166, 81, 52, 0.15) 100%);
  pointer-events: none;
  z-index: 99;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.2); border-left: 1px solid var(--fg-dim); }
::-webkit-scrollbar-thumb { background: var(--fg-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--fg); }