:root {
  --bg: #1f2023;
  --bg-deep: #151619;
  --rail: #252629;
  --panel: #2b2c30;
  --panel-soft: #333439;
  --text: #f2f3f5;
  --muted: #a8abb2;
  --quiet: #777b84;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #94d9f4;
  --accent-strong: #75c8ec;
  --good: #a6dc52;
  --chip: rgba(255, 255, 255, 0.12);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --hero-text: #f6f7f9;
}

[data-theme="light"] {
  --bg: #eef1f4;
  --bg-deep: #f7f8fa;
  --rail: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f2f4f7;
  --text: #191b20;
  --muted: #5c636f;
  --quiet: #7b8390;
  --line: rgba(20, 24, 31, 0.11);
  --accent: #287fa6;
  --accent-strong: #1c6f95;
  --good: #4f8f10;
  --chip: rgba(20, 24, 31, 0.08);
  --shadow: 0 22px 70px rgba(30, 40, 55, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 74px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  background:
    radial-gradient(circle at 22% 12%, rgba(117, 200, 236, 0.1), transparent 34%),
    var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
}

.brand {
  width: 100%;
  height: 32px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  position: relative;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  border: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.brand-logo {
  object-fit: contain;
  padding: 0;
}

.brand-copy {
  position: fixed;
  left: 76px;
  top: 13px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.brand-copy strong {
  font-size: 0.85rem;
}

.brand-copy span {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--accent);
  color: #101114;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.nav-list,
.sidebar-bottom {
  width: 100%;
  display: grid;
  gap: 8px;
}

.sidebar-bottom {
  margin-top: auto;
}

.nav-item {
  min-height: 58px;
  border-radius: 6px;
  color: var(--quiet);
  display: grid;
  place-items: center;
  gap: 3px;
  font-size: 0.64rem;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: rgba(20, 24, 31, 0.07);
}

.nav-item.compact {
  min-height: 50px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  position: relative;
  display: block;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  border-color: currentColor;
}

.icon-home::before {
  width: 14px;
  height: 11px;
  left: 5px;
  top: 9px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.icon-home::after {
  width: 12px;
  height: 12px;
  left: 6px;
  top: 2px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.icon-library::before {
  inset: 4px 5px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.icon-library::after {
  width: 16px;
  height: 15px;
  left: 4px;
  top: 5px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-compare::before {
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-compare::after {
  width: 10px;
  height: 2px;
  left: 8px;
  top: 11px;
  background: currentColor;
  transform: rotate(35deg);
}

.icon-review::before {
  width: 17px;
  height: 14px;
  left: 4px;
  top: 5px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-review::after {
  width: 10px;
  height: 2px;
  left: 7px;
  top: 10px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.icon-add::before,
.icon-info::before,
.icon-admin::before {
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-add::after {
  width: 12px;
  height: 2px;
  left: 6px;
  top: 11px;
  background: currentColor;
  box-shadow: 0 0 0 currentColor;
}

.icon-info::after {
  width: 3px;
  height: 10px;
  left: 11px;
  top: 9px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor;
}

.icon-admin::after {
  width: 12px;
  height: 7px;
  left: 6px;
  top: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.theme-toggle {
  width: 56px;
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--quiet);
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 0.58rem;
  font-weight: 900;
}

.theme-toggle:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.theme-icon {
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.theme-icon::after {
  content: "";
  position: absolute;
  inset: 3px 0 3px 10px;
  border-radius: inherit;
  background: var(--rail);
}

[data-theme="light"] .theme-icon::after {
  transform: translateX(-8px);
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 44px;
  padding: 4px 12px 4px 488px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(31, 32, 35, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

[data-theme="light"] .topbar {
  background: rgba(238, 241, 244, 0.88);
}

.top-search {
  max-width: 750px;
  flex: 1;
  height: 32px;
  display: block;
  position: relative;
}

.top-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top-search input {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 42px 0 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: 0;
  font-size: 0.86rem;
}

[data-theme="light"] .top-search input {
  background: #ffffff;
}

.top-search::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 9px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  box-shadow: 5px 5px 0 -3px var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-wrap {
  position: relative;
}

.auth-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px 3px 3px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

[data-theme="light"] .auth-button {
  background: #ffffff;
}

.admin-login-button {
  min-height: 34px;
  border: 1px solid rgba(117, 200, 236, 0.36);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(117, 200, 236, 0.12);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 950;
}

.admin-login-button:hover {
  background: rgba(117, 200, 236, 0.2);
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  position: relative;
}

.icon-button::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 16px;
  left: 16px;
  top: 7px;
  background: currentColor;
}

.icon-button::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  left: 11px;
  top: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #d9dbdf, #5d6877);
  color: #111317;
  font-weight: 900;
}

.avatar.has-image {
  background-image: var(--avatar-image);
  background-size: cover;
  background-position: center;
  color: transparent;
}

.profile-preview {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.auth-label {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.account-menu strong,
.account-menu span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.account-bio {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.account-notifications {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: rgba(117, 200, 236, 0.08);
}

.account-notifications strong {
  color: var(--accent);
  font-size: 0.8rem;
}

.account-notifications span {
  white-space: normal;
  line-height: 1.35;
}

main {
  min-width: 0;
}

.profile-mode main > section:not(#profil) {
  display: none;
}

.profile-mode #profil {
  min-height: calc(100vh - 44px);
}

.spotlight {
  position: relative;
  min-height: 690px;
  padding: 205px 40px 34px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(18, 19, 22, 0.96) 0%, rgba(18, 19, 22, 0.74) 27%, rgba(18, 19, 22, 0.2) 67%),
    linear-gradient(0deg, var(--bg) 0%, rgba(31, 32, 35, 0.12) 42%),
    var(--spotlight-image, linear-gradient(120deg, #3a4a57, #1d2026));
  background-size: cover;
  background-position: center;
}

[data-theme="light"] .spotlight {
  background:
    linear-gradient(90deg, rgba(15, 17, 20, 0.76) 0%, rgba(15, 17, 20, 0.48) 34%, rgba(15, 17, 20, 0.1) 72%),
    linear-gradient(0deg, var(--bg) 0%, rgba(238, 241, 244, 0.04) 42%),
    var(--spotlight-image, linear-gradient(120deg, #d1dce8, #8797a8));
}

.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 35%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 54%);
  pointer-events: none;
}

.spotlight-content,
.spotlight-rail {
  position: relative;
  z-index: 1;
}

.spotlight-content {
  width: min(820px, 78vw);
  color: var(--hero-text);
}

.spotlight-meta {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.rating {
  color: var(--good);
  font-weight: 900;
}

.meta-chip,
.tag,
.score-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--chip);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 900;
}

.spotlight h1 {
  margin: 0 0 10px;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.spotlight p {
  max-width: 900px;
  margin: 0;
  color: rgba(246, 247, 249, 0.82);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 650;
}

.spotlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 900;
}

.button.primary {
  background: var(--accent);
  color: #101114;
}

.button.muted {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.button:disabled,
.mini-button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.spotlight-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 13vw);
  gap: 13px;
  overflow-x: auto;
  padding: 226px 0 5px;
  scrollbar-width: thin;
}

.spotlight-thumb {
  height: 122px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: var(--panel);
  color: #f8fafc;
  position: relative;
  box-shadow: var(--shadow);
}

.spotlight-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.72)),
    var(--thumb-image);
  background-size: cover;
  background-position: center;
  transition: transform 180ms ease;
}

.spotlight-thumb:hover::before,
.spotlight-thumb.active::before {
  transform: scale(1.06);
}

.spotlight-thumb.active {
  outline: 4px solid var(--accent);
  outline-offset: -4px;
}

.spotlight-thumb span {
  position: absolute;
  left: 16px;
  right: 12px;
  bottom: 14px;
  text-align: left;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.profile-section {
  scroll-margin-top: 62px;
  padding: 54px 40px 42px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(117, 200, 236, 0.12), transparent 46%),
    var(--bg-deep);
}

.profile-hero {
  min-height: 170px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
}

.profile-page-avatar {
  width: 132px;
  height: 132px;
  border: 3px solid rgba(117, 200, 236, 0.62);
  box-shadow: 0 0 0 8px rgba(117, 200, 236, 0.08);
  font-size: 2.4rem;
}

.profile-identity {
  min-width: 0;
}

.profile-identity h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.profile-identity p {
  max-width: 720px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 750;
}

.profile-points {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(117, 200, 236, 0.38);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(117, 200, 236, 0.12);
  color: var(--accent);
  font-weight: 900;
}

.profile-points strong {
  font-size: 1.15rem;
}

.profile-command-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.profile-stat-grid {
  max-width: 1120px;
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.profile-stat {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
}

.profile-stat-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(117, 200, 236, 0.28);
  border-radius: 10px;
  background: rgba(117, 200, 236, 0.12);
  color: var(--accent);
  font-weight: 950;
}

.profile-stat strong {
  display: block;
  font-size: 1.75rem;
}

.profile-stat span:last-child {
  color: var(--muted);
  font-weight: 850;
}

.profile-tabs,
.profile-content {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.profile-tabs {
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.profile-tabs button.active {
  background: var(--accent);
  color: #101114;
}

.profile-content {
  margin-top: 28px;
}

.profile-panel-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 36px 48px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-panel-card h3,
.profile-entry h3 {
  margin: 0;
}

.profile-panel-card p,
.profile-entry p {
  color: var(--muted);
  line-height: 1.6;
}

.badge-row {
  margin: 18px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(117, 200, 236, 0.3);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(117, 200, 236, 0.1);
  color: var(--accent);
  font-weight: 950;
  font-size: 0.8rem;
}

.profile-detail-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.profile-detail span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 850;
}

.notification-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.notification-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.notification-item.unread {
  border-color: rgba(117, 200, 236, 0.42);
  background: rgba(117, 200, 236, 0.1);
}

.notification-item strong {
  display: block;
  margin-bottom: 6px;
}

.notification-item p {
  margin: 0 0 6px;
}

.notification-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.profile-entry-list {
  display: grid;
  gap: 12px;
}

.profile-entry {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  background: var(--panel);
}

.profile-entry.compact {
  grid-template-columns: 1fr;
  padding: 20px;
}

.profile-entry-art {
  min-height: 118px;
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.44)),
    var(--entry-image);
  background-size: cover;
  background-position: center;
}

.profile-entry-body {
  display: grid;
  gap: 8px;
  align-content: start;
}

.section-block {
  scroll-margin-top: 62px;
  margin: 0 40px 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

[data-theme="light"] .section-block {
  background: rgba(255, 255, 255, 0.66);
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  letter-spacing: 0;
}

.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.library-tools {
  margin-bottom: 18px;
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.library-tools label {
  flex: 1 1 220px;
}

.library-tools .mini-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #101114;
}

.segmented {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 6px;
  background: var(--panel);
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segmented button.active {
  background: var(--accent);
  color: #101114;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.character-card {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.card-art {
  height: 150px;
  background-image:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62)),
    var(--card-image);
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 16px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.card-body h3,
.compare-card h3,
.critique-item h3 {
  margin: 12px 0 5px;
}

.universe,
.story,
.compare-card p,
.critique-item p {
  color: var(--muted);
  line-height: 1.55;
}

.universe {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 800;
}

.community-line {
  width: max-content;
  max-width: 100%;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(117, 200, 236, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 950;
}

.story {
  margin-top: 0;
}

.metrics {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.metric {
  display: grid;
  grid-template-columns: 72px 1fr 34px;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .bar {
  background: rgba(20, 24, 31, 0.12);
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mini-button {
  min-height: 33px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 900;
}

.mini-button:hover {
  border-color: var(--accent);
}

.mini-button.active {
  border-color: var(--accent);
  background: rgba(117, 200, 236, 0.16);
  color: var(--accent);
}

.compare-controls,
.score-row,
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.compare-controls select,
.score-row label,
.form-grid label {
  flex: 1 1 220px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 900;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-check input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: var(--panel);
  color: var(--text);
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(117, 200, 236, 0.6);
  outline-offset: 3px;
}

.comparison-board {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compare-card,
.critique-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--panel);
}

.verdict,
.compare-score,
.critique-feed,
.panel-form {
  display: grid;
  gap: 12px;
}

.form-lock-note {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(117, 200, 236, 0.1);
  color: var(--text);
  font-weight: 850;
  line-height: 1.45;
}

.compare-score {
  margin-top: 14px;
}

.score-pill {
  background: rgba(117, 200, 236, 0.14);
  color: var(--text);
}

.critique-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 16px;
}

.critique-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.spoiler-box {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.spoiler-text {
  filter: blur(6px);
  user-select: none;
}

.spoiler-text.revealed {
  filter: none;
  user-select: auto;
}

.reply-block {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.reply-list {
  display: grid;
  gap: 8px;
}

.reply-item {
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .reply-item {
  background: rgba(20, 24, 31, 0.05);
}

.reply-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.reply-item p {
  margin: 0;
}

.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.create-form {
  max-width: 1040px;
}

.submission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.72fr);
  gap: 20px;
  align-items: start;
}

.upload-section {
  background:
    linear-gradient(135deg, rgba(117, 200, 236, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.035);
}

[data-theme="light"] .upload-section {
  background:
    linear-gradient(135deg, rgba(40, 127, 166, 0.11), transparent 44%),
    rgba(255, 255, 255, 0.72);
}

.file-field input[type="file"] {
  min-height: 45px;
  padding: 8px;
}

.file-field input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  background: var(--accent);
  color: #101114;
  font-weight: 900;
}

.submission-board {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.submission-board-head h3 {
  margin: 9px 0 5px;
  font-size: 1.18rem;
}

.submission-board-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 700;
}

.submission-list {
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.submission-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel);
}

.submission-card-art {
  min-height: 126px;
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.38)),
    var(--submission-image);
  background-size: cover;
  background-position: center;
}

.submission-card-body {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.submission-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.submission-card-body strong {
  font-size: 1rem;
}

.submission-universe,
.submission-card-body p {
  color: var(--muted);
}

.submission-card-body p {
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.submission-card .mini-button {
  justify-self: start;
  margin-top: 3px;
}

.submission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.submission-empty {
  padding: 18px;
}

.admin-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(117, 200, 236, 0.16);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 950;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stat,
.admin-user {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.admin-stat {
  padding: 15px;
}

.admin-stat span,
.admin-user span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.admin-stat strong {
  display: block;
  margin-top: 7px;
  font-size: 1.55rem;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-user {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.8fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.admin-user-main {
  min-width: 0;
}

.admin-user-main strong,
.admin-user-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.status-chip {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--chip);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 950;
}

.status-chip.good {
  background: rgba(166, 220, 82, 0.14);
  color: var(--good);
}

.status-chip.warn {
  background: rgba(255, 190, 90, 0.14);
  color: #ffc56c;
}

.status-chip.danger {
  background: rgba(255, 108, 108, 0.15);
  color: #ff8c8c;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mini-button.danger {
  color: #ff9a9a;
}

.mini-button.warn {
  color: #ffc56c;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 24px;
  color: var(--muted);
  background: var(--panel);
  font-weight: 800;
}

.about-strip {
  margin: 0 40px 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.about-strip strong {
  color: var(--text);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.auth-panel {
  position: relative;
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.profile-panel {
  width: min(500px, 100%);
}

.detail-panel {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 34px));
  padding: 0;
  overflow: hidden;
}

.detail-content {
  max-height: inherit;
  overflow-y: auto;
}

.detail-hero {
  min-height: 330px;
  padding: 120px 28px 28px;
  display: flex;
  align-items: end;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.78) 100%),
    var(--detail-image);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.detail-hero-copy {
  max-width: 760px;
}

.detail-hero-copy h2 {
  margin: 10px 0 5px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.detail-hero-copy p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

.detail-score {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(117, 200, 236, 0.18);
  color: var(--accent);
}

.detail-body {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 16px;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
}

[data-theme="light"] .detail-block {
  background: rgba(255, 255, 255, 0.72);
}

.detail-block h3 {
  margin: 0 0 10px;
}

.detail-block p {
  color: var(--muted);
  line-height: 1.6;
}

.detail-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-rating {
  min-width: min(260px, 100%);
}

.detail-critique {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.detail-critique p {
  margin-bottom: 0;
}

.auth-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--text);
}

.auth-close::before,
.auth-close::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  left: 10px;
  top: 16px;
  background: currentColor;
}

.auth-close::before {
  transform: rotate(45deg);
}

.auth-close::after {
  transform: rotate(-45deg);
}

.auth-mode-badge {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  margin-bottom: 7px;
  background: rgba(148, 217, 244, 0.14);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-modal.admin-auth .auth-panel {
  border-color: rgba(166, 220, 82, 0.42);
  background:
    linear-gradient(140deg, rgba(166, 220, 82, 0.13), transparent 42%),
    var(--panel);
}

.auth-modal.admin-auth .auth-mode-badge {
  background: rgba(166, 220, 82, 0.16);
  color: var(--good);
}

.auth-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-right: 36px;
  margin-bottom: 18px;
}

.auth-heading h2 {
  margin: 0 0 4px;
}

.auth-heading p,
.auth-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--bg);
}

.auth-tabs.single {
  grid-template-columns: 1fr;
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: var(--accent);
  color: #101114;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-message.error {
  color: #ff8c8c;
}

.auth-message.success {
  color: var(--good);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 850;
}

@media (max-width: 1180px) {
  .topbar {
    padding-left: 190px;
  }

  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-hero,
  .profile-stat-grid {
    max-width: 100%;
  }

  .submission-layout {
    grid-template-columns: 1fr;
  }

  .submission-list {
    max-height: none;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 190px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    height: auto;
    min-height: 66px;
    flex-direction: row;
    justify-content: space-between;
    padding: 8px;
  }

  .brand {
    width: auto;
    margin: 0;
  }

  .brand-copy {
    display: none;
  }

  .nav-list,
  .sidebar-bottom {
    width: auto;
    display: flex;
    align-items: center;
  }

  .nav-item {
    width: 48px;
    min-height: 48px;
  }

  .nav-item span:last-child,
  .theme-toggle span:last-child {
    display: none;
  }

  .theme-toggle {
    width: 48px;
    min-height: 48px;
  }

  .topbar {
    top: 66px;
    padding: 8px;
    height: 52px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .icon-button {
    display: none;
  }

  .auth-label {
    display: none;
  }

  .admin-login-button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.72rem;
  }

  .spotlight {
    min-height: 620px;
    padding: 190px 18px 22px;
  }

  .spotlight-content {
    width: 100%;
  }

  .spotlight-rail {
    grid-auto-columns: minmax(185px, 70vw);
    padding-top: 120px;
  }

  .section-block,
  .about-strip {
    scroll-margin-top: 190px;
    margin-left: 12px;
    margin-right: 12px;
  }

  .profile-section {
    scroll-margin-top: 190px;
    padding: 32px 12px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 18px;
  }

  .profile-page-avatar {
    width: 112px;
    height: 112px;
  }

  .profile-command-row {
    justify-content: center;
  }

  .profile-stat-grid,
  .profile-detail-grid,
  .profile-entry {
    grid-template-columns: 1fr;
  }

  .profile-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .profile-tabs button {
    flex: 0 0 auto;
  }

  .profile-panel-card {
    padding: 24px;
  }

  .detail-body {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .detail-hero {
    min-height: 260px;
    padding: 96px 18px 20px;
  }

  .reply-form {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: grid;
    align-items: start;
  }

  .segmented {
    overflow-x: auto;
  }

  .character-grid,
  .comparison-board,
  .critique-layout {
    grid-template-columns: 1fr;
  }

  .submission-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .submission-card-art {
    min-height: 112px;
  }

  .admin-stats,
  .admin-user {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}
