:root {
  --bg: #000000;
  --panel: #0d0d0d;
  --fg: #ffffff;
  --fg-dim: #b3b3b3;
  --muted: #7a7a7a;
  --border: #2a2a2a;
  --surface: #141414;
  --radius: 2px;
}

* {
    box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, sans-serif;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.menu-btn {
  position: fixed;
  top: 0px;
  right: 0px;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(128, 128, 128, 0.25);
  border: none;
  border-radius: 0px;
  border-bottom-left-radius: var(--radius);
  color: var(--fg);
  cursor: pointer;
  z-index: 60;
  backdrop-filter: blur(4px);
}

.menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.menu-btn:hover {
    background: rgba(128, 128, 128, 0.4);
}
.menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
.menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}

.stage-area {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#canvas {
  max-width: 100%;
  max-height: 100%;
  image-rendering: auto;
}

.notice {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  white-space: nowrap;
  z-index: 10;
}

.notice.hidden { display: none; }

.sidebar {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--panel);
  padding: 20px;
  transition: transform 0.25s ease;
  transform: translateX(100%);
  z-index: 50;
  overflow-y: auto;
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.sidebar-header h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-section {
    margin-top: 16px;
}
.sidebar-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px dashed var(--border);
}

.muted {
    color: var(--muted); font-size: 11px;
}

.small {
    font-size: 12px; color: var(--fg-dim);
}

#projectUrlSection input,
#projectInputOverlay {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: none;
  border-radius: 0px;
  color: var(--fg);
  font-size: 13px;
  margin-bottom: 10px;
}

button {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

button:hover {
    background: #1f1f1f; border-color: #555;
}
button:disabled {
    opacity: 0.4; cursor: not-allowed;
}
button.primary {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
  font-weight: 600;
}

#useProjectBtn, #useProjectBtnOverlay {
    width: 100%;
}

.controls {
    display: flex; flex-direction: column; gap: 8px;
}
.controls button {
    width: 100%;
}

#projectOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#projectOverlay.hidden {
    display: none;
}
#projectOverlay .title {
  margin-bottom: 16px;
  color: var(--fg);
}

#projectBtnGroup {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  width: 100%;
  max-width: 340px;
}

.ask-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  color: var(--fg);
}
.ask-overlay.hidden {
    display: none;
}

.ask-overlay-content {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ask-overlay-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.ask-overlay-label {
    font-size: 14px; color: var(--fg);
}

.ask-overlay-close,
#ask-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}
.ask-overlay-close:hover,
#ask-close-btn:hover {
    color: var(--fg);
}

#ask-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--fg);
  font-family: inherit;
  outline: none;
}

#ask-input:focus {
    border-color: var(--fg);
}

.ask-overlay-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: flex-end;
}

#ask-submit, #ask-cancel {
  flex: 1;
}
