/* Nebel des Krieges — Layout & Look */

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: #14161c;
}

.app-toolbar {
  background: #1b1e27;
  z-index: 20;
}

.app-toolbar .tool-btn.active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

#stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, #1c1f28 0%, #12141a 100%);
  touch-action: none;
}

#stage canvas {
  position: absolute;
  inset: 0;
  touch-action: none;
}

#fogLayer { cursor: crosshair; }
#fogLayer.panning { cursor: grab; }
#fogLayer.panning:active { cursor: grabbing; }

/* Leerer Zustand */
#emptyState {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
#emptyState.d-none { display: none !important; }
.empty-card {
  max-width: 380px;
  background: rgba(27, 30, 39, .95);
}

/* Drop-Overlay */
#dropHint {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(13, 110, 253, .35);
  border: 4px dashed rgba(255, 255, 255, .7);
  pointer-events: none;
}
#dropHint.d-none { display: none !important; }

/* Footer im Chaosinstitut-Stil */
.app-footer {
  background: #1b1e27;
  z-index: 20;
  white-space: nowrap;
  overflow-x: auto;
}
.app-footer a {
  color: var(--bs-body-color);
  text-decoration: none;
}
.app-footer a:hover { color: var(--bs-primary); }

/* Szenenliste */
#sceneList .scene-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  background: #0b0d12;
}
#sceneList .list-group-item.active {
  background: rgba(13, 110, 253, .25);
  border-color: var(--bs-primary);
  color: var(--bs-body-color);
}

.token-preview {
  width: 72px;
  height: 72px;
}

.brush-size-wrap .form-range { vertical-align: middle; }

/* Token-Bibliothek */
.token-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}
.token-lib-item {
  position: relative;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  background: #12141a;
  padding: 6px;
  cursor: pointer;
  text-align: center;
}
.token-lib-item:hover { border-color: var(--bs-primary); }
.token-lib-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}
.token-lib-item .lib-name {
  font-size: .7rem;
  color: var(--bs-secondary-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.token-lib-item .lib-del {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 5px;
  line-height: 1.3;
}

/* Schwebende Token-Steuerung */
#tokenCtrls {
  position: absolute;
  z-index: 15;
  background: rgba(27, 30, 39, .97);
  min-width: 180px;
}

/* Teilen-Modal */
.qr-box { width: fit-content; }
.qr-box svg { display: block; background: #fff; padding: 6px; border-radius: 6px; }

/* Kopierbare Prompts in der Hilfe */
.prompt-copy {
  background: #12141a;
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0;
  font-size: .78rem;
  white-space: pre-wrap;
  cursor: copy;
}
.prompt-copy:hover { border-color: var(--bs-primary); }
