:root {
  --bg: #0b0d12;
  --bg-2: #11141c;
  --bg-3: #181c27;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9ecf3;
  --muted: #8a92a6;
  --accent: #7c5cff;
  --accent-2: #00e0ff;
  --ok: #2ee59d;
  --warn: #ffc400;
  --bad: #ff4d6d;
  --radius: 12px;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
[hidden] { display: none !important; }
a { color: var(--accent-2); }
button { font: inherit; }

/* ---------- header */
.top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, 0.9);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark { display: grid; grid-template-columns: 10px 10px; gap: 2px; }
.logo-mark i { width: 10px; height: 10px; display: block; border-radius: 2px; }
.logo-mark i:nth-child(1) { background: var(--accent); }
.logo-mark i:nth-child(2) { background: var(--accent-2); }
.logo-mark i:nth-child(3) { background: var(--ok); }
.logo-mark i:nth-child(4) { background: var(--warn); }

.stats { flex: 1; max-width: 420px; }
.stats-line { font-size: 13px; color: var(--muted); }
.stats-line b { color: var(--text); font-family: var(--mono); }
.progress { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; margin-top: 4px; }
.progress-bar { height: 100%; width: 0.3%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.6s ease; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.price-tag { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }

/* ---------- buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-primary { border: 0; background: linear-gradient(90deg, var(--accent), #5a7dff 60%, var(--accent-2)); color: #fff; }
.btn-wide { width: 100%; margin-top: 8px; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.link-btn:hover { color: var(--text); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(17, 20, 28, 0.9); color: var(--text);
  font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--bg-3); }

/* ---------- layout */
.layout { flex: 1; display: flex; min-height: 0; }
.stage { position: relative; flex: 1; min-width: 0; overflow: hidden; }
#view { display: block; touch-action: none; cursor: grab; }
body.buy-mode #view { cursor: crosshair; }
.zoom-controls { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.hint {
  position: absolute; left: 14px; bottom: 14px; max-width: calc(100% - 80px);
  font-size: 12px; color: var(--muted); background: rgba(11, 13, 18, 0.8);
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); pointer-events: none;
}
body.buy-mode .hint { color: var(--accent-2); border-color: rgba(0, 224, 255, 0.35); }

.tooltip {
  position: absolute; max-width: 280px; padding: 10px 12px; border-radius: 10px;
  background: rgba(17, 20, 28, 0.96); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); z-index: 3;
}
.tooltip-title { font-weight: 600; word-break: break-word; }
.tooltip-link { font-size: 13px; text-decoration: none; }

/* ---------- side panel */
.panel {
  width: 380px; flex-shrink: 0; overflow-y: auto; padding: 22px;
  border-left: 1px solid var(--line); background: var(--bg-2);
}
.panel h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 12px; }
.panel h2 { font-size: 15px; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { margin: 0; font-size: 18px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); margin: 0 0 16px; }
.steps { padding-left: 20px; margin: 0 0 12px; color: var(--muted); }
.steps li { margin-bottom: 6px; }
.steps b { color: var(--text); }
.muted { color: var(--muted); font-size: 13px; }
.fine { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(46, 229, 157, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(46, 229, 157, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 229, 157, 0); } }

.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.list-item {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-3); color: var(--text); cursor: pointer;
}
.list-item:hover { border-color: rgba(124, 92, 255, 0.5); }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- form */
.selection-info { margin-top: 14px; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.price-big { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--mono); margin: 4px 0 8px; }
.form-error { color: var(--bad); font-size: 13px; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-weight: 400; }
.field input[type="text"], .field input[type="url"] {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 400;
}
.field input:focus { outline: 2px solid rgba(124, 92, 255, 0.6); outline-offset: 0; border-color: transparent; }
.field input[type="file"] { font-weight: 400; color: var(--muted); }
.fit-row { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.preview-wrap {
  margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--bg);
  border: 1px dashed var(--line); display: grid; place-items: center;
}
.pixelated { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- order */
.order-card { display: flex; gap: 14px; align-items: center; margin: 16px 0; }
.order-card img { border-radius: 4px; border: 1px solid var(--line); background: var(--bg); }
.order-title { font-weight: 700; word-break: break-word; }
.status { padding: 10px 12px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; border: 1px solid; }
.status-ok { color: var(--ok); border-color: rgba(46, 229, 157, 0.35); background: rgba(46, 229, 157, 0.08); }
.status-info { color: #b8a8ff; border-color: rgba(124, 92, 255, 0.4); background: rgba(124, 92, 255, 0.1); }
.status-warn { color: var(--warn); border-color: rgba(255, 196, 0, 0.35); background: rgba(255, 196, 0, 0.08); }
.status-bad { color: var(--bad); border-color: rgba(255, 77, 109, 0.35); background: rgba(255, 77, 109, 0.08); }
.notice { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); }
.notice b { color: var(--warn); }

/* ---------- toasts */
.toasts { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 10; pointer-events: none; }
.toast {
  background: rgba(24, 28, 39, 0.97); border: 1px solid var(--line); padding: 10px 16px;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); font-size: 14px;
  animation: toast-in 0.25s ease; transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- mobile */
@media (max-width: 820px) {
  body { overflow: auto; }
  .top { flex-wrap: wrap; gap: 10px 16px; padding: 10px 14px; }
  .stats { order: 3; flex-basis: 100%; max-width: none; }
  .price-tag { display: none; }
  .layout { flex: none; flex-direction: column; }
  .stage { flex: none; height: 62vh; }
  .panel { width: auto; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .panel h1 { font-size: 24px; }
}

/* ---------- admin */
body.admin { overflow: auto; display: block; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); cursor: pointer; }
.tab.active { color: var(--text); border-color: var(--accent); background: rgba(124, 92, 255, 0.15); }
.tab .count { font-family: var(--mono); margin-left: 6px; opacity: 0.7; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-preview { background: var(--bg); border-radius: 8px; display: grid; place-items: center; padding: 10px; min-height: 120px; }
.card-preview img { max-width: 100%; max-height: 220px; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; word-break: break-all; }
.card-actions { display: flex; gap: 8px; }
.card-actions .btn { flex: 1; }
.btn-ok { background: rgba(46, 229, 157, 0.15); border-color: rgba(46, 229, 157, 0.4); color: var(--ok); }
.btn-bad { background: rgba(255, 77, 109, 0.12); border-color: rgba(255, 77, 109, 0.4); color: var(--bad); }
.empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.reason-row { display: flex; gap: 8px; }
.reason-row input { flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; }

/* ---------- language switch */
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: none; border: 0; color: var(--muted); padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer; letter-spacing: 0.04em; }
.lang-switch button.active { color: var(--text); background: var(--bg-3); }
.lang-switch button:hover { color: var(--text); }

/* ---------- document pages (rules) */
.doc { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.doc h1 { font-size: 30px; letter-spacing: -0.02em; margin: 8px 0 4px; }
.doc h2 { font-size: 18px; margin: 28px 0 8px; }
.doc p, .doc li { color: #c9cfdc; }
.doc ul { padding-left: 20px; }
.panel-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.panel-foot a, .fine a { color: var(--muted); }
.panel-foot a:hover, .fine a:hover { color: var(--text); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- pixel editor */
.editor { margin: 14px 0 4px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.field-label { font-size: 13px; font-weight: 600; }
.upload-btn { font-size: 13px; color: var(--accent-2); cursor: pointer; position: relative; overflow: hidden; }
.upload-btn:hover { text-decoration: underline; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.editor .fit-row { margin-bottom: 8px; }
.editor-tools { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-bottom: 8px; }
.tool {
  height: 32px; min-width: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 15px; padding: 0;
}
.tool:hover { background: var(--bg-3); }
.tool.active { border-color: var(--accent); background: rgba(124, 92, 255, 0.2); }
.editor-tools .sep { display: none; }
.editor-stage {
  max-height: 340px; overflow: auto; border-radius: 10px; padding: 8px; background: var(--bg);
  border: 1px dashed var(--line); display: grid; place-items: center;
}
#ed-canvas { touch-action: none; cursor: crosshair; display: block; background-color: #fff; }
#ed-canvas.grid {
  background-image: linear-gradient(rgba(0,0,0,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.08) 1px, transparent 1px);
}
.palette { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; margin-top: 8px; }
.swatch { aspect-ratio: 1; border-radius: 5px; border: 1px solid rgba(255,255,255,0.15); cursor: pointer; padding: 0; }
.swatch.active { outline: 2px solid #fff; outline-offset: 1px; }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------- block panel */
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.share-row .btn { padding: 10px 8px; font-size: 14px; }
#b-visit { justify-content: center; }

/* ---------- time machine */
.timebar {
  position: absolute; left: 14px; right: 64px; bottom: 14px; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px; background: rgba(17, 20, 28, 0.94); border: 1px solid var(--line); z-index: 2;
}
.timebar input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 80px; }
.tm-date { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tm-video { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.timebar:not([hidden]) ~ .hint { display: none; }
@media (max-width: 820px) { .tm-date { display: none; } }

/* ---------- free zone & presence */
.free-pop {
  position: absolute; z-index: 4; width: 236px; padding: 12px; border-radius: 12px;
  background: rgba(17, 20, 28, 0.97); border: 1px solid rgba(46, 229, 157, 0.4); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.free-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.free-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.free-palette.disabled { opacity: 0.35; pointer-events: none; }
.free-pop .muted { margin-top: 8px; }
.online { color: var(--ok); font-size: 12px; white-space: nowrap; }

/* ---------- badges, buyout, eggs */
.tooltip-badges { font-size: 14px; margin: 2px 0; }
.tooltip-badges:empty { display: none; }
.badges { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.badges li { font-size: 12px; padding: 4px 8px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); }
.buyout-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.btn-buyout { background: rgba(255, 77, 109, 0.12); border-color: rgba(255, 77, 109, 0.45); color: #ff8fa3; }
.btn-buyout:disabled { background: var(--bg-3); border-color: var(--line); color: var(--muted); opacity: 1; }
.buyout-notice { margin-top: 12px; color: #ff8fa3; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
body.party #view { animation: party 1.2s linear infinite; }
@keyframes party { from { filter: hue-rotate(0deg) saturate(1.6); } to { filter: hue-rotate(360deg) saturate(1.6); } }

/* ---------- likes & search */
.like-btn { width: 100%; margin-bottom: 8px; font-size: 15px; }
.like-btn .heart { color: #ff4d6d; font-size: 17px; }
.like-btn.on { border-color: rgba(255, 77, 109, 0.55); background: rgba(255, 77, 109, 0.12); }
.search {
  width: 100%; margin-top: 22px; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
.search:focus { outline: 2px solid rgba(124, 92, 255, 0.6); border-color: transparent; }
#search-results:not(:empty) { margin-top: 8px; }

/* ---------- seasons */
.snow { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.season-hi { font-size: 13px; color: #ffd166; white-space: nowrap; }
body.newyear .top { position: relative; }
body.newyear .top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #ff4d6d 0 8px, transparent 8px 16px, #ffd166 16px 24px, transparent 24px 32px, #2ee59d 32px 40px, transparent 40px 48px, #29adff 48px 56px, transparent 56px 64px);
  animation: garland 1.6s steps(4) infinite;
}
@keyframes garland { to { background-position: 64px 0; } }
.free-theme { font-size: 12px; color: var(--ok); margin: -4px 0 8px; }
.settings-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.settings-row label { font-size: 14px; font-weight: 600; }
.settings-row input { flex: 1; min-width: 200px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; }
@media (max-width: 820px) { .season-hi { display: none; } }

/* ---------- embed badge */
.embed { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-3); }
.embed summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.embed img { display: block; margin: 10px 0; image-rendering: pixelated; max-width: 100%; }
.embed textarea { width: 100%; resize: none; background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: 12px/1.4 var(--mono); }
.o-clicks { margin: -4px 0 12px; }

/* ---------- frames & capsule */
.frames-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; font-size: 13px; }
.frames-bar > .muted { margin-right: 4px; }
.frames-list { display: flex; gap: 4px; }
.frames-bar .tool { width: 30px; height: 28px; font-size: 13px; }
.frames-bar .tool:disabled { opacity: 0.35; cursor: not-allowed; }
.frames-note { margin: 0 0 8px; }
.capsule-toggle { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.capsule-box textarea {
  width: 100%; resize: vertical; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px;
}
.capsule-box input[type="date"] { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit; }
.capsule-view { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 196, 0, 0.08); border: 1px solid rgba(255, 196, 0, 0.35); color: #ffd166; font-size: 14px; }
.capsule-head { font-weight: 600; margin-bottom: 6px; }
.capsule-text { white-space: pre-wrap; color: var(--text); }

/* ---------- chat */
.chat-btn {
  position: absolute; left: 14px; bottom: 56px; z-index: 3; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(17, 20, 28, 0.95); color: var(--text); font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.chat-btn:hover { background: var(--bg-3); }
.chat-unread {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
}
.chat {
  position: absolute; left: 14px; bottom: 108px; z-index: 4; width: 330px; height: 430px; max-height: calc(100% - 130px);
  display: flex; flex-direction: column; border-radius: 14px; background: rgba(17, 20, 28, 0.97);
  border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-list { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.chat-list li { word-break: break-word; }
.chat-time { color: var(--muted); font-size: 11px; font-family: var(--mono); margin-right: 6px; }
.chat-form { padding: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.chat-form input { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; min-width: 0; }
#chat-nick { font-size: 12px; padding: 5px 8px; }
.chat-row { display: flex; gap: 6px; }
.chat-row input { flex: 1; }
.chat-row .btn { padding: 8px 12px; }
.chat-rules { margin: 0; padding: 0 10px 8px; font-size: 11px; }
.chat-admin summary { cursor: pointer; font-weight: 600; }
.chat-admin-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; width: 100%; }
.chat-admin-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chat-admin-list .btn { padding: 4px 8px; font-size: 12px; }
@media (max-width: 820px) { .chat { left: 8px; right: 8px; width: auto; } }

/* ---------- pixel wars & streak */
.wars-score { font-family: var(--mono); font-weight: 700; font-size: 15px; text-align: center; margin: 2px 0 8px; }
.wars-score:empty { display: none; }
.team-pick .muted { font-size: 12px; margin-bottom: 6px; }
.team-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.team-row .btn { padding: 7px 6px; font-size: 13px; }
.team-red { border-color: rgba(255, 77, 109, 0.6); }
.team-blue { border-color: rgba(41, 173, 255, 0.6); }
.team-mine { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.team-mine .link-btn { font-size: 12px; text-decoration: underline; padding: 0; }
.free-palette.needs-team { opacity: 0.35; pointer-events: none; }
.swatch.bonus { box-shadow: 0 0 8px currentColor; }
.swatch.locked { opacity: 0.5; font-size: 10px; cursor: not-allowed; box-shadow: none; }
.streak { font-size: 12px; color: #ffa300; margin-top: 8px; }
.streak:empty { display: none; }

/* ---------- treasure hunt */
.coords { position: absolute; left: 14px; top: 12px; font: 12px var(--mono); color: var(--muted); background: rgba(11, 13, 18, 0.8); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; pointer-events: none; }
.treasure-card { margin-top: 22px; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(255, 196, 0, 0.35); background: rgba(255, 196, 0, 0.06); }
.treasure-card h2 { margin: 0 0 6px; }
.treasure-card .muted { color: #ffd166; }
.treasure-mine { margin-top: 8px; color: var(--ok); font-weight: 600; font-size: 14px; }

/* ---------- profiles, comments, neighbours */
.b-owner, .neighbors { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.b-owner a, .neighbors a { color: var(--accent-2); text-decoration: none; }
.b-owner a:hover, .neighbors a:hover { text-decoration: underline; }
.comments h2 { margin-top: 18px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; max-height: 220px; overflow-y: auto; }
.comment-list li { word-break: break-word; }
.comment-form { display: flex; gap: 6px; }
.comment-form input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; }
.comment-form .btn { padding: 8px 12px; font-size: 13px; }
.profile-item { flex-direction: row; align-items: center; gap: 10px; }
.profile-item img { border-radius: 3px; flex-shrink: 0; }
.referral { margin-top: 18px; padding: 12px; border-radius: var(--radius); border: 1px solid rgba(46, 229, 157, 0.35); background: rgba(46, 229, 157, 0.06); }
.referral h2 { margin: 0 0 6px; }
.ref-row { display: flex; gap: 6px; margin: 8px 0; }
.ref-row input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: 13px var(--mono); }
.my-profile { margin-top: 10px; }
.credit-note { color: var(--ok); }
.chat-admin .sub { display: block; margin-top: 14px; }
.ref-row { flex-direction: column; }
.ref-row .btn { padding: 8px 10px; font-size: 13px; }

/* ---------- heat map, night, photo */
.icon-btn.active { border-color: var(--accent); background: rgba(124, 92, 255, 0.25); }
.photo-pop { position: absolute; right: 60px; bottom: 14px; z-index: 4; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: rgba(17, 20, 28, 0.97); border: 1px solid var(--line); }
.photo-pop .btn { font-size: 13px; padding: 8px 12px; text-align: left; }
.heat-legend { position: absolute; right: 60px; top: 12px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); background: rgba(11, 13, 18, 0.85); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.heat-legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(41,120,255,0.8), #ffd000, #ff2a00); }
@media (max-height: 760px) { .zoom-controls { flex-direction: row; flex-wrap: wrap-reverse; justify-content: flex-end; max-width: 170px; } }

/* ---------- PixelDle & promo */
.dle-card { margin-top: 22px; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(124, 92, 255, 0.45); background: rgba(124, 92, 255, 0.08); }
.dle-card h2 { margin: 0 0 6px; }
.dle-frame { display: grid; place-items: center; padding: 14px; margin: 12px 0; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.dle-frame img { width: 192px; height: 192px; border-radius: 6px; }
.dle-tries { text-align: center; font-size: 22px; letter-spacing: 4px; margin-bottom: 12px; }
.promo-row { display: flex; gap: 6px; }
.promo-row input { flex: 1; min-width: 0; text-transform: uppercase; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 400; }
.promo-row .btn { padding: 8px 12px; font-size: 13px; }
.promo-status { color: var(--ok); margin: -6px 0 10px; }
.promo-admin summary { cursor: pointer; font-weight: 600; }
.promo-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; width: 100%; }
.promo-form input, .promo-form select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13px; }
.promo-form input[type="number"] { width: 80px; }

/* ---------- stats & about */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 18px 0; }
.stat-card { padding: 16px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.stat-value { font: 700 26px var(--mono); letter-spacing: -0.02em; margin-bottom: 4px; }
.big-progress { height: 10px; margin-top: 14px; }
.doc h3 { font-size: 15px; margin: 18px 0 4px; }
.embed-code { width: 100%; resize: none; background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: 12px/1.4 var(--mono); }
.doc-page .top-actions .btn { text-decoration: none; }
.analytics { width: 100%; overflow-x: auto; margin-top: 10px; }
.an-table { border-collapse: collapse; font-size: 13px; font-family: var(--mono); }
.an-table th, .an-table td { padding: 4px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.an-table th:first-child, .an-table td:first-child { text-align: left; }
.stat-card:last-child .stat-value { font-size: 20px; white-space: nowrap; }

/* ---------- Pixie & sound */
.pixie-bubble {
  position: absolute; z-index: 4; max-width: 230px; padding: 10px 12px; border-radius: 12px; font-size: 13px;
  background: #fff; color: #0b0d12; box-shadow: 0 8px 24px rgba(0,0,0,0.45); pointer-events: none;
}
.sound-btn { width: 34px; height: 34px; font-size: 15px; }
@media (max-width: 820px) { .sound-btn { display: none; } }

/* ---------- weekend events & theme poll */
.event-card { margin-top: 22px; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(255, 43, 214, 0.5); background: rgba(255, 43, 214, 0.08); }
.event-card h2 { margin: 0 0 6px; }
.event-card .muted { color: #ff8ae8; }
.poll-card { margin-top: 22px; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(46, 229, 157, 0.4); background: rgba(46, 229, 157, 0.06); }
.poll-card h2 { margin: 0 0 6px; }
.poll-options { display: grid; gap: 6px; margin: 10px 0 8px; }
.poll-opt { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.poll-opt:hover { border-color: rgba(46, 229, 157, 0.7); }
.poll-opt.mine { border-color: var(--ok); }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; background: rgba(46, 229, 157, 0.18); pointer-events: none; transition: width .3s; }
.poll-opt span { position: relative; }
.poll-opt .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.o-notify { display: block; box-sizing: border-box; margin-top: 10px; text-decoration: none; text-align: center; }
.o-notify-on { margin-top: 10px; color: var(--ok); }

/* ---------- New Year: advent calendar, countdown */
.advent-card { margin-top: 22px; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(46, 229, 157, 0.45); background: linear-gradient(135deg, rgba(196, 30, 58, 0.12), rgba(11, 102, 35, 0.14)); }
.advent-card h2 { margin: 0 0 8px; }
.advent-task { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 600; }
.advent-swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #fff; flex: none; }
.advent-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 10px 0 6px; }
.advent-grid span { aspect-ratio: 1; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; font-size: 10px; color: var(--muted); }
.advent-grid span.got { border-color: transparent; color: rgba(0, 0, 0, 0.55); font-weight: 700; }
.advent-grid span.today { outline: 2px solid #fff; outline-offset: 1px; }
.countdown { border: 1px solid rgba(255, 209, 102, 0.5); background: rgba(255, 209, 102, 0.1); color: #ffd166; border-radius: 999px; padding: 4px 10px; font: 600 13px/1.2 inherit; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.countdown:hover { background: rgba(255, 209, 102, 0.2); }
.swatch.advent { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6); }

/* ---------- gifts, pools */
.gift-card { margin-top: 22px; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(255, 119, 168, 0.45); background: rgba(255, 119, 168, 0.07); }
.gift-card h2 { margin: 0 0 6px; }
.gift-card .share-row { margin-top: 10px; }
.gift-sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.gift-size { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.gift-size b { font-size: 17px; }
.gift-size span { color: var(--muted); font-size: 13px; }
.gift-size.active { border-color: #ff77a8; box-shadow: 0 0 0 1px #ff77a8; }
.gift-letter { margin: 12px 0; padding: 16px; border-radius: var(--radius); border: 1px dashed rgba(255, 119, 168, 0.6); background: rgba(255, 119, 168, 0.06); text-align: center; }
.gift-big { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.gift-letter blockquote { margin: 10px 0; font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
.gift-code { margin: 10px 0; font: 700 20px/1.2 ui-monospace, monospace; letter-spacing: 2px; color: #ffd166; }
.pool-sum { font-weight: 600; margin: 8px 0 12px; }
.pool-usd { align-self: center; }
.pool-chips { margin-top: 14px; }
.pool-chips li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
#pool-chip h3 { margin: 18px 0 8px; font-size: 15px; }
#pu-link { margin: 6px 0; }
.install-btn { margin-top: 14px; }

/* ---------- leaderboard */
.leaders-card { margin-top: 22px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.leaders-card h2 { margin: 0 0 8px; }
.leaders-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.leaders-cols h3 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.leaders-cols ol { margin: 0; padding-left: 20px; font-size: 14px; }
.leaders-cols li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders-cols li.me { color: var(--ok); font-weight: 700; }
.leaders-cols li span { color: var(--muted); }
.leaders-nick { margin-top: 8px; }
