/*
  Optik am Minecraft-GUI orientiert: keine runden Ecken, stattdessen der
  klassische 2px-Bevel (heller Rand oben/links, dunkler unten/rechts) über
  inset-Schatten. Grün stammt direkt aus der Logo-Wortmarke.
*/

:root {
  --bg: #2b2b2b;
  --bg-panel: #3a3a3a;
  --bg-button: #4d4d4d;
  --bg-button-hover: #5c5c5c;
  --bg-sunken: #232323;

  --bevel-light: rgba(255, 255, 255, 0.22);
  --bevel-dark: rgba(0, 0, 0, 0.45);
  --outline: #1a1a1a;

  --text: #f2f2f2;
  --text-dim: #a6a6a6;

  --accent: #79c10f;
  --accent-hi: #93ce13;
  --accent-lo: #4f9810;

  --nether: #e0674d;
  --end: #c9a7f0;

  --shadow-text: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Wiederverwendbarer Minecraft-Bevel */

.bevel {
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
}

/* Kopfzeile */

.topbar {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 38px 24px 26px;
}

.admin-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--bg-button);
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  text-shadow: var(--shadow-text);
  padding: 7px 14px;
  cursor: pointer;
}

.admin-toggle:hover { background: var(--bg-button-hover); color: var(--text); }

.admin-toggle.is-active {
  background: var(--accent-lo);
  color: #ffffff;
}

.brand { min-width: 0; }

.brand-logo {
  width: min(460px, 80vw);
  height: auto;
  margin: 0 auto;
  display: block;
  image-rendering: pixelated;
}

/* Filterleiste über den Einträgen; jede .filter-row ist eine eigene
   Auswahlgruppe, weitere Gruppen lassen sich darunter ergänzen. */

.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 30px;
  padding: 0 0 26px;
}

.filterbar[hidden] { display: none; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-shadow: var(--shadow-text);
  margin-right: 2px;
}

/* Dialog zum Freischalten des Verwaltungsmodus */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: grid;
  place-content: center;
  padding: 24px;
  z-index: 30;
}

.modal[hidden] { display: none; }

.modal-box {
  width: min(440px, 92vw);
  background: var(--bg-panel);
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-box h2 {
  margin: 0;
  font-size: 1.1rem;
  text-shadow: var(--shadow-text);
}

.modal-box p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-shadow: var(--shadow-text);
}

.modal-box input {
  background: var(--bg-sunken);
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 rgba(0, 0, 0, 0.4),
    inset -2px -2px 0 rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  padding: 10px 12px;
  width: 100%;
}

.modal-box input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.modal-error {
  color: var(--nether) !important;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-actions .copy { flex: 1 1 auto; }

.chip {
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  background: var(--bg-button);
  color: var(--text);
  padding: 9px 18px;
  font-size: 0.85rem;
  font-family: inherit;
  text-shadow: var(--shadow-text);
  cursor: pointer;
}

.chip:hover { background: var(--bg-button-hover); }

.chip:active {
  box-shadow:
    inset 2px 2px 0 var(--bevel-dark),
    inset -2px -2px 0 var(--bevel-light);
}

.chip.is-active {
  background: var(--accent-lo);
  color: #ffffff;
}

.chip.is-active:hover { background: var(--accent); }

/* Raster */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 24px 60px;
}

.status {
  color: var(--text-dim);
  padding: 48px 0;
  text-align: center;
  text-shadow: var(--shadow-text);
}

.status.is-error { color: var(--nether); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.card {
  background: var(--bg-panel);
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  display: flex;
  flex-direction: column;
}

.card-media {
  position: relative;
  border-bottom: 2px solid var(--outline);
  line-height: 0;
}

.shot {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--bg-sunken);
  display: block;
  border: 0;
  padding: 0;
  cursor: zoom-in;
}

/* Überblendungen im Bild: oben Zeitstempel und Welt, unten der Titel — jeweils
   auf einem zum Bildrand hin schwarz auslaufenden Verlauf. pointer-events
   bleibt aus, damit ein Klick weiterhin die Großansicht öffnet. */
.shot-top,
.shot-bottom {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.35;
  pointer-events: none;
}

.shot-top {
  top: 0;
  padding: 9px 10px 28px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(0, 0, 0, 0) 100%
  );
}

.shot-bottom {
  bottom: 0;
  align-items: flex-end;
  padding: 34px 10px 9px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.7) 45%,
    rgba(0, 0, 0, 0) 100%
  );
}

.shot-bottom h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  color: #ffffff;
  word-break: break-word;
  text-shadow: var(--shadow-text);
}

.overlay-meta {
  margin: 0;
  font-size: 0.72rem;
  color: #d0d0d0;
  text-shadow: var(--shadow-text);
}

/* Sitzt in der unteren Überblendung neben dem Titel und muss dort als
   einziges Element wieder Klicks annehmen. */
.card-delete {
  flex: 0 0 auto;
  pointer-events: auto;
  width: 30px;
  height: 30px;
  background: #a33427;
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1;
  text-shadow: var(--shadow-text);
  cursor: pointer;
}

.card-delete:hover { background: #c4402f; }

.card-delete:disabled { opacity: 0.6; cursor: default; }

.shot-missing {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: var(--bg-sunken);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.5;
  text-shadow: var(--shadow-text);
}

.card-body {
  padding: 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  word-break: break-word;
  text-shadow: var(--shadow-text);
}

.badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 9px;
  white-space: nowrap;
  background: var(--bg-sunken);
  border: 2px solid var(--outline);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.35);
  text-shadow: var(--shadow-text);
}

.badge[data-dim="minecraft:overworld"]  { color: var(--accent-hi); }
.badge[data-dim="minecraft:the_nether"] { color: var(--nether); }
.badge[data-dim="minecraft:the_end"]    { color: var(--end); }

/* Koordinaten und Kopieren-Knopf teilen sich eine Zeile */

.card-line {
  margin-top: auto;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.coords {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--bg-sunken);
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 rgba(0, 0, 0, 0.4),
    inset -2px -2px 0 rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
}

.coords b {
  color: var(--text);
  font-weight: 700;
}

.copy {
  flex: 0 0 auto;
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  background: var(--accent-lo);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: var(--shadow-text);
  padding: 10px 14px;
  cursor: pointer;
}

.copy:hover { background: var(--accent); }

.copy:active {
  box-shadow:
    inset 2px 2px 0 var(--bevel-dark),
    inset -2px -2px 0 var(--bevel-light);
}

.copy.is-done { background: var(--accent-hi); }

/* Zweitrangige Schaltfläche, etwa "Abbrechen" im Verwalten-Dialog */
.copy-exact {
  background: var(--bg-button);
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.8rem;
}

.copy-exact:hover { background: var(--bg-button-hover); color: var(--text); }

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 40px;
  z-index: 20;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(1400px, 92vw);
  max-height: 82vh;
  border: 2px solid var(--outline);
  box-shadow: inset 2px 2px 0 var(--bevel-light);
}

.lightbox-caption {
  margin: 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-shadow: var(--shadow-text);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 42px;
  height: 42px;
  background: var(--bg-button);
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  text-shadow: var(--shadow-text);
  cursor: pointer;
}

.lightbox-close:hover { background: var(--bg-button-hover); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

footer {
  border-top: 2px solid var(--outline);
  background: var(--bg-sunken);
  padding: 22px 24px 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-shadow: var(--shadow-text);
}

footer code {
  background: var(--bg);
  border: 2px solid var(--outline);
  color: var(--accent-hi);
  padding: 2px 7px;
}

.download { margin: 18px 0 10px; }

.dl-button {
  display: inline-block;
  background: var(--accent-lo);
  border: 2px solid var(--outline);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-shadow: var(--shadow-text);
  padding: 11px 22px;
}

.dl-button:hover { background: var(--accent); }

.dl-button:active {
  box-shadow:
    inset 2px 2px 0 var(--bevel-dark),
    inset -2px -2px 0 var(--bevel-light);
}

.requirements {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}
