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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Consolas', 'Courier New', monospace;
  background: #0e0e12;
  color: #d4d4d4;
}

.us-app {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 12px 32px;
}

.us-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.us-header a { color: #8ab4f8; text-decoration: none; }

.us-room {
  margin: 16px 0;
  background: #1a1a22;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  overflow: hidden;
}

#us-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.us-room-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 14px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid rgba(255,255,255,0.06);
  opacity: 0.85;
}

.us-room-hud strong { color: #f0d880; font-weight: 600; }

.us-editor {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}

.us-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #2d2d30;
  font-size: 0.75rem;
  border-bottom: 1px solid #333;
}

.us-toolbar-label { color: #ccc; }

.us-toolbar-hint {
  color: #888;
  font-size: 0.7rem;
}

.us-toolbar-hint em { color: #ce9178; font-style: normal; }

.us-log {
  display: block;
  width: 100%;
  min-height: 200px;
  padding: 14px;
  border: none;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
}

.us-log:focus { outline: none; }

.us-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top: 1px solid #333;
  color: #888;
}

.us-progress-track {
  flex: 1;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
}

.us-progress-fill {
  height: 100%;
  width: 0%;
  background: #4ec9b0;
  transition: width 0.2s;
}

.us-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.us-overlay[hidden] { display: none !important; }

.us-overlay-box {
  background: #1a1a22;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 28px 24px;
  max-width: 460px;
}

.us-overlay-box h1,
.us-overlay-box h2 { margin: 0 0 12px; color: #f0d880; }

.us-overlay-box p { margin: 0 0 10px; line-height: 1.45; font-size: 0.9rem; }

.us-credit {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.6;
}

.us-required {
  margin: 12px 0;
  padding-left: 20px;
  font-size: 0.85rem;
  color: #4ec9b0;
}

.us-warn { color: #ce9178; font-size: 0.85rem; }

.us-btn {
  margin-top: 14px;
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #2d2d30;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
}

.us-btn--primary { background: #0e639c; border-color: #1177bb; }

.us-overlay--dead .us-overlay-box h2 { color: #f44747; }

.us-flash-undo {
  animation: us-flash-u 0.3s ease;
}

.us-flash-redo {
  animation: us-flash-r 0.3s ease;
}

@keyframes us-flash-u {
  50% { box-shadow: inset 0 0 40px rgba(78,201,176,0.25); }
}

@keyframes us-flash-r {
  50% { box-shadow: inset 0 0 40px rgba(244,71,71,0.35); }
}
