/* Wall of Creations - Pinterest-style masonry + Instagram-style viewer. Light by default, dark aware. */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f3f8;
  --surface: #ffffff;
  --text: #16131f;
  --muted: #6f6b80;
  --line: #e7e4ef;
  --hover: #efedf5;
  --brand-1: #ff4fa3;
  --brand-2: #7c5cff;
  --brand-3: #2ec4f1;
  --brand-4: #ffc93c;
  --heart: #ff3b5c;
  --shadow: 0 1px 2px rgba(22, 19, 31, 0.06), 0 8px 24px rgba(22, 19, 31, 0.08);
  --shadow-lg: 0 24px 80px rgba(10, 6, 30, 0.35);
  --radius: 20px;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0d1a;
    --bg-soft: #1a1729;
    --surface: #17142a;
    --text: #f3f1fa;
    --muted: #a19cb8;
    --line: #2a2640;
    --hover: #221e36;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- icons (masks) */
.icon { display: inline-block; width: 22px; height: 22px; background: currentColor; flex: none;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
[data-icon="search"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
[data-icon="close"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
[data-icon="left"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 5-7 7 7 7'/%3E%3C/svg%3E"); }
[data-icon="right"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E"); }
[data-icon="heart"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 20.5s-7.5-4.6-9.3-9.2C1.5 8 3.6 4.5 7.1 4.5c2 0 3.6 1.1 4.9 2.9 1.3-1.8 2.9-2.9 4.9-2.9 3.5 0 5.6 3.5 4.4 6.8-1.8 4.6-9.3 9.2-9.3 9.2z'/%3E%3C/svg%3E"); }
[data-icon="up"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3zm0 0 4-8a3 3 0 0 1 3 3v4h5.5a2 2 0 0 1 2 2.4l-1.6 8A2 2 0 0 1 17.9 21H7'/%3E%3C/svg%3E"); }
[data-icon="up-fill"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3zm0 0 4-8a3 3 0 0 1 3 3v4h5.5a2 2 0 0 1 2 2.4l-1.6 8A2 2 0 0 1 17.9 21H7'/%3E%3C/svg%3E"); }
[data-icon="down"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-3zm0 0-4 8a3 3 0 0 1-3-3v-4H4.5a2 2 0 0 1-2-2.4l1.6-8A2 2 0 0 1 6.1 3H17'/%3E%3C/svg%3E"); }
[data-icon="down-fill"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-3zm0 0-4 8a3 3 0 0 1-3-3v-4H4.5a2 2 0 0 1-2-2.4l1.6-8A2 2 0 0 1 6.1 3H17'/%3E%3C/svg%3E"); }
[data-icon="comment"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.4 8.4 0 0 1-12.2 7.6L3 21l1.9-5.7A8.5 8.5 0 1 1 21 11.5z'/%3E%3C/svg%3E"); }
[data-icon="heart-fill"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5s-7.5-4.6-9.3-9.2C1.5 8 3.6 4.5 7.1 4.5c2 0 3.6 1.1 4.9 2.9 1.3-1.8 2.9-2.9 4.9-2.9 3.5 0 5.6 3.5 4.4 6.8-1.8 4.6-9.3 9.2-9.3 9.2z'/%3E%3C/svg%3E"); }
[data-icon="share"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 3 10 14'/%3E%3Cpath d='M21 3l-7 18-4-7-7-4 18-7z'/%3E%3C/svg%3E"); }
[data-icon="replay"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E"); }
[data-icon="download"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0-5-5m5 5 5-5'/%3E%3Cpath d='M4 17v3h16v-3'/%3E%3C/svg%3E"); }
[data-icon="video"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='2.5' y='5.5' width='14' height='13' rx='3'/%3E%3Cpath d='m16.5 10 5-3v10l-5-3z'/%3E%3C/svg%3E"); }
[data-icon="more"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E"); }
[data-icon="mail"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E"); }
[data-icon="play"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z'/%3E%3C/svg%3E"); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 11px 20px; font-weight: 800; text-decoration: none; transition: transform 0.15s, background 0.15s, filter 0.15s; white-space: nowrap; }
.btn:active { transform: scale(0.96); }
.btn .icon { width: 18px; height: 18px; }
.btn-play { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #fff; box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35); }
.btn-play:hover { filter: brightness(1.08); }
.btn-comics { background: var(--bg-soft); color: var(--text); }
.btn-comics:hover { filter: brightness(0.97); }
.btn-soft { background: var(--bg-soft); color: var(--text); }
.btn-kofi { background: #29abe0; color: #fff; text-decoration: none; }
.btn-kofi:hover { background: #1d94c6; }
.kofi-cup { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-soft:hover { background: var(--hover); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; transition: background 0.15s, transform 0.15s; }
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: scale(0.9); }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 3vw, 32px); padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: conic-gradient(from 200deg, var(--brand-1), var(--brand-2), var(--brand-3), var(--brand-4), var(--brand-1));
  position: relative; box-shadow: 0 4px 14px rgba(124, 92, 255, 0.4); }
.brand-mark::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 3px solid #fff; border-right-color: transparent; transform: rotate(-30deg); }
.site-logo { width: min(260px, 100%); height: auto; display: block; min-width: 0; }
.search input { min-width: 0; width: 100%; }
@media (max-width: 1000px) { .site-logo { width: 170px; } }
.brand-text { font-weight: 900; font-size: 20px; letter-spacing: -0.3px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto; padding: 0 18px; height: 48px;
  border-radius: 999px; background: var(--bg-soft); color: var(--muted); transition: box-shadow 0.15s, background 0.15s; }
.search:focus-within { background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 35%, transparent); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text); min-width: 0; }
.search input::placeholder { color: var(--muted); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.avatar-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; font-weight: 900; font-size: 18px;
  color: #fff; background: var(--bg-soft); transition: transform 0.15s; }
.avatar-btn:hover { transform: scale(1.06); }
.avatar-btn.signed-out { color: var(--text); font-size: 13px; width: auto; padding: 0 16px; border-radius: 999px; }

/* ---------------------------------------------------------------- hero, profile, chips */
main { max-width: 1600px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 32px) 80px; }
.hero { text-align: center; padding: 34px 12px 8px; }
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 60px); font-weight: 900; letter-spacing: -1.5px; line-height: 1.05;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 10px auto 0; max-width: 560px; color: var(--muted); font-weight: 600; font-size: 17px; }

.profile { display: flex; align-items: center; gap: clamp(18px, 4vw, 44px); justify-content: center; padding: 36px 12px 10px; }
.profile-avatar { width: clamp(88px, 14vw, 140px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-size: clamp(38px, 6vw, 60px); font-weight: 900; color: #fff; box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--brand-2); }
.profile h1 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 40px); font-weight: 900; }
.profile-stats { margin: 0 0 14px; color: var(--muted); font-weight: 700; }
.profile-stats b { color: var(--text); }
.dot-sep::before { content: "\00b7"; margin: 0 6px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-note { margin: 10px 0 0; color: var(--muted); font-weight: 600; }
.profile-comics { max-width: 1200px; margin: 6px auto 0; padding: 0 clamp(14px, 3vw, 32px); }
.profile-comics h2 { font-size: 18px; margin: 10px 0; }
.comic-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.comic-card { display: block; text-decoration: none; color: inherit; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
.comic-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; }
.comic-card span { display: block; padding: 8px 10px; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comic-card small { display: block; padding: 0 10px 10px; color: var(--muted); font-size: 12px; }

.chips { position: sticky; top: 72px; z-index: 10; display: flex; gap: 8px; justify-content: center; padding: 14px 0; overflow-x: auto; scrollbar-width: none;
  background: var(--bg); margin: 0 calc(-1 * clamp(12px, 3vw, 32px)) 6px; padding-left: clamp(12px, 3vw, 32px); padding-right: clamp(12px, 3vw, 32px); }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 800; background: var(--bg-soft); color: var(--text); white-space: nowrap; transition: background 0.15s, color 0.15s; }
.chip-contests { border-radius: 999px; padding: 10px 18px; font-weight: 900; white-space: nowrap; text-decoration: none; color: #3a2400; background: linear-gradient(135deg, #ffe066, #ffb300); box-shadow: 0 3px 0 #c98a00; }
.chip-contests:hover { filter: brightness(1.05); }
.chip:hover { background: var(--hover); }
.chip.active { background: var(--text); color: var(--bg); }

/* ---------------------------------------------------------------- masonry */
.masonry { columns: 5 240px; column-gap: 16px; }
.pin { break-inside: avoid; margin: 0 0 18px; display: block; width: 100%; text-align: left; border: 0; padding: 0; background: none; animation: rise 0.45s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.pin-media { position: relative; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); cursor: zoom-in; isolation: isolate; }
.pin-media img, .pin-media canvas { width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; transition: transform 0.4s ease; }
/* Tall / square tiles show the whole drawing on a colored mat, like a framed print. */
.pin.tall .pin-media, .pin.square .pin-media { background: var(--mat, #f1ecff); }
.pin.tall .pin-media img, .pin.tall .pin-media canvas.still { aspect-ratio: 4 / 5; object-fit: contain; padding: 14%  9%; }
.pin.square .pin-media img, .pin.square .pin-media canvas.still { aspect-ratio: 1; object-fit: contain; padding: 9%; }
.pin.tall .pin-media img, .pin.square .pin-media img { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18)); }
.pin:hover .pin-media img { transform: scale(1.04); }
.pin-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 30%, transparent 55%, rgba(0, 0, 0, 0.55)); opacity: 0; transition: opacity 0.2s; }
.pin:hover .pin-overlay, .pin:focus-visible .pin-overlay { opacity: 1; }
.pin-top { display: flex; justify-content: space-between; align-items: center; }
.live-tag { display: inline-flex; align-items: center; gap: 5px; color: #fff; font-size: 12px; font-weight: 900; letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.45); padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.live-tag .icon { width: 12px; height: 12px; }
.pin-quick { display: flex; gap: 6px; }
.pin-quick .icon-btn { width: 38px; height: 38px; background: rgba(255, 255, 255, 0.92); color: #16131f; }
.pin-quick .icon-btn:hover { background: #fff; }
.pin-quick .icon-btn .icon { width: 19px; height: 19px; }
.pin-quick .liked { color: var(--heart); }
.pin-title { color: #fff; font-weight: 900; font-size: 18px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); text-transform: capitalize;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-meta { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0; }
.mini-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 13px; flex: none; text-decoration: none; }
.pin-artist { font-weight: 700; font-size: 13px; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pin-artist:hover { text-decoration: underline; }
.pin-likes { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 800; font-size: 13px; }
.pin-likes .icon { width: 16px; height: 16px; }
.pin-likes.liked { color: var(--heart); }
.pin-word { padding: 10px 4px 0; color: var(--text); font-weight: 800; font-size: 15px; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.skeleton .pin-media { background: linear-gradient(100deg, var(--bg-soft) 30%, var(--hover) 50%, var(--bg-soft) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s infinite linear; box-shadow: none; }
.skeleton .pin-media::before { content: ""; display: block; aspect-ratio: 8 / 5; }
.skeleton.tall .pin-media::before { aspect-ratio: 4 / 5; }
.skeleton .pin-meta span { height: 12px; border-radius: 6px; background: var(--bg-soft); flex: 1; }
@keyframes shimmer { to { background-position: -150% 0; } }

.empty { text-align: center; padding: 60px 16px; }
.hidden-badge { position: absolute; left: 10px; top: 10px; z-index: 2; background: rgba(22, 19, 31, 0.78); color: #fff; font-size: 12px;
  font-weight: 900; letter-spacing: 0.5px; padding: 5px 10px; border-radius: 999px; }
.pin.is-hidden .pin-media img { opacity: 0.55; filter: grayscale(0.4); }
.hidden-note { margin: 4px 16px 0; padding: 8px 12px; border-radius: 12px; background: var(--bg-soft); color: var(--muted); font-weight: 700; font-size: 13px; }
.empty-art { width: 140px; height: 110px; margin: 0 auto 18px; border-radius: 28px; transform: rotate(-6deg);
  background: linear-gradient(135deg, var(--brand-4), var(--brand-1) 50%, var(--brand-2)); box-shadow: var(--shadow); position: relative; }
.empty-art::after { content: ""; position: absolute; inset: 16px; border-radius: 16px; background: var(--surface); opacity: 0.9; }
.empty h2 { margin: 0 0 6px; font-weight: 900; }
.empty p { color: var(--muted); font-weight: 600; margin: 0 auto 20px; max-width: 420px; }
.sentinel { height: 1px; }

/* ---------------------------------------------------------------- viewer */
dialog { border: 0; padding: 0; color: var(--text); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(8, 6, 18, 0.82); backdrop-filter: blur(6px); }
dialog[open] { animation: pop 0.22s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } }
.viewer { width: 100vw; height: 100vh; height: 100dvh; display: grid; place-items: center; }
.viewer:not([open]) { display: none; }
.viewer-close { position: fixed; top: 14px; right: 14px; color: #fff; z-index: 3; }
.viewer-close:hover, .nav:hover { background: rgba(255, 255, 255, 0.14); }
.nav { position: fixed; top: 50%; transform: translateY(-50%); color: #fff; background: rgba(255, 255, 255, 0.08); z-index: 3; }
.nav.prev { left: 14px; }
.nav.next { right: 14px; }
.post { display: grid; grid-template-columns: minmax(0, 1fr) 360px; width: min(1240px, calc(100vw - 140px)); max-height: calc(100dvh - 60px);
  background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.post-media { position: relative; background: #0b0a12; display: grid; place-items: center; min-height: 0; max-height: calc(100dvh - 60px); overflow: hidden; }
/* The whole drawing always shows: it shrinks to fit the width AND the height (tall comic-page drawings in a short
   window, e.g. the panel inside the game), keeping its shape. replay.js sets the drawing's own aspect ratio. */
.post-media canvas { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 60px); aspect-ratio: 8 / 5; object-fit: contain; background: transparent; cursor: pointer; touch-action: manipulation; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.15); }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-1), var(--brand-4)); }
.burst { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; pointer-events: none; opacity: 0; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3zm0 0 4-8a3 3 0 0 1 3 3v4h5.5a2 2 0 0 1 2 2.4l-1.6 8A2 2 0 0 1 17.9 21H7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3zm0 0 4-8a3 3 0 0 1 3 3v4h5.5a2 2 0 0 1 2 2.4l-1.6 8A2 2 0 0 1 17.9 21H7z'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4)); }
.burst.go { animation: burst 0.9s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(0.3); } 15% { opacity: 0.95; transform: scale(1.15); } 30% { transform: scale(0.95); } 70% { opacity: 0.95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1) translateY(-20px); } }

/* the side column scrolls on its own (comments, "More from"), within the viewer's height */
.post-side { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 60px); overflow-y: auto; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 14px 10px 14px 16px; border-bottom: 1px solid var(--line); }
.post-head .mini-avatar { width: 40px; height: 40px; font-size: 17px; }
.post-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.post-artist { font-weight: 900; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-artist:hover { text-decoration: underline; }
.muted { color: var(--muted); font-weight: 600; }
.small { font-size: 14px; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 46px; z-index: 5; min-width: 200px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.menu-pop button:hover { background: var(--hover); }
.menu-pop .danger { color: var(--heart); }
.post-title { margin: 16px 16px 4px; font-size: 26px; font-weight: 900; text-transform: capitalize; line-height: 1.15; letter-spacing: -0.4px; }
.post-actions { display: flex; align-items: center; gap: 2px; padding: 4px 8px; }
.post-actions .spacer { flex: 1; }
.like.on { color: var(--heart); }
.like.on .icon, .pin-quick .liked { color: #2bd67b; }
.like.on .icon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5s-7.5-4.6-9.3-9.2C1.5 8 3.6 4.5 7.1 4.5c2 0 3.6 1.1 4.9 2.9 1.3-1.8 2.9-2.9 4.9-2.9 3.5 0 5.6 3.5 4.4 6.8-1.8 4.6-9.3 9.2-9.3 9.2z'/%3E%3C/svg%3E"); }
.like.pulse .icon { animation: pulse 0.4s; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.likes-line { margin: 2px 16px 0; font-weight: 700; }
.likes-line .sep { color: var(--muted); font-weight: 600; margin: 0 6px; }
.dislike.on { color: var(--accent, #7c5cff); }
.pin-likes .down { margin-left: 8px; opacity: 0.75; }
.post-desc { margin: 6px 16px 4px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.post-desc:empty { display: none; }
.comments { padding: 12px 16px 6px; border-top: 1px solid var(--line); }
.comments h3 { margin: 0 0 8px; font-size: 16px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comment { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: start; }
.comment .mini-avatar { width: 32px; height: 32px; font-size: 14px; }
.comment-body { min-width: 0; }
.comment-body b { margin-right: 6px; }
.comment-body p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-body .muted { font-size: 12px; }
.comment-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; padding: 4px; }
.comment-del:hover { color: var(--heart); }
.comment-form { display: flex; gap: 8px; margin: 12px 0 6px; }
.comment-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; border-radius: 14px; border: 1px solid var(--line); padding: 10px 12px; font: inherit; background: var(--card, transparent); color: inherit; }
.comment-form button, .comments .link-btn { border: 0; border-radius: 999px; padding: 0 16px; font: inherit; font-weight: 800; cursor: pointer; background: var(--accent, #7c5cff); color: white; }
.comments .link-btn { padding: 8px 14px; margin-top: 8px; background: transparent; color: var(--accent, #7c5cff); }
.no-comments { color: var(--muted); margin: 4px 0; }
.edit-form label { display: block; font-weight: 800; margin: 10px 0 4px; }
.edit-form input, .edit-form textarea { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line); padding: 10px 12px; font: inherit; background: transparent; color: inherit; }
.edit-form textarea { min-height: 110px; resize: vertical; }
.tip { margin: 2px 16px 12px; font-size: 13px; }
.more { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.more h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 800; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.more-grid button { border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--bg-soft); aspect-ratio: 1; }
.more-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.more-grid button:hover img { transform: scale(1.06); }

/* ---------------------------------------------------------------- sheets */
.sheet { width: min(460px, calc(100vw - 24px)); padding: 26px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); }
.sheet h2 { margin: 0 0 14px; font-weight: 900; font-size: 24px; }
.sheet-close { position: absolute; top: 12px; right: 12px; }
.share-preview { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--bg-soft); margin-bottom: 16px; }
.share-preview img { width: 96px; aspect-ratio: 8 / 5; object-fit: cover; border-radius: 10px; background: #fff; }
.share-preview p { margin: 0; font-weight: 700; font-size: 14px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; margin-bottom: 18px; }
.share-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px; border-radius: 12px; }
.share-grid button:hover { background: var(--hover); }
.share-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 22px; font-family: Arial, sans-serif; }
.share-ic[data-icon] { -webkit-mask: none; mask: none; position: relative; }
.share-ic[data-icon]::after { content: ""; position: absolute; inset: 14px; background: #fff; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.share-ic.native { background: var(--brand-2); } .share-ic.x { background: #000; } .share-ic.fb { background: #1877f2; } .share-ic.wa { background: #25d366; }
.share-ic.rd { background: #ff4500; } .share-ic.pi { background: #e60023; } .share-ic.tg { background: #229ed9; } .share-ic.em { background: #6f6b80; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; border: 0; border-radius: 999px; padding: 0 16px; background: var(--bg-soft); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; }

.login form input { width: 100%; margin: 6px 0; padding: 15px 18px; border-radius: 14px; border: 2px solid transparent; background: var(--bg-soft); color: var(--text); font: inherit; font-weight: 700; outline: 0; }
.login form input:focus { border-color: var(--brand-2); background: var(--surface); }
.login-art { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 12px; background: conic-gradient(from 200deg, var(--brand-1), var(--brand-2), var(--brand-3), var(--brand-4), var(--brand-1)); }
.error { color: var(--heart); min-height: 1.3em; margin: 6px 0; font-weight: 800; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 100; transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 13px 22px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow-lg); transition: transform 0.25s, opacity 0.25s; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .post { grid-template-columns: 1fr; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; grid-template-rows: auto 1fr; }
  .post-media canvas { max-height: 56dvh; }
  .nav { display: none; }
  .viewer-close { background: rgba(0, 0, 0, 0.45); }
}
@media (max-width: 640px) {
  .brand-text { display: none; }
  .site-logo { width: 110px; }
  .search { padding: 0 12px; gap: 6px; }
  .search input { min-width: 0; width: 100%; }
  .topbar { gap: 10px; }
  .btn-play { padding: 10px 16px; }
  .btn-comics { padding: 10px 12px; }
  .chips { top: 68px; justify-content: flex-start; }
  .masonry { columns: 2 150px; column-gap: 10px; }
  .pin { margin-bottom: 14px; }
  .pin-media { border-radius: 16px; }
  .pin-overlay { display: none; }
  .profile { flex-direction: column; text-align: center; }
  .profile-actions { justify-content: center; }
  .share-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* the artists' market: buy a picture, tip an artist */
.market-box { margin: 12px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.market-box .price { font-weight: 900; font-size: 20px; }
.market-box .muted { font-size: 13px; }
.market-box .fine { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.market-box .btn { padding: 8px 14px; }
.small { font-size: 13px; }
.tip-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 6px; }
.tip-amounts button { padding: 10px 0; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-weight: 900; cursor: pointer; }
.tip-amounts button.on { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 14%, transparent); }
.sale-tag { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: #18b67a; color: #fff; font-weight: 900; font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); pointer-events: none; }
.market-box a.btn { text-decoration: none; }
/* after buying: confirmation bar over everything (also over the open picture) */
.bought-banner { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 1000; width: min(720px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); border: 2px solid #18b67a; border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-lg);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 600; }
.bought-banner a:not(.btn) { color: inherit; }
.bought-banner .btn { padding: 7px 14px; text-decoration: none; }
