/* NoxBot · web de la comunidad. Noche + oro luna, mobile-first. */
:root {
  --ground: #f2f3f5;
  --surface: #ffffff;
  --raised: #f5f6f8;
  --line: #e1e3e8;
  --line-strong: #c9cdd4;
  --text: #15171b;
  --muted: #62676f;
  --faint: #8d919b;
  --accent: #9a6614;
  --accent-soft: #f3e6cc;
  --on-accent: #ffffff;
  --ok: #1d8656;
  --ng: #c2442d;
  --ng-soft: #f8e0da;
  --stage: #1a1d22;
  --tone: rgba(21, 23, 27, 0.06);
  --shadow: 0 10px 30px rgba(20, 22, 26, 0.12);
  --shade: linear-gradient(180deg, rgba(8, 9, 11, 0) 42%, rgba(8, 9, 11, 0.88));

  --font-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --nav-h: 64px;
  --side-w: 236px;
  --content-w: 1160px;
  --gutter: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1013;
    --surface: #15181c;
    --raised: #1b1f24;
    --line: #262a31;
    --line-strong: #353a43;
    --text: #ece8e1;
    --muted: #9a9ea6;
    --faint: #6f747d;
    --accent: #e8b865;
    --accent-soft: #2c2519;
    --on-accent: #17120a;
    --ok: #6cc79a;
    --ng: #ef7d6b;
    --ng-soft: #2d1a17;
    --stage: #08090b;
    --tone: rgba(236, 232, 225, 0.06);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.link { color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Estructura ---------- */

.app { min-height: 100dvh; }
.main { min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 8px; min-height: 56px; max-width: var(--content-w); margin: 0 auto; }
.topbar__title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar__title h1 {
  font: 700 20px/1.2 var(--font-display); letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  transition: opacity .2s, transform .2s;
}
.topbar.title-collapse:not(.show-title) .topbar__title h1 { opacity: 0; transform: translateY(4px); pointer-events: none; }
.topbar__back { margin-left: -8px; flex: none; }
.topbar__actions { display: flex; align-items: center; gap: 6px; flex: none; }
.kanji { font-family: var(--font-display); color: var(--accent); font-size: 13px; letter-spacing: 0.18em; white-space: nowrap; }

.view {
  max-width: var(--content-w); margin: 0 auto;
  padding: 8px var(--gutter) calc(var(--nav-h) + var(--safe-b) + 32px);
}
.stack { display: grid; gap: 24px; min-width: 0; }
.stack--tight { display: grid; gap: 12px; min-width: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 11px; letter-spacing: 0.02em;
}
.tab svg { width: 23px; height: 23px; }
.tab.is-active { color: var(--text); }
.tab.is-active::before {
  content: ""; position: absolute; top: 0; width: 22px; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent);
}
.brand { display: none; }
.tab__kanji, .nav-actions { display: none; }

@media (min-width: 700px) {
  :root { --gutter: 24px; }
}

@media (min-width: 960px) {
  :root { --gutter: 36px; }
  /* Barra de navegación flotante estilo HUD de anime: cristal nocturno, trama de manga, kanji gigante detrás de cada sección */
  .app { display: block; }
  .tabbar {
    position: sticky; top: 12px; z-index: 40;
    width: calc(min(var(--content-w), 100vw) - 2 * var(--gutter)); height: 66px; margin: 12px auto 0;
    display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px;
    color: #ece8e1; border: 1px solid rgba(232, 184, 101, .26); border-radius: 22px; isolation: isolate; overflow: hidden;
    background:
      radial-gradient(38% 180% at 50% 130%, rgba(232, 184, 101, .20), transparent 70%),
      radial-gradient(30% 140% at 0% 0%, rgba(63, 169, 184, .16), transparent 70%),
      radial-gradient(26% 140% at 100% 0%, rgba(224, 119, 95, .14), transparent 70%),
      linear-gradient(180deg, rgba(22, 25, 32, .94), rgba(11, 13, 17, .92));
    -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  /* Trama de puntos de manga que se desvanece hacia el centro */
  .tabbar::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(rgba(232, 184, 101, .22) 1px, transparent 1.3px);
    background-size: 7px 7px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 28%, transparent 72%, #000 100%);
    mask-image: linear-gradient(90deg, #000 0%, transparent 28%, transparent 72%, #000 100%);
    opacity: .7;
  }
  /* Destello dorado que recorre el borde de arriba */
  .tabbar::after {
    content: ""; position: absolute; top: 0; left: -30%; width: 30%; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 226, 173, .9), transparent);
    animation: nav-shine 7s ease-in-out infinite;
  }
  @keyframes nav-shine { 0%, 15% { left: -30%; } 55%, 100% { left: 100%; } }

  .brand { position: relative; display: flex; align-items: center; gap: 12px; margin-right: auto; padding: 0 6px 0 2px; }
  .brand img { width: 40px; height: 40px; border-radius: 12px; filter: drop-shadow(0 0 12px rgba(232, 184, 101, .55)); }
  .brand__text { display: grid; gap: 3px; }
  .brand b { font: 800 22px/1 var(--font-display); color: #f7f1e6; letter-spacing: .01em; }
  .brand__kana { font: 600 9.5px/1 var(--font-display); letter-spacing: .38em; color: #e8b865; opacity: .85; white-space: nowrap; }
  .brand__seal {
    position: absolute; left: 28px; top: -3px; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 5px;
    transform: rotate(-10deg); background: #c8352b; color: #fff4ea; font: 700 11px/1 var(--font-display);
    box-shadow: inset 0 0 0 1.5px rgba(255, 240, 225, .4), 0 3px 10px rgba(200, 53, 43, .45);
  }

  .tab {
    flex: none; height: 46px; flex-direction: row; justify-content: center; gap: 8px; padding: 0 18px;
    border-radius: 15px; font-size: 14.5px; font-weight: 500; color: #b8b3aa; overflow: hidden; isolation: isolate;
    transition: color .25s, background .25s, box-shadow .25s;
  }
  .tab span:not(.tab__kanji) { position: relative; z-index: 1; }
  .tab svg { position: relative; z-index: 1; width: 18px; height: 18px; opacity: .85; transition: transform .25s; }
  /* Kanji gigante detrás del nombre */
  .tab__kanji {
    display: block; position: absolute; left: 50%; top: 50%; z-index: 0; transform: translate(-50%, -46%) scale(.7);
    font: 800 34px/1 var(--font-display); letter-spacing: 0; color: #e8b865; opacity: 0; white-space: nowrap; pointer-events: none;
    transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1);
  }
  .tab:hover { color: #f7f1e6; background: rgba(255, 255, 255, .05); }
  .tab:hover svg { transform: translateY(-1px) rotate(-6deg); }
  .tab:hover .tab__kanji { opacity: .13; transform: translate(-50%, -46%) scale(1); }
  .tab.is-active {
    color: #ffe3b0;
    background: linear-gradient(135deg, rgba(232, 184, 101, .26), rgba(232, 184, 101, .06) 60%, rgba(224, 119, 95, .10));
    box-shadow: inset 0 0 0 1px rgba(232, 184, 101, .5), 0 0 24px rgba(232, 184, 101, .22);
  }
  .tab.is-active svg { color: #e8b865; }
  .tab.is-active .tab__kanji { opacity: .2; transform: translate(-50%, -46%) scale(1.05); }
  .tab.is-active::before { display: none; }
  /* Destellos que parpadean en la sección activa */
  .tab.is-active::after {
    content: "✦"; position: absolute; right: 7px; top: 5px; z-index: 1; font-size: 9px; line-height: 1; color: #ffe3b0;
    text-shadow: 0 0 8px rgba(232, 184, 101, .95); animation: nav-twinkle 2.4s ease-in-out infinite;
  }
  @keyframes nav-twinkle { 0%, 100% { opacity: .25; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(90deg); } }

  .nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-left: 6px; }
  .nav-actions .icon-btn {
    width: 42px; height: 42px; border-radius: 14px; color: #f1ece3;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); transition: background .2s, border-color .2s;
  }
  .nav-actions .icon-btn:hover { background: rgba(232, 184, 101, .14); border-color: rgba(232, 184, 101, .4); }
  .nav-actions .avatar { width: 42px; height: 42px; padding: 2px; background: conic-gradient(from 210deg, #e8b865, #e0775f, #3fa9b8, #e8b865); }
  .topbar { position: static; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar .top-me { display: none; }
  .topbar__inner { min-height: 64px; max-width: calc(var(--content-w) - 2 * var(--gutter)); }
  .is-home .topbar { display: none; }
  .is-home .view { padding-top: 22px; }
  @media (prefers-reduced-motion: reduce) { .tabbar::after, .tab.is-active::after { animation: none; } }
  .view { padding-bottom: 56px; }
}

/* ---------- Controles ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer;
  font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn--discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn--discord:hover { background: #4752c4; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--tone); }
.icon-btn svg { width: 22px; height: 22px; }

.input {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search { position: relative; display: block; min-width: 0; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 42px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 12px; background: var(--tone); max-width: 420px; }
.segmented a, .segmented button {
  display: grid; place-items: center; height: 38px; border-radius: 9px; border: 0; background: none; color: var(--muted); font-weight: 500; cursor: pointer;
}
.segmented .is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

.toolbar { display: grid; gap: 12px; }
@media (min-width: 700px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .toolbar .chips { margin: 0; padding: 0; }
}

.toggle { display: flex; align-items: center; gap: 14px; padding: 14px 0; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle__text { flex: 1; display: grid; gap: 2px; }
.toggle__text small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.switch { position: relative; flex: none; width: 46px; height: 28px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--line-strong); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Tipografía y bloques ---------- */

.section-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.section-head h2 { font: 700 19px/1.3 var(--font-display); }
.section-head .more { margin-left: auto; color: var(--accent); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.section-head .more:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13.5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; min-width: 0; }
.card--flat { background: var(--raised); border-color: transparent; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px;
  background: var(--tone); color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--glass { background: rgba(10, 11, 13, .6); color: #f4efe6; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Inicio ---------- */

.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 24px 20px 22px; color: #f3eee5;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(232, 184, 101, .2), transparent 55%),
    linear-gradient(160deg, #1b1f27 0%, #0d0f13 100%);
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 70%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 18%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 58%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 84%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 44%, #fff4 50%, transparent 51%);
}
.hero__moon { position: absolute; right: -24px; top: -28px; width: 120px; height: 120px; z-index: -1; opacity: .42; filter: drop-shadow(0 0 24px rgba(232, 184, 101, .45)); }
.hero__kanji { font: 600 11.5px/1 var(--font-display); letter-spacing: .3em; color: #e8b865; }
.hero h1 { margin: 12px 0 8px; font: 800 clamp(26px, 7vw, 40px)/1.12 var(--font-display); max-width: 18ch; }
.hero p { color: #c7c2b9; max-width: 46ch; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 20px; }
.hero__stats b { display: block; font: 700 24px/1.1 var(--font-display); color: #fff; font-variant-numeric: tabular-nums; }
.hero__stats span { font-size: 12px; color: #a9a49b; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero .btn:not(.btn--accent):not(.btn--discord) { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #f3eee5; }
@media (min-width: 960px) {
  .hero { padding: 40px 44px 36px; }
  .hero__moon { width: 220px; height: 220px; right: 36px; top: 50%; transform: translateY(-50%); opacity: .75; }
}

.home-grid { display: grid; gap: 24px; min-width: 0; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(136px, 40%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 700px) {
  .rail { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); overflow: visible; margin: 0; padding: 0; gap: 16px; }
}

.submit-card { display: grid; gap: 14px; align-items: center; }
@media (min-width: 700px) { .submit-card { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---------- Tarjetas de personaje ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; } }

.ccard { position: relative; display: block; border-radius: 14px; overflow: hidden; background: var(--stage); aspect-ratio: 2 / 3; isolation: isolate; min-width: 0; }
.ccard img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s, transform .5s; }
.ccard img.is-in { opacity: 1; }
.ccard:hover img { transform: scale(1.04); }
.ccard::after { content: ""; position: absolute; inset: 0; background: var(--shade); pointer-events: none; }
.ccard__info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 10px 12px 12px; color: #f7f3ec; }
.ccard__name { font: 700 15px/1.2 var(--font-display); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.ccard__anime { margin-top: 3px; font-size: 11.5px; color: #d2ccc2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard__tags { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 1; display: flex; justify-content: space-between; gap: 6px; }

/* ---------- Animes ---------- */

.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.acard { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s; min-width: 0; }
.acard:hover { border-color: var(--line-strong); }
.acard__covers { position: relative; height: 104px; }
.acard__covers img { position: absolute; top: 4px; width: 62px; height: 93px; object-fit: cover; border-radius: 8px; border: 2px solid var(--surface); background: var(--stage); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.acard__covers img:nth-child(1) { left: 0; z-index: 3; }
.acard__covers img:nth-child(2) { left: 14px; z-index: 2; transform: rotate(5deg); }
.acard__covers img:nth-child(3) { left: 28px; z-index: 1; transform: rotate(10deg); }
.acard__covers img:only-child { left: 14px; }
.acard h3 { font: 700 16px/1.25 var(--font-display); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- Ficha de personaje ---------- */

.char { display: grid; gap: 18px; grid-template-areas: "title" "side" "body"; min-width: 0; }
.char__title { grid-area: title; display: grid; gap: 6px; justify-items: start; min-width: 0; }
.char__side { grid-area: side; min-width: 0; }
.char__body { grid-area: body; }
.char__title h1 { font: 800 clamp(28px, 7vw, 44px)/1.08 var(--font-display); overflow-wrap: anywhere; }
.char__title .anime { color: var(--accent); font-weight: 500; }
.char__title .anime:hover { text-decoration: underline; text-underline-offset: 3px; }
.char__title .meta-row { margin-top: 4px; }

@media (min-width: 700px) {
  .char {
    grid-template-columns: minmax(260px, min(400px, 38%)) minmax(0, 1fr);
    grid-template-areas: "side title" "side body";
    grid-template-rows: auto 1fr;
    column-gap: 40px; row-gap: 24px;
  }
  .char__side { position: sticky; top: 84px; align-self: start; }
  .char__title { padding-top: 8px; }
}

.viewer { position: relative; border-radius: 18px; overflow: hidden; background: var(--stage); aspect-ratio: 2 / 3; touch-action: pan-y; user-select: none; }
@media (max-width: 699px) { .viewer { max-height: 72vh; margin-inline: auto; } }
.viewer__track { display: flex; height: 100%; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.viewer__slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; }
.viewer__slide img { width: 100%; height: 100%; object-fit: contain; }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(10, 11, 13, .55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; }
.viewer:hover .viewer__nav, .viewer__nav:focus-visible { opacity: 1; }
.viewer__nav:hover { background: rgba(10, 11, 13, .8); }
.viewer__nav svg { width: 22px; height: 22px; }
.viewer__nav--prev { left: 10px; }
.viewer__nav--next { right: 10px; }
.viewer__top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.viewer__count { margin-left: auto; }
@media (hover: none) { .viewer__nav { display: none; } }

.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex: none; width: 50px; aspect-ratio: 2 / 3; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--stage); cursor: pointer; opacity: .55; transition: opacity .15s, border-color .15s; }
.thumbs button:hover { opacity: .85; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button.is-on { opacity: 1; border-color: var(--accent); }

.image-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.stars { color: var(--accent); letter-spacing: 1px; }
.image-meta a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* Usar en Mudae */
.use-mudae { container-type: inline-size; display: grid; gap: 16px; }
.use-mudae__head { display: grid; gap: 6px; }
.use-mudae__body { display: grid; gap: 16px; }
@container (min-width: 640px) {
  .use-mudae__body { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
}

.mudae {
  display: grid; gap: 2px; justify-items: start; align-content: start; padding: 11px 13px 13px; border-radius: 6px;
  background: #2b2d31; color: #dbdee1; box-shadow: inset 4px 0 0 var(--mudae, #e8b865);
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Arial, sans-serif; min-width: 0; max-width: 260px;
}
.mudae__name { font-weight: 700; font-size: 15px; color: #f2f3f5; line-height: 1.3; }
.mudae__series { font-size: 13.5px; line-height: 1.35; }
.mudae__hint { font-size: 12.5px; color: #b5bac1; margin: 2px 0 8px; line-height: 1.35; }
.mudae__img { width: 100%; max-width: 194px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: #1e1f22; }
@container (max-width: 639px) {
  .mudae { grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; max-width: none; width: 100%; }
  .mudae__img { grid-column: 1; grid-row: 1 / span 4; width: 96px; }
  .mudae__name, .mudae__series, .mudae__hint { grid-column: 2; }
}

.cmds { display: grid; gap: 10px; min-width: 0; }
.cmd {
  display: grid; gap: 6px; width: 100%; min-width: 0; padding: 10px 12px 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--raised);
  transition: border-color .15s, background .15s;
}
.cmd:hover { border-color: var(--line-strong); }
.cmd:active { background: var(--tone); }
.cmd__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmd__label { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cmd__copy { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 12.5px; font-weight: 500; color: var(--accent); }
.cmd__copy svg { width: 15px; height: 15px; }
.cmd__done { display: none; }
.cmd.is-copied { border-color: var(--ok); }
.cmd.is-copied .cmd__copy { color: var(--ok); }
.cmd.is-copied .cmd__copy-text { display: none; }
.cmd.is-copied .cmd__done { display: inline; }
.cmd__text {
  display: block; font: 500 13.5px/1.5 var(--font-mono); color: var(--text);
  overflow-wrap: anywhere; word-break: break-all; user-select: all;
}
.cmd__note { font-size: 12.5px; color: var(--faint); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-strong); flex: none; }

/* ---------- Novedades ---------- */

.feed { display: grid; gap: 10px; min-width: 0; }
@media (min-width: 700px) { .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feed-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; min-width: 0; }
.feed-item:hover { border-color: var(--line-strong); }
.feed-item__imgs { display: flex; width: 76px; }
.feed-item__imgs img { width: 48px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--stage); border: 2px solid var(--surface); }
.feed-item__imgs img + img { margin-left: -26px; }
.feed-item__text { display: grid; gap: 1px; min-width: 0; }
.feed-item__text b { font: 700 15.5px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item__text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Perfil y entrar ---------- */

.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--raised); flex: none; }
.avatar--sm { width: 34px; height: 34px; }
.profile-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile-head h1 { font: 800 26px/1.15 var(--font-display); overflow-wrap: anywhere; }

.narrow { max-width: 640px; }

.login { max-width: 420px; margin: 6vh auto 0; text-align: center; display: grid; gap: 16px; justify-items: center; }
.login__moon { width: 72px; height: 72px; }
.login h1 { font: 800 30px/1.15 var(--font-display); }
.people { display: grid; gap: 6px; width: 100%; text-align: left; margin-top: 8px; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; text-align: left; }
.person:hover { border-color: var(--accent); }

.soon { display: grid; gap: 14px; justify-items: start; padding: 24px; border-radius: var(--r-lg); border: 1px dashed var(--line-strong); max-width: 640px; }
.soon h2 { font: 700 21px/1.25 var(--font-display); }
.soon ul { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }

.alert { width: 100%; padding: 12px 14px; border-radius: var(--r-md); background: var(--ng-soft); color: var(--ng); font-size: 14px; text-align: left; }
.alert--info { background: var(--accent-soft); color: var(--text); }

/* ---------- Estados ---------- */

.skeleton { background: linear-gradient(90deg, var(--tone) 0%, color-mix(in srgb, var(--tone) 35%, transparent) 50%, var(--tone) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 56px 16px; color: var(--muted); }
.empty b { color: var(--text); font: 700 19px/1.3 var(--font-display); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; transition: opacity .2s, transform .2s;
  padding: 10px 16px; border-radius: 22px; background: var(--text); color: var(--ground); font-size: 14px; box-shadow: var(--shadow);
  pointer-events: none; max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--bad { background: var(--ng); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

.fade-in { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Comunidad y perfiles ---------- */

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; min-width: 0; }
.member:hover { border-color: var(--line-strong); }
.member__text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.member__text b { font: 700 16px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar--md { width: 48px; height: 48px; }
.avatar--lg { width: 76px; height: 76px; }
@media (min-width: 700px) { .avatar--lg { width: 96px; height: 96px; } }

.profile-head__text { display: grid; gap: 2px; min-width: 0; }
.profile-head h1 { font-size: clamp(24px, 6vw, 34px); }
.profile-stats { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.profile-stats b { color: var(--text); font-variant-numeric: tabular-nums; }

.tabs-scroll { overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.tabs-scroll::-webkit-scrollbar { display: none; }
.segmented--auto { display: inline-grid; max-width: none; grid-auto-columns: auto; }
.segmented--auto button { display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; white-space: nowrap; }
.tab-count { margin-left: 4px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.segmented .is-on .tab-count { color: var(--accent); }

.ccard--empty { background: linear-gradient(160deg, var(--raised), var(--surface)); border: 1px dashed var(--line-strong); }
.ccard--empty::after { background: none; }
.ccard--empty .ccard__info { color: var(--text); }
.ccard--empty .ccard__name { text-shadow: none; }
.ccard--empty .ccard__anime { color: var(--muted); }
.ccard__placeholder { position: absolute; inset: 0 0 34% 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--faint); font-size: 12px; text-align: center; padding: 10px; }
.ccard__placeholder svg { width: 40px; height: 40px; opacity: .35; }

.wish-list { display: grid; gap: 8px; }
@media (min-width: 700px) { .wish-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wish { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.wish__img { flex: none; width: 44px; height: 66px; border-radius: 8px; overflow: hidden; background: var(--stage); display: grid; place-items: center; }
.wish__img img { width: 100%; height: 100%; object-fit: cover; }
.wish__img--empty { background: var(--raised); }
.wish__img--empty svg { width: 22px; height: 22px; opacity: .35; }
.wish__text { display: grid; gap: 2px; min-width: 0; }
.wish__text b { font: 700 15.5px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed--single { grid-template-columns: minmax(0, 1fr) !important; max-width: 760px; }
.sub { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.sub__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.sub__text b { font: 700 15.5px/1.3 var(--font-display); }
.badge--approved { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge--rejected { background: var(--ng-soft); color: var(--ng); }
.badge--pending { background: var(--accent-soft); color: var(--accent); }

/* Hoja inferior */
.no-scroll { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; background: rgba(5, 6, 8, 0); transition: background .2s; }
.sheet-wrap.is-on { background: rgba(5, 6, 8, .55); }
.sheet {
  position: relative; display: grid; gap: 14px; width: 100%; max-height: 92dvh; overflow-y: auto;
  padding: 22px var(--gutter) calc(18px + var(--safe-b)); border-radius: 20px 20px 0 0;
  background: var(--surface); box-shadow: var(--shadow); transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.sheet-wrap.is-on .sheet { transform: none; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; justify-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 20px; padding: 26px; transform: translateY(16px); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet-wrap.is-on .sheet { opacity: 1; }
}
.sheet__close { position: absolute; top: 10px; right: 10px; font-size: 16px; color: var(--muted); }
.sheet__title { font: 700 21px/1.25 var(--font-display); padding-right: 36px; }
.sheet__actions { display: flex; justify-content: flex-end; gap: 8px; }
.textarea { min-height: 150px; padding: 12px 14px; resize: vertical; line-height: 1.5; font-family: var(--font-body); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Barra del móvil: dock flotante a juego con la de escritorio ---------- */
@media (max-width: 959px) {
  :root { --nav-h: 76px; }   /* 64 de dock + hueco: así el contenido, los avisos y la píldora de admin no quedan debajo */
  .tabbar {
    left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); height: 64px; padding: 0 6px;
    color: #ece8e1; border: 1px solid rgba(232, 184, 101, .28); border-radius: 22px; overflow: hidden; isolation: isolate;
    background:
      radial-gradient(45% 170% at 50% 140%, rgba(232, 184, 101, .22), transparent 70%),
      radial-gradient(35% 140% at 0% 0%, rgba(63, 169, 184, .16), transparent 70%),
      radial-gradient(30% 140% at 100% 0%, rgba(224, 119, 95, .14), transparent 70%),
      linear-gradient(180deg, rgba(22, 25, 32, .95), rgba(10, 12, 16, .95));
    -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  /* Trama de puntos de manga en los extremos */
  .tabbar::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .65;
    background-image: radial-gradient(rgba(232, 184, 101, .24) 1px, transparent 1.3px);
    background-size: 6px 6px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 22%, transparent 78%, #000 100%);
    mask-image: linear-gradient(90deg, #000 0%, transparent 22%, transparent 78%, #000 100%);
  }
  /* Destello dorado que recorre el borde de arriba */
  .tabbar::after {
    content: ""; position: absolute; top: 0; left: -35%; width: 35%; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 226, 173, .9), transparent);
    animation: dock-shine 7s ease-in-out infinite;
  }
  @keyframes dock-shine { 0%, 15% { left: -35%; } 55%, 100% { left: 100%; } }

  .tab { color: #9c978e; font-size: 10.5px; font-weight: 500; gap: 3px; padding-top: 2px; isolation: isolate; transition: color .25s; }
  .tab svg { position: relative; z-index: 1; width: 22px; height: 22px; transition: transform .3s cubic-bezier(.2, .8, .2, 1), color .25s; }
  .tab span:not(.tab__kanji) { position: relative; z-index: 1; }
  .tab:active svg { transform: scale(.88); }
  .tab.is-active { color: #ffe3b0; }
  .tab.is-active svg { color: #e8b865; transform: translateY(-2px); filter: drop-shadow(0 0 6px rgba(232, 184, 101, .55)); }
  /* Placa dorada detrás del icono activo */
  .tab.is-active::before {
    top: 6px; left: 50%; width: 54px; height: 34px; z-index: 0; transform: translateX(-50%); border-radius: 13px;
    background: linear-gradient(135deg, rgba(232, 184, 101, .30), rgba(232, 184, 101, .08) 60%, rgba(224, 119, 95, .12));
    box-shadow: inset 0 0 0 1px rgba(232, 184, 101, .5), 0 0 18px rgba(232, 184, 101, .25);
    animation: dock-pop .35s cubic-bezier(.2, .8, .2, 1);
  }
  @keyframes dock-pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
  /* Kanji de la sección, gigante y transparente detrás de la placa */
  .tab.is-active .tab__kanji {
    display: block; position: absolute; top: 23px; left: 50%; z-index: 0; transform: translate(-50%, -50%);
    font: 800 26px/1 var(--font-display); color: #e8b865; opacity: .16; white-space: nowrap; pointer-events: none;
  }
  /* Destello que parpadea en la esquina */
  .tab.is-active::after {
    content: "✦"; position: absolute; top: 3px; left: calc(50% + 21px); z-index: 1; font-size: 9px; line-height: 1; color: #ffe3b0;
    text-shadow: 0 0 8px rgba(232, 184, 101, .95); animation: dock-twinkle 2.4s ease-in-out infinite;
  }
  @keyframes dock-twinkle { 0%, 100% { opacity: .25; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(90deg); } }
}
@media (max-width: 959px) and (prefers-reduced-motion: reduce) {
  .tabbar::after, .tab.is-active::after, .tab.is-active::before { animation: none; }
}


/* Peticiones de series y pelis */
.pet-row { display: flex; gap: 14px; align-items: flex-start; }
.pet-main { flex: 1; min-width: 0; }
.pet-poster { width: 78px; border-radius: 10px; flex: none; }
@media (max-width: 520px) { .pet-poster { width: 56px; } }
