:root {
  --bg: #1c0a15;
  --bg2: #2a0f1f;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 190, 210, 0.18);
  --text: #fff3f7;
  --muted: #d9aebe;
  --rose: #ff4d7d;
  --rose2: #ff8fab;
  --gold: #f5c97b;
  --danger: #ff5c5c;
  --ok: #5ee6a0;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 77, 125, 0.25), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(245, 201, 123, 0.15), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--rose2); }
h1, h2, h3 { font-family: 'Playfair Display', serif; margin: 0 0 .4em; }
.script { font-family: 'Great Vibes', cursive; font-weight: 400; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left));
  background: rgba(28, 10, 21, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; flex: 1; min-width: 0; }
.brand .script { color: var(--rose2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; transition: .2s; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--card-strong); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--rose), #c2185b); border-color: transparent; box-shadow: 0 6px 20px rgba(255, 77, 125, .35); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: #ffd6d6; border-color: rgba(255, 92, 92, .4); }
.btn.danger:hover { background: rgba(255, 92, 92, .15); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.icon { padding: 8px 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- cards / forms ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .85rem; color: var(--muted); }
.field small { color: var(--muted); font-size: .75rem; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25); outline: none; transition: .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--rose2); box-shadow: 0 0 0 3px rgba(255, 143, 171, .2); }
select option { background: #2a0f1f; }
textarea { min-height: 80px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; text-align: center; padding: 36px 28px; }
.login-card .big-heart { font-size: 3.4rem; animation: beat 1.4s infinite; display: inline-block; }
.login-card h1 { font-size: 2.6rem; color: var(--rose2); }
.login-card form { text-align: left; margin-top: 18px; }
.err { color: #ffb3b3; min-height: 1.2em; font-size: .9rem; margin: 6px 0; }
@keyframes beat { 0%,100% { transform: scale(1) } 15% { transform: scale(1.18) } 30% { transform: scale(1) } 45% { transform: scale(1.12) } }

/* ---------- dashboard ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 2rem; }
.museum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.museum-card { padding: 0; overflow: hidden; cursor: pointer; transition: .25s; }
.museum-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(255, 77, 125, .2); }
.museum-card .cover { height: 150px; background: linear-gradient(135deg, #5a1636, #2a0f1f); background-size: cover; background-position: center; display: grid; place-items: center; font-size: 3rem; }
.museum-card .body { padding: 14px 16px 16px; }
.museum-card .names { font-family: 'Great Vibes', cursive; font-size: 1.7rem; color: var(--rose2); }
.empty { text-align: center; padding: 60px 20px; }
.empty .big { font-size: 4rem; }

/* ---------- editor ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; white-space: nowrap; }
.tab.active { background: linear-gradient(135deg, var(--rose), #c2185b); border-color: transparent; }
.building-tabs .tab.active { background: rgba(245, 201, 123, .2); border-color: var(--gold); color: var(--gold); }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center;
  cursor: pointer; transition: .2s; background: rgba(0, 0, 0, .15);
}
.dropzone.drag, .dropzone:hover { border-color: var(--rose2); background: rgba(255, 77, 125, .08); }
.dropzone .big { font-size: 2.4rem; }
.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 12px; display: none; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--gold)); transition: width .2s; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.media-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.media-item .thumb { position: relative; aspect-ratio: 4/3; background: #000; }
.media-item .thumb img, .media-item .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .badge { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .6); padding: 2px 8px; border-radius: 99px; font-size: .75rem; }
.media-item .meta { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.media-item .meta input, .media-item .meta select { padding: 7px 10px; font-size: .85rem; }
.media-item .actions { display: flex; gap: 6px; }
.media-item .actions .btn { flex: 1; }

.music-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; cursor: pointer; }
.music-option.active { border-color: var(--rose2); background: rgba(255, 77, 125, .08); }
.music-option input { margin-top: 5px; accent-color: var(--rose); }
input[type=range] { width: 100%; accent-color: var(--rose); }
audio { width: 100%; margin-top: 10px; }

.share-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: rgba(245, 201, 123, .08); border: 1px solid rgba(245, 201, 123, .3); padding: 12px 14px; border-radius: 14px; margin-bottom: 18px; }
.share-box code { background: rgba(0, 0, 0, .3); padding: 3px 8px; border-radius: 6px; word-break: break-all; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 2, 8, .7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .2s; }
.modal { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: linear-gradient(180deg, #34142a, #220b19); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
@keyframes fade { from { opacity: 0 } }
.modal.wide { max-width: 840px; }

/* ---------- photo editor ---------- */
.ed-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-aspects { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ed-aspects .tab { padding: 6px 12px; font-size: .82rem; }
.ed-stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; touch-action: none; user-select: none; line-height: 0; background: #000; border-radius: 8px; overflow: hidden; }
.ed-canvas { display: block; max-width: 100%; }
.ed-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(10, 2, 8, .6); cursor: move; touch-action: none;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 33.33% 33.33%; background-position: -1px -1px; }
.ed-h { position: absolute; width: 22px; height: 22px; background: var(--rose); border: 2px solid #fff; border-radius: 50%; touch-action: none; }
.ed-h.nw { left: -3px; top: -3px; cursor: nwse-resize; }
.ed-h.ne { right: -3px; top: -3px; cursor: nesw-resize; }
.ed-h.sw { left: -3px; bottom: -3px; cursor: nesw-resize; }
.ed-h.se { right: -3px; bottom: -3px; cursor: nwse-resize; }
.ed-info { font-size: .8rem; text-align: center; margin-top: 8px; }
@media (max-width: 640px) { .modal { padding: 16px; } .ed-h { width: 26px; height: 26px; } }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
#toast div { background: #3a1430; border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 30px rgba(0,0,0,.4); animation: fade .2s; max-width: 100%; text-align: center; }
#toast div.error { border-color: var(--danger); }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .brand { font-size: 1.25rem; }
  .topbar .btn .lbl { display: none; }
  .page-head h1 { font-size: 1.6rem; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card { padding: 16px; }
  .container { padding-top: 18px; }
}
