*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper: #BA8671;
  --sticky-white: #faf8f2;
  --sticky-dark: #262320;
  --ink: #1a1410;
  --ink-mid: rgba(26,20,16,0.55);
  --ink-faint: rgba(26,20,16,0.28);
  --border: rgba(26,20,16,0.1);
  --radius: 10px;
  --radius-sm: 6px;
}

html, body { height: 100%; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--ink); background: var(--paper); }
input, textarea, button, select { font-family: inherit; font-size: 14px; color: inherit; }

input[type="text"], input[type="password"], input[type="url"], textarea {
  width: 100%; padding: 10px 13px; border: 0.5px solid rgba(0,0,0,0.18);
  border-radius: var(--radius-sm); background: rgba(255,255,255,0.75);
  outline: none; margin-bottom: 10px; display: block;
}
input:focus, textarea:focus { border-color: rgba(0,0,0,0.38); background: #fff; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
button { cursor: pointer; border: none; background: none; }

.btn-primary { background: var(--ink); color: #fff; border-radius: var(--radius-sm); padding: 10px 18px; font-size: 13px; letter-spacing: 0.02em; }
.btn-primary:active { opacity: 0.82; }
.btn-ghost { background: rgba(0,0,0,0.07); color: var(--ink); border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px; }
.btn-ghost:hover { background: rgba(0,0,0,0.11); }
.btn-sm { padding: 6px 12px !important; font-size: 12px !important; }
.btn-danger { color: #c03030 !important; }
.error-msg { color: #c03030; font-size: 12px; margin-top: 4px; }
.modal-section-title { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; font-weight: 500; }

/* ── LOGIN ── */
.login-body { display:flex; align-items:center; justify-content:center; min-height:100vh; background:var(--paper); }
.login-wrap { width:100%; max-width:320px; padding:24px; }
.login-logo { font-size:30px; font-weight:500; color:#fff; text-align:center; margin-bottom:28px; letter-spacing:-0.5px; }
.login-logo span { color:rgba(255,255,255,0.55); }
.login-card { background:rgba(255,255,255,0.15); backdrop-filter:blur(8px); border-radius:14px; padding:20px; }
.login-card input { background:rgba(255,255,255,0.9); margin-bottom:10px; }
.login-card .btn-primary { width:100%; padding:12px; font-size:14px; margin-top:2px; border-radius:var(--radius-sm); }

/* ── ADMIN ── */
.admin-body { background:var(--paper); min-height:100vh; overflow:auto; }
.admin-shell { max-width:580px; margin:0 auto; padding:0 16px 40px; }
.admin-topbar { display:flex; align-items:center; justify-content:space-between; padding:18px 0 20px; border-bottom:0.5px solid rgba(255,255,255,0.2); margin-bottom:22px; }
.admin-topbar-left { display:flex; align-items:center; gap:10px; }
.admin-topbar-right { display:flex; gap:8px; }
.site-wordmark { font-size:18px; font-weight:500; color:#fff; letter-spacing:-0.3px; }
.site-wordmark .dot { color:rgba(255,255,255,0.5); }
.role-badge { font-size:10px; letter-spacing:0.12em; text-transform:uppercase; background:rgba(255,255,255,0.15); color:rgba(255,255,255,0.8); padding:3px 9px; border-radius:10px; }
.admin-section-title { font-size:11px; letter-spacing:0.12em; text-transform:uppercase; color:rgba(255,255,255,0.6); margin-bottom:12px; font-weight:500; }
.user-list { display:flex; flex-direction:column; gap:7px; margin-bottom:10px; }
.user-card { background:rgba(255,255,255,0.12); border:0.5px solid rgba(255,255,255,0.18); border-radius:var(--radius); padding:13px 14px; display:flex; align-items:center; justify-content:space-between; gap:10px; backdrop-filter:blur(4px); }
.uc-left { display:flex; align-items:center; gap:10px; }
.uc-avatar { width:38px; height:38px; border-radius:50%; background:rgba(255,255,255,0.2); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; color:#fff; flex-shrink:0; }
.uc-name { font-size:14px; font-weight:500; color:#fff; }
.uc-sub { font-size:11px; color:rgba(255,255,255,0.6); margin-top:1px; }
.uc-right { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.online-pip { width:7px; height:7px; border-radius:50%; background:rgba(255,255,255,0.3); flex-shrink:0; display:inline-block; }
.online-pip.online { background:#6ada6a; }
.btn-add-user { width:100%; padding:12px; border-radius:var(--radius); background:rgba(255,255,255,0.1); border:0.5px dashed rgba(255,255,255,0.3); color:rgba(255,255,255,0.75); font-size:13px; margin-top:4px; }
.btn-add-user:hover { background:rgba(255,255,255,0.15); }
.empty-hint { font-size:13px; color:rgba(255,255,255,0.5); padding:20px 0; text-align:center; }
.admin-card-btn { background:rgba(255,255,255,0.12); color:rgba(255,255,255,0.85); border-radius:var(--radius-sm); padding:6px 11px; font-size:12px; }
.admin-card-btn:hover { background:rgba(255,255,255,0.2); }
.admin-card-btn.danger { color:#ffaaaa; }

/* ── BOARD ── */
.board-body { overflow:hidden; background:var(--paper); }
.board-shell { display:flex; flex-direction:column; height:100vh; }
.board-topbar { height:48px; background:rgba(186,134,113,0.92); backdrop-filter:blur(6px); border-bottom:0.5px solid rgba(0,0,0,0.1); display:flex; align-items:center; justify-content:space-between; padding:0 14px; flex-shrink:0; z-index:100; }
.tb-left { display:flex; align-items:center; gap:10px; }
.tb-right { display:flex; align-items:center; gap:8px; }
.back-btn { display:flex; align-items:center; gap:5px; font-size:12px; color:rgba(255,255,255,0.85); background:rgba(0,0,0,0.12); border-radius:var(--radius-sm); padding:5px 10px; }
.back-btn svg { flex-shrink:0; stroke:rgba(255,255,255,0.85); }
.board-name-label { font-size:11px; color:rgba(255,255,255,0.6); letter-spacing:0.08em; text-transform:uppercase; }
.board-topbar .site-wordmark { color:#fff; font-size:15px; }
.board-topbar .site-wordmark .dot { color:rgba(255,255,255,0.5); }
.board-topbar .btn-ghost { background:rgba(0,0,0,0.12); color:rgba(255,255,255,0.85); }
.board-topbar .btn-primary { background:rgba(0,0,0,0.25); color:#fff; }

.canvas-wrap { flex:1; overflow:hidden; position:relative; cursor:grab; touch-action:none; }
.canvas-wrap.dragging { cursor:grabbing; }
.canvas { position:absolute; width:8000px; height:6000px; background:var(--paper); }

/* ── STICKY ── */
.sticky { position:absolute; border-radius:3px; box-shadow:2px 4px 16px rgba(0,0,0,0.18),0 1px 3px rgba(0,0,0,0.1); display:flex; flex-direction:column; user-select:none; cursor:move; }
.sticky.white { background:var(--sticky-white); }
.sticky.dark { background:var(--sticky-dark); }
.sticky.size-sm { width:130px; }
.sticky.size-md { width:170px; }
.sticky.size-lg { width:220px; }
.sticky.size-xl { width:530px; }

.sticky-pin { width:13px; height:13px; border-radius:50%; position:absolute; top:-6px; left:50%; transform:translateX(-50%); border:1.5px solid rgba(0,0,0,0.15); box-shadow:0 2px 5px rgba(0,0,0,0.3); z-index:2; }

.sticky-body { padding:12px 11px 8px; flex:1; display:flex; flex-direction:column; gap:0; }
.sticky-meta { font-size:8.5px; letter-spacing:0.06em; font-weight:500; margin-bottom:6px; }
.sticky.white .sticky-meta { color:rgba(26,20,16,0.3); }
.sticky.dark .sticky-meta { color:rgba(255,255,255,0.22); }

/* Content blocks */
.sticky-main-img { width:100%; border-radius:2px; display:block; object-fit:cover; }
.sticky-youtube { position:relative; width:100%; padding-bottom:56.25%; border-radius:2px; overflow:hidden; background:#000; flex-shrink:0; cursor:pointer; }
.sticky-youtube iframe { position:absolute; inset:0; width:100%; height:100%; border:none; }
.sticky-youtube-thumb { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.sticky-youtube-play { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.yt-play-btn { width:40px; height:28px; background:rgba(180,0,0,0.9); border-radius:6px; display:flex; align-items:center; justify-content:center; }

.sticky-spotify { border-radius:4px; overflow:hidden; flex-shrink:0; }
.sticky-spotify iframe { display:block; border:none; width:100%; }

.sticky-link-card { display:flex; flex-direction:column; gap:3px; padding:8px; border-radius:3px; cursor:pointer; text-decoration:none; }
.sticky.white .sticky-link-card { background:rgba(0,0,0,0.04); }
.sticky.dark .sticky-link-card { background:rgba(255,255,255,0.06); }
.slc-image { width:100%; height:60px; object-fit:cover; border-radius:2px; margin-bottom:4px; }
.slc-domain { font-size:9px; letter-spacing:0.06em; text-transform:uppercase; opacity:0.45; }
.slc-title { font-size:11px; font-weight:500; line-height:1.35; }
.slc-desc { font-size:10px; line-height:1.4; opacity:0.6; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sticky.white .slc-domain, .sticky.white .slc-title, .sticky.white .slc-desc { color:var(--ink); }
.sticky.dark .slc-domain, .sticky.dark .slc-title, .sticky.dark .slc-desc { color:rgba(255,255,255,0.85); }

.sticky-subtext { font-size:11px; line-height:1.5; margin-top:7px; }
.sticky.white .sticky-subtext { color:var(--ink); }
.sticky.dark .sticky-subtext { color:rgba(255,255,255,0.82); }

.sticky-note-text { font-size:12px; line-height:1.55; }
.sticky.white .sticky-note-text { color:var(--ink); }
.sticky.dark .sticky-note-text { color:rgba(255,255,255,0.85); }

.sticky-doodle-wrap { position:relative; border-radius:2px; overflow:hidden; }
.sticky-doodle-wrap img { display:block; width:100%; }
.sticky-doodle-edit { position:absolute; bottom:4px; right:4px; background:rgba(0,0,0,0.4); color:#fff; font-size:10px; border-radius:3px; padding:2px 6px; display:none; cursor:pointer; }
.sticky-doodle-wrap:hover .sticky-doodle-edit { display:block; }

/* edit button on sticky */
.sticky-edit-btn { position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%; background:rgba(0,0,0,0.08); display:none; align-items:center; justify-content:center; font-size:12px; cursor:pointer; z-index:5; }
.sticky:hover .sticky-edit-btn { display:flex; }
.sticky.dark .sticky-edit-btn { background:rgba(255,255,255,0.1); color:#fff; }

/* ── COMMENTS SCROLL ── */
.comments-strip { border-top:0.5px solid; cursor:pointer; user-select:none; flex-shrink:0; }
.sticky.white .comments-strip { border-color:rgba(0,0,0,0.08); }
.sticky.dark .comments-strip { border-color:rgba(255,255,255,0.08); }
.comments-toggle { display:flex; align-items:center; justify-content:space-between; padding:6px 11px; font-size:10px; }
.sticky.white .comments-toggle { color:var(--ink-faint); }
.sticky.dark .comments-toggle { color:rgba(255,255,255,0.3); }
.comments-arrow { transition:transform 0.25s; font-style:normal; }
.comments-arrow.open { transform:rotate(180deg); }

.comments-scroll { overflow:hidden; max-height:0; transition:max-height 0.35s cubic-bezier(0.4,0,0.2,1); }
.comments-scroll.open { max-height:600px; }
.comments-inner { padding:6px 10px 4px; display:flex; flex-direction:column; gap:5px; }
.comment-item { border-radius:3px; padding:5px 7px; }
.sticky.white .comment-item { background:rgba(0,0,0,0.04); }
.sticky.dark .comment-item { background:rgba(255,255,255,0.06); }
.comment-author { font-size:9px; font-weight:600; letter-spacing:0.05em; margin-bottom:2px; }
.sticky.white .comment-author { color:var(--ink-mid); }
.sticky.dark .comment-author { color:rgba(255,255,255,0.45); }
.comment-text { font-size:11px; line-height:1.45; }
.sticky.white .comment-text { color:var(--ink); }
.sticky.dark .comment-text { color:rgba(255,255,255,0.8); }
.comment-del { float:right; font-size:11px; color:#c03030; cursor:pointer; margin-left:6px; }

.comment-input-row { display:flex; gap:6px; padding:6px 10px 8px; }
.comment-input-row input { flex:1; padding:6px 9px; border-radius:4px; font-size:12px; border:0.5px solid rgba(0,0,0,0.15); background:rgba(255,255,255,0.8); outline:none; margin-bottom:0; }
.sticky.dark .comment-input-row input { background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.15); color:#fff; }
.comment-send-btn { background:var(--ink); color:#fff; border-radius:4px; padding:0 10px; font-size:12px; flex-shrink:0; }
.sticky.dark .comment-send-btn { background:rgba(255,255,255,0.2); }

/* ── ZOOM & MINIMAP ── */
.zoom-bar { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:8px; background:rgba(186,134,113,0.92); border:0.5px solid rgba(0,0,0,0.12); border-radius:20px; padding:5px 13px; z-index:200; backdrop-filter:blur(4px); }
.zoom-btn { width:28px; height:28px; border-radius:50%; background:rgba(0,0,0,0.1); font-size:16px; color:rgba(255,255,255,0.9); display:flex; align-items:center; justify-content:center; }
.zoom-btn:hover { background:rgba(0,0,0,0.18); }
.zoom-lbl { font-size:11px; color:rgba(255,255,255,0.7); min-width:34px; text-align:center; letter-spacing:0.04em; }
.minimap { position:fixed; bottom:16px; right:14px; width:90px; height:70px; background:rgba(186,134,113,0.85); border:0.5px solid rgba(0,0,0,0.15); border-radius:6px; overflow:hidden; z-index:200; }
.minimap-viewport { position:absolute; border:1.5px solid rgba(255,255,255,0.7); border-radius:2px; pointer-events:none; background:rgba(255,255,255,0.1); }

/* ── CREATOR OVERLAY ── */
.creator-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.45); display:flex; align-items:flex-end; justify-content:center; z-index:1000; padding:0; }
@media(min-width:600px) { .creator-overlay { align-items:center; padding:20px; } }

.creator-shell { background:#faf8f2; border-radius:16px 16px 0 0; width:100%; max-width:520px; max-height:92vh; overflow-y:auto; display:flex; flex-direction:column; }
@media(min-width:600px) { .creator-shell { border-radius:16px; max-height:88vh; } }

.creator-header { display:flex; align-items:center; justify-content:space-between; padding:16px 16px 12px; border-bottom:0.5px solid var(--border); flex-shrink:0; }
.creator-title { font-size:15px; font-weight:500; color:var(--ink); }
.creator-close { width:28px; height:28px; border-radius:50%; background:rgba(0,0,0,0.07); font-size:14px; color:var(--ink-mid); display:flex; align-items:center; justify-content:center; }
.creator-back { width:32px; height:32px; border-radius:50%; background:rgba(0,0,0,0.07); font-size:18px; color:var(--ink-mid); display:flex; align-items:center; justify-content:center; }

.type-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; padding:16px; }
.type-card { display:flex; flex-direction:column; align-items:center; gap:7px; padding:16px 8px; border-radius:var(--radius); border:0.5px solid var(--border); background:rgba(0,0,0,0.02); cursor:pointer; transition:background 0.12s; }
.type-card:hover, .type-card:active { background:rgba(0,0,0,0.06); }
.type-icon { font-size:26px; }
.type-label { font-size:12px; color:var(--ink-mid); font-weight:500; }

.content-area { padding:14px 16px 0; flex:1; }
.url-input-wrap { display:flex; gap:8px; margin-bottom:10px; }
.url-input-wrap input { flex:1; margin-bottom:0; }
.url-input-wrap .btn-primary { flex-shrink:0; white-space:nowrap; }
.preview-loading { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-mid); padding:12px 0; }
.spinner { width:16px; height:16px; border:2px solid rgba(0,0,0,0.1); border-top-color:var(--ink); border-radius:50%; animation:spin 0.7s linear infinite; flex-shrink:0; }
@keyframes spin { to { transform:rotate(360deg); } }

.preview-result { border-radius:var(--radius-sm); overflow:hidden; border:0.5px solid var(--border); margin-bottom:10px; }
.pr-yt { background:#000; position:relative; padding-bottom:56.25%; }
.pr-yt img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.pr-yt-play { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.pr-spotify { background:#191414; }
.pr-spotify iframe { display:block; border:none; width:100%; height:152px; }
.pr-link { padding:10px; background:rgba(0,0,0,0.03); }
.pr-link img { width:100%; height:80px; object-fit:cover; border-radius:3px; margin-bottom:7px; }
.pr-link .pr-domain { font-size:9px; text-transform:uppercase; letter-spacing:0.06em; color:var(--ink-faint); }
.pr-link .pr-title { font-size:13px; font-weight:500; margin-top:2px; }
.pr-link .pr-desc { font-size:11px; color:var(--ink-mid); margin-top:3px; line-height:1.4; }

.photo-drop-zone { border:1.5px dashed rgba(0,0,0,0.18); border-radius:var(--radius); padding:20px; text-align:center; cursor:pointer; background:rgba(0,0,0,0.02); }
.photo-drop-zone:active { background:rgba(0,0,0,0.05); }
.photo-drop-icon { font-size:32px; margin-bottom:8px; }
.photo-drop-label { font-size:13px; color:var(--ink-mid); }

#creatorDoodleCanvas { display:block; width:100%; border:0.5px solid var(--border); border-radius:4px; background:#fff; touch-action:none; cursor:crosshair; }
.doodle-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.color-swatches { display:flex; gap:6px; }
.ds { width:22px; height:22px; border-radius:50%; cursor:pointer; border:2.5px solid transparent; }
.ds.active { border-color:rgba(0,0,0,0.5); box-shadow:0 0 0 2px rgba(255,255,255,0.9); }
.size-dots { display:flex; gap:6px; align-items:center; }
.sdot { border-radius:50%; background:var(--ink); cursor:pointer; }
.sdot.active { box-shadow:0 0 0 2.5px rgba(30,80,200,0.5); }
.tool-sep { width:0.5px; height:18px; background:var(--border); }
.eraser-btn { font-size:11px; padding:5px 10px; border-radius:var(--radius-sm); background:rgba(0,0,0,0.07); color:var(--ink-mid); }
.eraser-btn.active { background:var(--ink); color:#fff; }

.options-bar { padding:12px 16px 0; border-top:0.5px solid var(--border); margin-top:14px; }
.option-row-inline { display:flex; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.opt-label { font-size:11px; color:var(--ink-faint); width:44px; flex-shrink:0; letter-spacing:0.04em; }
.btn-group { display:flex; gap:5px; }
.opt-btn { padding:5px 12px; border-radius:var(--radius-sm); border:0.5px solid rgba(0,0,0,0.15); background:rgba(0,0,0,0.04); font-size:12px; }
.opt-btn.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.pin-colors { display:flex; gap:7px; margin-left:4px; }
.pin-swatch { width:20px; height:20px; border-radius:50%; cursor:pointer; }
.pin-swatch.active { box-shadow:0 0 0 2px #faf8f2, 0 0 0 4px var(--ink); }

.btn-anheften { width:calc(100% - 32px); margin:14px 16px 16px; padding:13px; background:var(--ink); color:#fff; border-radius:var(--radius-sm); font-size:15px; font-weight:500; letter-spacing:0.02em; }

.edit-content-area { padding:14px 16px; flex:1; overflow-y:auto; }
.edit-actions { display:flex; gap:10px; padding:12px 16px 16px; border-top:0.5px solid var(--border); }
.edit-actions .btn-primary { flex:1; }

/* ── PHOTO FULL ── */
.photo-full-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.92); display:flex; align-items:center; justify-content:center; z-index:2000; padding:20px; }
.photo-full-overlay img { max-width:100%; max-height:90vh; border-radius:6px; object-fit:contain; }
.photo-full-close { position:absolute; top:16px; right:16px; width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,0.15); color:#fff; font-size:18px; display:flex; align-items:center; justify-content:center; }

/* ── ANIMATIONS ── */
@keyframes stickyPop {
  0%   { transform:scale(0.5) rotate(var(--rot)); opacity:0; }
  70%  { transform:scale(1.07) rotate(var(--rot)); opacity:1; }
  100% { transform:scale(1) rotate(var(--rot)); opacity:1; }
}
.sticky.popping { animation:stickyPop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards; }

/* ── TOAST ── */
.toast { position:fixed; top:58px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; font-size:12px; padding:8px 18px; border-radius:20px; z-index:2000; white-space:nowrap; box-shadow:0 2px 10px rgba(0,0,0,0.25); }

/* ── MODALS (admin) ── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.4); display:flex; align-items:center; justify-content:center; z-index:1000; padding:16px; }
.modal { background:#faf8f2; border-radius:var(--radius); padding:20px; width:100%; max-width:380px; max-height:90vh; overflow-y:auto; }
.modal-title { font-size:15px; font-weight:500; margin-bottom:14px; }
.share-box { background:rgba(0,0,0,0.05); border-radius:var(--radius-sm); padding:12px; font-size:13px; line-height:1.7; white-space:pre; margin-bottom:10px; font-family:monospace; }
