* {
  box-sizing: border-box;
}

:root {
  --bg: #08111f;
  --bg-soft: #101b31;
  --panel: rgba(11, 18, 33, 0.78);
  --panel-strong: rgba(17, 28, 50, 0.92);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f7fb;
  --muted: #b8c3d9;
  --site-width: min(1320px, calc(100% - 32px));
  --accent-hue: 42;
  --accent: hsl(var(--accent-hue), 88%, 61%);
  --accent-strong: hsl(var(--accent-hue), 88%, 71%);
  --danger: #ff6b6b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

html, body {
  min-height: 100%;
  background-color: var(--bg);
}

body.app-page,
body.auth-page {
  overflow-x: clip;
}

html:has(.freundeskreis-wrap) {
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, hsla(var(--accent-hue), 88%, 61%, 0.18), transparent 25%),
    radial-gradient(circle at right 10%, rgba(113, 198, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #06101d, #0e1a31 55%, #08111f);
}

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

h1, h2, h3 {
  margin: 0 0 0.5rem;
  font-family: 'Fraunces', serif;
  letter-spacing: 0.01em;
}

.spicy-heading {
  color: rgba(255, 100, 80, 0.9);
}

p {
  margin: 0;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

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

.background-orb {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(10px);
  opacity: 0.5;
}

.background-orb-a {
  top: -120px;
  left: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: hsla(var(--accent-hue), 88%, 61%, 0.2);
}

.background-orb-b {
  bottom: -140px;
  right: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(104, 177, 255, 0.18);
}

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: linear-gradient(rgba(255, 255, 255, 0.95) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.95) 1px, transparent 1px);
  background-size: 36px 36px;
}

.auth-page,
.app-page {
  position: relative;
  z-index: 1;
}

.topbar,
.page-shell,
.auth-shell {
  width: var(--site-width);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  height: auto;
  padding: 0;
}

.brand-logo {
  max-width: 300px;
  height: auto;
  display: block;
}

.brand-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.5;
}

.hero-sub {
  font-size: 0.9rem;
  opacity: 0.5;
  margin-top: 0.25rem;
  font-style: italic;
}

.eyebrow {
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--accent-strong);
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  opacity: 0.9;
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav-burger.nav-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.nav-open span:nth-child(2) { opacity: 0; }
.nav-burger.nav-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .nav-burger {
    display: flex;
  }

  .topbar-actions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 300;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0.75rem;
    background: var(--panel-strong);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
  }

  .topbar-actions.nav-open {
    display: flex;
  }

  .topbar-actions .ghost-button {
    text-align: left;
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions .ghost-button,
  .nav-dropdown-menu a,
  .nav-dropdown-menu button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
  }

  .topbar-actions .nav-home-button {
    width: auto;
    min-width: 46px;
    justify-content: center;
    padding-inline: 0.85rem;
  }

  .nav-home-icon {
    font-size: 1.1rem;
    line-height: 1;
  }

  .nav-item-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-toggle {
    width: 100%;
    text-align: left;
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,0.04);
    margin-top: 0.3rem;
  }
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.4rem;
  min-width: 150px;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-dropdown-menu a,
.nav-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu button:hover {
  background: rgba(255,255,255,0.07);
}

.nav-dropdown-menu form {
  margin: 0;
}

.page-shell {
  display: grid;
  gap: 1.25rem;
  padding: 1rem 0 3rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  justify-items: center;
  padding: 3rem 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  min-width: 0;
}

.hero,
.auth-hero,
.auth-card,
.section-card,
.stat-card {
  padding: 1.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.2rem;
  align-items: center;
}

.hero-with-image,
.section-header-with-image {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero-image,
.section-header-image {
  max-height: 200px;
  height: auto;
  flex-shrink: 0;
}

.dashboard-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.35rem 1.5rem;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.16), hsla(var(--accent-hue), 88%, 71%, 0.08));
  border: 1px solid hsla(var(--accent-hue), 88%, 61%, 0.28);
}

.dashboard-alert-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: hsla(var(--accent-hue), 88%, 61%, 0.18);
  color: hsla(var(--accent-hue), 88%, 80%, 0.96);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.dashboard-alert-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: hsla(var(--accent-hue), 88%, 84%, 0.98);
}

.dashboard-alert-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: hsla(var(--accent-hue), 88%, 82%, 0.92);
}

.dashboard-alert-text a {
  color: hsla(var(--accent-hue), 88%, 88%, 1);
  text-decoration: underline;
}

.hero-art {
  margin: 0;
  width: min(260px, 34vw);
  flex: 0 0 auto;
  justify-self: end;
}

.hero-art img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.25));
}

.hero h1,
.auth-hero h1 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.95;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.feature-grid,
.stats-grid,
.card-grid,
.detail-grid,
.settings-grid {
  display: grid;
  gap: 1rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.6rem;
}

.feature-grid div,
.setting-card,
.relationship-card,
.photo-card,
.character-card,
.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
}

.feature-grid div {
  border-radius: 18px;
  padding: 1rem;
}

.feature-grid strong,
.stat-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.feature-grid span,
.muted,
.card-meta,
.setting-card p,
.relationship-card p,
.info-list span {
  color: var(--muted);
}

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

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.card-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-top: 1rem;
}

.character-card {
  display: grid;
  gap: 0.8rem;
  border-radius: 22px;
  padding: 1.2rem;
  transition: transform 160ms ease, border-color 160ms ease;
  justify-items: center;
  text-align: center;
}

.character-card-main {
  display: grid;
  gap: 0.8rem;
  justify-items: center;
  text-align: center;
}

.incomplete-card {
  position: relative;
  overflow: hidden;
}

.profile-ribbon {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 2;
  display: grid;
  gap: 2px;
  width: 140px;
  padding: 6px 10px 7px;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.95), hsla(var(--accent-hue), 88%, 54%, 0.82));
  color: #2d1c00;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%) rotate(10deg);
  text-align: center;
}

.profile-ribbon:hover {
  filter: brightness(1.03);
}

.profile-ribbon-tag {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-ribbon-text {
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 700;
}

.profile-ribbon,
.character-card-main {
  text-decoration: none;
}

.character-card:hover {
  transform: translateY(-4px);
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.45);
}

.character-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.32), rgba(113, 198, 255, 0.24));
  font-weight: 800;
}

.new-soul-card {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--muted);
}

.new-soul-card:hover {
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.45);
  color: var(--fg);
}

.new-soul-avatar {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  font-size: 2.4rem;
  font-weight: 300;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.character-cover {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.character-cover-wrap {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 14px;
  width: 100px;
  height: 100px;
}

.owner-card {
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.6) !important;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.08), hsla(var(--accent-hue), 88%, 66%, 0.04));
}

.owner-avatar {
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.5), hsla(var(--accent-hue), 88%, 54%, 0.35));
  font-size: 1.4rem;
}

.owner-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1.1rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.owner-label {
  font-size: 0.7rem;
  font-weight: 700;
  background: hsla(var(--accent-hue), 88%, 61%, 0.25);
  color: rgb(244, 185, 66);
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: middle;
  margin-left: 4px;
}

.owner-banner {
  background: linear-gradient(90deg, hsla(var(--accent-hue), 88%, 61%, 0.15), hsla(var(--accent-hue), 88%, 54%, 0.08));
  border: 1px solid hsla(var(--accent-hue), 88%, 61%, 0.35);
  border-radius: 16px;
  padding: 0.85rem 1.2rem;
  font-weight: 600;
  color: rgb(244, 200, 80);
  margin-bottom: 0.5rem;
}

.profile-warning {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: -0.1rem;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid hsla(var(--accent-hue), 88%, 61%, 0.22);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.profile-warning:hover {
  transform: translateY(-1px);
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.4);
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.12), rgba(255, 255, 255, 0.04));
}

.profile-warning strong {
  color: var(--accent-strong);
}

.profile-warning span {
  color: var(--muted);
  font-size: 0.9rem;
}

.card-meta {
  font-size: 0.9rem;
}

.section-card h2 {
  margin-bottom: 1.2rem;
}

.section-card h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.9rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.search-form,
.inline-form {
  display: flex;
  gap: 0.65rem;
}

.search-form input,
.stack-form input,
.stack-form textarea,
.stack-form select,
.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: border-color 150ms ease, background 150ms ease;
  outline: none;
}

.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus,
.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.form-grid select,
.stack-form select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(180,195,220,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-grid select option,
.stack-form select option {
  color: var(--text);
  background-color: #0e1a31;
}

/* Character form: brighter selects for a more natural look */
.character-form-grid select {
  color-scheme: light;
  color: #152033;
  background-color: #ffffff;
  border-color: rgba(21, 32, 51, 0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23384a68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.character-form-grid select:focus {
  border-color: rgba(56, 74, 104, 0.45);
  background-color: #ffffff;
}

.character-form-grid select option {
  color: #152033;
  background-color: #ffffff;
}

.character-form-grid .form-fact-group {
  display: grid;
  gap: 1rem;
}

.search-form input::placeholder,
.stack-form input::placeholder,
.stack-form textarea::placeholder,
.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: rgba(244, 247, 251, 0.3);
}

.stack-form,
.form-grid {
  display: grid;
  gap: 1.1rem;
}
.search-form {
  align-items: center;
}
.search-submit {
  min-width: 46px;
  padding-inline: 0.9rem;
  justify-content: center;
}

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

.form-grid > label {
  min-width: 0;
}

.new-soul-card .character-cover-wrap {
  background: linear-gradient(135deg, rgba(244, 185, 66, 0.12), rgba(113, 198, 255, 0.1));
  border: 1px solid rgba(244, 185, 66, 0.2);
}

.new-soul-icon-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  z-index: 2;
  pointer-events: none;
}

.new-soul-icon {
  font-size: 3.2rem;
  color: var(--accent-strong);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22));
}

.half-width-field {
  grid-column: span 1;
}

.compact-grid {
  margin-bottom: 1rem;
}

.full-width {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  text-transform: none;
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--text);
  font-weight: 400;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.slider-field,
.slider-display {
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  text-transform: none;
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--text);
  font-weight: 400;
}

.slider-field input[type='range'],
.slider-display input[type='range'] {
  width: 100%;
  accent-color: var(--accent-strong);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.slider-labels strong {
  color: var(--text);
}

.slider-field-cleared .slider-labels strong {
  color: rgba(244, 247, 251, 0.56);
  font-style: italic;
}

.slider-field-cleared input[type='range'] {
  opacity: 0.72;
}

.slider-display {
  display: grid;
}

.slider-display strong {
  display: inline;
  margin-top: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 46px;
  padding: 0.8rem 1.15rem;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.small {
  min-height: 38px;
  padding-inline: 0.9rem;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #241800;
  font-weight: 800;
}

.secondary-button,
.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.danger-button {
  background: rgba(255, 107, 107, 0.14);
  color: #ffd3d3;
  border: 1px solid rgba(255, 107, 107, 0.34);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.character-card:hover {
  transform: translateY(-1px);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
}

.detail-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.detail-hero {
  align-items: center;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-placeholder {
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.12), rgba(113, 198, 255, 0.10));
  border: 1.5px dashed hsla(var(--accent-hue), 88%, 61%, 0.18);
  color: #b8c3d9;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 2.2rem;
  flex-shrink: 0;
  overflow: hidden;
}

.info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.info-list div,
.setting-card,
.relationship-card,
.photo-card {
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.info-list strong {
  display: block;
  margin-top: 0.25rem;
}

.partner-link {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%,0.15), hsla(var(--accent-hue), 88%, 71%,0.1));
  border: 1px solid hsla(var(--accent-hue), 88%, 61%,0.3);
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.partner-link:hover {
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%,0.28), hsla(var(--accent-hue), 88%, 71%,0.2));
  border-color: hsla(var(--accent-hue), 88%, 61%,0.55);
}

.traits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.trait-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Make trait boxes uniform size and enable watermark overlays */
.traits-grid {
  grid-auto-rows: 120px; /* fixed row height to align boxes */
}

.trait-card {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 0.9rem 1.6rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  overflow: hidden;
}

.trait-card > * {
  position: relative;
  z-index: 2; /* keep content above watermark */
}

/* Watermark: subtle large symbol depending on yes/no */
.trait-card-yes::after,
.trait-card-no::after {
  content: '';
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.trait-card-yes::after {
  content: '✓';
  color: rgba(84,200,120,0.12);
  font-size: 5.5rem;
  font-weight: 800;
  display: block;
  text-align: center;
  line-height: 1;
  transform: translateY(8%);
}

.trait-card-no::after {
  content: '✕';
  color: rgba(255,107,107,0.12);
  font-size: 5.5rem;
  font-weight: 800;
  display: block;
  text-align: center;
  line-height: 1;
  transform: translateY(8%);
}

/* Position watermark centrally but keep it subtle */
.trait-card-yes::after,
.trait-card-no::after {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -35%) rotate(-8deg);
  z-index: 1;
  opacity: 0.10;
  font-family: 'Fraunces', serif;
}

/* Ensure pill/status remains visible */
.trait-pill {
  z-index: 3;
}

/* Stronger, glanceable visual treatment for yes/no */
.trait-card-yes {
  border-left: 6px solid rgba(84,200,120,0.18);
  background: linear-gradient(180deg, rgba(84,200,120,0.02), rgba(255,255,255,0.01));
  box-shadow: 0 8px 24px rgba(84,200,120,0.03);
}

.trait-card-no {
  border-left: 6px solid rgba(255,107,107,0.14);
  background: linear-gradient(180deg, rgba(255,107,107,0.015), rgba(255,255,255,0.01));
  box-shadow: 0 8px 24px rgba(255,107,107,0.02);
}

/* Badge element (inline SVG) styled top-right for clarity */
.trait-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 3;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  pointer-events: none;
}

.trait-badge svg { width: 24px; height: 24px; display: block; }

/* Subtle entrance / hover */
.trait-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.trait-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}

/* Make the pill less dominant since the badge signals state */
.trait-pill-yes {
  background: rgba(84,200,120,0.14);
  color: rgb(40,120,64);
}

.trait-pill-no {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

/* Optional: hint animation for newly changed states */
.trait-card-new {
  animation: state-pop 420ms ease;
}

@keyframes state-pop {
  0% { transform: scale(0.985); opacity: 0.85 }
  60% { transform: scale(1.02) }
  100% { transform: scale(1); opacity: 1 }
}

.trait-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.trait-value {
  font-size: 1rem;
  font-weight: 700;
}

.trait-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 0.2rem 0.7rem;
  align-self: flex-start;
}

.trait-pill-yes {
  background: rgba(84, 200, 120, 0.15);
  color: rgb(84, 200, 120);
}

.trait-pill-no {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.trait-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.trait-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.trait-dot.filled {
  background: var(--accent-strong);
}

.trait-dot-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin-left: 4px;
}

.text-block {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: #e7edf8;
}

.photo-grid,
.relationship-list,
.vibe-list,
.settings-list {
  display: grid;
  gap: 0.75rem;
}

.vibe-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: 18px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
}

.vibe-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}

.vibe-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.vibe-name {
  font-size: 1rem;
  font-weight: 700;
}

.vibe-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.num-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.num-input-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.num-btn {
  width: 44px;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 300;
  cursor: pointer;
  transition: color 120ms, background 120ms;
  min-height: 0;
  padding: 0;
  border-radius: 0;
}

.num-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.num-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.num-dec {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.num-inc {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.num-input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 0.5rem !important;
  -moz-appearance: textfield;
}

.num-input:focus {
  outline: none;
}

.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.spicy-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.spicy-divider::before,
.spicy-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 80, 80, 0.4), transparent);
}

.spicy-divider span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 100, 80, 0.8);
  white-space: nowrap;
}

.facts-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.facts-divider::before,
.facts-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 195, 217, 0.4), transparent);
}

.facts-divider span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(184, 195, 217, 0.8);
  white-space: nowrap;
}

.card-vibe {
  margin-bottom: 0.15rem;
}

.relation-section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin: 1.2rem 0 0.5rem;
}

.rel-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rel-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rel-group-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  padding-top: 0.22rem;
}

.rel-group-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.rel-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.rel-group-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 140px));
  gap: 0.55rem;
  width: 100%;
  justify-content: start;
}

.rel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 0.42rem 0.6rem;
}

.rel-card-name {
  font-size: clamp(0.8rem, 0.95vw, 0.88rem);
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.rel-card-name:hover {
  color: var(--accent-strong);
}

.rel-card-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: space-between;
  min-width: 0;
}

.rel-card-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.rel-bubble-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.rel-bubble-btn:hover,
.rel-bubble-btn--active {
  opacity: 1;
}

.rel-card-delete {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #1a1a2e);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rel-card-delete:hover {
  background: rgba(255,255,255,0.12);
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.rel-card-note {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.35;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 0.3rem;
}

@media (max-width: 900px) {
  .rel-group-members {
    grid-template-columns: repeat(auto-fill, minmax(130px, 130px));
    gap: 0.5rem;
  }
}

@media (max-width: 620px) {
  .rel-group-members {
    grid-template-columns: 1fr;
  }

  .rel-card {
    padding: 0.4rem 0.55rem;
  }
}

.rel-card-note.hidden {
  display: none;
}

a.vibe-name {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 3px;
}

a.vibe-name:hover {
  text-decoration-color: var(--accent);
  color: var(--accent-strong);
}

.vibe-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.hof-new-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.hof-new-form input {
  flex: 1;
}

.small-button {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.hof-card-open {
  border-color: rgba(113, 198, 255, 0.2);
  background: linear-gradient(135deg, rgba(113, 198, 255, 0.05), rgba(255,255,255,0.02));
}

.hof-decide-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.4rem;
}

.hof-decide-form select {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
}

.hof-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.hof-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: 18px;
  padding: 1rem 1.1rem;
  border: 1px solid hsla(var(--accent-hue), 88%, 61%, 0.2);
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.06), rgba(255,255,255,0.02));
}

.hof-trophy {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.hof-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hof-thesis {
  font-weight: 600;
  font-size: 0.95rem;
}

.hof-winner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hof-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.hof-initials {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.32), rgba(113, 198, 255, 0.24));
  font-size: 0.65rem;
  font-weight: 800;
}

.hof-winner strong {
  font-size: 0.85rem;
  color: var(--accent-strong);
}

@media (max-width: 720px) {
  .hof-layout {
    grid-template-columns: 1fr;
  }
  .traits-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
}

/* New hero trait layout */
.traits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.traits-title { font-size: 1.6rem; font-weight: 800; }
.overall-badge { background: linear-gradient(90deg,#1f8a4a,#35c07a); color:#042214; padding:8px 14px; border-radius:20px; font-weight:700; box-shadow:0 6px 18px rgba(52,180,112,0.07);} 

.traits-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.trait-hero-card {
  border-radius: 24px;
  padding: 1.6rem 1.4rem 2.2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.008));
  backdrop-filter: blur(8px) saturate(1.05);
  display:flex; flex-direction:column; align-items:center; text-align:center; justify-content:flex-start; min-height:220px; position:relative; overflow:hidden;
  border: 1px solid rgba(255,255,255,0.035);
}

.trait-hero-card .hero-icon { margin-top:6px; margin-bottom:12px; display:grid; place-items:center; width:92px; height:92px; border-radius:999px; }
.trait-hero-card .hero-icon svg { filter: drop-shadow(0 8px 30px rgba(0,0,0,0.6)); }
.trait-hero-card .hero-body { width:100%; }
.hero-label { font-size:1.15rem; margin-bottom:8px; font-weight:800; }
.hero-sub { color:var(--muted); margin:0 0 12px 0; font-size:0.95rem; }
.hero-badge { display:none; }

/* Numeric display for slider-type hero cards */
.hero-number {
  font-size:1.6rem;
  font-weight:900;
  color: var(--accent-strong);
  margin-top:8px;
  letter-spacing: -0.02em;
}

@media (max-width: 920px) {
  .hero-number { font-size:1.2rem; }
}

/* Glows */
.hero-yes { box-shadow: 0 24px 60px rgba(39,167,89,0.12), inset 0 1px 0 rgba(84,200,120,0.02); border-color: rgba(39,167,89,0.12);}
.hero-no { box-shadow: 0 24px 60px rgba(255,90,90,0.08), inset 0 1px 0 rgba(255,107,107,0.02); border-color: rgba(255,90,90,0.08);}
.hero-score { box-shadow: 0 20px 48px rgba(80,110,150,0.06); }
.hero-text { box-shadow: 0 20px 48px rgba(100,100,180,0.06); border-color: rgba(140,140,220,0.08); }

/* Score ring */
.score-ring { --size:96px; width:var(--size); height:var(--size); border-radius:50%; display:grid; place-items:center; background: conic-gradient(var(--accent) calc(var(--score) * 1turn), rgba(255,255,255,0.03) 0); box-shadow: inset 0 -8px 30px rgba(0,0,0,0.55); border: 4px solid rgba(255,255,255,0.02); }
.trait-hero-card .hero-icon .score-ring { --size: 84px; }
.score-val { font-size:1.6rem; font-weight:900; color: #fff; line-height:1; }
.score-sub { display:block; font-size:0.7rem; color:var(--muted); font-weight:600; }

.hero-dots { display:flex; gap:8px; margin-top:8px; justify-content:center; }
.hero-dot { width:12px; height:12px; border-radius:50%; background: rgba(255,255,255,0.06);} 
.hero-dot.filled { background: linear-gradient(90deg, #a2f49a, #2dbb66); box-shadow: 0 6px 18px rgba(45,187,102,0.18);} 

/* Wide slider */
.traits-wide { margin-top: 0.8rem; display:flex; flex-direction:column; gap:0.6rem; }
.trait-wide-card { display:flex; gap:1rem; align-items:center; padding:1rem 1.2rem; border-radius:20px; background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01)); border:1px solid rgba(255,255,255,0.03); box-shadow: 0 10px 28px rgba(0,0,0,0.5); }
.trait-wide-text .wide-left { flex:1; }
.wide-text-value { margin:0.2rem 0 0; font-size:0.95rem; white-space:pre-wrap; word-break:break-word; }
.wide-icon-number { width:48px; height:48px; display:grid; place-items:center; font-size:1.5rem; font-weight:900; color:rgba(200,200,255,0.85); flex-shrink:0; }
.wide-left { display:flex; gap:0.9rem; align-items:center; min-width:0; }
.wide-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:12px; background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 66%,0.06), rgba(255,255,255,0.02)); }
.wide-slider { flex:1; }
.wide-track { height:12px; background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02)); border-radius:999px; position:relative; }
.wide-fill { position:absolute; left:0; top:0; bottom:0; background: linear-gradient(90deg,#ffd278,#ffb86b); border-radius:999px; }
.wide-thumb { position:absolute; top:50%; transform:translate(-50%,-50%); width:16px; height:16px; border-radius:50%; background:#ffd278; box-shadow: 0 6px 18px rgba(255,178,107,0.18); }
.wide-score { width:72px; text-align:center; font-weight:800; color:#ffd278; }

@media (max-width: 920px) {
  .traits-hero { grid-template-columns: 1fr; }
  .trait-hero-card { min-height:120px; }
}

.vibe-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.3;
  padding: 0.2rem;
  line-height: 1;
  transition: opacity 0.15s;
  flex-shrink: 0;
  align-self: flex-start;
}

.vibe-delete:hover {
  opacity: 0.8;
}

.photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* Small category awards in character detail gallery */
.hof-category-grid-small {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.hof-cat-small {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.8rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.02);
}
.hof-cat-small-emoji { font-size: 1.6rem; margin-top: 4px; }
.hof-cat-theses { margin: 0.4rem 0 0 0; padding-left: 1rem; color: var(--muted); }

@media (max-width: 767px) {
  .hof-category-grid-small { grid-template-columns: 1fr; }
}

/* small badges in the Awards section for category counts */
.detail-award-cats { display:flex; gap:0.6rem; margin-bottom:0.6rem; flex-wrap:wrap; }
.detail-award-badge { padding:0.35rem 0.7rem; border-radius:999px; background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.03); font-weight:600; display:inline-flex; gap:0.45rem; align-items:center; }
.detail-award-badge .muted { opacity:0.8; }
.detail-award-badge.fame { color: var(--accent); }
.detail-award-badge.shame { color: #ffd86b; }
.detail-award-badge.spicy { color: #ff6b6b; }

.photo-upload-form {
  margin-bottom: 1.5rem;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 200, 120, 0.04), rgba(200, 160, 255, 0.04));
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.upload-area * {
  pointer-events: none;
}

.upload-area:hover {
  border-color: rgba(255, 200, 120, 0.5);
  background: linear-gradient(135deg, rgba(255, 200, 120, 0.1), rgba(200, 160, 255, 0.1));
  transform: translateY(-2px);
}

.upload-area:active {
  transform: translateY(0);
}

#photo-input {
  display: none;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  font-size: 2.5rem;
  pointer-events: none;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  pointer-events: none;
}

.upload-title {
  font-weight: 600;
  font-size: 1rem;
  color: inherit;
  pointer-events: none;
}

.upload-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.gallery-empty {
  text-align: center;
  padding: 1.5rem;
  font-style: italic;
}

.photo-card {
  overflow: hidden;
  padding: 0;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.photo-card img:hover {
  opacity: 0.85;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-focal-btn {
  background: rgba(255, 200, 120, 0.85);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem 0.5rem;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.15s;
}

.photo-focal-btn:hover {
  background: rgba(255, 200, 120, 1);
}

.photo-delete {
  background: rgba(255, 100, 100, 0.85);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem 0.5rem;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.15s;
}

.photo-delete:hover {
  background: rgba(255, 100, 100, 1);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  width: 100%;
}

.lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.6rem 0.9rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 1;
}

.lightbox-btn:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-prev { left: -3.2rem; }
.lightbox-next { right: -3.2rem; }

.lightbox-close {
  position: absolute;
  top: -2.6rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-counter {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
}



/* Focal point modal */
.focal-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0, 0, 0, 0.88);
  overflow: hidden;
}

.focal-modal.open {
  display: block;
}

.focal-img {
  position: fixed;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
  touch-action: none;
}

.focal-img:active {
  cursor: grabbing;
}

.focal-spotlight {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 18px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  z-index: 2;
  pointer-events: none;
}

.focal-ring {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}

.focal-chrome {
  position: fixed;
  bottom: 2rem;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 4;
}

.focal-hint {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
}

.focal-actions {
  display: flex;
  gap: 0.75rem;
}



.relationship-card,
.setting-card {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.settings-grid {
  grid-template-columns: 1fr;
}

.settings-form {
  min-height: auto;
}

.settings-list-container {
  margin-top: 1rem;
}

.inner-panel {
  padding: 1.5rem;
}

.flash {
  margin: 0 0 0.5rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(84, 200, 120, 0.12);
  border-color: rgba(84, 200, 120, 0.24);
}

.flash-error {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.24);
}

.alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
}

.alert-box {
  background: var(--panel-strong);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 20px;
  padding: 2rem;
  max-width: 340px;
  width: calc(100% - 2rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.alert-msg {
  font-size: 1rem;
  line-height: 1.5;
}

.compact-form {
  margin-bottom: 1rem;
}

.freundeskreis-section {
  padding-bottom: 0;
}

.freundeskreis-wrap {
  width: 100%;
  height: calc(100vh - 280px);
  min-height: 400px;
  overflow: hidden;
  display: block;
  position: relative;
  cursor: grab;
}

.freundeskreis-wrap.is-panning {
  cursor: grabbing;
}

.freundeskreis-svg {
  display: block;
  will-change: transform;
}

.freundeskreis-svg {
  display: block;
  flex-shrink: 0;
}

.single-panel {
  min-height: calc(100vh - 110px);
  display: grid;
  place-items: center;
}

.auth-card.auth-login-card {
  max-width: 980px;
  padding: 1rem;
}

.auth-login-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.05fr);
  gap: 1rem;
  align-items: stretch;
}

.auth-login-content {
  width: 100%;
  max-width: none;
  padding: 1.9rem 1.8rem;
}

.auth-login-content h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 0.96;
  margin-bottom: 0.55rem;
}

.auth-login-content .muted {
  max-width: 24ch;
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
}

.auth-login-form {
  gap: 0.95rem;
}

.auth-login-form label {
  font-size: 1.03rem;
  font-weight: 600;
}

.auth-login-form input {
  min-height: 56px;
  border-radius: 18px;
}

.auth-login-submit {
  width: 100%;
  min-height: 54px;
  font-size: 1.12rem;
  font-weight: 800;
  white-space: nowrap;
}

.auth-side-image {
  margin: 0;
  display: grid;
  place-items: center;
  padding: 1.1rem;
  min-height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at 18% 20%, rgba(116, 87, 255, 0.32), rgba(20, 20, 46, 0.92) 45%), linear-gradient(160deg, #2c2852, #171932 62%, #121629);
}

.auth-side-image img {
  width: min(100%, 355px);
  max-height: 520px;
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42));
}

.auth-card {
  width: 100%;
  max-width: 520px;
}

@media (max-width: 980px) {
  .detail-grid,
  .settings-grid,
  .hero,
  .section-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .section-header,
  .hero {
    align-items: stretch;
  }

  .hero,
  .section-header {
    gap: 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    width: min(220px, 60vw);
    justify-self: start;
  }

  .hero-with-image,
  .section-header-with-image {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-image,
  .section-header-image {
    width: min(220px, 70vw);
    max-height: none;
    justify-self: start;
  }

  .dashboard-alert {
    grid-template-columns: 1fr;
  }

  .dashboard-alert-icon {
    justify-self: start;
  }

  .dashboard-alert-text {
    overflow-wrap: anywhere;
  }

  .feature-grid,
  .stats-grid,
  .info-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    justify-items: stretch;
  }

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

  .auth-login-content {
    max-width: none;
    padding: 1.4rem;
  }

  .auth-login-content .muted {
    max-width: none;
  }

  .auth-side-image {
    min-height: 0;
    padding: 0.85rem;
  }

  .auth-side-image img {
    width: min(280px, 72vw);
    max-height: none;
  }

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

@media (max-width: 640px) {
  .topbar,
  .page-shell,
  .auth-shell {
    width: var(--site-width);
  }

  .hero,
  .auth-hero,
  .auth-card,
  .section-card,
  .stat-card,
  .inner-panel {
    padding: 1.1rem;
  }

  .hero-actions,
  .search-form,
  .inline-form,
  .relationship-card,
  .setting-card {
    flex-direction: column;
    align-items: stretch;
  }

  .hero,
  .dashboard-alert {
    padding: 1.1rem;
  }

  .hero-art {
    width: min(160px, 62vw);
  }

  .hero-image,
  .section-header-image {
    width: min(180px, 62vw);
  }

  .hero-art img,
  .character-cover,
  .photo-card img,
  .auth-side-image img {
    max-width: 100%;
  }
}

/* ── Stats ── */
.stats-carousel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.stats-carousel-header {
  order: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-carousel-header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.55rem;
}

.stats-carousel-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stats-carousel-btn {
  display: grid;
  justify-items: start;
  gap: 0.1rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms, background 140ms, border-color 140ms, color 140ms;
}

.stats-carousel-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.4);
}

.stats-carousel-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stats-carousel-btn-note {
  font-size: 0.7rem;
  line-height: 1;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-carousel-btn-title {
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 800;
  text-align: left;
}

.stats-carousel-track {
  order: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.stats-carousel-slide {
  scroll-snap-align: start;
  display: grid;
  gap: 1rem;
  align-content: start;
  justify-items: stretch;
  min-width: 0;
  overflow: hidden;
  padding: 1.15rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
}

.stats-slide-head {
  display: grid;
  gap: 0.3rem;
}

.stats-slide-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-slide-head h3 {
  margin: 0;
  font-size: 1.25rem;
}

.stats-carousel-footer {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.15rem 0 0.1rem;
}

.stats-carousel-status {
  font-size: 0.9rem;
}

.stats-carousel-dots {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.stats-carousel-dot {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms, background 140ms, border-color 140ms, color 140ms;
}

.stats-carousel-dot:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.stats-carousel-dot.active {
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.45);
  background: hsla(var(--accent-hue), 88%, 61%, 0.14);
  color: var(--accent-strong);
}

.stats-carousel-dot-range {
  min-width: 3.9rem;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}

.stats-carousel-slide .stats-table {
  margin-top: 0;
}

.stats-text-table .stats-name {
  width: 42%;
}

.stats-text-table .stats-value {
  text-align: left;
  width: 58%;
}

.stats-text-table .stats-value strong {
  display: inline-block;
  white-space: pre-wrap;
}

.stats-text-table .stats-row {
  vertical-align: top;
}

.stats-text-table .stats-name,
.stats-text-table .stats-value {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.stats-row {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stats-row:last-child {
  border-bottom: none;
}

.stats-rank, .stats-name, .stats-value {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
  min-width: 0;
}

.stats-rank {
  width: 52px;
  text-align: center;
}

.stats-medal {
  font-size: 1.4rem;
}

.stats-rank-num {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.stats-name a {
  font-weight: 700;
  transition: color 120ms;
  overflow-wrap: anywhere;
}

.stats-name a:hover {
  color: var(--accent-strong);
}

.stats-top-1 .stats-name a { color: #ffd700; }
.stats-top-2 .stats-name a { color: #c0c0c0; }
.stats-top-3 .stats-name a { color: #cd7f32; }

.stats-value {
  text-align: right;
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.stats-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-end;
}

.stats-bar-track {
  width: 160px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  overflow: hidden;
}

.stats-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, hsla(var(--accent-hue), 88%, 61%,0.5), hsla(var(--accent-hue), 88%, 61%,0.95));
  min-width: 3px;
}

.stats-pie-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  min-width: 0;
}

.stats-pie-card {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.stats-pie {
  width: min(38vw, 220px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 12px 32px rgba(0, 0, 0, 0.25);
}

.stats-pie-legend {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.stats-slice-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.7rem 0.85rem;
  min-width: 0;
}

.stats-slice-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}

.stats-swatch {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.stats-slice-members {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.stats-slice-members a {
  color: var(--text);
  font-weight: 600;
}

.stats-slice-members a:hover {
  color: var(--accent-strong);
}

@media (max-width: 700px) {
  .stats-carousel-header h2 {
    font-size: 1.2rem;
  }

  .stats-carousel-slide {
    padding: 0.95rem;
  }

  .stats-carousel-btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.8rem;
  }

  .stats-carousel-btn-title {
    font-size: 0.8rem;
  }

  .stats-carousel-dot {
    min-width: 1.8rem;
    height: 1.8rem;
    padding: 0 0.45rem;
  }

  .stats-carousel-dot-range {
    min-width: 3.4rem;
  }

  .stats-rank, .stats-name, .stats-value {
    padding: 0.55rem 0.3rem;
  }

  .stats-rank {
    width: 36px;
  }

  .stats-medal {
    font-size: 1.1rem;
  }

  .stats-name a {
    font-size: 0.88rem;
  }

  .stats-value {
    font-size: 0.82rem;
    white-space: normal;
  }

  .stats-bar-wrap {
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .stats-bar-track {
    width: 70px;
  }

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

  .stats-pie {
    width: min(70vw, 220px);
  }
}
.award-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.award-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.4;
}

.award-trophy {
  flex-shrink: 0;
  font-size: 1rem;
}

/* Character detail: modern award chips */
.detail-awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  align-items: stretch;
}

.detail-award-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.58rem 0.66rem;
  border-radius: 16px;
  min-height: 70px;
  overflow: hidden;
  background:
    linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%,0.12), hsla(var(--accent-hue), 88%, 71%,0.06));
  border: 1px solid hsla(var(--accent-hue), 88%, 61%,0.3);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.detail-award-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, hsla(var(--accent-hue), 88%, 61%, 0.10), transparent 42%);
  opacity: 1;
  pointer-events: none;
}

.detail-award-chip:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: hsla(var(--accent-hue), 88%, 67%, 0.55);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.24),
    0 0 0 1px hsla(var(--accent-hue), 88%, 67%, 0.16),
    0 0 22px hsla(var(--accent-hue), 88%, 61%, 0.12);
}

.award-chip__icon {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: clamp(0.72rem, 0.9vw, 0.86rem);
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%, 0.18), hsla(var(--accent-hue), 88%, 71%, 0.08));
  border: 1px solid hsla(var(--accent-hue), 88%, 61%, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.award-chip__content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.award-chip__title {
  margin: 0;
  width: 100%;
  text-align: center;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: clamp(0.66rem, 0.8vw, 0.76rem);
  line-height: 1.18;
  letter-spacing: 0.005em;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  hyphens: auto;
  word-break: break-word;
}

@media (max-width: 980px) {
  .detail-awards-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.7rem;
  }

  .detail-award-chip {
    min-height: 74px;
    padding: 0.8rem 0.9rem;
  }

  .award-chip__title {
    font-size: clamp(0.68rem, 2.8vw, 0.8rem);
  }
}

@media (max-width: 620px) {
  .detail-awards-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .detail-award-chip {
    min-height: 70px;
    padding: 0.78rem 0.85rem;
  }

  .award-chip__icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
  }

  .award-chip__title {
    font-size: clamp(0.67rem, 3.4vw, 0.78rem);
  }
}

/* Hall of Fame — Portrait Cards */
.hof-portrait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.hof-portrait-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.2rem 1rem 1rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  min-height: 240px;
  text-align: center;
}

.hof-portrait-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11rem;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.hof-portrait-title {
  position: relative;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  line-height: 1.3;
  margin: 0;
  z-index: 1;
}

.hof-portrait-avatar-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hof-portrait-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsla(var(--accent-hue), 88%, 61%,0.4);
  box-shadow: 0 0 20px hsla(var(--accent-hue), 88%, 61%,0.15);
}

.hof-portrait-initials {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%,0.15), rgba(113,198,255,0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid hsla(var(--accent-hue), 88%, 61%,0.3);
  color: rgba(255,255,255,0.35);
}

.hof-portrait-name {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: 'Fraunces', serif;
}

.hof-portrait-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
}

/* Chalkboard tally */
.chalk-board {
  background: #1a2e1a;
  border: 3px solid #2d4a2d;
  border-radius: 18px;
  padding: 1.75rem 2rem;
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.4), 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.chalk-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 28px,
    rgba(255,255,255,0.015) 28px,
    rgba(255,255,255,0.015) 29px
  );
  pointer-events: none;
}

.chalk-heading {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  margin-bottom: 1.1rem;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(255,255,255,0.15), 1px 1px 0 rgba(0,0,0,0.4);
  filter: blur(0.2px);
}

.chalk-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chalk-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chalk-name {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  min-width: 120px;
  text-shadow: 0 0 6px rgba(255,255,255,0.12), 1px 1px 0 rgba(0,0,0,0.35);
  filter: blur(0.15px);
}

.chalk-tally {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: rgba(255,255,255,0.78);
}

.tally-group {
  display: block;
  opacity: 0.88;
  filter: blur(0.4px);
}

/* ── Theme Picker ── */
.theme-picker-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.theme-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: inherit;
}

.theme-preset-btn:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}

.theme-preset-btn.active {
  border-color: var(--accent);
  color: var(--text);
}

.theme-preset-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: block;
  background: linear-gradient(135deg, hsl(var(--preset-hue), 62%, 10%), hsl(var(--preset-hue), 55%, 20%));
  border: 2px solid hsl(var(--preset-hue), 40%, 30%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.accent-swatch {
  background: hsl(var(--preset-hue), 82%, 56%);
  border-color: hsl(var(--preset-hue), 60%, 40%);
}

.theme-preset-label {
  white-space: nowrap;
}

.theme-custom-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.theme-custom-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
  min-width: 180px;
}

.theme-hue-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  appearance: none;
  background: linear-gradient(to right,
    hsl(0,70%,50%), hsl(30,70%,50%), hsl(60,70%,50%), hsl(90,70%,50%),
    hsl(120,70%,50%), hsl(150,70%,50%), hsl(180,70%,50%), hsl(210,70%,50%),
    hsl(240,70%,50%), hsl(270,70%,50%), hsl(300,70%,50%), hsl(330,70%,50%), hsl(360,70%,50%)
  );
  cursor: pointer;
  outline: none;
  border: none;
}

.theme-hue-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
}

.theme-hue-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
}

.theme-hue-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  transition: background 0.1s;
}

/* Camouflage swatch special case */
.theme-preset-btn[value="999"] .theme-preset-swatch {
  background:
    radial-gradient(ellipse 18px 12px at 30% 35%, #2a3318 0%, transparent 70%),
    radial-gradient(ellipse 12px 18px at 65% 25%, #4a5c2a 0%, transparent 65%),
    radial-gradient(ellipse 16px 10px at 70% 68%, #3a2e18 0%, transparent 70%),
    radial-gradient(ellipse 10px 16px at 20% 70%, #506028 0%, transparent 65%),
    radial-gradient(ellipse 14px 10px at 50% 50%, #1e2814 0%, transparent 60%),
    #344020;
  border-color: #4a5a28;
}

/* ── Font Picker ── */
.font-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.font-option-btn {
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: center;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text);
  font-family: inherit;
  gap: 0;
}

.font-option-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
}

.font-option-btn.active {
  border-color: var(--accent);
  background: hsla(var(--accent-hue), 88%, 61%,0.07);
}

.font-option-preview {
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.font-option-name {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Push notification prompt banner */
#push-prompt {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  width: calc(100% - 2.4rem);
  max-width: 460px;
  backdrop-filter: blur(12px);
}

.push-prompt-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.push-prompt-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.push-prompt-text strong {
  font-size: 0.95rem;
  color: var(--text);
}

.push-prompt-text span {
  font-size: 0.82rem;
  color: var(--muted);
}

.push-prompt-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Hall of Fame — Champion Section */
.hof-champion-section {
  overflow: hidden;
}

.hof-champion-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem 2rem;
}

.hof-champion-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(var(--accent-hue), 88%, 61%,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hof-champion-crown {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px hsla(var(--accent-hue), 88%, 61%,0.6));
  animation: hof-float 3s ease-in-out infinite;
}

@keyframes hof-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hof-champion-avatar-wrap {
  position: relative;
  margin: 0.6rem 0;
}

/* ensure avatar wrap centers content and provides sizing for the ring */
.hof-champion-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Category champions (Fame / Shame / Spicy) */
.hof-category-champions .hof-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.6rem;
}
.hof-cat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.02);
  width: 100%;
  min-height: 120px;
}
.hof-cat-emoji { font-size: 1.6rem; }
.hof-cat-body strong { display: block; }
.hof-cat-count { font-size: 0.85rem; opacity: 0.8; }

/* Mini champion variant for category winners */
.hof-champion-mini {
  position: relative;
}
.hof-champion-mini .hof-champion-crown {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  filter: none;
  animation: none;
}
.hof-champion-mini .hof-champion-avatar-wrap {
  margin: 0.4rem 0;
}

@media (max-width: 767px) {
  .hof-category-champions .hof-category-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hof-category-champions .hof-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.hof-champion-mini .hof-champion-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
}
.hof-champion-mini .hof-champion-ring.mini {
  /* position the ring exactly around the avatar */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  inset: auto;
  z-index: 0;
}
.hof-cat-card.hof-champion-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 12px;
  min-width: 160px;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.006));
  border: 1px solid rgba(255,255,255,0.02);
}
.hof-champion-badge.mini {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  opacity: 0.95;
}

.hof-champion-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  border: 3px solid hsla(var(--accent-hue), 88%, 61%,0.6);
}

.hof-champion-initials {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--panel-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  position: relative;
  z-index: 1;
  border: 3px solid hsla(var(--accent-hue), 88%, 61%,0.6);
}

.hof-champion-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  inset: auto;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%,0.8), hsla(var(--accent-hue), 88%, 71%,0.3), hsla(var(--accent-hue), 88%, 61%,0.8)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: hof-spin 8s linear infinite;
  z-index: 0;
}

@keyframes hof-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hof-champion-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}

.hof-champion-count {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.hof-champion-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.hof-champion-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.hof-champion-badge {
  margin-top: 0.6rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: hsla(var(--accent-hue), 88%, 61%,0.12);
  border: 1px solid hsla(var(--accent-hue), 88%, 61%,0.3);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Hall of Fame — open thesis award cards */
.hof-open-section {
  overflow: hidden;
}

.hof-open-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

.hof-open-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(130,140,255,0.14) 0%, transparent 70%);
  pointer-events: none;
}

.hof-open-counter {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.hof-open-question {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 10px rgba(130,140,255,0.5));
  animation: hof-float 3s ease-in-out infinite;
}

.hof-open-thesis {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  max-width: 520px;
  line-height: 1.4;
  margin: 0;
}

.hof-open-decide-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 320px;
}

.hof-open-select {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 1rem;
  appearance: auto;
}

.hof-open-pending {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.hof-open-delete-form {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.hof-open-delete {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.hof-open-delete:hover {
  color: var(--text);
  background: var(--panel-strong);
}

/* Character detail — champion banner */
.detail-champion-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
  border-radius: 14px;
  background: linear-gradient(135deg, hsla(var(--accent-hue), 88%, 61%,0.12), hsla(var(--accent-hue), 88%, 71%,0.06));
  border: 1px solid hsla(var(--accent-hue), 88%, 61%,0.3);
}

.detail-champion-crown {
  font-size: 2rem;
  flex-shrink: 0;
  animation: hof-float 3s ease-in-out infinite;
}

.detail-champion-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.detail-champion-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.detail-champion-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.detail-champion-badge {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.detail-category-winners {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.detail-champion-banner-mini {
  padding: 0.8rem 1rem;
  margin-bottom: 0;
}

.detail-champion-banner-mini .detail-champion-crown {
  font-size: 1.6rem;
}

.detail-champion-banner-mini .detail-champion-title {
  font-size: 0.9rem;
}

.detail-champion-banner-mini .detail-champion-sub {
  font-size: 0.75rem;
}

/* Missing fields — detail alert */
.missing-alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: hsla(var(--accent-hue), 88%, 61%, 0.08);
  border: 1px solid hsla(var(--accent-hue), 88%, 61%, 0.25);
}

.missing-alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.missing-alert-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.missing-alert-body strong {
  font-size: 0.88rem;
  color: var(--accent-strong);
}

.missing-alert-body span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Missing fields — edit form */
label.label-empty {
  position: relative;
}

label.label-empty > input,
label.label-empty > textarea,
label.label-empty > select,
label.label-empty > .num-input-wrap {
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.45) !important;
  background: hsla(var(--accent-hue), 88%, 61%, 0.04) !important;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.3rem;
  opacity: 0.8;
}

.field-empty-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 3px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

/* Nicoflix */
.nicoflix-search-section {
  position: relative;
  z-index: 5;
}

.nicoflix-search {
  position: relative;
}

.nicoflix-search-input {
  width: 100%;
  min-height: 46px;
  padding: 0.8rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1rem;
}

.nicoflix-search-results {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  padding: 0.4rem;
}

.nicoflix-search-results.open {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nicoflix-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.nicoflix-result:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nicoflix-result img,
.nicoflix-result-noposter {
  width: 40px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.nicoflix-result-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.nicoflix-result-info strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nicoflix-result-info span {
  font-size: 0.78rem;
  color: var(--muted);
}

.nicoflix-hidden-form {
  display: none;
}

.nicoflix-preview {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.nicoflix-preview-poster-wrap {
  position: relative;
  width: 110px;
  flex-shrink: 0;
}

.nicoflix-preview-poster {
  width: 110px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nicoflix-preview-poster[hidden] {
  display: none;
}

.nicoflix-preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.nicoflix-preview-info strong {
  font-size: 1.2rem;
  font-family: 'Fraunces', serif;
  line-height: 1.3;
}

.nicoflix-preview-info span {
  color: var(--muted);
  font-size: 0.9rem;
}

.nicoflix-preview-meta {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0.15rem 0 0;
}

.nicoflix-preview-plot {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.6rem;
}

.nicoflix-trailer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ff4d4d;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  margin: 0 0 0.9rem;
}

.nicoflix-trailer-link:hover {
  text-decoration: underline;
}

.nicoflix-trailer-link[hidden] {
  display: none;
}

.nicoflix-cast-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin: 0 0 1.25rem;
}

.nicoflix-cast-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  width: 68px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.nicoflix-cast-member:hover .nicoflix-cast-name {
  color: var(--accent-strong);
}

.nicoflix-cast-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsla(var(--accent-hue), 88%, 61%, 0.35);
}

.nicoflix-cast-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 1.1rem;
}

.nicoflix-cast-name {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
}

.nicoflix-season-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 1.25rem;
  max-width: 280px;
}

.nicoflix-season-field[hidden] {
  display: none;
}

.nicoflix-season-field select {
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 400;
  color-scheme: dark light;
}

.nicoflix-preview-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nicoflix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.nicoflix-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.nicoflix-card-available {
  border-color: hsla(var(--accent-hue), 88%, 61%, 0.4);
}

.nicoflix-card-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.nicoflix-card-open:hover .nicoflix-title {
  color: var(--accent-strong);
}

.nicoflix-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.nicoflix-modal[hidden] {
  display: none;
}

.nicoflix-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.nicoflix-modal-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
}

.nicoflix-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.nicoflix-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-strong);
}

.nicoflix-person-modal-content {
  max-width: 640px;
}

.nicoflix-person-modal-content h3 {
  margin: 0 0 1rem;
  padding-right: 2rem;
}

.nicoflix-person-credit-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
}

.nicoflix-person-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}

.nicoflix-person-credit:hover .nicoflix-person-credit-title {
  color: var(--accent-strong);
}

.nicoflix-person-credit img,
.nicoflix-person-credit-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nicoflix-person-credit-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.4rem;
}

.nicoflix-person-credit-title {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.25;
}

.nicoflix-poster-wrap {
  position: relative;
  width: 100%;
}

.nicoflix-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nicoflix-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.nicoflix-available-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.nicoflix-title {
  font-size: 0.92rem;
  font-weight: 800;
  font-family: 'Fraunces', serif;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(1.25em * 2);
  width: 100%;
}

.nicoflix-year,
.nicoflix-ordered-by {
  font-size: 0.76rem;
  color: var(--muted);
}

.nicoflix-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  width: 100%;
}

.nicoflix-available-button {
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
}

.nicoflix-delete-form {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
}
