/* IG-Feed-Sim – Dark Mode, an Instagrams Profil-Grid angelehnt. */
:root {
  --bg:        #000000;
  --surface:   #121212;
  --surface-2: #1c1c1c;
  --border:    #262626;
  --text:      #f5f5f5;
  --text-dim:  #a8a8a8;
  --accent:    #0095f6;   /* IG-Blau */
  --accent-2:  #1877f2;
  --danger:    #ed4956;
  --radius:    12px;
  --grid-gap:  3px;        /* IG-Web-Grid-Abstand */
  --maxw:      935px;      /* IG-Profil-Breite */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  text-align: center;
  padding: 22px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: .3px; }
.topbar .sub { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }
.brand-logo {
  display: block;
  margin: 0 auto 10px;
  height: 92px;
  width: auto;
  user-select: none;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* --- Handle-Loader --- */
.loader { text-align: center; margin-bottom: 20px; }
#handle-form {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  gap: 6px;
  max-width: 100%;
}
#handle-form .at { color: var(--text-dim); }
#handle-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  width: 220px;
  max-width: 46vw;
}
#load-btn, #export-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
#load-btn:hover, #export-btn:hover { background: var(--accent-2); }
#load-btn:disabled { opacity: .5; cursor: default; }

.status { min-height: 18px; margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.status.error { color: var(--danger); }

.link-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 12px; cursor: pointer; margin-top: 6px; text-decoration: underline;
}
.link-btn:hover { color: var(--text); }

/* --- Simulations-Slots --- */
.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 auto 18px;
  max-width: 520px;
}
.slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, transform .1s;
  color: var(--text-dim);
  text-align: center;
  font-size: 12px;
  user-select: none;
}
.slot:hover { border-color: #3a3a3a; }
.slot.dragover { border-color: var(--accent); background: #101d29; }
.slot.filled { border-style: solid; cursor: grab; }
.slot.filled.inactive { opacity: .35; }
.slot.filled:active { cursor: grabbing; }
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot .slot-plus { font-size: 30px; line-height: 1; }
.slot .slot-label { position: absolute; bottom: 6px; font-size: 10px; }

.slot .slot-badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,.65); color: #fff;
  border-radius: 6px; padding: 2px 6px; font-size: 10px; font-weight: 600;
}
.slot .slot-actions {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 4px;
}
.slot .slot-actions button {
  width: 22px; height: 22px; border: none; border-radius: 6px;
  background: rgba(0,0,0,.65); color: #fff; cursor: pointer;
  font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.slot .slot-actions button:hover { background: rgba(0,0,0,.9); }

/* --- Toolbar --- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 0 auto 14px; max-width: var(--maxw);
}
.toolbar .hint { color: var(--text-dim); font-size: 12px; }

/* --- Profil-Header --- */
.profile { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.profile-head {
  display: flex; align-items: center; gap: 26px;
  padding: 8px 4px 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3px;
}
.avatar {
  width: 130px; height: 130px; border-radius: 50%;
  object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--border); flex-shrink: 0;
}
.profile-meta { min-width: 0; }
.username { font-size: 20px; font-weight: 400; }
.counts { display: flex; gap: 26px; margin: 14px 0; font-size: 15px; color: var(--text); flex-wrap: wrap; }
.counts b { font-weight: 700; }
.fullname { font-weight: 600; font-size: 14px; }
.bio { font-size: 14px; color: var(--text); white-space: pre-wrap; margin-top: 2px; }

/* --- Grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.sim::after {
  content: "NEU";
  position: absolute; top: 6px; left: 6px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
}
.tile .vid-badge {
  position: absolute; top: 6px; right: 6px; color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); font-size: 14px;
}

.foot {
  text-align: center; color: var(--text-dim);
  font-size: 11px; padding: 24px 16px 40px;
  border-top: 1px solid var(--border);
}
.foot .credits { margin-top: 8px; }
.foot .credits a { color: var(--text-dim); text-decoration: none; border-bottom: 1px dotted var(--border); }
.foot .credits a:hover { color: var(--text); }

/* --- Mobile --- */
@media (max-width: 640px) {
  :root { --grid-gap: 2px; }
  .profile-head { gap: 16px; padding-bottom: 18px; }
  .avatar { width: 84px; height: 84px; }
  .username { font-size: 17px; }
  .counts { gap: 16px; font-size: 13px; }
  .slots { gap: 8px; }
}
