/* ==================================================================
   Karten-Bibliothek (#maps) — Stile im bestehenden Design-System.
   Nutzt die Theme-Tokens aus themes.css; additiv zu app.css.
   ================================================================== */

/* ---- Tabs ---- */
.maps-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line-faint); padding-bottom: 0; }
.maps-tabs button {
  font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .03em;
  background: transparent; color: var(--muted); border: 1px solid transparent; border-bottom: none;
  padding: 10px 16px; border-radius: 8px 8px 0 0; cursor: pointer; transition: .15s; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 8px;
}
.maps-tabs button:hover { color: var(--head-ink); }
.maps-tabs button.on { color: var(--head-ink); background: var(--panel); border-color: var(--line-faint); border-bottom-color: var(--panel); }
.maps-badge { background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; }

/* ---- Galerie-Toolbar ---- */
.maps-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.maps-search { flex: 1; min-width: 220px; margin: 0; }
.maps-sort { flex: 0 0 auto; width: 180px; }
.maps-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.maps-tag {
  font-family: var(--body); font-size: 12.5px; padding: 5px 12px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; transition: .15s;
}
.maps-tag:hover { color: var(--head-ink); border-color: var(--accent); }
.maps-tag.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.maps-tag.clear { border-style: dashed; color: var(--muted); }

/* ---- Karten-Grid ---- */
.maps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 18px; }
/* Skeleton-Ladezustand für die Galerie */
.map-card.skeleton { cursor: default; pointer-events: none; }
.map-card.skeleton:hover { transform: none; border-color: var(--line); box-shadow: none; }
.skel-shimmer { aspect-ratio: 4 / 3; background: var(--line-faint); position: relative; overflow: hidden; }
.skel-shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); transform: translateX(-100%); animation: skelSweep 1.3s ease-in-out infinite; }
@keyframes skelSweep { 100% { transform: translateX(100%); } }
.maps-loading { padding: 40px; text-align: center; }
.map-card { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .14s, box-shadow .2s, border-color .2s; padding: 0; }
.map-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 34px rgba(0,0,0,.4); }
.mc-thumb { position: relative; aspect-ratio: 4 / 3; background-size: cover; background-position: center; }
.mc-src { position: absolute; top: 8px; left: 8px; font-family: var(--display); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 5px; backdrop-filter: blur(4px); }
.mc-src-official { background: rgba(200,160,70,.92); color: #1a1c1e; }
.mc-src-community { background: rgba(30,32,36,.82); color: #e6e2d6; border: 1px solid rgba(255,255,255,.14); }
.mc-src-gm-generated { background: rgba(120,90,200,.86); color: #f2eeff; }
.mc-body { padding: 13px 14px 12px; display: flex; flex-direction: column; gap: 7px; }
.mc-title { font-family: var(--display); font-size: 16px; color: var(--head-ink); line-height: 1.2; }
.mc-meta { letter-spacing: .02em; }
.mc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mc-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--accent-wash); border: 1px solid var(--line-faint); color: var(--muted); }
.mc-vote { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--body); font-size: 13px;
  padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line-faint); background: var(--panel-2);
  color: var(--ink); cursor: pointer; transition: .14s;
}
.vote-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.vote-btn.up.on { color: #7fc08a; border-color: rgba(127,192,138,.6); background: rgba(127,192,138,.12); }
.vote-btn.down.on { color: #d97a6a; border-color: rgba(217,122,106,.6); background: rgba(217,122,106,.12); }
.mc-score { margin-left: auto; font-family: var(--display); font-size: 14px; color: var(--head-ink); }

/* ---- leer / Hinweise ---- */
.maps-empty { padding: 44px 26px; text-align: center; color: var(--head-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.me-ico { font-size: 34px; opacity: .8; margin-bottom: 4px; }

/* ---- Lightbox ---- */
.map-lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(8,9,11,.78); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 30px; }
.map-lightbox.on { display: flex; animation: mapsFade .2s ease both; }
.ml-card { position: relative; display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,.9fr); max-width: 1040px; width: 100%; max-height: 86vh; overflow: hidden; padding: 0; }
.ml-img { background-size: cover; background-position: center; min-height: 420px; }
.ml-side { padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.ml-title { font-size: 26px; line-height: 1.15; }
.ml-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.welcome-x { position: absolute; top: 12px; right: 12px; z-index: 2; }

/* ---- Form-Controls ---- */
.inp2 { width: 100%; background: rgba(0,0,0,.22); border: 1px solid var(--line-faint); border-radius: 6px; padding: 11px 13px; font-family: var(--body); font-size: 14px; color: var(--head-ink); min-height: 42px; }
.inp2:focus { outline: none; border-color: var(--accent); }
select.inp2 { cursor: pointer; color: var(--head-ink); appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select.inp2 option { background: #1f2024; color: #f1efe7; }

/* ---- Einreichen ---- */
.submit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: 10px; min-height: 280px; display: grid; place-items: center; cursor: pointer; transition: .15s; overflow: hidden; background: rgba(0,0,0,.14); }
.dropzone:hover, .dropzone:focus { border-color: var(--accent); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-wash); }
.dropzone.has { border-style: solid; }
.dz-hint { text-align: center; color: var(--muted); line-height: 1.5; padding: 20px; }
.dz-ico { font-size: 34px; margin-bottom: 8px; color: var(--accent); }
.dz-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-clear { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(20,20,24,.7); color: #fff; cursor: pointer; }
.tag-input { display: flex; gap: 8px; }
.tag-input .inp2 { flex: 1; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; min-height: 24px; align-items: center; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 6px 4px 11px; border-radius: 6px; background: var(--accent-wash); border: 1px solid var(--accent); color: var(--head-ink); }
.tag-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; }
.tag-chip button:hover { color: var(--accent); }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-suggest .sug { font-size: 11.5px; padding: 3px 10px; border-radius: 14px; border: 1px dashed var(--line-faint); background: transparent; color: var(--muted); cursor: pointer; transition: .14s; }
.tag-suggest .sug:hover { border-color: var(--accent); color: var(--head-ink); border-style: solid; }
.submit-note { padding: 9px 12px; border-radius: 7px; background: var(--accent-wash); border: 1px solid var(--line-faint); }
.sub-msg { margin-top: 10px; padding: 9px 12px; border-radius: 7px; font-size: 13px; }
.sub-msg.ok { color: #7fc08a; background: rgba(127,192,138,.1); border: 1px solid rgba(127,192,138,.4); }
.sub-msg.err { color: #d97a6a; background: rgba(217,122,106,.1); border: 1px solid rgba(217,122,106,.4); }
.mine-list { display: flex; flex-direction: column; gap: 8px; }
.mine-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line-faint); border-radius: 8px; background: var(--panel-2); }
.mine-thumb { width: 64px; height: 44px; border-radius: 5px; background-size: cover; background-position: center; flex: 0 0 auto; }
.mine-title { font-family: var(--display); color: var(--head-ink); font-size: 14.5px; }
.st-badge { font-size: 11px; padding: 4px 10px; border-radius: 14px; white-space: nowrap; }
.st-badge.pending { color: #d8b25a; background: rgba(200,160,70,.12); border: 1px solid rgba(200,160,70,.4); }
.st-badge.ok { color: #7fc08a; background: rgba(127,192,138,.1); border: 1px solid rgba(127,192,138,.4); }
.st-badge.rej { color: #d97a6a; background: rgba(217,122,106,.1); border: 1px solid rgba(217,122,106,.4); }

/* ---- Moderation ---- */
.mod-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mod-list { display: flex; flex-direction: column; gap: 12px; }
.mod-card { display: flex; align-items: center; gap: 16px; padding: 14px; }
.mod-thumb { width: 132px; height: 92px; border-radius: 7px; background-size: cover; background-position: center; flex: 0 0 auto; border: 1px solid var(--line-faint); }
.mod-info { flex: 1; min-width: 0; }
.mod-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }

/* ---- GM-Studio ---- */
.studio-conn { margin-bottom: 16px; }
.studio-conn.conn-off { border-color: rgba(217,122,106,.4); }
.conn-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.conn-dot.on { background: #7fc08a; box-shadow: 0 0 10px rgba(127,192,138,.7); }
.conn-dot.off { background: #d97a6a; box-shadow: 0 0 10px rgba(217,122,106,.6); }
.conn-dot.checking { background: var(--accent); animation: connPulse 1s infinite; }
@keyframes connPulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
.conn-onboard { margin-top: 12px; line-height: 1.6; }
.conn-onboard ul { margin: 8px 0 12px; padding-left: 18px; }
.conn-onboard code { background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 4px; color: var(--head-ink); font-family: var(--mono, monospace); font-size: 12px; }
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.studio-panel { display: flex; flex-direction: column; }
.effect-row { display: flex; flex-wrap: wrap; gap: 8px; }
.effect { font-family: var(--body); font-size: 13px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; transition: .14s; }
.effect:hover { color: var(--head-ink); border-color: var(--accent); }
.effect.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.studio-out { margin-top: 16px; }
.studio-ph { border-radius: 8px; min-height: 200px; display: grid; place-items: center; font-family: var(--mono, monospace); font-size: 12px; letter-spacing: .08em; }
.studio-busy { min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line-faint); border-top-color: var(--accent); border-radius: 50%; animation: connSpin .8s linear infinite; }
@keyframes connSpin { to { transform: rotate(360deg); } }
.studio-result img { width: 100%; border-radius: 8px; display: block; border: 1px solid var(--line-faint); }
.studio-result-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---- Toast ---- */
.maps-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); z-index: 200;
  background: var(--pop-bg); color: var(--head-ink); border: 1px solid var(--accent);
  padding: 12px 20px; border-radius: 8px; font-family: var(--display); font-size: 14px;
  box-shadow: 0 14px 36px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.maps-toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes mapsFade { from { opacity: 0; } to { opacity: 1; } }

/* ==================================================================
   Karten-Vorauswahl: ★-Stern auf der Kachel (Galerie) +
   Vorauswahl-Regal im GM-Reiter (s-map-shortlist.js)
   ================================================================== */
/* Stern auf der Karten-Kachel */
.mc-star {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(18,20,22,.7); backdrop-filter: blur(6px);
  color: #e6e2d6; font-size: 16px; cursor: pointer; line-height: 1;
  display: grid; place-items: center; transition: .15s; z-index: 3;
}
.mc-star:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.06); }
.mc-star.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: var(--glow-accent); }
.map-card.starred { border-color: var(--accent); }

/* GM-Regal */
.vorausw { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.vorausw-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font-family: var(--display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  background: transparent; border: none; padding: 2px 0; cursor: pointer; text-align: left;
}
.vorausw-head:hover { color: var(--head-ink); }
.vorausw-head .va-caret { font-size: 12px; transition: transform .18s ease; display: inline-block; }
.vorausw.collapsed .vorausw-head .va-caret { transform: rotate(-90deg); }
.vorausw-head .va-count { color: var(--muted); font-family: var(--body); letter-spacing: 0; text-transform: none; margin-left: 2px; }
.va-body { overflow: hidden; transition: max-height .22s ease, opacity .18s ease; max-height: 220px; opacity: 1; }
.vorausw.collapsed .va-body { max-height: 0; opacity: 0; }
.va-row { display: flex; gap: 9px; overflow-x: auto; padding: 3px 2px 8px; scrollbar-width: thin; }
.va-empty {
  width: 100%; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.5;
  border: 1px dashed var(--line); border-radius: 9px; padding: 14px 10px;
}
.va-thumb {
  position: relative; flex: 0 0 auto; width: 104px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
  background: var(--panel-2); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.va-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.va-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--glow-accent); }
.va-thumb.dragging { opacity: .45; }
.va-thumb.drop-target { border-color: var(--accent); border-style: dashed; }
.va-thumb .vt-img { height: 64px; background-size: cover; background-position: center; }
.va-thumb .vt-title {
  font-size: 10.5px; line-height: 1.25; color: var(--ink); padding: 5px 7px 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.va-thumb .vt-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: none;
  border-radius: 6px; background: rgba(18,20,22,.82); color: #d8c8a4;
  font-size: 11px; cursor: pointer; line-height: 1; display: grid; place-items: center; opacity: 0; transition: .14s;
}
.va-thumb:hover .vt-x { opacity: 1; }
.va-thumb .vt-x:hover { background: #a33b3b; color: #fff; }
.va-thumb .vt-flag {
  position: absolute; bottom: 28px; left: 4px;
  font-size: 9px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; font-family: var(--display);
}
.va-thumb .vt-flag.gm   { background: var(--accent); color: var(--on-accent); }
.va-thumb .vt-flag.live { background: #4a8f5a; color: #f2fff2; }

/* Pending-Block: gewählte, noch nicht freigegebene GM-Vorschau */
.gm-pending[hidden] { display: none; }
.gm-pending { margin-bottom: 12px; }
.gm-active-name { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; font-family: var(--display); font-size: 14px; color: var(--head-ink); }
.gm-pending-img { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; aspect-ratio: 16/9; background: #0c0d0f; background-size: cover; background-position: center; }
.vis-line { display: flex; align-items: center; gap: 7px; font-size: 11.5px; margin: 2px 0 8px; color: var(--muted); }
.vis-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); }
.vis-dot.live { background: #4a8f5a; box-shadow: 0 0 8px rgba(74,143,90,.6); }
.gm-live-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.gm-live-label b { color: var(--head-ink); font-weight: 600; }

@media (max-width: 860px) {
  .submit-grid, .studio-grid { grid-template-columns: 1fr; }
  .ml-card { grid-template-columns: 1fr; }
  .ml-img { min-height: 240px; }
}
