.clue-cards-app {
  padding: 1rem;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.04)),
    var(--color-bg);
}

.clue-cards-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.clue-cards-header h2,
.clue-cards-header h3 {
  margin: 0;
}

.clue-cards-subtitle {
  margin: 0.25rem 0 0 0;
  opacity: 0.8;
}

.clue-cards-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.clue-cards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Card look */

.clue-card {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
}

.clue-card-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #181818;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.16);
  min-height: 360px;
}

.clue-card:hover .clue-card-shell {
  transform: translateY(-2px);
}

.clue-card-shell {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.clue-card-media,
.clue-card-no-image {
  position: relative;
  min-height: 360px;
}

.clue-card-media img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.clue-card-media-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top,
      rgba(0, 0, 0, 0.58) 0%,
      rgba(0, 0, 0, 0.38) 28%,
      rgba(0, 0, 0, 0.13) 55%,
      rgba(0, 0, 0, 0.02) 75%,
      rgba(0, 0, 0, 0.00) 100%);
}

.clue-card-no-image {
  background:
    linear-gradient(160deg, #95897a 0%, #746757 55%, #4f453a 100%);
}

.clue-card-content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 1.2rem 1.2rem 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  color: #f7f4ee;
}

.clue-card-content.no-image-layout {
  position: absolute;
  inset: auto 0 0 0;
}

.clue-card-main-text {
  max-width: 90%;
}

.clue-card-title {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.clue-card-description p {
  margin: 0.4rem 0 0 0;
  font-size: 1rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.clue-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.clue-card-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  color: #f3f1eb;
  font-size: 0.85rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.clue-card-drag-handle,
.clue-card-actions {
  pointer-events: auto;
}

.clue-card-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.42);
  color: #fff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: grab;
}

.clue-card-drag-handle:active {
  cursor: grabbing;
}

.clue-card-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.clue-card-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(25, 25, 25, 0.46);
  color: #fff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.clue-card-actions button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.clue-card.is-dragging {
  opacity: 0.55;
}

.clue-reveal-list,
.clue-card-section,
.clue-card-top,
.clue-inline-image,
.clue-cards-meta {
  all: unset;
}
/* Image */

.clue-inline-image {
  position: relative;
  z-index: 1;
  margin-bottom: 0.9rem;
  padding: 0.4rem;
  border-radius: 10px;
  background: rgba(70, 53, 33, 0.08);
  border: 1px solid rgba(90, 70, 45, 0.16);
}

.clue-inline-image img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(70, 50, 30, 0.22);
}

/* Reveal blocks */

.clue-reveal-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.clue-card-section {
  position: relative;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(95, 74, 46, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(to bottom, rgba(255, 250, 242, 0.9), rgba(244, 236, 221, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.clue-card-section strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c4630;
}

.clue-card-section p {
  margin: 0;
  line-height: 1.4;
  color: #2d2419;
}

/* Notes / forms */

.clue-cards-form {
  position: relative;
  z-index: 1;
  margin-bottom: 0.9rem;
}

.clue-cards-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.clue-cards-form .form-group:last-child {
  margin-bottom: 0;
}

.clue-cards-form textarea,
.clue-cards-form input[type="text"],
.clue-cards-form select,
.clue-cards-filter-row select,
.clue-folder-creation-row input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
}

.clue-cards-form textarea {
  min-height: 90px;
  resize: vertical;
}

/* Folder look */

.clue-folder-section {
  position: relative;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1rem 1rem 1rem;
  border: 1px solid rgba(98, 78, 48, 0.34);
  border-radius: 0 12px 12px 12px;
  background:
    linear-gradient(to bottom, rgba(232, 214, 181, 0.32), rgba(205, 181, 140, 0.24)),
    rgba(255, 248, 233, 0.72);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.clue-folder-section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0.85rem;
  width: 120px;
  height: 24px;
  border: 1px solid rgba(98, 78, 48, 0.34);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background:
    linear-gradient(to bottom, rgba(241, 226, 196, 0.96), rgba(221, 196, 154, 0.96));
}

.clue-folder-header {
  position: relative;
  z-index: 1;
  margin-bottom: 0.75rem;
  padding-left: 0.15rem;
}

.clue-folder-header h3,
.clue-folder-header h4 {
  margin: 0;
  color: #2e2519;
}

.clue-folder-drop-hint {
  position: relative;
  z-index: 1;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px dashed rgba(98, 78, 48, 0.35);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #5c4a35;
  background: rgba(255, 252, 245, 0.55);
}

.clue-folder-section.is-drop-target {
  border-color: rgba(180, 120, 35, 0.9);
  box-shadow:
    0 0 0 2px rgba(180, 120, 35, 0.18),
    0 2px 10px rgba(0, 0, 0, 0.14);
}

/* Empty / filter / misc */

.clue-cards-empty {
  padding: 1rem;
  border: 1px dashed rgba(98, 78, 48, 0.35);
  border-radius: 10px;
  text-align: center;
  background: rgba(255, 250, 240, 0.65);
  opacity: 0.9;
}

.clue-cards-empty p {
  margin: 0;
}

.clue-cards-filter-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.clue-cards-sidebar-button {
  width: 100%;
  margin-top: 0.5rem;
}

.clue-cards-sidebar-button i {
  margin-right: 0.35rem;
}

.clue-folder-creation-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.clue-folder-creation-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.clue-reveal-editor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Small screen / narrow window */

@media (max-width: 700px) {
  .clue-cards-header,
  .clue-card-top {
    flex-direction: column;
    align-items: stretch;
  }

  .clue-card-actions,
  .clue-cards-header-actions {
    width: 100%;
  }
}


#clue-cards-compact-app .window-content,
#player-compact-app .window-content {
  padding: 5px !important;
  overflow: hidden;
}

.clue-browser-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.4rem;
  box-sizing: border-box;
}

.clue-browser-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem 0.15rem;
}

.clue-browser-topbar-left {
  flex: 1 1 auto;
  width: auto;
  text-align: left;
}

.clue-browser-topbar-left h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.02;
}

.clue-browser-subtitle {
  margin: 0.35rem 0 0 0;
  opacity: 0.8;
}

.clue-browser-topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
  flex: 0 0 auto;
}

.clue-browser-topbar-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
  line-height: 1;
  box-shadow: none;
}

.clue-browser-topbar-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  transform: translateY(-1px);
}

.clue-browser-topbar-actions button:active {
  transform: translateY(0);
}

.clue-browser-topbar-actions [data-action="new-clue"] {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.36);
  color: #e8c84a;
}

.clue-browser-topbar-actions [data-action="new-clue"]:hover {
  background: rgba(201, 162, 39, 0.24);
  border-color: rgba(201, 162, 39, 0.54);
  color: #f5d860;
}

.clue-browser-inline-actions {
  margin-bottom: 0;
  justify-content: flex-end;
  padding-left: 0;
}

.clue-browser-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  grid-template-rows: 1fr;
  gap: 0.5rem;
}

.clue-browser-left,
.clue-browser-right {
  min-height: 0;
  border: 1px solid rgba(90, 90, 90, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.clue-browser-left {
  display: flex;
  flex-direction: column;
}

.clue-browser-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.75rem 0.3rem;
  border-bottom: 1px solid rgba(90, 90, 90, 0.15);
}

.clue-browser-back-button {
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  border-radius: 8px;
}

.clue-browser-location {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.16rem 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.clue-browser-location-label {
  font-size: 0.62rem;
  opacity: 0.45;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.clue-browser-location-label::after {
  content: "/";
  margin-left: 0.25rem;
}

.clue-browser-location-name {
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clue-browser-create-folder {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-bottom: 1px solid rgba(90, 90, 90, 0.15);
}

.clue-browser-create-folder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  line-height: 1;
  box-shadow: none;
}

.clue-browser-create-folder-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.clue-browser-create-folder-form {
  display: none;
  flex: 1;
  align-items: center;
  gap: 0.5rem;
}

.clue-browser-create-folder.is-open .clue-browser-create-folder-toggle {
  display: none;
}

.clue-browser-create-folder.is-open .clue-browser-create-folder-form {
  display: flex;
}

.clue-browser-create-folder-form input {
  flex: 1;
  min-width: 0;
}

.clue-browser-left-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.clue-browser-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.clue-browser-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.clue-browser-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 125px);
  gap: 0.85rem;
  justify-content: start;
  align-items: start;
}

.clue-browser-item {
  min-height: 125px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.clue-tile-card {
  position: relative;
  width: 125px;
  height: 190px;
  min-height: 190px;
  overflow: hidden;
  border-radius: 14px;
  background: #2b2b2b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  border: 3px solid transparent;
  cursor: grab;
  transition:
    transform 750ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 750ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 750ms cubic-bezier(0.16, 1, 0.3, 1);
}

.clue-tile-card:active {
  cursor: grabbing;
}

.clue-tile-card:hover {
  transform: translateY(-2px);
}

.clue-tile-card.is-selected {
  transform: translateY(-11px);
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.12),
    0 28px 60px rgba(0, 0, 0, 0.34),
    0 10px 23px rgba(0, 0, 0, 0.22);
}

.clue-tile-card.is-select-animating {
  animation: clueTileSelectedLift 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: none;
}

@keyframes clueTileSelectedLift {
  from {
    transform: translateY(-2px);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  }

  to {
    transform: translateY(-11px);
    border-color: rgba(255, 255, 255, 0.88);
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.12),
      0 28px 60px rgba(0, 0, 0, 0.34),
      0 10px 23px rgba(0, 0, 0, 0.22);
  }
}

.clue-tile-card.is-dragging {
  opacity: 0;
}

.clue-tile-media {
  position: absolute;
  inset: 0;
}

.clue-tile-media > img,
.clue-tile-no-image {
  width: 100%;
  height: 100%;
}

.clue-tile-media > img {
  object-fit: cover;
  display: block;
  transform-origin: center center;
}

.clue-tile-no-image {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #c2c2c2 0%, #aaaaaa 55%, #8c8c8c 100%);
}

.clue-tile-no-image i {
  position: absolute;
  left: 50%;
  top: 25%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0.92;
  pointer-events: none;
}

.clue-browser-compact .clue-tile-no-image i {
  font-size: 1.2rem;
}

.clue-tile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.60) 0%,
    rgba(0, 0, 0, 0.38) 38%,
    rgba(0, 0, 0, 0.08) 72%,
    rgba(0, 0, 0, 0.00) 100%);
  pointer-events: none;
}

.clue-tile-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0.55rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.02) 42%, transparent 72%);
}

.clue-tile-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  max-width: 100%;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.clue-tile-text {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  line-height: 1.3;
  opacity: 0.92;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clue-tile-meta-row {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 2.8rem;
  margin-top: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.clue-tile-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.62rem;
}

.clue-tile-toolbar {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.clue-tile-card:hover .clue-tile-toolbar,
.clue-tile-card:focus-within .clue-tile-toolbar,
.clue-tile-card.is-select-animating .clue-tile-toolbar,
.clue-tile-card.is-selected .clue-tile-toolbar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.clue-tile-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 0.1rem;
}

.clue-tile-actions button,
.clue-tile-card .clue-card-drag-handle {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.9;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.clue-tile-actions button i {
  font-size: 0.6rem;
}

.clue-tile-actions button:hover,
.clue-tile-card .clue-card-drag-handle:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.clue-folder-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 125px;
  height: 190px;
  min-height: 190px;
  padding: 0.45rem;
  border-radius: 14px;
  border: 1px solid rgba(160, 125, 70, 0.22);
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.11) 42%, rgba(0, 0, 0, 0.05) 100%),
    var(--folder-color, #d3b07a);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.clue-folder-tile:hover {
  transform: translateY(-2px);
}

.folder-drag-active .clue-folder-tile:hover {
  transform: none !important;
}

.clue-folder-tile-top {
  display: block;
}

.clue-folder-tile-name-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  min-height: 24px;
  height: auto;
  padding: 2px 4px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.36);
  border-color: rgba(255, 255, 255, 0.26);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  color: var(--folder-text-color, #ffffff);
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  word-break: break-word;
  field-sizing: content;
  box-sizing: border-box;
  font-family: inherit;
}

.clue-folder-tile-name-input.is-save-glow {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 10px rgba(255, 215, 120, 0.45);
}

.clue-folder-tile-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.clue-folder-tile-icon {
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.clue-folder-tile-content,
.clue-folder-tile-name,
.clue-folder-tile-meta {
  display: none;
}

.clue-folder-tile-name {
  color: var(--folder-text-color, #ffffff);
}

.clue-folder-tile-actions {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 0.1rem;
}

.clue-folder-tile-actions button,
.clue-folder-color-button {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.clue-folder-tile-actions button i {
  font-size: 0.6rem;
}

.clue-folder-tile-actions input {
  width: 100%;
  min-width: 0;
}

.clue-folder-tile.is-drop-target,
.clue-folder-tile:hover {
  box-shadow:
    0 0 0 2px rgba(190, 140, 40, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

/* Source folder goes invisible during drag, just like cards */
.clue-folder-tile.is-dragging {
  opacity: 0;
}

/* Nest-inside indicator — only shows when hovering center of a folder while dragging another folder */
.clue-folder-tile.folder-drag-inside {
  box-shadow: 0 0 0 2px rgba(80, 200, 110, 0.85), 0 10px 24px rgba(0, 0, 0, 0.18);
  transform: scale(0.96);
}

/* Folder navigation slide animations */
@keyframes folder-nav-enter {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes folder-nav-back {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
.clue-browser-entry-grid.folder-nav-enter {
  animation: folder-nav-enter 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.clue-browser-entry-grid.folder-nav-back {
  animation: folder-nav-back 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.clue-folder-color-button {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.clue-folder-color-button i {
  font-size: 0.6rem;
  pointer-events: none;
}

.clue-folder-color-button input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.clue-preview-shell {
  height: 100%;
  padding: 0.6rem;
  box-sizing: border-box;
}

.clue-preview-card {
  overflow-y: auto;
  border: 1px solid rgba(100, 100, 100, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  animation: cluePreviewEnter 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.clue-preview-image {
  overflow: hidden;
  background: #181818;
  border-radius: 18px 18px 0 0;
}

.clue-preview-image > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  transform-origin: center center;
}

.clue-external-paper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.clue-external-paper > .hqp-news-paper {
  width: 100%;
  max-width: none !important;
  margin: 0;
  pointer-events: none;
  user-select: none;
}

.clue-tile-media.clue-external-paper {
  position: absolute;
  height: 100%;
}

.clue-external-paper .hqp-block-image[data-empty="true"],
.clue-external-paper .hqp-block-handles,
.clue-external-paper .hqp-img-controls,
.clue-external-paper .hqp-block-del,
.clue-external-paper .hqp-move-bar,
.clue-external-paper .hqp-rh,
.clue-external-paper .hqp-line-controls,
.clue-external-paper .hqp-line-del,
.clue-external-paper .hqp-line-resize,
.clue-external-paper .hqp-line-rotate,
.clue-external-paper .hqp-banner-handles,
.clue-external-paper .hqp-banner-del {
  display: none !important;
}

.clue-preview-body {
  padding: 1.15rem 1.15rem 1rem 1.15rem;
  font-size: 0.92rem;
}

.clue-preview-body h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.55rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.clue-preview-meta {
  margin-top: 0;
  margin-bottom: 0.9rem;
  opacity: 0.7;
  font-size: 0.85rem;
}

.clue-preview-external-btn {
  width: 100%;
  margin: 0.35rem 0 0.9rem;
  border: 1px solid rgba(212, 168, 75, 0.55);
  background: rgba(212, 168, 75, 0.14);
  color: inherit;
}

.clue-preview-external-btn:hover {
  background: rgba(212, 168, 75, 0.24);
}

.clue-preview-audio {
  margin-bottom: 0.9rem;
}

.clue-preview-audio audio {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.clue-editor-audio-preview {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 0.5rem;
  border-radius: 8px;
}

.clue-preview-levels {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.clue-preview-level {
  border: 1px solid rgba(120, 120, 120, 0.18);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.03);
}

.clue-preview-level h4 {
  margin: 0 0 0.45rem 0;
}

.clue-preview-level p {
  margin: 0;
  line-height: 1.3;
  font-size: 0.9rem;
}

.clue-preview-level-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.clue-preview-level-badge {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.clue-preview-level-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.55;
  font-weight: 600;
}

.clue-preview-notes {
  background: rgba(180, 140, 60, 0.07);
  border-color: rgba(180, 140, 60, 0.22);
}

.clue-preview-notes h4 {
  margin: 0 0 0.35rem 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.7;
  font-weight: 700;
}

.clue-preview-empty {
  height: 100%;
  border: 1px dashed rgba(120, 120, 120, 0.28);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  box-sizing: border-box;
  opacity: 0.85;
}

.clue-preview-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

@keyframes cluePreviewEnter {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cluePreviewExit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(22px);
  }
}

.clue-compact-preview-panel.is-exiting {
  animation: cluePreviewExit 200ms cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

.clue-preview-notes-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.clue-preview-level textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
  resize: vertical;
}

.clue-browser-parent-drop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.75rem;
  padding: 0.28rem 0.6rem;
  border: 1px dashed rgba(160, 160, 160, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.clue-browser-parent-drop.is-drop-target {
  box-shadow: 0 0 0 2px rgba(200, 200, 200, 0.18);
  border-color: rgba(220, 220, 220, 0.5);
}

.clue-browser-parent-drop-icon {
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.7;
}

.clue-browser-parent-drop-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.clue-browser-parent-drop-text strong {
  font-size: 0.78rem;
}

.clue-browser-parent-drop-text span {
  font-size: 0.68rem;
  opacity: 0.6;
}

.clue-image-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.clue-image-input-row input {
  flex: 1;
  min-width: 0;
}

.clue-editor-image-tools {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.clue-editor-image-frame {
  border: 1px solid rgba(120, 120, 120, 0.22);
  border-radius: 16px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.clue-editor-image-preview-stage {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  height: 320px;
  background: #1d1d1d;
}

.clue-editor-image-preview-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transition: transform 0.08s linear, object-position 0.08s linear;
}

.clue-editor-image-controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 1px solid rgba(120, 120, 120, 0.22);
  border-radius: 16px;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.clue-editor-slider-value {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.clue-editor-no-image-controls {
  grid-template-columns: 1fr 1fr;
}

.clue-editor-no-image-controls input[type="color"] {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.2rem;
}

@media (max-width: 900px) {
  .clue-browser-layout {
    grid-template-columns: 1fr;
  }

  .clue-browser-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .clue-editor-image-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .clue-editor-no-image-controls {
    grid-template-columns: 1fr;
  }
}

.clue-delivery-popup-layer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
}

.clue-delivery-popup-layer.fading {
  background: rgba(0, 0, 0, 0);
}

.clue-delivery-popup {
  position: fixed;
  left: 50%;
  top: 1rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  transform: translateX(-50%) translateY(140px) scale(0.82);
  opacity: 0;
  transition:
    transform 0.65s cubic-bezier(0.18, 0.88, 0.22, 1),
    opacity 0.32s ease;
  will-change: transform, opacity;
}

.clue-delivery-popup.entering {
  opacity: 0;
  transform: translateX(-50%) translateY(140px) scale(0.82);
}

.clue-delivery-popup.entered {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.clue-delivery-popup.leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(-32px) scale(0.96);
}

.clue-delivery-popup-inner {
  overflow: auto;
  max-height: calc(100vh - 2rem);
  border-radius: 22px;
  background: #171717;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.42),
    0 6px 18px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clue-delivery-popup-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #232323;
}

.clue-delivery-popup-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
}

.clue-delivery-popup-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(160deg, #4b4b4b, #262626);
}

.clue-delivery-popup-body {
  padding: 1rem 1rem 1.1rem 1rem;
  color: #f5f3ee;
}

.clue-delivery-popup-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: 0.4rem;
}

.clue-delivery-popup-body h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.clue-delivery-popup-meta {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  opacity: 0.82;
}

.clue-delivery-popup-body p {
  margin: 0.7rem 0 0 0;
  line-height: 1.4;
  opacity: 0.96;
}

/* Popup close button */
.clue-delivery-popup-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.72);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  z-index: 2;
  transition: background 0.18s ease, transform 0.18s ease;
}

.clue-delivery-popup-close:hover {
  background: rgba(36, 36, 36, 0.9);
  transform: scale(1.05);
}

.clue-delivery-popup-close:active {
  transform: scale(0.96);
}

/* Popup staged reveal boxes */
.clue-delivery-popup-reveals {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.75rem;
}

.clue-delivery-popup-reveal {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.8rem;
}

.clue-delivery-popup-reveal-header {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.72;
  margin-bottom: 0.55rem;
}

.clue-delivery-popup-reveal-button {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f3ee;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.clue-delivery-popup-reveal-button:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.2);
}

.clue-delivery-popup-reveal-button:active {
  transform: scale(0.985);
}

.clue-delivery-popup-reveal-content[hidden] {
  display: none !important;
}

.clue-delivery-popup-reveal-content {
  display: block;
  width: 100%;
  margin-top: 0.7rem;
  padding: 0;
  white-space: normal;
  opacity: 0.98;
  text-align: left !important;
}

.clue-delivery-popup-reveal-text {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  text-align: left !important;
  text-indent: 0 !important;
}

.clue-delivery-popup-reveal.is-revealed .clue-delivery-popup-reveal-content {
  animation: clueDeliveryRevealFadeIn 0.22s ease;
}

@keyframes clueDeliveryRevealFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.clue-browser-app ::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.clue-browser-app ::-webkit-scrollbar-track {
  background: transparent;
}

.clue-browser-app ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.clue-browser-app ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.clue-cards-window-opening {
  animation: clueCardsWindowOpen 420ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center top;
}

@keyframes clueCardsWindowOpen {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.clue-cards-window-opening-manager {
  animation: clueCardsWindowOpen 420ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center top;
}

.clue-cards-compact-opening {
  animation: clueCardsCompactOpen 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: left top;
}

@keyframes clueCardsCompactOpen {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* Compact GM Window */

.clue-browser-compact {
  zoom: 0.90;
}

#clue-cards-compact-app .window-title,
#player-compact-app .window-title {
  font-size: 0.75rem;
}

.clue-browser-compact .clue-compact-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
}

.clue-compact-toolbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid rgba(90, 90, 90, 0.15);
  flex-shrink: 0;
}

.clue-compact-toolbar .clue-browser-location {
  flex: 1 1 auto;
  min-width: 0;
}

.clue-compact-toolbar .clue-browser-location-label {
  font-size: 0.6rem;
}

.clue-compact-toolbar .clue-browser-location-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.clue-compact-actions {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.clue-compact-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.72rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.clue-compact-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.clue-compact-expand-btn {
  background: rgba(82, 160, 220, 0.12);
  border-color: rgba(82, 160, 220, 0.36);
  color: #7ac3f5;
}

.clue-compact-expand-btn:hover {
  background: rgba(82, 160, 220, 0.22);
  border-color: rgba(82, 160, 220, 0.56);
  color: #a8d9ff;
}

.clue-browser-compact .clue-browser-create-folder {
  display: none;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(90, 90, 90, 0.12);
  flex-shrink: 0;
}

.clue-browser-compact .clue-browser-create-folder.is-open {
  display: flex;
}

.clue-browser-compact .clue-browser-create-folder-form {
  display: flex;
  flex: 1;
  gap: 0.35rem;
}

.clue-browser-compact .clue-browser-entry-grid {
  grid-template-columns: repeat(auto-fill, 70px);
  gap: 0.5rem;
}

.clue-browser-compact .clue-browser-item {
  min-height: 70px;
  border-radius: 9px;
}

.clue-browser-compact .clue-tile-card {
  width: 70px;
  height: 108px;
  min-height: 108px;
  border-radius: 9px;
}

.clue-browser-compact .clue-folder-tile {
  width: 70px;
  height: 108px;
  min-height: 108px;
  border-radius: 9px;
  padding: 0.3rem;
}

.clue-browser-compact .clue-folder-tile-icon {
  font-size: 1.3rem;
}

.clue-browser-compact .clue-folder-tile-name-input {
  height: 16px;
  font-size: 0.5rem;
}

.clue-browser-compact .clue-tile-content {
  padding: 0.22rem 0.3rem 0.18rem;
}

.clue-browser-compact .clue-tile-title {
  font-size: 0.62rem;
}

.clue-browser-compact .clue-tile-pill {
  font-size: 0.52rem;
  padding: 0.1rem 0.32rem;
}

.clue-browser-compact .clue-tile-meta-row,
.clue-tile-card--compact-ghost .clue-tile-meta-row {
  display: none;
}

/* Drag ghost from inspector window — restore correct sizes, keep pill visible */
.clue-tile-card--inspector-ghost .clue-tile-content {
  padding: 0.55rem;
  font-size: 1rem;
}

.clue-tile-card--inspector-ghost .clue-tile-title {
  font-size: 0.82rem;
}

.clue-tile-card--inspector-ghost .clue-tile-meta-row {
  display: flex;
  bottom: 2.8rem;
}

.clue-tile-card--inspector-ghost .clue-tile-pill {
  font-size: 0.68rem;
  padding: 0.18rem 0.4rem;
}

.clue-tile-card--inspector-ghost .clue-tile-actions button {
  width: 1.45rem;
  height: 1.45rem;
}

.clue-tile-card--inspector-ghost .clue-tile-actions button i {
  font-size: 0.6rem;
}

/* Drag ghost from compact window — re-apply compact inner styles */
.clue-tile-card--compact-ghost .clue-tile-content {
  padding: 0.22rem 0.3rem 0.18rem;
}

.clue-tile-card--compact-ghost .clue-tile-title {
  font-size: 0.62rem;
}

.clue-tile-card--compact-ghost .clue-tile-no-image i {
  font-size: 1.2rem;
}

.clue-tile-card--compact-ghost .clue-tile-actions button {
  width: 1rem;
  height: 1rem;
}

.clue-tile-card--compact-ghost .clue-tile-actions button i {
  font-size: 0.48rem;
}

@keyframes clueTileSelectedLiftCompact {
  from {
    transform: translateY(-2px);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  }
  to {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.88);
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.12),
      0 28px 60px rgba(0, 0, 0, 0.34),
      0 10px 23px rgba(0, 0, 0, 0.22);
  }
}

.clue-browser-compact .clue-tile-card.is-select-animating {
  animation-name: clueTileSelectedLiftCompact !important;
  animation-duration: 410ms !important;
}

.clue-browser-compact .clue-tile-card.is-selected:not(.is-select-animating) {
  transform: translateY(-6px) !important;
}

.clue-browser-compact .clue-tile-card .clue-tile-toolbar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.clue-browser-compact .clue-tile-actions button {
  width: 1rem !important;
  height: 1rem !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
}

.clue-browser-compact .clue-tile-actions button i {
  font-size: 0.42rem;
}

/* Folder action buttons: match clue card button size */
.clue-browser-compact .clue-folder-tile-actions button,
.clue-browser-compact .clue-folder-color-button {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.clue-browser-compact .clue-folder-tile-actions button i,
.clue-browser-compact .clue-folder-color-button i {
  font-size: 0.42rem;
}

.clue-browser-compact .clue-browser-left-scroll {
  padding: 0.4rem;
  gap: 0.45rem;
}

.clue-compact-toolbar .clue-browser-back-button {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* External preview panel (attached to right side of compact window) */
.clue-compact-preview-panel {
  position: fixed;
  z-index: 95;
  width: 240px;
  border-radius: 12px;
  border: 1px solid var(--color-border-dark, rgba(90, 70, 40, 0.55));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.clue-compact-preview-panel .clue-preview-shell {
  height: 100%;
  padding: 0.4rem;
  box-sizing: border-box;
}

.clue-compact-preview-panel .clue-preview-card {
  overflow-y: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Scale preview panel content to match compact window proportions */
.clue-compact-preview-panel .clue-preview-image {
  border-radius: 10px 10px 0 0;
}

.clue-compact-preview-panel .clue-preview-image > img {
  max-height: 150px;
}

.clue-compact-preview-panel .clue-preview-body {
  padding: 0.55rem 0.6rem 0.5rem;
  font-size: 0.75rem;
}

.clue-compact-preview-panel .clue-preview-body h3 {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.clue-compact-preview-panel .clue-preview-meta {
  font-size: 0.65rem;
  margin-bottom: 0.5rem;
}

.clue-compact-preview-panel .clue-preview-levels {
  gap: 0.45rem;
}

.clue-compact-preview-panel .clue-preview-audio {
  margin-bottom: 0.5rem;
}

.clue-compact-preview-panel .clue-preview-audio audio {
  height: 24px;
}

.clue-compact-preview-panel .clue-preview-audio audio::-webkit-media-controls-current-time-display,
.clue-compact-preview-panel .clue-preview-audio audio::-webkit-media-controls-time-remaining-display,
.clue-board-preview-panel .clue-preview-audio audio::-webkit-media-controls-current-time-display,
.clue-board-preview-panel .clue-preview-audio audio::-webkit-media-controls-time-remaining-display {
  font-size: 0.55rem;
}

.clue-compact-preview-panel .clue-preview-level {
  padding: 0.4rem;
  border-radius: 8px;
}

.clue-compact-preview-panel .clue-preview-level-header {
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.clue-compact-preview-panel .clue-preview-level-badge {
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.55rem;
}

.clue-compact-preview-panel .clue-preview-level-label {
  font-size: 0.55rem;
}

.clue-compact-preview-panel .clue-preview-level p {
  font-size: 0.72rem;
  line-height: 1.35;
}

/* Compact window — tab strip */

.clue-compact-tabstrip {
  display: flex;
  flex-shrink: 0;
  padding: 0.2rem 0.25rem 0;
  gap: 0.2rem;
}

.clue-compact-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.28rem 0.4rem;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: 1;
}

.clue-compact-tab:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
}

.clue-compact-tab.is-active {
  color: #fff;
  border-bottom-color: var(--color-warm-2, #d4a84b);
  background: rgba(255, 255, 255, 0.06);
}

.clue-compact-tab i {
  font-size: 0.65rem;
}

/* Compact window — player list */

.clue-compact-player-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.clue-compact-player-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.clue-compact-player-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.clue-compact-player-avatar {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.clue-compact-player-name {
  flex: 1;
}

.clue-compact-player-indicator {
  font-size: 0.75rem;
  opacity: 0.7;
  color: var(--color-warm-2, #d4a84b);
  flex-shrink: 0;
}

/* Compact window — conversation view */

.clue-compact-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem;
}

.clue-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.clue-chat-msg.is-self {
  align-self: flex-end;
  align-items: flex-end;
}

.clue-chat-msg.is-other {
  align-self: flex-start;
  align-items: flex-start;
}

.clue-chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
  font-size: 0.6rem;
  opacity: 0.55;
}

.clue-chat-msg-sender {
  font-weight: 600;
}

.clue-chat-msg-time {
  font-size: 0.55rem;
}

.clue-chat-msg-text {
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  word-break: break-word;
}

.clue-chat-msg.is-self .clue-chat-msg-text {
  background: rgba(212, 168, 75, 0.25);
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-bottom-right-radius: 3px;
}

.clue-chat-msg.is-other .clue-chat-msg-text {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 3px;
}

.clue-chat-input-row {
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.clue-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  color: inherit;
  font-size: 0.75rem;
  outline: none;
  min-width: 0;
}

.clue-chat-input:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.clue-chat-send-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgba(212, 168, 75, 0.2);
  border: 1px solid rgba(212, 168, 75, 0.35);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.clue-chat-send-btn:hover {
  background: rgba(212, 168, 75, 0.35);
  border-color: rgba(212, 168, 75, 0.55);
}

.clue-chat-msg {
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.1s;
}

.clue-chat-msg.is-checked {
  background: rgba(212, 168, 75, 0.12);
  outline: 1px solid rgba(212, 168, 75, 0.4);
}

.clue-chat-msg.is-checked .clue-chat-msg-text {
  position: relative;
}

.clue-chat-msg.is-checked .clue-chat-msg-text::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.5rem;
  position: absolute;
  top: -0.6rem;
  right: 0;
  color: var(--color-warm-2, #d4a84b);
  opacity: 0.9;
}

.clue-compact-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.clue-chat-empty {
  margin: auto;
  text-align: center;
  opacity: 0.45;
  font-size: 0.72rem;
  padding: 1rem;
}

/* Player chat window */

.clue-player-chat-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.clue-player-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem;
}

/* Inherit shared .clue-chat-msg styles; bump sizes slightly for the larger window */
#player-gm-chat-app .clue-chat-msg-text {
  font-size: 0.82rem;
}

#player-gm-chat-app .clue-chat-msg-meta {
  font-size: 0.65rem;
}

#player-gm-chat-app .clue-chat-input {
  font-size: 0.82rem;
}

#player-gm-chat-app .clue-chat-input-row {
  padding: 0.5rem 0.6rem;
}

#player-gm-chat-app .clue-chat-send-btn {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.82rem;
}

/* Voice messages */

.clue-chat-voice-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.clue-chat-voice-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.clue-voice-recording-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.5rem;
  min-width: 0;
}

.clue-voice-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53935;
  flex-shrink: 0;
  animation: clue-rec-pulse 1s ease-in-out infinite;
}

@keyframes clue-rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.clue-voice-rec-timer {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.clue-voice-cancel-btn {
  color: rgba(255, 100, 100, 0.8);
}

.clue-voice-stop-btn {
  background: rgba(229, 57, 53, 0.25);
  border-color: rgba(229, 57, 53, 0.4);
}

.clue-voice-stop-btn:hover {
  background: rgba(229, 57, 53, 0.4);
  border-color: rgba(229, 57, 53, 0.6);
}

.clue-chat-msg-voice {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  min-width: 180px;
  width: 85%;
}

.clue-chat-msg-voice audio { display: none; }

.clue-chat-msg.is-self .clue-chat-msg-voice {
  background: rgba(212, 168, 75, 0.25);
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-bottom-right-radius: 3px;
}

.clue-chat-msg.is-other .clue-chat-msg-voice {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 3px;
}

.clue-voice-play-btn {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
  transition: background 0.15s;
}

.clue-voice-play-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.clue-voice-waveform {
  flex: 1;
  height: 22px;
  min-width: 60px;
  position: relative;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.15) 0px, rgba(255, 255, 255, 0.15) 2px,
    transparent 2px, transparent 5px
  );
}

.clue-voice-waveform-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    rgba(212, 168, 75, 0.6) 0px, rgba(212, 168, 75, 0.6) 2px,
    transparent 2px, transparent 5px
  );
}

.clue-chat-msg.is-other .clue-voice-waveform-progress {
  background: repeating-linear-gradient(
    90deg,
    rgba(180, 180, 220, 0.55) 0px, rgba(180, 180, 220, 0.55) 2px,
    transparent 2px, transparent 5px
  );
}

.clue-voice-duration {
  font-size: 0.6rem;
  opacity: 0.65;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 2rem;
  text-align: right;
}

#player-gm-chat-app .clue-chat-voice-btn {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.82rem;
}

/* Clue board */

.clue-board-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #0e0e0e;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.clue-board-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* Toolbar */
.clue-board-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 2;
  gap: 0.75rem;
}

.clue-board-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.clue-board-toolbar-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.clue-board-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  min-height: 0 !important;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  box-shadow: none;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.clue-board-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.clue-board-share-btn {
  color: rgba(126, 220, 170, 0.9);
  border-color: rgba(126, 220, 170, 0.32);
}

.clue-board-share-btn:hover {
  color: #9ce8bd;
  background: rgba(126, 220, 170, 0.13);
  border-color: rgba(126, 220, 170, 0.55);
}

.clue-board-overlay.is-read-only .clue-board-connect-hint,
.clue-board-overlay.is-read-only .board-card-delete-btn,
.clue-board-overlay.is-read-only .board-card-connect-dot,
.clue-board-overlay.is-read-only .board-card-resize-handle,
.clue-board-overlay.is-read-only .board-text-node-delete,
.clue-board-overlay.is-read-only .board-bg-image-resize-handle {
  display: none !important;
}

/* Viewport */
.clue-board-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: grab;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 38px 38px;
}

.clue-board-viewport.is-panning {
  cursor: grabbing;
}

.clue-board-viewport.is-drop-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(212, 168, 75, 0.55);
  border-radius: 0;
  pointer-events: none;
  box-shadow: inset 0 0 40px rgba(212, 168, 75, 0.08);
}

/* World container (receives pan+zoom transform) */
.clue-board-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

/* SVG layer for connection lines */
.clue-board-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 8000px;
  height: 8000px;
  pointer-events: none;
  overflow: visible;
}

/* Board card title scales with card height — no upper limit */
.board-card .clue-tile-title {
  font-size: max(0.45rem, calc(var(--card-h, 190px) * 0.068));
}

/* Board card fallback icon scales with card height */
.board-card .clue-tile-no-image i {
  font-size: max(0.8rem, calc(var(--card-h, 190px) * 0.14));
}

/* Board cards — outer wrapper (overflow visible so connect dot floats above) */
.board-card {
  position: absolute;
  width: 125px;
  height: 190px;
  overflow: visible;
  user-select: none;
  cursor: pointer;
  transition:
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Inner card visual — fills the outer wrapper and clips its own content */
.board-card-inner.clue-tile-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: unset;
}

.board-card:hover {
  transform: translateY(-4px) !important;
  z-index: 2;
}

.board-card.is-board-dragging {
  cursor: grabbing !important;
  z-index: 10;
  opacity: 0.92;
  transform: scale(1.04) !important;
  transition: none;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55) !important;
}

/* Delete button that appears on hover */
.board-card-delete-btn {
  position: absolute;
  top: calc(var(--card-h, 190px) * 0.026);
  right: calc(var(--card-h, 190px) * 0.026);
  width: calc(var(--card-h, 190px) * 0.114);
  height: calc(var(--card-h, 190px) * 0.114);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.72);
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--card-h, 190px) * 0.034);
  opacity: 0;
  transition: opacity 0.15s ease, background 0.12s ease;
  z-index: 5;
  cursor: pointer;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.board-card:hover .board-card-delete-btn {
  opacity: 1;
}

.board-card-delete-btn:hover {
  background: rgba(180, 48, 48, 0.9);
  color: #fff;
}

/* Connect dot — appears on hover above the card center */
.board-card-connect-dot {
  position: absolute;
  top: calc(var(--card-h, 190px) * -0.058);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--card-h, 190px) * 0.116);
  height: calc(var(--card-h, 190px) * 0.116);
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--card-h, 190px) * 0.027);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  z-index: 15;
  backdrop-filter: blur(4px);
}

.board-card:hover .board-card-connect-dot {
  opacity: 1;
}

.board-card-connect-dot:hover {
  background: rgba(212, 168, 75, 0.22);
  border-color: rgba(212, 168, 75, 0.7);
  color: #d4a84b;
}

/* Source card dot is always visible and gold */
.board-card.is-connect-source .board-card-connect-dot {
  opacity: 1;
  background: rgba(212, 168, 75, 0.35);
  border-color: #d4a84b;
  color: #d4a84b;
}

/* During connection mode all dots are semi-visible to hint at targets */
.clue-board-overlay.is-connecting .board-card-connect-dot {
  opacity: 0.65;
}

/* Board preview panel */
.clue-board-preview-panel {
  position: fixed !important;
  z-index: 9999 !important;
  width: 290px !important;
  height: auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  background: #1a1a1a !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.clue-board-preview-panel.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Board button in compact toolbars */
.clue-compact-board-btn {
  color: rgba(212, 168, 75, 0.75) !important;
  border-color: rgba(212, 168, 75, 0.25) !important;
}

.clue-compact-board-btn:hover {
  color: #d4a84b !important;
  background: rgba(212, 168, 75, 0.1) !important;
  border-color: rgba(212, 168, 75, 0.45) !important;
}

.clue-compact-gm-board-btn {
  color: rgba(126, 185, 255, 0.8) !important;
  border-color: rgba(126, 185, 255, 0.28) !important;
}

.clue-compact-gm-board-btn:hover {
  color: #9bcaff !important;
  background: rgba(126, 185, 255, 0.1) !important;
  border-color: rgba(126, 185, 255, 0.5) !important;
}

/* Board — card action popup */

.board-card-action-popup {
  position: fixed;
  z-index: 1000;
  display: flex;
  gap: 4px;
  background: rgba(15, 15, 15, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 5px 6px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  animation: boardPopupIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes boardPopupIn {
  from { opacity: 0; transform: translateY(4px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.board-popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  min-height: 0 !important;
  line-height: 1;
}

.board-popup-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.board-popup-btn.is-connect-btn:hover {
  background: rgba(212, 168, 75, 0.18);
  color: #d4a84b;
  border-color: rgba(212, 168, 75, 0.45);
}

/* Board — connection mode states */

/* Hint text in toolbar during connection mode */
.clue-board-connect-hint {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: #d4a84b;
  font-style: italic;
  white-space: nowrap;
}

.clue-board-overlay.is-connecting .clue-board-connect-hint {
  display: flex;
}

/* Crosshair cursor while connecting */
.clue-board-overlay.is-connecting .clue-board-viewport {
  cursor: crosshair;
}

.clue-board-overlay.is-connecting .board-card {
  cursor: crosshair;
}

/* While editing a line: freeze card hover, hide connect dots */
.clue-board-overlay.is-editing-line .board-card:hover {
  transform: none !important;
  z-index: auto !important;
}

.clue-board-overlay.is-editing-line .board-card-connect-dot {
  opacity: 0 !important;
  pointer-events: none !important;
}

.clue-board-overlay.is-editing-line .board-card-delete-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

.clue-board-overlay.is-editing-line .board-card {
  cursor: default;
}

/* Source card gets a gold ring on the inner card visual */
.board-card.is-connect-source .board-card-inner {
  outline: 2px solid #d4a84b;
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(212, 168, 75, 0.45);
}

/* Board — line editor panel */

.board-line-editor {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 500;
  width: 240px;
  background: rgba(15, 15, 15, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.board-line-editor.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.board-line-editor-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.board-line-type-row {
  display: flex;
  gap: 5px;
}

.board-line-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 3px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.6rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  min-height: 0 !important;
  line-height: 1;
}

.board-line-type-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.22);
}

.board-line-type-btn.is-active {
  background: rgba(212, 168, 75, 0.18);
  color: #d4a84b;
  border-color: rgba(212, 168, 75, 0.5);
}

/* Small inline previews of line styles */
.line-preview {
  display: block;
  width: 28px;
  height: 2px;
  background: currentColor;
}

.line-preview.line-solid {
  /* default — solid handled by background */
}

.line-preview.line-dashed {
  background: repeating-linear-gradient(
    to right,
    currentColor 0px,
    currentColor 5px,
    transparent 5px,
    transparent 9px
  );
}

.line-preview.line-dotted {
  background: repeating-linear-gradient(
    to right,
    currentColor 0px,
    currentColor 2px,
    transparent 2px,
    transparent 5px
  );
}

.line-preview.line-arrow {
  position: relative;
  background: currentColor;
}

.line-preview.line-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}

.line-preview.line-double {
  position: relative;
  background: currentColor;
}

.line-preview.line-double::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 6px solid currentColor;
}

.line-preview.line-double::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}

.board-line-label-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.board-line-label-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
  padding: 4px 7px;
  outline: none;
  transition: border-color 0.12s ease;
}

.board-line-label-input:focus {
  border-color: rgba(212, 168, 75, 0.5);
}

.board-line-label-size {
  width: 46px;
  flex-shrink: 0;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
  padding: 4px 5px;
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
  transition: border-color 0.12s ease;
}

.board-line-label-size::-webkit-outer-spin-button,
.board-line-label-size::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.board-line-label-size:focus {
  border-color: rgba(212, 168, 75, 0.5);
}

.board-line-editor-hint {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
  line-height: 1.4;
}

.board-line-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(180, 48, 48, 0.15);
  border: 1px solid rgba(180, 48, 48, 0.3);
  color: rgba(220, 100, 100, 0.8);
  font-size: 0.68rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  min-height: 0 !important;
  line-height: 1;
}

.board-line-delete-btn:hover {
  background: rgba(180, 48, 48, 0.4);
  color: #ff8080;
  border-color: rgba(220, 80, 80, 0.5);
}

/* Board — text nodes */

.board-text-node {
  position: absolute;
  min-width: 80px;
  max-width: 280px;
  min-height: 1.4em;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  line-height: 1.45;
  outline: none;
  cursor: text;
  user-select: text;
  word-break: break-word;
  white-space: pre-wrap;
  transition: border-color 0.15s ease, background 0.15s ease;
  z-index: 20;
}

.board-text-node:hover,
.board-text-node:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.board-text-node:empty::before {
  content: "Type here…";
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

/* Delete button on text node (appears on hover/focus) */
.board-text-node:hover .board-text-node-delete,
.board-text-node:focus .board-text-node-delete,
.board-text-node:focus-within .board-text-node-delete {
  opacity: 1;
}

.board-text-node-delete {
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.12s ease;
  cursor: pointer;
  z-index: 5;
  min-height: 0 !important;
  line-height: 1;
}

.board-text-node-delete:hover {
  background: rgba(180, 48, 48, 0.9);
  color: #fff;
  border-color: rgba(220, 80, 80, 0.5);
}

/* Board — card resize handle */

.board-card-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: calc(var(--card-h, 190px) * 0.147);
  height: calc(var(--card-h, 190px) * 0.147);
  cursor: se-resize;
  z-index: 6;
  opacity: 0.25;
  transition: opacity 0.15s ease;
}

.board-card-resize-handle::after {
  content: "";
  position: absolute;
  bottom: calc(var(--card-h, 190px) * 0.026);
  right: calc(var(--card-h, 190px) * 0.026);
  width: calc(var(--card-h, 190px) * 0.058);
  height: calc(var(--card-h, 190px) * 0.058);
  border-right: 2.5px solid rgba(255, 255, 255, 0.9);
  border-bottom: 2.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

.board-card:hover .board-card-resize-handle {
  opacity: 1;
}

.board-card.is-resizing .board-card-resize-handle {
  opacity: 1;
}

/* Board — background image resize handle */

.board-bg-image-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: clamp(30px, 4%, 80px);
  height: clamp(30px, 4%, 80px);
  cursor: se-resize;
  z-index: 2;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.board-bg-image-resize-handle::after {
  content: "";
  position: absolute;
  bottom: 15%;
  right: 15%;
  width: 42%;
  height: 42%;
  border-right: 3.5px solid rgba(255, 255, 255, 0.95);
  border-bottom: 3.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 3px;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.9));
}

.board-bg-image-el:hover .board-bg-image-resize-handle {
  opacity: 1;
}

/* Board — card creator panel */

.clue-board-card-creator {
  position: fixed;
  z-index: 500;
  top: 4rem;
  right: 4rem;
  width: 270px;
  background: rgba(14, 14, 14, 0.96);
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-radius: 10px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.clue-board-creator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(212, 168, 75, 0.85);
}

.clue-board-creator-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  min-height: 0 !important;
  transition: color 0.12s ease;
}

.clue-board-creator-close:hover {
  color: rgba(255, 255, 255, 0.85);
}

.clue-board-creator-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
}

.clue-board-creator-section-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.1rem;
}

.clue-board-creator-image-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.clue-board-creator-image-row .clue-board-creator-image {
  flex: 1;
  min-width: 0;
  width: auto;
}

.clue-board-creator-browse-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.74rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  min-height: 0 !important;
  line-height: 1;
}

.clue-board-creator-browse-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
}

.clue-board-creator-paste-status {
  font-size: 0.65rem;
  color: rgba(212, 168, 75, 0.85);
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.15s ease, opacity 0.15s ease;
}

.clue-board-creator-paste-status.is-visible {
  max-height: 1.4em;
  opacity: 1;
}

.clue-board-creator-title,
.clue-board-creator-image {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.74rem;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.12s ease;
}

.clue-board-creator-title:focus,
.clue-board-creator-image:focus {
  border-color: rgba(212, 168, 75, 0.5);
}

.clue-board-creator-color-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.clue-board-creator-color-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.clue-board-creator-color-label input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  padding: 0;
}

.clue-board-creator-color-label i {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  pointer-events: none;
}

.clue-board-creator-text {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.74rem;
  padding: 5px 8px;
  outline: none;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
  transition: border-color 0.12s ease;
}

.clue-board-creator-text:focus {
  border-color: rgba(212, 168, 75, 0.5);
}

.clue-board-creator-footer {
  padding: 0.5rem 0.75rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.clue-board-creator-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(212, 168, 75, 0.15);
  border: 1px solid rgba(212, 168, 75, 0.35);
  color: rgba(212, 168, 75, 0.9);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  min-height: 0 !important;
}

.clue-board-creator-submit:hover {
  background: rgba(212, 168, 75, 0.28);
  color: #d4a84b;
  border-color: rgba(212, 168, 75, 0.6);
}

/* Icon select in board card creator */
.clue-board-creator-icon {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.74rem;
  padding: 4px 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s ease;
  /* Reset browser default <select> styling to match inputs */
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.clue-board-creator-icon:focus {
  border-color: rgba(212, 168, 75, 0.5);
}

/* Board preview — notes section */
.clue-board-preview-notes-section {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.clue-board-preview-notes-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
}

.clue-board-preview-notes,
.clue-board-preview-text-edit {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.74rem;
  line-height: 1.45;
  padding: 5px 8px;
  outline: none;
  resize: vertical;
  min-height: 55px;
  font-family: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.clue-board-preview-notes:focus,
.clue-board-preview-text-edit:focus {
  border-color: rgba(212, 168, 75, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

/* Board-only card text edit label */
.clue-preview-level:has(.clue-board-preview-text-edit) {
  padding-bottom: 0;
}
.clue-board-preview-text-edit {
  min-height: 70px;
  margin-top: 0.3rem;
}


/* ─── Sci-Fi Holographic Theme ──────────────────────────────────────────── */
/* Activated by: document.body.classList.add("clue-theme-scifi")             */

@keyframes holo-glow-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 220, 255, 0.4), 0 0 18px rgba(0, 180, 255, 0.2), inset 0 0 8px rgba(0, 200, 255, 0.06); }
  50%       { box-shadow: 0 0 10px rgba(0, 220, 255, 0.7), 0 0 28px rgba(0, 180, 255, 0.35), inset 0 0 14px rgba(0, 200, 255, 0.1); }
}

@keyframes holo-scan {
  0%   { background-position: 0 0; }
  100% { background-position: 0 80px; }
}

.clue-theme-scifi .clue-browser-app {
  background: transparent;
}

/* Titles */
.clue-theme-scifi .clue-browser-topbar-left h2 {
  font-family: monospace;
  color: #00d4ff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.8), 0 0 20px rgba(0, 180, 255, 0.4);
}

.clue-theme-scifi .clue-browser-subtitle {
  font-family: monospace;
  color: rgba(0, 180, 220, 0.55);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/* Panels */
.clue-theme-scifi .clue-browser-left,
.clue-theme-scifi .clue-browser-right {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 200, 255, 0.018) 3px,
      rgba(0, 200, 255, 0.018) 4px
    ),
    rgba(2, 14, 28, 0.96);
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.15), inset 0 0 20px rgba(0, 180, 255, 0.04);
}

/* Nav strip */
.clue-theme-scifi .clue-browser-nav {
  background: rgba(0, 30, 55, 0.7);
  border-bottom: 1px solid rgba(0, 200, 255, 0.2);
}

.clue-theme-scifi .clue-browser-location-label {
  font-family: monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 180, 220, 0.45);
}

.clue-theme-scifi .clue-browser-location-name {
  font-family: monospace;
  color: #00c8f0;
  font-size: 0.8rem;
}

/* Back button */
.clue-theme-scifi .clue-browser-back-button {
  background: rgba(0, 160, 200, 0.12);
  border-color: rgba(0, 200, 255, 0.35);
  color: #00c8f0;
  border-radius: 2px;
}

.clue-theme-scifi .clue-browser-back-button:hover {
  background: rgba(0, 180, 220, 0.2);
  border-color: rgba(0, 220, 255, 0.6);
  color: #00e8ff;
}

/* Toolbar buttons */
.clue-theme-scifi .clue-browser-topbar-actions button {
  background: rgba(0, 140, 180, 0.14);
  border: 1px solid rgba(0, 200, 255, 0.3);
  color: #00c0e8;
  font-family: monospace;
  font-size: 0.72rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.clue-theme-scifi .clue-browser-topbar-actions button:hover {
  background: rgba(0, 180, 220, 0.22);
  border-color: rgba(0, 230, 255, 0.55);
  color: #00e8ff;
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.25);
}

.clue-theme-scifi .clue-browser-topbar-actions [data-action="new-clue"] {
  background: rgba(0, 80, 200, 0.2);
  border-color: rgba(60, 160, 255, 0.45);
  color: #60c8ff;
}

.clue-theme-scifi .clue-browser-topbar-actions [data-action="new-clue"]:hover {
  background: rgba(0, 100, 220, 0.3);
  color: #80daff;
  box-shadow: 0 0 10px rgba(60, 160, 255, 0.3);
}

/* Section labels */
.clue-theme-scifi .clue-browser-section-title {
  font-family: monospace;
  color: rgba(0, 180, 220, 0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Create-folder input */
.clue-theme-scifi .clue-browser-create-folder-form input {
  background: rgba(0, 30, 55, 0.7);
  border-color: rgba(0, 200, 255, 0.3);
  color: #00c8f0;
  font-family: monospace;
  border-radius: 2px;
}

/* Parent drop zone */
.clue-theme-scifi .clue-browser-parent-drop {
  border-color: rgba(0, 200, 255, 0.25);
  color: rgba(0, 180, 220, 0.4);
}

.clue-theme-scifi .clue-browser-parent-drop-text {
  font-family: monospace;
  font-size: 0.7rem;
  color: rgba(0, 180, 220, 0.4);
  letter-spacing: 0.05em;
}

/* ── Folder tiles → holographic data nodes ── */
.clue-theme-scifi .clue-folder-tile {
  background: rgba(0, 20, 45, 0.92);
  border: 1px solid rgba(0, 200, 255, 0.35);
  border-radius: 3px;
  box-shadow:
    0 0 8px rgba(0, 180, 255, 0.18),
    inset 0 0 12px rgba(0, 160, 220, 0.06);
}

.clue-theme-scifi .clue-folder-tile:hover,
.clue-theme-scifi .clue-folder-tile.is-drop-target {
  border-color: rgba(0, 230, 255, 0.65);
  box-shadow:
    0 0 14px rgba(0, 200, 255, 0.35),
    inset 0 0 16px rgba(0, 200, 255, 0.08);
  transform: translateY(-2px);
}

/* Replace folder icon with microchip */
.clue-theme-scifi .clue-folder-tile-icon i::before {
  content: "\f2db";
}

.clue-theme-scifi .clue-folder-tile-icon {
  color: #00c8f0;
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.7), 0 0 20px rgba(0, 180, 255, 0.4);
}

/* Pulsing indicator dot at bottom of tile */
.clue-theme-scifi .clue-folder-tile-center::after {
  content: "";
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #00e8ff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 230, 255, 0.9), 0 0 14px rgba(0, 200, 255, 0.5);
}

/* Name input */
.clue-theme-scifi .clue-folder-tile-name-input {
  background: rgba(0, 30, 55, 0.8);
  border: 1px solid rgba(0, 200, 255, 0.25);
  color: #00c8f0;
  font-family: monospace;
  font-size: 0.62rem;
  border-radius: 2px;
  letter-spacing: 0.03em;
}

.clue-theme-scifi .clue-folder-tile-name-input.is-save-glow {
  box-shadow: 0 0 0 1px rgba(0, 200, 255, 0.5), 0 0 10px rgba(0, 200, 255, 0.4);
}

/* Folder action buttons */
.clue-theme-scifi .clue-folder-tile-actions button,
.clue-theme-scifi .clue-folder-color-button {
  background: rgba(0, 30, 55, 0.6);
  border-color: rgba(0, 180, 220, 0.35);
  color: #00a8d0;
}

/* ── Clue tiles → encrypted data chips ── */
.clue-theme-scifi .clue-tile-card {
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 3px;
  box-shadow:
    0 0 6px rgba(0, 180, 255, 0.15),
    inset 0 0 8px rgba(0, 160, 220, 0.04);
}

/* Holographic scan stripe at top edge */
.clue-theme-scifi .clue-tile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 200, 255, 0.0) 15%,
    rgba(0, 230, 255, 0.7) 50%,
    rgba(0, 200, 255, 0.0) 85%,
    transparent 100%);
  z-index: 5;
  border-radius: 3px 3px 0 0;
}

/* No-image background → deep space grid */
.clue-theme-scifi .clue-tile-no-image {
  background:
    linear-gradient(rgba(0, 200, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 255, 0.06) 1px, transparent 1px),
    #020e1c;
  background-size: 20px 20px, 20px 20px, auto;
}

.clue-theme-scifi .clue-tile-no-image i {
  color: rgba(0, 200, 255, 0.35);
  text-shadow: 0 0 12px rgba(0, 200, 255, 0.5);
}

/* Gradient overlay — deep cyan fade */
.clue-theme-scifi .clue-tile-card::after {
  background: linear-gradient(to top,
    rgba(0, 10, 30, 0.88) 0%,
    rgba(0, 15, 35, 0.45) 40%,
    rgba(0, 8, 20, 0.1) 70%,
    transparent 100%);
}

/* Title text */
.clue-theme-scifi .clue-tile-title {
  font-family: monospace;
  font-size: 0.67rem;
  color: #80e8ff;
  text-shadow: 0 0 6px rgba(0, 210, 255, 0.7);
  letter-spacing: 0.03em;
}

/* Selected state */
.clue-theme-scifi .clue-tile-card.is-selected {
  border-color: rgba(0, 230, 255, 0.7);
  animation: holo-glow-pulse 2s ease-in-out infinite;
}

/* ── Preview panel → holographic readout ── */
.clue-theme-scifi .clue-preview-shell {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 180, 255, 0.016) 3px,
      rgba(0, 180, 255, 0.016) 4px
    ),
    rgba(2, 14, 28, 0.97);
  border: 1px solid rgba(0, 200, 255, 0.25);
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.12);
}

.clue-theme-scifi .clue-preview-card {
  background: transparent;
}

.clue-theme-scifi .clue-preview-body h3 {
  font-family: monospace;
  color: #00d4ff;
  border-bottom: 1px solid rgba(0, 200, 255, 0.25);
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.5);
  letter-spacing: 0.04em;
}

.clue-theme-scifi .clue-preview-meta {
  font-family: monospace;
  color: rgba(0, 180, 220, 0.55);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.clue-theme-scifi .clue-preview-level {
  background: rgba(0, 140, 200, 0.07);
  border-left: 3px solid rgba(0, 200, 255, 0.4);
}

.clue-theme-scifi .clue-preview-level p,
.clue-theme-scifi .clue-preview-level-header {
  color: #b0ecff;
}

.clue-theme-scifi .clue-preview-level-badge {
  background: rgba(0, 180, 220, 0.2);
  border: 1px solid rgba(0, 200, 255, 0.4);
  color: #00d4ff;
  font-family: monospace;
  text-shadow: 0 0 6px rgba(0, 200, 255, 0.5);
}

.clue-theme-scifi .clue-preview-level-label {
  color: rgba(0, 180, 220, 0.55);
  font-family: monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Notes textarea */
.clue-theme-scifi .clue-preview-notes {
  background: rgba(0, 20, 45, 0.7);
  border-color: rgba(0, 180, 220, 0.3);
  color: #90dcf0;
  font-family: monospace;
}

/* Compact window */
.clue-theme-scifi .clue-browser-compact .clue-tile-card {
  border-radius: 2px;
}

.clue-theme-scifi .clue-browser-compact .clue-folder-tile {
  border-radius: 2px;
}

/* Scrollbar */
.clue-theme-scifi .clue-browser-left-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 180, 220, 0.35);
}

.clue-theme-scifi .clue-browser-left-scroll::-webkit-scrollbar-track {
  background: rgba(0, 10, 25, 0.5);
}

/* Handouts */

.clue-handout-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 1px solid rgba(120, 120, 120, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.clue-handout-toggle input {
  margin-top: 0.2rem;
}

.clue-handout-toggle span {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.clue-handout-toggle small {
  opacity: 0.72;
}

.clue-editor-image-tools.is-handout {
  grid-template-columns: 1fr;
}

.clue-editor-image-tools.is-handout .clue-editor-image-controls {
  display: none;
}

.clue-editor-image-tools.is-handout .clue-editor-image-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 140px;
  max-height: 480px;
}

.clue-editor-image-tools.is-handout .clue-editor-image-preview-stage img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  transform: none !important;
}

.clue-handout-no-levels {
  padding: 0.8rem;
  border: 1px dashed rgba(120, 120, 120, 0.3);
  border-radius: 10px;
  opacity: 0.72;
}

.clue-tile-card.is-handout,
.clue-browser-compact .clue-tile-card.is-handout {
  height: auto;
  min-height: 0;
  aspect-ratio: var(--handout-aspect, 1);
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
}

.clue-tile-card.is-handout::before,
.clue-tile-card.is-handout::after {
  display: none;
}

.clue-tile-card.is-handout .clue-tile-media > img,
.board-card.is-handout .clue-tile-media > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none !important;
}

.clue-tile-card.is-handout .clue-tile-media > img {
  pointer-events: none;
  user-select: none;
}

.clue-tile-card.is-handout .clue-tile-content {
  display: none;
}

.board-card.is-handout .board-card-inner {
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
}

.board-card.is-handout .board-card-inner::before,
.board-card.is-handout .board-card-inner::after {
  display: none;
}

.board-card.is-handout .board-card-delete-btn {
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  font-size: 8px;
}

.board-card.is-handout .board-card-connect-dot {
  top: -11px;
  width: 22px;
  height: 22px;
  font-size: 7px;
}

.board-card.is-handout .board-card-resize-handle {
  width: 28px;
  height: 28px;
}

.board-card.is-handout .board-card-resize-handle::after {
  right: 5px;
  bottom: 5px;
  width: 11px;
  height: 11px;
}

.clue-preview-card.is-handout .clue-preview-image > img,
.clue-delivery-popup.is-handout .clue-delivery-popup-image > img {
  object-fit: contain;
  object-position: center !important;
  transform: none !important;
}

.clue-delivery-popup.is-handout .clue-delivery-popup-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  max-height: 72vh;
}

.clue-delivery-popup.is-handout .clue-delivery-popup-image > img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72vh;
}

.clue-delivery-popup.is-handout {
  width: min(720px, calc(100vw - 2rem));
}
