html,
body {
  height: 100%;
  margin: 0;
  background: #0b0f14;
  color: #e7eef7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.25;
}

#ui {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
}

#displayWrap {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 13px;
  overflow-x: auto;
}

#hud {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 11px;
}

#bottom {
  display: flex;
  gap: 10px;
  align-items: stretch;
  min-height: 160px;
  max-height: 220px;
}

#log {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 1.3;
}

#inv {
  width: 320px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}

#inv h2 {
  margin: 0 0 6px 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: #cfe6ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#invMeta {
  font-size: 11px;
  color: #b7c7da;
  margin-bottom: 6px;
}

#invList {
  margin: 0;
  padding: 0 0 0 12px;
  font-size: 12px;
  line-height: 1.3;
}

#invList li {
  margin: 3px 0;
  word-break: break-word;
}

#help {
  width: 240px;
  flex-shrink: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #b7c7da;
  line-height: 1.3;
  font-size: 11px;
  overflow-y: auto;
}

#help > div {
  margin-bottom: 4px;
}

.tile {
  font-weight: 700;
}

.vinyl {
  color: #ffd56a;
}

.espresso {
  color: #7dffb7;
}

.spray {
  color: #9bc8ff;
}

.scalper {
  color: #ff6b6b;
}

.actually {
  color: #ffb86b;
}

.dust {
  color: #d7d7ff;
}

.exit {
  color: #ff00ff;
  font-weight: bold;
}

.feral {
  color: #00ffff;
  font-weight: bold;
}

/* Expandable sections */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  margin-bottom: 4px;
}

.collapsible-header:hover {
  opacity: 0.8;
}

.collapsible-icon {
  font-size: 14px;
  transition: transform 0.2s;
}

.collapsible-icon.expanded {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible-content.expanded {
  max-height: 180px;
  overflow-y: auto;
}

/* Mobile responsive */
@media (max-width: 768px) {
  #ui {
    gap: 6px;
    padding: 8px;
  }

  #bottom {
    flex-direction: column;
    max-height: none;
  }

  #log {
    min-height: 100px;
    max-height: 120px;
  }

  #inv {
    width: 100%;
  }

  #help {
    width: 100%;
    font-size: 10px;
  }

  #inv h2 {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #ui {
    padding: 6px;
  }

  #inv {
    padding: 6px;
  }
}
