:root {
  --black:      #050507;
  --ink:        #0a0a0f;
  --ink-deep:   #060608;
  --surface:    #13141b;
  --surface-2:  #1a1b24;
  --surface-3:  #24262f;
  --line:       rgba(255,255,255,0.07);
  --line-soft:  rgba(255,255,255,0.045);

  --blood:      #e11d29;
  --blood-soft: #ff3846;
  --blood-deep: #a50d18;
  --blood-glow: rgba(225,29,41,0.32);

  --amber:      #ff8a3d;
  --blurple:    #5865f2;
  --blurple-2:  #6f7bf6;

  --ivory:      #f5f3ef;
  --bone:       #cdc9c0;
  --ash:        #8a8882;
  --green:      #2fcf6e;
  --green-soft: #56e08d;

  --shadow-sm:  0 6px 22px rgba(0,0,0,0.4);
  --shadow:     0 18px 48px rgba(0,0,0,0.5);
  --shadow-lg:  0 34px 78px rgba(0,0,0,0.62);

  --grad-blood:  linear-gradient(135deg, #ff3846 0%, #e11d29 55%, #a50d18 100%);

  --font-display: 'Teko', 'Oswald', 'Impact', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --shell: 760px;
  --nav-h: 66px;
}

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

html { scroll-behavior: smooth; background: var(--ink); color-scheme: dark; }
body {
  font-family: var(--font-body);
  background: transparent;
  color: var(--ivory);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  background: var(--surface-3); padding: 1px 6px; border-radius: 5px;
  font-size: 0.85em; color: var(--blood-soft);
}
.hidden { display: none !important; }
.muted { color: var(--ash); }
.small { font-size: 12px; }

::selection { background: var(--blood); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--blood-deep); }

.fx-bg { position: fixed; inset: 0; z-index: -5; background: var(--ink); overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.62; }
.orb-blood {
  width: 560px; height: 560px; top: -180px; left: -140px;
  background: radial-gradient(circle, rgba(225,29,41,0.24), transparent 62%);
  animation: float1 22s var(--ease) infinite alternate;
}
.orb-blood2 {
  width: 480px; height: 480px; bottom: -160px; right: -120px;
  background: radial-gradient(circle, rgba(165,13,24,0.22), transparent 62%);
  animation: float2 26s var(--ease) infinite alternate;
}
.grid-veil {
  position: absolute; inset: 0; opacity: 0.4;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}
@keyframes float1 { to { transform: translate(80px, 60px) scale(1.12); } }
@keyframes float2 { to { transform: translate(-70px, -50px) scale(1.1); } }

.fx-logo { display: none; }
.fx-bg::after {
  content: "";
  position: absolute; top: 48%; left: 50%;
  width: 82vmin; height: 82vmin; max-width: 900px; max-height: 900px;
  transform: translate(-50%, -50%) rotate(-14deg);
  background: url("/logo.png") center / contain no-repeat;
  opacity: 0.11;
  pointer-events: none;
  animation: fxLogoDrift 38s var(--ease) infinite alternate;
}
@keyframes fxLogoDrift {
  from { transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
  to   { transform: translate(-50%, -53%) rotate(-9deg) scale(1.07); }
}

.embers { position: absolute; inset: 0; }
.embers span {
  position: absolute; bottom: -12px; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,110,85,0.9); box-shadow: 0 0 13px rgba(255,70,45,0.85);
  animation: rise linear infinite;
}
.embers span:nth-child(odd) { background: rgba(255,165,135,0.85); box-shadow: 0 0 13px rgba(255,105,70,0.75); }
.embers span:nth-child(3n)  { width: 4px; height: 4px; background: rgba(255,238,230,0.8); box-shadow: 0 0 12px rgba(255,205,195,0.6); }
.embers span:nth-child(1)  { left: 6%;  animation-duration: 13s; animation-delay: 0s; }
.embers span:nth-child(2)  { left: 14%; animation-duration: 17s; animation-delay: 2s; }
.embers span:nth-child(3)  { left: 22%; animation-duration: 11s; animation-delay: 4s; }
.embers span:nth-child(4)  { left: 31%; animation-duration: 19s; animation-delay: 1s; }
.embers span:nth-child(5)  { left: 39%; animation-duration: 14s; animation-delay: 6s; }
.embers span:nth-child(6)  { left: 47%; animation-duration: 16s; animation-delay: 3s; }
.embers span:nth-child(7)  { left: 55%; animation-duration: 12s; animation-delay: 5s; }
.embers span:nth-child(8)  { left: 63%; animation-duration: 18s; animation-delay: 0s; }
.embers span:nth-child(9)  { left: 71%; animation-duration: 15s; animation-delay: 7s; }
.embers span:nth-child(10) { left: 79%; animation-duration: 13s; animation-delay: 2s; }
.embers span:nth-child(11) { left: 86%; animation-duration: 20s; animation-delay: 4s; }
.embers span:nth-child(12) { left: 92%; animation-duration: 12s; animation-delay: 6s; }
.embers span:nth-child(13) { left: 50%; animation-duration: 21s; animation-delay: 8s; }
.embers span:nth-child(14) { left: 27%; animation-duration: 16s; animation-delay: 9s; }
.embers span:nth-child(15) { left: 10%; animation-duration: 15s; animation-delay: 5s; }
.embers span:nth-child(16) { left: 35%; animation-duration: 18s; animation-delay: 1s; }
.embers span:nth-child(17) { left: 58%; animation-duration: 13s; animation-delay: 7s; }
.embers span:nth-child(18) { left: 67%; animation-duration: 17s; animation-delay: 3s; }
.embers span:nth-child(19) { left: 83%; animation-duration: 14s; animation-delay: 6s; }
.embers span:nth-child(20) { left: 95%; animation-duration: 19s; animation-delay: 2s; }
@keyframes rise {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(-104vh) scale(0.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .embers span, .fx-logo { animation: none; }
}

.glass {
  background: linear-gradient(180deg, rgba(26,27,36,0.82), rgba(15,16,22,0.86));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: rgba(6,6,8,0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { height: 44px; width: auto; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.brand-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--bone); padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}

.user-box { display: flex; align-items: center; gap: 10px; }
.nick-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-size: 13px; font-weight: 600; }
.user-nick { font-size: 11px; color: #ff8a90; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.2px;
  border: 1px solid transparent; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn-icon { padding: 0 14px; }
.btn-icon svg { fill: none; }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--bone); }
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(225,29,41,0.4); color: var(--ivory); }

.btn-discord { background: var(--blurple); color: #fff; box-shadow: 0 12px 28px -12px rgba(88,101,242,0.7); }
.btn-discord:hover { background: var(--blurple-2); transform: translateY(-2px); }
.btn-discord .dico { width: 22px; height: 17px; fill: currentColor; stroke: none; }

.btn-primary { background: var(--grad-blood); color: #fff; font-weight: 700; box-shadow: 0 10px 24px -12px var(--blood-glow); }
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }

.btn-send {
  width: 42px; height: 42px; padding: 0; border-radius: 11px; flex: 0 0 auto;
  background: var(--grad-blood); color: #fff;
  box-shadow: 0 10px 22px -10px var(--blood-glow);
}
.btn-send svg { fill: currentColor; stroke: none; width: 19px; height: 19px; }
.btn-send:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-send:disabled { opacity: 0.5; cursor: default; transform: none; filter: none; }

.container {
  width: 100%; max-width: var(--shell); margin: 0 auto; flex: 1;
  padding: 30px 20px 60px;
}
.view { animation: fadeUp .4s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero {
  border-radius: 22px; padding: 40px 40px 38px; text-align: center;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
  margin-top: 24px;
}
.hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-blood); opacity: 0.9;
}
.hero-logo { width: 124px; height: auto; margin: 0 auto 6px; display: block; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.55)); }
.hero-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(42px, 8vw, 60px); line-height: 0.92; letter-spacing: 1px;
  margin: 6px 0 16px; text-transform: uppercase;
}
.grad { background: var(--grad-blood); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { color: var(--bone); font-size: 16px; line-height: 1.6; max-width: 460px; margin: 0 auto 28px; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--ash); }

.triangle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.tri-node {
  font-size: 13px; font-weight: 600; letter-spacing: 0.3px; color: var(--bone);
  padding: 8px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
}
.tri-link { width: 28px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--blood-deep), var(--blood-soft)); opacity: 0.7; }

.view-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 14px;
}
.view-head-l { display: flex; align-items: center; gap: 12px; }
.view-title {
  font-family: var(--font-display); font-weight: 600; font-size: 34px;
  letter-spacing: 1px; text-transform: uppercase; line-height: 1;
}
.count-pill {
  font-size: 13px; font-weight: 700; color: var(--blood-soft);
  padding: 3px 11px; border-radius: 999px;
  background: rgba(225,29,41,0.12); border: 1px solid rgba(225,29,41,0.28);
}

.ticket-list { display: flex; flex-direction: column; gap: 11px; }
.ticket-card {
  display: flex; align-items: center; gap: 15px;
  padding: 15px 18px; border-radius: 15px; cursor: pointer;
  background: linear-gradient(180deg, rgba(26,27,36,0.7), rgba(15,16,22,0.78));
  border: 1px solid var(--line);
  transition: transform .16s var(--ease), border-color .2s, box-shadow .2s, background .2s;
  position: relative; overflow: hidden;
}
.ticket-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-blood); opacity: 0; transition: opacity .2s;
}
.ticket-card:hover {
  transform: translateY(-2px); border-color: rgba(225,29,41,0.35);
  box-shadow: var(--shadow-sm); background: linear-gradient(180deg, rgba(32,33,44,0.8), rgba(18,19,26,0.85));
}
.ticket-card:hover::before { opacity: 1; }
.tc-emoji {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 12px; font-size: 22px;
  background: var(--surface-3); border: 1px solid var(--line);
}
.tc-main { flex: 1; min-width: 0; }
.tc-title { font-size: 15px; font-weight: 600; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-sub { font-size: 12.5px; color: var(--ash); margin-top: 3px; }

.featured-card {
  position: relative; cursor: pointer; overflow: hidden;
  border-radius: 18px; padding: 20px; margin-bottom: 22px;
  background: linear-gradient(160deg, rgba(46,20,24,0.85), rgba(18,14,18,0.92));
  border: 1px solid rgba(225,29,41,0.32);
  box-shadow: var(--shadow); transition: transform .16s var(--ease), box-shadow .2s;
}
.featured-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad-blood); }
.featured-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.featured-card.closed { border-color: var(--line); background: linear-gradient(160deg, rgba(26,27,36,0.85), rgba(15,16,22,0.92)); }
.featured-card.closed::before { background: var(--ash); opacity: 0.5; }
.featured-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.featured-label { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--blood-soft); }
.featured-card.closed .featured-label { color: var(--ash); }
.featured-main { display: flex; align-items: center; gap: 16px; }
.featured-emoji { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 14px; font-size: 30px; background: var(--surface-3); border: 1px solid var(--line); flex: 0 0 auto; }
.featured-info { min-width: 0; }
.featured-title { font-family: var(--font-display); font-size: 27px; font-weight: 600; letter-spacing: 0.5px; line-height: 1; }
.featured-sub { font-size: 13px; color: var(--ash); margin-top: 6px; }
.featured-cta { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; color: var(--blood-soft); }
.featured-card.closed .featured-cta { color: var(--bone); }

.cat-group { margin-bottom: 16px; }
.cat-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 4px; background: transparent; border: none; cursor: pointer;
  border-bottom: 1px solid var(--line); margin-bottom: 11px;
}
.cat-head-l { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cat-emoji { font-size: 16px; flex: 0 0 auto; }
.cat-name { font-size: 13px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--bone); }
.cat-head-text { display: flex; flex-direction: column; min-width: 0; }
.cat-sub { font-size: 11px; color: var(--ash); font-weight: 500; letter-spacing: 0; text-transform: none; margin-top: 2px; }
.cat-head-r { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.cat-count { font-size: 12px; font-weight: 700; color: var(--blood-soft); background: rgba(225,29,41,0.12); border: 1px solid rgba(225,29,41,0.25); padding: 2px 9px; border-radius: 999px; }
.cat-chevron { width: 18px; height: 18px; fill: none; stroke: var(--ash); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.cat-group.collapsed .cat-chevron { transform: rotate(-90deg); }
.cat-body { display: flex; flex-direction: column; gap: 11px; }
.cat-group.collapsed .cat-body { display: none; }
.muted-group .cat-name, .muted-group .cat-emoji { color: var(--ash); opacity: 0.85; }
.muted-group .cat-count { color: var(--ash); background: rgba(138,136,130,0.12); border-color: rgba(138,136,130,0.22); }
.muted-group .cat-body { opacity: 0.72; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.open    { color: #6ea8ff; background: rgba(110,168,255,0.12); border: 1px solid rgba(110,168,255,0.28); }
.badge.claimed { color: var(--amber); background: rgba(255,138,61,0.12); border: 1px solid rgba(255,138,61,0.3); }
.badge.closed  { color: var(--ash); background: rgba(138,136,130,0.12); border: 1px solid rgba(138,136,130,0.25); }

.empty {
  text-align: center; padding: 60px 20px; border-radius: 18px;
  border: 1px dashed var(--line); background: rgba(19,20,27,0.4);
}
.empty-ico { font-size: 44px; margin-bottom: 12px; opacity: 0.7; }
.empty p { font-size: 16px; font-weight: 600; margin-bottom: 6px; }

.ticket-head { align-items: center; }
.ticket-title { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; min-width: 0; }
.ticket-title > span:first-child { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.module-box {
  position: relative; padding: 14px 16px 14px 20px; margin-bottom: 18px;
  border-radius: 12px; font-size: 14px; line-height: 1.55; color: var(--bone);
  background: rgba(225,29,41,0.05); border: 1px solid rgba(225,29,41,0.16);
  white-space: pre-wrap;
}
.module-box::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--grad-blood);
}

.chat {
  display: flex; flex-direction: column; gap: 4px;
  min-height: 280px; max-height: 56vh; overflow-y: auto;
  padding: 18px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(10,10,15,0.5), rgba(8,8,11,0.6));
  border: 1px solid var(--line);
}
.day-sep { text-align: center; margin: 14px 0 8px; }
.day-sep span {
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--ash); background: var(--surface); padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line);
}
.msg { display: flex; gap: 10px; padding: 6px 0; max-width: 86%; animation: msgIn .25s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--surface-3); margin-top: 2px; }
.msg-body { min-width: 0; }
.msg-meta { font-size: 11.5px; color: var(--ash); margin-bottom: 3px; padding-left: 2px; }
.msg-author { font-weight: 600; color: var(--bone); }
.msg-author.staff { color: var(--blood-soft); }
.bubble {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 9px 13px; border-radius: 4px 13px 13px 13px;
  font-size: 14px; line-height: 1.5; color: var(--ivory);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.bubble img { display: block; max-width: min(340px, 100%); max-height: 340px; width: auto; height: auto; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line); cursor: zoom-in; object-fit: contain; }
.bubble-img-link { display: inline-block; max-width: 100%; }
.bubble .att-link, .bubble .att-fallback { display: inline-block; margin-top: 6px; color: var(--blood-soft); text-decoration: underline; font-size: 13.5px; }
.msg.self .bubble .att-link, .msg.self .bubble .att-fallback { color: #fff; }
.bubble-text { display: block; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble a { color: var(--blood-soft); text-decoration: underline; }

.msg.staff .bubble { border-color: rgba(225,29,41,0.28); border-left: 3px solid var(--blood); background: rgba(225,29,41,0.05); }
.msg.self { flex-direction: row-reverse; margin-left: auto; }
.msg.self .msg-meta { text-align: right; padding-right: 2px; }
.msg.self .bubble {
  background: var(--grad-blood); border-color: transparent; color: #fff;
  border-radius: 13px 4px 13px 13px; border-left: none;
}
.msg.self .bubble a { color: #fff; }

.reply-bar {
  display: flex; align-items: flex-end; gap: 10px;
  margin-top: 14px; padding: 9px; border-radius: 15px;
  box-shadow: var(--shadow-sm);
}
.reply-bar textarea {
  flex: 1; resize: none; max-height: 140px;
  background: transparent; border: none; outline: none;
  color: var(--ivory); font-family: inherit; font-size: 16px; line-height: 1.45;
  padding: 10px 8px;
}
.reply-bar textarea::placeholder { color: var(--ash); }

.closed-note {
  margin-top: 14px; padding: 14px 18px; border-radius: 13px; text-align: center;
  font-size: 14px; color: var(--bone);
  background: var(--surface); border: 1px solid var(--line);
}
.closed-note a { color: var(--blood-soft); font-weight: 600; text-decoration: underline; margin-left: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--ivory);
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: var(--shadow); animation: toastIn .3s var(--ease);
}
.toast.err { border-color: rgba(225,29,41,0.5); background: rgba(40,12,14,0.95); color: #ffd9dc; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

.site-foot {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap;
  padding: 22px 20px; font-size: 12.5px; color: var(--ash);
  border-top: 1px solid var(--line-soft);
}
.foot-brand { font-weight: 600; color: var(--bone); }
.foot-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-links a, .foot-link-btn { color: var(--ash); font-size: 12.5px; transition: color .2s; }
.foot-links a:hover, .foot-link-btn:hover { color: var(--blood-soft); }
.foot-link-btn { font-family: inherit; }

.skeleton {
  height: 76px; border-radius: 15px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(26,27,36,0.6) 30%, rgba(40,42,54,0.7) 50%, rgba(26,27,36,0.6) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.cookie-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(4,4,7,0.5); backdrop-filter: blur(2px);
}
.cookie-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 96; width: calc(100% - 32px); max-width: 540px;
  border-radius: 18px; padding: 22px; box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, rgba(24,25,33,0.98), rgba(13,14,19,0.99));
  border: 1px solid var(--line); border-top: 3px solid var(--blood);
  animation: bannerIn .35s var(--ease);
}
.cookie-banner.expanded { max-width: 600px; max-height: 86vh; overflow-y: auto; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.cookie-h {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 10px;
}
.cookie-banner p { font-size: 13.5px; line-height: 1.6; color: var(--bone); }
.cookie-banner a { color: var(--blood-soft); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.cookie-actions .btn { flex: 1; min-width: 120px; }
.cookie-cats { list-style: none; margin: 16px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.cookie-cat { padding: 13px 15px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.cookie-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cookie-cat-name { font-weight: 600; font-size: 14px; }
.cookie-cat-desc { font-size: 12px; color: var(--ash); margin-top: 6px; line-height: 1.5; }
.cookie-prefs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cookie-close { width: 30px; height: 30px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--bone); font-size: 18px; }
.cookie-close:hover { border-color: rgba(225,29,41,0.4); color: var(--ivory); }

.cookie-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.cookie-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cookie-track { width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); position: relative; transition: background .2s; flex: 0 0 auto; }
.cookie-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bone); transition: transform .2s, background .2s; }
.cookie-switch input:checked + .cookie-track { background: var(--blood); border-color: transparent; }
.cookie-switch input:checked + .cookie-track .cookie-thumb { transform: translateX(18px); background: #fff; }
.cookie-switch input:disabled + .cookie-track { opacity: 0.6; }
.cookie-sw-label { font-size: 11px; color: var(--ash); min-width: 70px; }

.legal {
  width: 100%; max-width: 820px; margin: 0 auto; flex: 1;
  padding: 40px 22px 70px;
}
.legal-back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ash); margin-bottom: 22px; }
.legal-back:hover { color: var(--blood-soft); }
.legal h1 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 6vw, 46px);
  letter-spacing: 1px; text-transform: uppercase; line-height: 1; margin-bottom: 6px;
}
.legal .updated { font-size: 12.5px; color: var(--ash); margin-bottom: 28px; }
.legal h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: 0.5px;
  text-transform: uppercase; margin: 30px 0 12px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.legal h2::before { content: ""; width: 8px; height: 20px; border-radius: 3px; background: var(--grad-blood); flex: 0 0 auto; }
.legal h3 { font-size: 16px; font-weight: 600; margin: 18px 0 8px; color: var(--ivory); }
.legal p, .legal li { font-size: 14.5px; line-height: 1.7; color: var(--bone); }
.legal p { margin-bottom: 12px; }
.legal ul { margin: 0 0 14px 22px; display: flex; flex-direction: column; gap: 6px; }
.legal a { color: var(--blood-soft); text-decoration: underline; }
.legal strong { color: var(--ivory); }
.legal .box {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--blood);
  border-radius: 12px; padding: 16px 18px; margin: 16px 0;
}
.legal table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--ivory); font-weight: 600; background: var(--surface); }
.legal td { color: var(--bone); }

.admin-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: rgba(4,4,7,0.74); backdrop-filter: blur(6px);
  animation: fadeUp .25s var(--ease);
}
.admin-modal {
  width: 100%; max-width: 720px; max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  border-radius: 20px; box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, rgba(22,23,31,0.96), rgba(13,14,19,0.98));
  border: 1px solid var(--line);
}
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.admin-head h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  letter-spacing: 1px; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.admin-head h2::before {
  content: ""; width: 9px; height: 22px; border-radius: 3px; background: var(--grad-blood);
}
#adminBody { padding: 20px 22px; overflow-y: auto; }

.admin-filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-filters select, .admin-filters input {
  height: 38px; padding: 0 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ivory);
  font-family: inherit; font-size: 14px; outline: none;
}
.admin-filters input { flex: 1; min-width: 150px; }
.admin-filters select:focus, .admin-filters input:focus { border-color: rgba(225,29,41,0.45); }

.admin-filters select {
  color-scheme: dark;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8882' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.admin-filters select option {
  background: #16171f;
  color: var(--ivory);
}

.twofa { text-align: center; padding: 8px 0; }
.twofa h3 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.twofa .qr { width: 188px; height: 188px; border-radius: 14px; margin: 18px auto; display: block; border: 4px solid #fff; background: #fff; }
.twofa-row { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.twofa-row input {
  width: 150px; height: 46px; text-align: center; letter-spacing: 8px;
  font-size: 20px; font-weight: 700; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ivory); outline: none;
}
.twofa-row input:focus { border-color: var(--blood); box-shadow: 0 0 0 3px var(--blood-glow); }
.err-text { color: var(--blood-soft); font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 500; }

#adminTicket .ticket-title { justify-content: flex-start; }
#aChat { max-height: 46vh; }

.admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-tab {
  padding: 9px 16px; font-size: 14px; font-weight: 600; color: var(--ash);
  border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; transition: color .2s, border-color .2s;
}
.admin-tab:hover { color: var(--ivory); }
.admin-tab.active { color: var(--blood-soft); border-bottom-color: var(--blood); }

.stats-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.stats-table th, .stats-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.stats-table th { color: var(--ivory); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.stats-table td { color: var(--bone); }
.stats-table tbody tr:hover { background: var(--surface); }
.stats-table .st-name { color: var(--ivory); font-weight: 600; }
.r-good { color: var(--green-soft); font-weight: 700; }
.r-mid { color: var(--amber); font-weight: 700; }
.r-low { color: var(--blood-soft); font-weight: 700; }

.admin-empty { text-align: center; padding: 42px 20px; }
.admin-empty-ico { font-size: 38px; opacity: 0.55; margin-bottom: 12px; }
.admin-empty p { font-size: 14.5px; color: var(--bone); margin-bottom: 18px; }
.admin-empty strong { color: var(--ivory); }
.admin-searchbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  font-size: 13px; flex-wrap: wrap;
}

@media (max-width: 600px) {
  /* iOS non zooma piu' sui campi di testo (font >= 16px) */
  input, textarea, select { font-size: 16px !important; }

  .topbar { padding: 0 12px; }
  .brand-logo { height: 34px; }
  .brand-tag { display: none; }
  .user-box { gap: 7px; }
  .nick-chip { padding: 4px 9px 4px 4px; gap: 7px; }
  .user-name { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-nick { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .container { padding: 20px 12px 48px; }
  .hero { padding: 32px 20px 28px; }
  .view-title { font-size: 28px; }

  .chat { max-height: 52vh; padding: 14px; }
  .msg { max-width: 96%; }
  .bubble img { max-width: 100%; max-height: 280px; }
  .reply-bar { padding: 7px; }

  .btn-icon span { display: none; }
  .btn-icon { padding: 0 12px; }
  .cookie-actions .btn { min-width: 100%; }
  .admin-modal { max-height: 92vh; }
}
