@import url('./encounter-workspace.css');

.object-nameplate {
  fill: var(--bg-inset);
  fill-opacity: 0.92;
  stroke: var(--border-hover);
  stroke-opacity: 0.65;
  stroke-width: 0.65px;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
}
.object-label {
  fill: var(--text-primary);
  stroke: none;
}
.object-assignee {
  fill: var(--accent-hover);
  stroke: none;
}
.encounter-object.selected .object-nameplate,
.encounter-object.highlighted .object-nameplate,
.encounter-object:hover .object-nameplate,
.encounter-object:focus-visible .object-nameplate {
  stroke: var(--text-warm);
  stroke-opacity: 1;
  stroke-width: 1.6px;
  fill: var(--accent-soft);
}
.encounter-object:focus {
  outline: none;
}
.encounter-svg.readonly .object-label,
.encounter-svg.readonly .object-assignee,
.encounter-svg.readonly .object-text {
  user-select: text;
  -webkit-user-select: text;
}
.encounter-svg.readonly {
  touch-action: pan-y pinch-zoom;
}
.skip-link:not(:focus) {
  clip-path: inset(50%);
}
.encounter-svg.panning,
.encounter-svg.panning .encounter-object {
  cursor: grab;
}
.encounter-svg.panning:active {
  cursor: grabbing;
}
.map-view-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.map-view-tools .button {
  min-height: 40px;
}
.map-actions,
.map-display-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.map-display-options {
  margin-left: auto;
  gap: 14px;
}
.map-view-tools .check-label {
  min-height: 40px;
  margin: 0;
  gap: 6px;
}
.map-view-tools [aria-pressed='true'],
#edit-room-outline[aria-pressed='true'] {
  color: var(--text-warm);
  border-color: var(--brown);
  background: var(--bg-warm-elevated);
}
.encounter-switcher {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.encounter-switcher .icon-button {
  flex-shrink: 0;
}
.editor-encounter {
  flex: 1 1 260px;
  min-width: 0;
}
.editor-encounter select {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.toolbar-actions {
  margin: 0;
  gap: 2px;
}
.toolbar-actions .icon-button {
  width: 40px;
  min-height: 40px;
}
.toolbar-save {
  flex-wrap: wrap;
}
.map-tool-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}
.properties-tabs button {
  min-width: 0;
}
.room-edit-layer {
  pointer-events: none;
}
.room-edit-outline {
  fill: #dabb6420;
  stroke: #e7c977;
  stroke-width: 0.5;
  pointer-events: none;
}
.room-edit-outline.invalid {
  stroke: #ff7777;
  fill: #f55a;
}
.room-edit-edge {
  stroke: transparent;
  pointer-events: stroke;
  cursor: move;
}
.room-edit-edge:hover,
.room-edit-edge.active {
  stroke: #e7c97766;
}
.room-corner {
  fill: #d8b46b;
  stroke: #211c17;
  stroke-width: 0.5;
  pointer-events: all;
  cursor: grab;
}
.room-corner.active,
.room-corner:focus-visible {
  fill: #fff4c9;
  stroke: #947332;
  outline: none;
}
.room-add-corner {
  cursor: crosshair;
  pointer-events: all;
}
.room-add-corner circle {
  fill: var(--bg-secondary);
  stroke: #c9b782;
  stroke-width: 0.3;
}
.room-add-corner path {
  stroke: #f4e7bf;
  stroke-width: 0.3;
  pointer-events: none;
}
.room-add-corner:focus-visible {
  outline: none;
}
.room-add-corner:focus-visible circle,
.room-add-corner:hover circle {
  fill: #76582c;
}
.room-corner .room-grip-hit,
.room-add-corner .room-grip-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}
.editing-room .objects-layer {
  opacity: 0.4;
  pointer-events: none;
}
.editing-room .object-names {
  display: none;
}
.room-edit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#room-properties {
  display: grid;
  gap: 16px;
}
#room-properties[hidden] {
  display: none;
}
#room-properties .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.room-corner-actions,
.room-edit-options {
  display: grid;
  gap: 8px;
}
.room-corner-actions .button,
.room-edit-options .button {
  min-height: 44px;
  white-space: normal;
}
.room-map-button {
  width: 100%;
  justify-content: flex-start;
  white-space: normal;
  text-align: left;
  min-height: 48px;
}
.room-map-button img,
.room-edit-options img {
  flex-shrink: 0;
  border-radius: 4px;
}
.room-map-picker {
  display: grid;
  gap: 14px;
}
.room-map-picker .search-input {
  max-width: none;
  width: 100%;
}
.room-map-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 60dvh;
  overflow: auto;
  padding: 3px;
}
.room-map-option {
  display: flex;
  flex-direction: column;
  text-align: left;
  align-items: stretch;
  padding: 6px;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.room-map-option img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--bg-inset);
  border-radius: 5px;
}
.room-map-option svg {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-inset);
  border-radius: 5px;
  pointer-events: none;
}
.arena-preview-label {
  fill: #eee5d2;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--bg-secondary);
  stroke-width: 0.65;
  stroke-linejoin: round;
}
.room-map-option .arena-description {
  color: var(--text-secondary);
  line-height: 1.5;
}
.room-map-option strong {
  font-size: 12px;
  line-height: 1.4;
}
.room-map-option span {
  font-size: 10px;
  color: var(--text-muted);
}
.room-map-option[aria-pressed='true'],
.room-map-option:hover {
  border-color: var(--brown);
  background: var(--bg-warm);
}
.room-map-picker .modal-actions {
  margin-top: 0;
}
.room-map-outline {
  paint-order: stroke;
  stroke-dasharray: 1 0.5;
}
.room-map-modal.modal.wide {
  width: 860px;
  max-width: calc(100vw - 28px);
  height: min(760px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
}
.room-map-modal[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.room-map-modal .modal-heading {
  flex-shrink: 0;
}
.room-map-modal .modal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.room-map-modal .room-map-picker {
  min-height: 0;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.room-map-modal .room-map-results {
  min-height: 0;
  max-height: none;
  overscroll-behavior: contain;
  align-content: start;
}
.room-map-modal .modal-actions {
  margin-top: 0;
}
@media (max-width: 767px) {
  .editor-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .editor-encounter {
    flex-basis: 100%;
  }
  .toolbar-actions {
    order: 1;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 2px;
  }
  .toolbar-actions .icon-button {
    min-height: 44px;
    width: 40px;
  }
  .toolbar-separator {
    margin: 0 6px;
  }
  .toolbar-save {
    order: 2;
    margin: 0;
    justify-content: flex-end;
  }
  .toolbar-save .save-status {
    position: static;
    margin-right: auto;
    max-width: 105px;
    text-align: left;
    font-size: 10px;
  }
  .planner-shell .editor-sidebar {
    max-height: none;
  }
  .map-view-tools {
    padding: 8px;
    gap: 6px 10px;
  }
  .map-view-tools .button,
  .map-view-tools .check-label {
    min-height: 44px;
  }
  .map-view-tools .button {
    font-size: 11px;
  }
  .planner-shell .editor-page-heading {
    gap: 8px;
  }
  .editor-page-heading > a {
    flex-basis: 100%;
  }
  .editor-heading-controls,
  .editor-heading-actions {
    width: 100%;
  }
  .editor-heading-actions > button {
    flex: 1;
    min-height: 44px;
  }
  .room-map-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .room-map-picker .modal-actions {
    flex-wrap: wrap;
  }
  .room-map-picker .modal-actions .button {
    min-height: 44px;
  }
}
