/* AnimeVIP design refresh layer. Loaded after the main stylesheet. */
body:not(.theme-blueanime) {
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 143, 45, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(120, 38, 20, 0.18), transparent 30rem),
    linear-gradient(180deg, #090807 0%, #120d0a 38%, #070706 100%);
  color: var(--text);
}

body:not(.theme-blueanime)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 72%);
}

body:not(.theme-blueanime)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 205, 123, 0.08), transparent 32rem),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.26) 100%);
}

.topbar,
.site-header,
.mobile-topbar {
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border-bottom: 1px solid rgba(255, 190, 103, 0.18);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.left-sidebar,
.right-sidebar,
.profile-card,
.character-card,
.profile-panel,
.profile-card-block,
.news-card,
.news-article-card,
.comments-card,
.roleplay-card,
.village-card,
.subsection-card,
.thread-card,
.thread-post-card,
.thread-compose-card,
.mission-form-section,
.technique-form-section,
.artifact-card,
.gift-card,
.auth-card,
.settings-clean-card,
.settings-mini-card,
.admin-card,
.admin-panel,
.content-card {
  border: 1px solid rgba(255, 181, 88, 0.18);
  background:
    linear-gradient(145deg, rgba(39, 25, 17, 0.92), rgba(16, 13, 11, 0.96)),
    rgba(18, 14, 12, 0.94);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 232, 194, 0.07);
}

.profile-card,
.character-card,
.news-card,
.roleplay-card,
.village-card,
.subsection-card,
.thread-card,
.artifact-card,
.gift-card,
.technique-card-modern,
.character-modern-card {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.profile-card:hover,
.character-card:hover,
.news-card:hover,
.roleplay-card:hover,
.village-card:hover,
.subsection-card:hover,
.thread-card:hover,
.artifact-card:hover,
.gift-card:hover,
.technique-card-modern:hover,
.character-modern-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 190, 103, 0.34);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 181, 88, 0.08),
    inset 0 1px 0 rgba(255, 232, 194, 0.08);
}

.page-title,
.section-title,
.profile-section-title,
.roleplay-section-title,
.admin-page-title,
.settings-page-title,
.home-title,
.news-section h1,
.news-section h2,
.roleplay-page h1,
.technique-page h1,
.technique-school-page h1,
.character-page h1,
.profile-page h1 {
  color: #fff1c9;
  letter-spacing: 0;
  text-shadow: 0 8px 28px rgba(255, 136, 38, 0.18);
}

.page-title::after,
.section-title::after,
.profile-section-title::after,
.roleplay-section-title::after,
.admin-page-title::after,
.settings-page-title::after,
.home-title::after,
.news-section h1::after,
.news-section h2::after,
.roleplay-page h1::after,
.technique-page h1::after,
.technique-school-page h1::after,
.character-page h1::after,
.profile-page h1::after {
  content: "";
  display: block;
  width: min(132px, 42%);
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb454, rgba(255, 138, 28, 0.18), transparent);
  box-shadow: 0 0 18px rgba(255, 138, 28, 0.28);
}

.button,
.button-primary,
.btn,
button[type="submit"],
input[type="submit"] {
  border: 1px solid rgba(255, 201, 118, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 184, 82, 0.96), rgba(196, 91, 31, 0.96));
  color: #261105;
  box-shadow:
    0 10px 22px rgba(255, 126, 35, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  font-weight: 800;
}

.button:hover,
.button-primary:hover,
.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(255, 126, 35, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.button-secondary,
.btn-secondary,
a.button-secondary {
  border: 1px solid rgba(255, 186, 97, 0.22);
  background:
    linear-gradient(180deg, rgba(72, 44, 28, 0.88), rgba(40, 27, 21, 0.92));
  color: #ffe1aa;
  box-shadow: inset 0 1px 0 rgba(255, 232, 194, 0.08);
}

.profile-badge,
.badge,
.tag,
.technique-mark-badge,
.roleplay-badge,
.character-rank-badge,
.news-badge {
  border: 1px solid rgba(255, 185, 91, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 145, 40, 0.18), rgba(63, 37, 25, 0.72));
  color: #ffe4b5;
  box-shadow: inset 0 1px 0 rgba(255, 232, 194, 0.08);
}

.home-page,
.news-section,
.roleplay-page,
.technique-page,
.technique-school-page,
.profile-page,
.character-page,
.settings-page-clean,
.admin-hub-page {
  position: relative;
}

.home-page > .profile-panel:first-child,
.roleplay-page > .profile-panel:first-child,
.technique-school-page > .profile-panel:first-child,
.news-section > .profile-panel:first-child,
.settings-clean-head,
.admin-hub-page > .profile-panel:first-child {
  overflow: hidden;
  border-color: rgba(255, 184, 82, 0.28);
  background:
    radial-gradient(circle at 9% 20%, rgba(255, 172, 70, 0.2), transparent 20rem),
    radial-gradient(circle at 85% 10%, rgba(129, 43, 24, 0.18), transparent 22rem),
    linear-gradient(145deg, rgba(48, 29, 19, 0.96), rgba(17, 13, 11, 0.98));
}

.home-page > .profile-panel:first-child::before,
.roleplay-page > .profile-panel:first-child::before,
.technique-school-page > .profile-panel:first-child::before,
.news-section > .profile-panel:first-child::before,
.settings-clean-head::before,
.admin-hub-page > .profile-panel:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.055) 42%, transparent 62%);
  opacity: 0.7;
}

.news-card h3,
.thread-card h3,
.subsection-card h3,
.roleplay-card h3,
.technique-card-modern h2,
.character-modern-card h2,
.artifact-card h3,
.profile-card h3 {
  color: #ffe6b2;
}

.news-card h3 a,
.thread-card h3 a,
.subsection-card h3 a,
.roleplay-card h3 a,
.technique-card-modern h2 a,
.character-modern-card h2 a {
  color: inherit;
  text-decoration: none;
}

.news-card p,
.thread-card p,
.subsection-card p,
.roleplay-card p,
.technique-card-modern p,
.character-modern-card p,
.artifact-card p,
.profile-card p {
  color: rgba(255, 239, 210, 0.76);
}

.left-sidebar .sidebar-link,
.left-sidebar a,
.mobile-bottom-nav a,
.bottom-nav a {
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.left-sidebar .sidebar-link:hover,
.left-sidebar a:hover,
.mobile-bottom-nav a:hover,
.bottom-nav a:hover {
  transform: translateX(2px);
}

.left-sidebar .is-active,
.left-sidebar .active,
.mobile-bottom-nav .is-active,
.mobile-bottom-nav .active,
.bottom-nav .is-active,
.bottom-nav .active {
  border-color: rgba(255, 192, 106, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 139, 38, 0.24), rgba(42, 26, 18, 0.86));
  color: #fff2cf;
  box-shadow: inset 3px 0 0 rgba(255, 160, 52, 0.9);
}

.chat-message,
.message-card,
.private-message,
.comment-card,
.diary-card,
.diary-entry-card {
  border: 1px solid rgba(255, 181, 88, 0.16);
  background:
    linear-gradient(145deg, rgba(36, 24, 18, 0.88), rgba(17, 13, 11, 0.94));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.chat-message.is-own,
.message-card.is-own,
.private-message.is-own {
  border-color: rgba(255, 194, 108, 0.28);
  background:
    linear-gradient(145deg, rgba(63, 38, 22, 0.9), rgba(28, 18, 14, 0.95));
}

/* Message composition refresh: avatars become compact author markers. */
.chat-feed,
.messages-thread,
.comments-list,
.diary-comments,
.ticket-thread {
  display: grid;
  gap: 12px;
}

.chat-message.chat-message-flat {
  position: relative;
  display: block;
  padding: 13px 14px;
  border-radius: 16px;
}

.chat-message.chat-message-flat > img {
  display: none;
}

.chat-bubble-body,
.chat-bubble-body-flat {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.chat-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 190, 103, 0.1);
}

.chat-meta > span:last-child {
  flex: 0 0 auto;
  color: rgba(255, 232, 194, 0.54);
  font-size: 0.78rem;
  line-height: 1.4;
}

.chat-meta .user-chip,
.chat-meta .user-chip-inline {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-author-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  opacity: 0.86;
}

.chat-meta .user-chip-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-meta .user-chip-name-wrap {
  min-width: 0;
}

.chat-meta .user-chip-name {
  font-size: 1rem;
  line-height: 1.2;
}

.chat-meta .user-chip-copy small {
  color: rgba(255, 232, 194, 0.54);
  font-size: 0.76rem;
  line-height: 1.25;
}

.chat-text {
  min-width: 0;
  color: rgba(255, 245, 226, 0.9);
  font-size: 0.98rem;
  line-height: 1.58;
}

.chat-text p:first-child {
  margin-top: 0;
}

.chat-text p:last-child {
  margin-bottom: 0;
}

.chat-reply-quote {
  border-left: 3px solid rgba(255, 169, 70, 0.56);
  border-radius: 12px;
  background: rgba(255, 169, 70, 0.08);
  padding: 9px 11px;
}

.chat-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  padding-top: 2px;
}

.chat-message-actions .button-secondary,
.chat-message-actions .button-danger,
.chat-message-actions button,
.chat-message-actions a {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 0.82rem;
}

.chat-pinned-message {
  border-radius: 16px;
}

.chat-pinned-details > summary {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
}

.chat-pinned-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.message-bubble,
.message-card,
.private-message,
.ticket-message-card,
.comment-card,
.diary-comment-card {
  border-radius: 16px;
}

.messages-thread-feed .message-bubble:not(.is-own) .message-bubble-card,
.messages-thread-feed-telegram .message-bubble-telegram:not(.is-own) .message-bubble-card {
  border-left: 3px solid rgba(255, 177, 84, 0.42);
  background:
    linear-gradient(145deg, rgba(34, 23, 18, 0.92), rgba(17, 13, 11, 0.96));
}

.messages-thread-feed .message-bubble.is-own .message-bubble-card,
.messages-thread-feed-telegram .message-bubble-telegram.is-own .message-bubble-card {
  border-right: 3px solid rgba(255, 139, 38, 0.58);
  border-left-color: transparent;
  background:
    linear-gradient(145deg, rgba(64, 38, 22, 0.94), rgba(29, 19, 14, 0.97));
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 232, 194, 0.08);
}

.messages-thread-feed .message-bubble:not(.is-own) .message-bubble-meta,
.messages-thread-feed-telegram .message-bubble-telegram:not(.is-own) .message-bubble-meta {
  color: rgba(255, 232, 194, 0.62);
}

.messages-thread-feed .message-bubble.is-own .message-bubble-meta,
.messages-thread-feed-telegram .message-bubble-telegram.is-own .message-bubble-meta {
  color: rgba(255, 220, 170, 0.72);
}

.message-bubble-avatar,
.messages-thread-avatar,
.messages-conversation-avatar,
.ticket-message-avatar,
.small-avatar,
.user-chip-avatar {
  border-radius: 11px;
  border: 1px solid rgba(255, 190, 103, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 164, 72, 0.14), rgba(34, 21, 15, 0.82));
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.18);
  object-fit: cover;
}

.message-bubble-avatar,
.ticket-message-avatar,
.small-avatar {
  width: 38px;
  height: 38px;
}

.messages-thread-avatar,
.messages-conversation-avatar {
  width: 44px;
  height: 44px;
}

.user-chip-avatar {
  width: 30px;
  height: 30px;
}

body.theme-blueanime .chat-message.chat-message-flat > img,
body.theme-blueanime .message-bubble-avatar,
body.theme-blueanime .messages-thread-avatar,
body.theme-blueanime .messages-conversation-avatar,
body.theme-blueanime .ticket-message-avatar,
body.theme-blueanime .small-avatar,
body.theme-blueanime .user-chip-avatar {
  border-color: rgba(93, 176, 255, 0.24);
  background:
    linear-gradient(145deg, rgba(83, 166, 237, 0.14), rgba(13, 30, 52, 0.9));
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.18);
}

body.theme-blueanime .chat-message,
body.theme-blueanime .message-card,
body.theme-blueanime .private-message,
body.theme-blueanime .comment-card,
body.theme-blueanime .diary-card,
body.theme-blueanime .diary-entry-card {
  border-color: rgba(93, 176, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(17, 37, 62, 0.92), rgba(8, 17, 31, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

body.theme-blueanime .chat-message.is-own,
body.theme-blueanime .message-card.is-own,
body.theme-blueanime .private-message.is-own {
  border-color: rgba(120, 190, 255, 0.3);
  background:
    linear-gradient(145deg, rgba(24, 57, 92, 0.94), rgba(9, 24, 43, 0.97));
}

body.theme-blueanime .chat-pinned-message,
body.theme-blueanime .chat-pinned-details > summary {
  border-color: rgba(93, 176, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(19, 45, 76, 0.92), rgba(8, 18, 34, 0.96));
}

body.theme-blueanime .chat-pinned-mark,
body.theme-blueanime .chat-pinned-label {
  color: #d8efff;
  background:
    linear-gradient(135deg, rgba(83, 166, 237, 0.22), rgba(13, 30, 52, 0.88));
}

body.theme-blueanime .chat-message-actions .button-secondary,
body.theme-blueanime .chat-message-actions .button-danger,
body.theme-blueanime .chat-message-actions button,
body.theme-blueanime .chat-message-actions a {
  border-color: rgba(93, 176, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(16, 38, 64, 0.9), rgba(7, 16, 30, 0.94));
  color: #e8f6ff;
}

body.theme-blueanime .chat-meta {
  border-bottom-color: rgba(72, 145, 218, 0.12);
}

body.theme-blueanime .chat-meta > span:last-child,
body.theme-blueanime .chat-meta .user-chip-copy small {
  color: rgba(216, 239, 255, 0.58);
}

body.theme-blueanime .chat-text {
  color: rgba(232, 246, 255, 0.9);
}

body.theme-blueanime .chat-reply-quote {
  border-left-color: rgba(45, 130, 216, 0.58);
  background: rgba(83, 166, 237, 0.1);
}

body.theme-blueanime .messages-thread-feed .message-bubble:not(.is-own) .message-bubble-card,
body.theme-blueanime .messages-thread-feed-telegram .message-bubble-telegram:not(.is-own) .message-bubble-card {
  border-left-color: rgba(120, 190, 255, 0.42);
  background:
    linear-gradient(145deg, rgba(17, 37, 62, 0.94), rgba(8, 17, 31, 0.97));
}

body.theme-blueanime .messages-thread-feed .message-bubble.is-own .message-bubble-card,
body.theme-blueanime .messages-thread-feed-telegram .message-bubble-telegram.is-own .message-bubble-card {
  border-right-color: rgba(83, 166, 237, 0.62);
  background:
    linear-gradient(145deg, rgba(25, 62, 98, 0.94), rgba(10, 25, 45, 0.97));
}

body.theme-blueanime .messages-thread-feed .message-bubble:not(.is-own) .message-bubble-meta,
body.theme-blueanime .messages-thread-feed-telegram .message-bubble-telegram:not(.is-own) .message-bubble-meta {
  color: rgba(216, 239, 255, 0.58);
}

body.theme-blueanime .messages-thread-feed .message-bubble.is-own .message-bubble-meta,
body.theme-blueanime .messages-thread-feed-telegram .message-bubble-telegram.is-own .message-bubble-meta {
  color: rgba(216, 239, 255, 0.74);
}

/* Keep character profile avatar compact enough to not stretch the profile page. */
.character-roleplay-side {
  justify-items: start;
}

.character-roleplay-avatar {
  width: min(100%, 220px);
  max-width: 220px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.character-profile-tabs {
  display: grid;
  gap: 14px;
}

.character-profile-tab-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid rgba(255, 181, 88, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(36, 24, 18, 0.86), rgba(17, 13, 11, 0.94));
  scrollbar-width: thin;
}

.character-profile-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 181, 88, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 240, 212, 0.82);
  font-weight: 800;
  cursor: pointer;
}

.character-profile-tab.is-active {
  border-color: rgba(255, 194, 108, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 157, 61, 0.24), rgba(240, 195, 106, 0.12));
  color: #fff0d4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.character-profile-tab-panel {
  min-width: 0;
}

.character-profile-tabs.js-ready .character-profile-tab-panel:not(.is-active) {
  display: none;
}

.character-profile-tab-panel > .profile-panel {
  margin: 0;
}

.character-profile-tab-panel .character-technique-ranks-compact {
  display: grid;
  gap: 14px;
}

.character-profile-tab-panel .character-technique-ranks-compact .roleplay-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.character-profile-tab-panel .character-technique-ranks-compact .roleplay-card {
  min-height: auto;
}

.character-profile-tab-panel .character-technique-ranks-compact .roleplay-card-body > p {
  max-height: 9.5em;
  overflow: auto;
}

body.theme-blueanime .character-profile-tab-nav {
  border-color: rgba(93, 176, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(17, 37, 62, 0.9), rgba(8, 17, 31, 0.96));
}

body.theme-blueanime .character-profile-tab {
  border-color: rgba(93, 176, 255, 0.2);
  background: rgba(106, 184, 255, 0.045);
  color: rgba(232, 246, 255, 0.82);
}

body.theme-blueanime .character-profile-tab.is-active {
  border-color: rgba(120, 190, 255, 0.56);
  background:
    linear-gradient(135deg, rgba(106, 184, 255, 0.22), rgba(168, 220, 255, 0.1));
  color: #e8f6ff;
}

.profile-tabbed-page {
  display: grid;
  gap: 16px;
}

.profile-page-tab-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid rgba(255, 194, 108, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(28, 18, 16, 0.74), rgba(12, 10, 12, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.profile-page-tab {
  appearance: none;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 194, 108, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-muted, #cbbdb7);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
}

.profile-page-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 194, 108, 0.34);
  color: var(--text, #fff8ee);
}

.profile-page-tab.is-active {
  border-color: rgba(255, 194, 108, 0.5);
  background: linear-gradient(135deg, rgba(255, 155, 70, 0.3), rgba(70, 30, 18, 0.96));
  color: #fff9ef;
  box-shadow: 0 12px 24px rgba(30, 12, 5, 0.24);
}

.profile-page-tab-panels,
.profile-page-tab-panel {
  min-width: 0;
}

.profile-tabbed-page.js-ready .profile-page-tab-panel:not(.is-active) {
  display: none;
}

.profile-page-tab-panel > .profile-panel,
.profile-page-tab-panel > .profile-card-block {
  margin: 0;
}

.profile-tabbed-page .settings-clean-layout,
.profile-tabbed-page .settings-spoiler-stack,
.profile-tabbed-page .settings-admin-stack,
.profile-tabbed-page .admin-hub-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.profile-user-overview-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-user-wide-panel {
  display: grid;
  gap: 14px;
}

.profile-page-legacy.profile-tabbed-page .profile-grid-legacy {
  display: block;
}

.profile-tabbed-page .settings-clean-nav .settings-nav-link.profile-page-tab,
.profile-tabbed-page .profile-page-tab-nav .settings-nav-link.profile-page-tab {
  width: auto;
  justify-content: center;
}

.admin-hub-page.profile-tabbed-page .admin-hub-hero {
  border-color: rgba(255, 194, 108, 0.22);
  background:
    radial-gradient(circle at top left, rgba(255, 180, 95, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(24, 18, 18, 0.95), rgba(12, 10, 12, 0.98));
}

.admin-hub-page.profile-tabbed-page .profile-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.admin-hub-page.profile-tabbed-page .sidebar-link-card {
  min-height: 86px;
  border-radius: 14px;
  border-color: rgba(255, 194, 108, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02)),
    rgba(12, 10, 12, 0.72);
}

.admin-hub-page.profile-tabbed-page .settings-admin-spoiler {
  border-radius: 16px;
}

body.theme-blueanime .profile-page-tab-nav {
  border-color: rgba(93, 176, 255, 0.18);
  background: linear-gradient(135deg, rgba(11, 24, 48, 0.82), rgba(6, 12, 26, 0.96));
}

body.theme-blueanime .profile-page-tab {
  border-color: rgba(93, 176, 255, 0.2);
  background: rgba(93, 176, 255, 0.075);
  color: #cfe6ff;
}

body.theme-blueanime .profile-page-tab.is-active {
  border-color: rgba(120, 190, 255, 0.56);
  background: linear-gradient(135deg, rgba(54, 135, 255, 0.34), rgba(16, 28, 52, 0.96));
  color: #f5fbff;
  box-shadow: 0 12px 24px rgba(5, 12, 28, 0.26);
}

body.theme-blueanime .admin-hub-page.profile-tabbed-page .admin-hub-hero {
  border-color: rgba(93, 176, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(93, 176, 255, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(10, 22, 45, 0.95), rgba(6, 12, 26, 0.98));
}

body.theme-blueanime .admin-hub-page.profile-tabbed-page .sidebar-link-card {
  border-color: rgba(93, 176, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(93, 176, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(8, 17, 35, 0.76);
}

@media (max-width: 820px) {
  .character-roleplay-avatar {
    width: min(100%, 180px);
    max-width: 180px;
    margin-inline: auto;
  }

  .character-profile-tab-nav {
    margin-inline: -2px;
    padding: 8px;
    border-radius: 15px;
  }

  .character-profile-tab {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.9rem;
  }

  .profile-page-tab-nav {
    margin-inline: -2px;
    padding: 8px;
    border-radius: 15px;
  }

  .profile-page-tab {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.9rem;
  }

  .profile-user-overview-panel {
    grid-template-columns: 1fr;
  }
}

body.theme-blueanime {
  background:
    radial-gradient(circle at 14% 0%, rgba(88, 166, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 86% 6%, rgba(26, 84, 150, 0.18), transparent 30rem),
    linear-gradient(180deg, #0b1727 0%, #101f33 42%, #08111f 100%);
}

body.theme-blueanime .profile-card,
body.theme-blueanime .character-card,
body.theme-blueanime .profile-panel,
body.theme-blueanime .profile-card-block,
body.theme-blueanime .news-card,
body.theme-blueanime .news-article-card,
body.theme-blueanime .comments-card,
body.theme-blueanime .roleplay-card,
body.theme-blueanime .village-card,
body.theme-blueanime .subsection-card,
body.theme-blueanime .thread-card,
body.theme-blueanime .thread-post-card,
body.theme-blueanime .thread-compose-card,
body.theme-blueanime .mission-form-section,
body.theme-blueanime .technique-form-section,
body.theme-blueanime .artifact-card,
body.theme-blueanime .gift-card,
body.theme-blueanime .auth-card,
body.theme-blueanime .settings-clean-card,
body.theme-blueanime .settings-mini-card,
body.theme-blueanime .admin-card,
body.theme-blueanime .admin-panel,
body.theme-blueanime .content-card {
  border-color: rgba(93, 176, 255, 0.2);
  background:
    linear-gradient(145deg, rgba(18, 39, 64, 0.94), rgba(8, 17, 31, 0.96));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(205, 232, 255, 0.08);
}

body.theme-blueanime .page-title,
body.theme-blueanime .section-title,
body.theme-blueanime .profile-section-title,
body.theme-blueanime .roleplay-section-title,
body.theme-blueanime .admin-page-title,
body.theme-blueanime .settings-page-title,
body.theme-blueanime .home-title,
body.theme-blueanime .news-section h1,
body.theme-blueanime .news-section h2,
body.theme-blueanime .roleplay-page h1,
body.theme-blueanime .technique-page h1,
body.theme-blueanime .technique-school-page h1,
body.theme-blueanime .character-page h1,
body.theme-blueanime .profile-page h1 {
  color: #d8efff;
  text-shadow: 0 8px 28px rgba(45, 116, 190, 0.22);
}

body.theme-blueanime .page-title::after,
body.theme-blueanime .section-title::after,
body.theme-blueanime .profile-section-title::after,
body.theme-blueanime .roleplay-section-title::after,
body.theme-blueanime .admin-page-title::after,
body.theme-blueanime .settings-page-title::after,
body.theme-blueanime .home-title::after,
body.theme-blueanime .news-section h1::after,
body.theme-blueanime .news-section h2::after,
body.theme-blueanime .roleplay-page h1::after,
body.theme-blueanime .technique-page h1::after,
body.theme-blueanime .technique-school-page h1::after,
body.theme-blueanime .character-page h1::after,
body.theme-blueanime .profile-page h1::after {
  background: linear-gradient(90deg, #2d82d8, rgba(83, 166, 237, 0.2), transparent);
  box-shadow: 0 0 18px rgba(45, 130, 216, 0.16);
}

body.theme-blueanime .button,
body.theme-blueanime .button-primary,
body.theme-blueanime .btn,
body.theme-blueanime button[type="submit"],
body.theme-blueanime input[type="submit"] {
  border-color: rgba(42, 120, 194, 0.32);
  background: linear-gradient(180deg, #66b8ff, #2e7fd1);
  color: #f7fbff;
  box-shadow:
    0 10px 22px rgba(46, 127, 209, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.theme-blueanime .button-secondary,
body.theme-blueanime .btn-secondary,
body.theme-blueanime a.button-secondary {
  border-color: rgba(93, 176, 255, 0.24);
  background: linear-gradient(180deg, rgba(27, 58, 91, 0.9), rgba(13, 30, 52, 0.94));
  color: #d7efff;
}

body.theme-blueanime .profile-badge,
body.theme-blueanime .badge,
body.theme-blueanime .tag,
body.theme-blueanime .technique-mark-badge,
body.theme-blueanime .roleplay-badge,
body.theme-blueanime .character-rank-badge,
body.theme-blueanime .news-badge {
  border-color: rgba(93, 176, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(83, 166, 237, 0.18), rgba(16, 39, 66, 0.9));
  color: #d8efff;
}

/* Account settings should stay calm and theme-neutral. */
.settings-page-clean .settings-clean-head {
  overflow: visible;
  border-color: rgba(142, 101, 62, 0.18);
  background:
    linear-gradient(145deg, rgba(31, 22, 18, 0.88), rgba(16, 13, 11, 0.92));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.settings-page-clean .settings-clean-head::before {
  display: none;
}

.settings-page-clean .settings-clean-head .section-kicker {
  color: rgba(246, 214, 156, 0.72);
}

.settings-page-clean .settings-clean-head h1 {
  color: #f6e0bc;
  text-shadow: none;
}

.settings-page-clean .settings-clean-head h1::after {
  width: 84px;
  height: 2px;
  background: linear-gradient(90deg, rgba(246, 214, 156, 0.7), transparent);
  box-shadow: none;
}

body.theme-blueanime .settings-page-clean .settings-clean-head {
  border-color: rgba(93, 176, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(17, 37, 62, 0.9), rgba(8, 17, 31, 0.94));
}

body.theme-blueanime .settings-page-clean .settings-clean-head .section-kicker {
  color: rgba(216, 239, 255, 0.72);
}

body.theme-blueanime .settings-page-clean .settings-clean-head h1 {
  color: #d8efff;
}

body.theme-blueanime .settings-page-clean .settings-clean-head h1::after {
  background: linear-gradient(90deg, rgba(120, 190, 255, 0.65), transparent);
}

/* Technique editor cleanup. */
.technique-editor-form {
  display: grid;
  gap: 14px;
}

.technique-editor-form > .technique-form-section {
  margin: 0;
}

.technique-form-section-primary,
.technique-description-form-section,
.technique-mark-form-section {
  overflow: hidden;
}

.technique-description-form-section label {
  display: grid;
  gap: 9px;
}

.technique-form-spoiler {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.technique-form-spoiler > summary {
  margin: -2px -2px 12px;
}

.technique-mark-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.technique-mark-choice {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 22px 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid rgba(255, 185, 91, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(37, 25, 18, 0.78), rgba(18, 14, 12, 0.88));
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.technique-mark-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 185, 91, 0.36);
  background:
    linear-gradient(145deg, rgba(50, 32, 20, 0.82), rgba(20, 15, 12, 0.9));
}

.technique-mark-choice input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.technique-mark-choice-check {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 185, 91, 0.42);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
}

.technique-mark-choice-check::after {
  content: "";
  display: block;
  width: 5px;
  height: 10px;
  margin: 2px auto 0;
  border-right: 2px solid #1d1208;
  border-bottom: 2px solid #1d1208;
  opacity: 0;
  transform: rotate(45deg) scale(0.75);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.technique-mark-choice-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 185, 91, 0.2);
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.15), transparent 30%),
    rgba(255, 138, 28, 0.1);
  color: #f6d69c;
  font-weight: 900;
}

.technique-mark-choice-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.technique-mark-choice-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.technique-mark-choice-copy strong {
  color: #f8e1b4;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.technique-mark-choice-copy small {
  color: rgba(255, 232, 194, 0.62);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.technique-mark-choice:has(input[type="checkbox"]:checked) {
  border-color: rgba(255, 185, 91, 0.62);
  background:
    radial-gradient(circle at top right, rgba(255, 185, 91, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(62, 38, 22, 0.86), rgba(22, 15, 12, 0.92));
  box-shadow: 0 12px 26px rgba(255, 138, 28, 0.12);
}

.technique-mark-choice:has(input[type="checkbox"]:checked) .technique-mark-choice-check {
  border-color: #f0c36a;
  background: linear-gradient(135deg, #ffe3aa, #ff9d3d);
}

.technique-mark-choice:has(input[type="checkbox"]:checked) .technique-mark-choice-check::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

body.theme-blueanime .technique-mark-choice {
  border-color: rgba(93, 176, 255, 0.2);
  background:
    linear-gradient(145deg, rgba(17, 37, 62, 0.84), rgba(8, 17, 31, 0.92));
}

body.theme-blueanime .technique-mark-choice:hover,
body.theme-blueanime .technique-mark-choice:has(input[type="checkbox"]:checked) {
  border-color: rgba(120, 190, 255, 0.54);
  background:
    radial-gradient(circle at top right, rgba(83, 166, 237, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(25, 62, 98, 0.88), rgba(8, 17, 31, 0.94));
}

body.theme-blueanime .technique-mark-choice-icon {
  border-color: rgba(93, 176, 255, 0.22);
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.12), transparent 30%),
    rgba(83, 166, 237, 0.12);
  color: #d8efff;
}

body.theme-blueanime .technique-mark-choice-copy strong {
  color: #d8efff;
}

body.theme-blueanime .technique-mark-choice-copy small {
  color: rgba(216, 239, 255, 0.62);
}

@media (max-width: 720px) {
  .technique-mark-picker-grid {
    grid-template-columns: 1fr;
  }

  .technique-mark-choice {
    grid-template-columns: 22px 40px minmax(0, 1fr);
    min-height: 62px;
  }

  .technique-mark-choice-icon {
    width: 40px;
    height: 40px;
  }

  .technique-mark-choice-icon img {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 720px) {
  body:not(.theme-blueanime)::before {
    background-size: 34px 34px;
    opacity: 0.55;
  }

  .profile-card:hover,
  .character-card:hover,
  .news-card:hover,
  .roleplay-card:hover,
  .village-card:hover,
  .subsection-card:hover,
  .thread-card:hover,
  .artifact-card:hover,
  .gift-card:hover,
  .technique-card-modern:hover,
  .character-modern-card:hover,
  .button:hover,
  .button-primary:hover,
  .btn:hover,
  button[type="submit"]:hover,
  input[type="submit"]:hover {
    transform: none;
  }

  .page-title::after,
  .section-title::after,
  .profile-section-title::after,
  .roleplay-section-title::after,
  .admin-page-title::after,
  .settings-page-title::after,
  .home-title::after,
  .news-section h1::after,
  .news-section h2::after,
  .roleplay-page h1::after,
  .technique-page h1::after,
  .technique-school-page h1::after,
  .character-page h1::after,
  .profile-page h1::after {
    width: 92px;
    height: 2px;
    margin-top: 8px;
  }

  .left-sidebar .sidebar-link:hover,
  .left-sidebar a:hover,
  .mobile-bottom-nav a:hover,
  .bottom-nav a:hover {
    transform: none;
  }

  .chat-message.chat-message-flat {
    padding: 11px;
    border-radius: 14px;
  }

  .chat-message.chat-message-flat > img {
    display: none;
  }

  .chat-author-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 10px;
    opacity: 0.82;
  }

  .chat-meta {
    display: grid;
    gap: 4px;
    padding-bottom: 6px;
  }

  .chat-meta > span:last-child {
    font-size: 0.72rem;
  }

  .chat-meta .user-chip-name {
    font-size: 0.94rem;
  }

  .chat-text {
    font-size: 0.95rem;
    line-height: 1.52;
  }

  .chat-message-actions {
    justify-content: stretch;
  }

  .chat-message-actions .button-secondary,
  .chat-message-actions .button-danger,
  .chat-message-actions button,
  .chat-message-actions a {
    flex: 1 1 auto;
    justify-content: center;
  }

  .message-bubble-avatar,
  .ticket-message-avatar,
  .small-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .messages-thread-avatar,
  .messages-conversation-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
}

.mission-form-help {
  margin: 10px 0 16px;
  border: 1px solid rgba(255, 194, 108, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.mission-form-help > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
  color: var(--text, #fff0d4);
  list-style-position: inside;
}

.mission-form-help[open] > summary {
  border-bottom: 1px solid rgba(255, 194, 108, 0.14);
}

.mission-form-help-body {
  display: grid;
  gap: 9px;
  padding: 13px 15px 15px;
  color: var(--text-muted, #cbbdb7);
  line-height: 1.55;
}

.mission-form-help-body p {
  margin: 0;
}

.mission-form-help-body ul {
  margin: 0;
  padding-left: 21px;
}

.mission-form-help-body li + li {
  margin-top: 4px;
}

.mission-kind-guide {
  display: grid;
  gap: 8px;
}

.mission-kind-guide .bb-spoiler {
  margin: 0;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

body.theme-blueanime .mission-form-help {
  border-color: rgba(93, 176, 255, 0.22);
  background: rgba(93, 176, 255, 0.06);
}

body.theme-blueanime .mission-form-help[open] > summary {
  border-bottom-color: rgba(93, 176, 255, 0.18);
}

body.design-lab .mission-form-help {
  border-color: var(--lab-border, rgba(255, 255, 255, 0.14));
  background: color-mix(in srgb, var(--lab-surface-2, #172336) 80%, transparent);
}
