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

html, body {
  height: 100%;
  background: #09080f;
  color: #c0b8d0;
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  gap: 12px;
}

#game-canvas {
  display: block;
  border: 2px solid #3a3050;
  border-radius: 4px;
  image-rendering: pixelated;
  flex-shrink: 0;
  /* Scale canvas to fit viewport height */
  max-height: calc(100vh - 24px);
  width: auto;
}

#sidebar {
  width: 260px;
  min-width: 260px;
  background: #0e0c14;
  border: 2px solid #3a3050;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3050 #0e0c14;
}

#ui-header {
  font-size: 15px;
  font-weight: bold;
  color: #e8e0f8;
  text-align: center;
  letter-spacing: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid #3a3050;
}

.ui-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ui-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #504060;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.ui-value {
  font-size: 13px;
  color: #e8e0f8;
}

.bar-label {
  font-size: 10px;
  color: #706080;
  margin-top: 2px;
}

.bar-track {
  height: 8px;
  background: #1a1520;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #2a2035;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.1s ease;
}

.bar-fill.xp {
  background: #3355cc;
}

.bar-text {
  font-size: 11px;
  color: #a090c0;
  text-align: right;
}

.ui-gold {
  font-size: 13px;
  margin-top: 2px;
}

.ui-equip-slot {
  font-size: 12px;
  color: #a090c0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ui-atk-def {
  font-size: 13px;
  color: #88aadd;
}

#ui-log {
  max-height: 160px;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-line {
  font-size: 11px;
  line-height: 1.4;
  word-break: break-word;
}

.key-hint {
  font-size: 10px;
  color: #504060;
  line-height: 1.5;
}
