:root {
  --bg: #070b11;
  --bg-deep: #04070b;
  --panel: rgba(12, 20, 30, 0.96);
  --panel-soft: rgba(18, 28, 41, 0.88);
  --panel-hover: rgba(26, 39, 55, 0.94);
  --gold: #d0ad52;
  --gold-light: #f0d785;
  --gold-dark: #74571d;
  --ink: #f4ead2;
  --muted: #adab9f;
  --line: rgba(208, 173, 82, 0.28);
  --danger: #c95c5c;
  --success: #6eb493;
  --warning: #d6a84b;
  --info: #6fa4c8;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.44);
  --radius: 16px;
}

/* Quenta v2 staff preview */
.quenta-v2-summary {
  margin-bottom: 18px;
}

.quenta-v2-panel {
  min-height: 260px;
}

.quenta-v2-issues {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quenta-v2-issue {
  display: grid;
  grid-template-columns: minmax(170px, 0.35fr) 1fr;
  gap: 5px 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--info);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
}

.quenta-v2-issue.danger { border-left-color: var(--danger); }
.quenta-v2-issue.warning { border-left-color: var(--warning); }
.quenta-v2-issue strong { color: var(--gold-light); }
.quenta-v2-issue small { grid-column: 2; color: var(--muted); }

.quenta-v2-import {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.4fr);
  gap: 20px;
  align-items: center;
}

.quenta-v2-import > details { grid-column: 1 / -1; }
.quenta-v2-import code { display: block; overflow-wrap: anywhere; color: var(--muted); }

.quenta-v2-import-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quenta-v2-import-stats span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
}

.quenta-v2-import-stats strong { display: block; color: var(--gold-light); font-size: 1.2rem; }
.quenta-v2-import-stats .danger strong { color: #ef8d8d; }

.quenta-v2-catalog,
.quenta-v2-rules,
.quenta-v2-drafts {
  margin-top: 18px;
}

.quenta-v2-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.quenta-v2-section-head p { margin: 4px 0 0; color: var(--muted); }
.quenta-v2-tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.quenta-v2-tabs .active { border-color: var(--gold); color: var(--gold-light); background: rgba(208, 173, 82, 0.12); }
.quenta-v2-filter { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.15); }

.quenta-v2-entity-list,
.quenta-v2-rule-list,
.quenta-v2-draft-list {
  display: grid;
  gap: 10px;
}

.quenta-v2-draft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid rgba(208, 173, 82, 0.18);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(18, 29, 43, 0.82), rgba(7, 12, 19, 0.86));
}

.quenta-v2-draft-card > div { display: grid; gap: 5px; }
.quenta-v2-draft-card > div:last-child { justify-items: end; }
.quenta-v2-draft-card strong { color: var(--gold-light); font-size: 1.02rem; }
.quenta-v2-draft-card span,
.quenta-v2-draft-card small { color: var(--muted); }

.quenta-v2-entity {
  padding: 15px 16px;
  border: 1px solid rgba(208, 173, 82, 0.18);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(18, 29, 43, 0.82), rgba(7, 12, 19, 0.86));
}

.quenta-v2-entity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.quenta-v2-entity-head > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.quenta-v2-entity-head strong { color: var(--gold-light); font-size: 1.02rem; }
.quenta-v2-entity-head code { color: var(--muted); }
.quenta-v2-entity p { margin: 10px 0 6px; line-height: 1.6; }
.quenta-v2-entity > small { color: var(--muted); }
.quenta-v2-entity pre,
.quenta-v2-rule pre {
  overflow: auto;
  max-height: 360px;
  padding: 12px;
  border-radius: 10px;
  color: #d8e1e9;
  background: rgba(2, 6, 10, 0.78);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quenta-v2-pagination { margin-top: 16px; }

.quenta-v2-rule {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.18);
}

.quenta-v2-rule summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--gold-light);
  cursor: pointer;
}

.quenta-v2-rule summary small { color: var(--muted); }

@media (max-width: 800px) {
  .quenta-v2-issue,
  .quenta-v2-import {
    grid-template-columns: 1fr;
  }

  .quenta-v2-issue small,
  .quenta-v2-import > details {
    grid-column: auto;
  }

  .quenta-v2-import-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quenta-v2-section-head,
  .quenta-v2-entity-head,
  .quenta-v2-draft-card,
  .quenta-v2-rule summary {
    align-items: stretch;
    flex-direction: column;
  }

  .quenta-v2-tabs { justify-content: flex-start; }
  .quenta-v2-draft-card > div:last-child { justify-items: start; }
}

/* Forum */
.forum-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
  padding: 30px 34px;
  border: 1px solid rgba(208, 173, 82, 0.42);
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 50%, rgba(208, 173, 82, 0.18), transparent 28%),
    linear-gradient(120deg, rgba(12, 21, 32, 0.98), rgba(5, 10, 16, 0.98));
  box-shadow: var(--shadow), inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.forum-hero::after {
  position: absolute;
  right: 12%;
  content: "ᚦ ᛟ ᚠ";
  color: rgba(208, 173, 82, 0.07);
  font: 700 clamp(3rem, 8vw, 8rem) Cinzel, serif;
  transform: rotate(-8deg);
  pointer-events: none;
}

.forum-hero h2 {
  margin: 0 0 8px;
  color: var(--gold-light);
  font: 700 clamp(1.4rem, 3vw, 2.2rem) Cinzel, serif;
}

.forum-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.forum-hero > a {
  z-index: 1;
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(117, 133, 255, 0.5);
  border-radius: 12px;
  background: rgba(75, 85, 190, 0.22);
  text-decoration: none;
}

.forum-hero-rune {
  float: left;
  margin-right: 18px;
  color: var(--gold);
  font: 700 3rem Cinzel, serif;
  filter: drop-shadow(0 0 12px rgba(208, 173, 82, 0.5));
}

.forum-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.forum-category {
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(18, 29, 43, 0.97), rgba(8, 14, 21, 0.97));
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.forum-category:hover,
.forum-category.active {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.32), inset 0 0 25px rgba(208, 173, 82, 0.07);
}

.forum-category > span {
  display: block;
  margin-bottom: 10px;
  font-size: 1.8rem;
}

.forum-category strong,
.forum-category small,
.forum-category b {
  display: block;
}

.forum-category strong {
  margin-bottom: 8px;
  color: var(--gold-light);
  font-family: Cinzel, serif;
}

.forum-category small {
  min-height: 50px;
  color: var(--muted);
  line-height: 1.4;
}

.forum-category b {
  margin-top: 10px;
  color: var(--gold);
  font-size: 0.75rem;
}

.forum-topic-panel {
  overflow: hidden;
  padding: 0;
}

.forum-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.forum-list-head h2 {
  margin: 0;
}

.forum-list-head label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.forum-topic-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(208, 173, 82, 0.12);
  color: var(--ink);
  text-decoration: none;
  transition: background 140ms ease;
}

.forum-topic-row:last-child {
  border-bottom: 0;
}

.forum-topic-row:hover {
  background: rgba(208, 173, 82, 0.06);
}

.forum-topic-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(4, 8, 13, 0.8);
  font-size: 1.2rem;
}

.forum-topic-copy,
.forum-topic-stats {
  display: flex;
}

.forum-topic-copy {
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.forum-topic-copy strong {
  color: var(--gold-light);
  font-family: Cinzel, serif;
}

.forum-topic-copy small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-topic-stats {
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.76rem;
}

.forum-composer {
  overflow: hidden;
  margin: 8px 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 9, 15, 0.82);
}

.forum-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 28, 41, 0.72);
}

.forum-toolbar button,
.forum-color {
  display: inline-grid;
  min-width: 36px;
  height: 34px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid rgba(208, 173, 82, 0.2);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(4, 9, 15, 0.9);
  cursor: pointer;
}

.forum-toolbar button:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.forum-color input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.forum-editor {
  min-height: 190px;
  padding: 18px;
  outline: 0;
  line-height: 1.7;
}

.forum-editor:empty::before {
  color: #777b7e;
  content: attr(data-placeholder);
  pointer-events: none;
}

.forum-upload {
  display: block;
  padding: 12px 16px;
  border-top: 1px dashed var(--line);
  color: var(--gold-light);
  cursor: pointer;
}

.forum-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.forum-upload-list {
  display: grid;
  gap: 6px;
  padding: 0 14px 12px;
}

.forum-upload-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(110, 180, 147, 0.09);
  font-size: 0.8rem;
}

.forum-upload-item.error {
  color: #efaaaa;
  background: rgba(201, 92, 92, 0.1);
}

.forum-constructor {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(111, 164, 200, 0.35);
  border-radius: 14px;
  background: rgba(26, 57, 78, 0.13);
}

.forum-constructor summary {
  color: #a8d9f6;
  font-weight: 700;
  cursor: pointer;
}

.forum-topic-opening,
.forum-post,
.forum-reply-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(14, 23, 34, 0.98), rgba(7, 12, 18, 0.98));
  box-shadow: var(--shadow);
}

.forum-topic-opening {
  padding: 26px;
}

.forum-topic-opening > header,
.forum-topic-opening > footer,
.forum-post-main > header,
.forum-post-main > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.forum-topic-opening > footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(208, 173, 82, 0.14);
}

.forum-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.forum-author div {
  display: grid;
  gap: 4px;
}

.forum-author small {
  color: var(--muted);
}

.forum-topic-summary {
  margin: 22px 0;
  color: var(--gold-light);
  font: 600 1.15rem "Cormorant Garamond", serif;
}

.forum-rich-body {
  overflow-wrap: anywhere;
  color: #e8e1d1;
  line-height: 1.75;
}

.forum-rich-body blockquote {
  margin: 18px 0;
  padding: 10px 18px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  background: rgba(208, 173, 82, 0.06);
}

.forum-rich-body pre {
  overflow: auto;
  padding: 14px;
  border-radius: 10px;
  background: #03070b;
}

.forum-custom-content {
  overflow: hidden;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(111, 164, 200, 0.25);
  border-radius: 14px;
}

.forum-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.forum-attachment-image {
  overflow: hidden;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.forum-attachment-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #030609;
}

.forum-attachment-media {
  width: 100%;
  max-height: 480px;
  border-radius: 12px;
  background: #000;
}

.forum-audio,
.forum-file {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 9, 15, 0.78);
}

.forum-audio audio {
  width: 100%;
}

.forum-file {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.forum-file small {
  color: var(--muted);
}

.forum-rich-body figure,
.portal-rich-body figure,
.portal-application-design figure {
  margin: 1rem 0;
}

.forum-rich-body img,
.forum-rich-body video,
.portal-rich-body img,
.portal-rich-body video,
.portal-application-design img,
.portal-application-design video {
  max-width: 100%;
  border: 1px solid rgba(199, 164, 72, 0.28);
  border-radius: 16px;
  background: #030609;
}

.portal-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.portal-character-asset {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid rgba(199, 164, 72, 0.22);
  border-radius: 18px;
  background: rgba(5, 10, 16, 0.62);
}

.portal-character-asset img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
}

.portal-character-asset figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
}

.portal-warning-card,
.portal-nested-card {
  margin: 0.8rem 0;
  padding: 1rem;
  border: 1px solid rgba(213, 184, 90, 0.34);
  border-radius: 18px;
  background: rgba(213, 184, 90, 0.07);
}

.portal-warning-card strong {
  color: var(--gold);
}

.forum-like {
  padding: 8px 13px;
  border: 1px solid rgba(201, 92, 92, 0.34);
  border-radius: 999px;
  color: #e7c6c6;
  background: rgba(201, 92, 92, 0.08);
  cursor: pointer;
}

.forum-like.active {
  border-color: #e36b7b;
  color: #fff;
  background: rgba(227, 107, 123, 0.24);
  box-shadow: 0 0 16px rgba(227, 107, 123, 0.17);
}

.forum-posts {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.forum-posts > h2 {
  color: var(--gold-light);
  font-family: Cinzel, serif;
}

.forum-post {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
}

.forum-post.moderated {
  opacity: 0.62;
  border-color: var(--danger);
}

.forum-post > aside {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgba(3, 8, 13, 0.5);
  text-align: center;
}

.forum-post > aside .portal-user-avatar {
  width: 62px;
  height: 62px;
  font-size: 1.7rem;
}

.forum-post > aside small,
.forum-post-main time {
  color: var(--muted);
  font-size: 0.75rem;
}

.forum-post-main {
  min-width: 0;
  padding: 20px 22px;
}

.forum-post-main > header {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(208, 173, 82, 0.12);
}

.forum-post-main > footer {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 18px;
}

.forum-reply-target {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: rgba(208, 173, 82, 0.07);
}

.forum-reply-target button {
  float: right;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.forum-mod-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(201, 92, 92, 0.35);
}

.forum-mod-tools button {
  padding: 8px 12px;
  border: 1px solid rgba(201, 92, 92, 0.4);
  border-radius: 8px;
  color: #f2cccc;
  background: rgba(201, 92, 92, 0.08);
  cursor: pointer;
}

@media (max-width: 1200px) {
  .forum-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .forum-hero,
  .forum-list-head,
  .forum-topic-opening > header,
  .forum-topic-opening > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .forum-category-grid {
    grid-template-columns: 1fr;
  }

  .forum-category {
    min-height: auto;
  }

  .forum-topic-row {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 14px;
  }

  .forum-topic-stats {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .forum-post {
    grid-template-columns: 1fr;
  }

  .forum-post > aside {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(3, 7, 12, 0.88), rgba(3, 7, 12, 0.94)),
    url("/assets/img/background-tavern-2.png") center / cover fixed,
    var(--bg);
  font-family: Inter, system-ui, sans-serif;
}

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

a {
  color: var(--gold-light);
}

.portal-shell {
  display: grid;
  min-height: 100vh;
  grid-template:
    "header header" 74px
    "sidebar main" 1fr / 260px minmax(0, 1fr);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.portal-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(208, 173, 82, 0.35));
}

.portal-brand strong,
.portal-title,
.portal-card h2,
.portal-card h3 {
  font-family: Cinzel, "Cormorant Garamond", serif;
}

.portal-profile-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.portal-profile-photo {
  display: grid;
  width: 160px;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  border: 2px solid rgba(208, 173, 82, 0.4);
  border-radius: 22px;
  background:
    radial-gradient(circle at 35% 25%, rgba(208, 173, 82, 0.2), transparent 45%),
    #0a111b;
  color: var(--gold);
  font-size: 46px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
}

.portal-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-profile-form textarea {
  min-height: 82px;
}

.portal-brand strong,
.portal-brand small {
  display: block;
}

.portal-brand strong {
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.portal-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.portal-header-actions,
.portal-user,
.portal-actions,
.portal-inline,
.portal-filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-user {
  min-width: 0;
}

.portal-user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(145deg, #2d3340, #101722);
  color: var(--gold);
}

.portal-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-user-copy {
  min-width: 0;
}

.portal-user-copy strong,
.portal-user-copy small {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-account-points {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}

.portal-point-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid rgba(208, 173, 82, 0.24);
  border-radius: 999px;
  background: rgba(208, 173, 82, 0.08);
  color: #e8d99e;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.portal-point-chip.patron {
  border-color: rgba(112, 190, 255, 0.28);
  background: rgba(80, 150, 210, 0.1);
  color: #b9ddff;
}

.portal-user-balances { display: grid; gap: 4px; min-width: 100px; font-size: 11px; }
.portal-point-adjust { margin-top: 7px; min-width: 170px; }
.portal-point-adjust summary { color: var(--gold-light); cursor: pointer; font-size: 11px; }
.portal-point-adjust[open] { display: grid; gap: 6px; }
.portal-point-adjust .portal-input { min-width: 150px; margin-top: 5px; }

.portal-user-copy small {
  margin-top: 2px;
  color: var(--muted);
}

.portal-user-role-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 330px;
  margin-top: 4px;
  overflow: hidden;
}

.portal-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(208, 173, 82, 0.24);
  border-radius: 999px;
  background: rgba(208, 173, 82, 0.08);
  color: #e5d7aa;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-role-more {
  color: var(--muted);
  font-size: 10px;
}

.portal-role-gallery {
  display: grid;
  gap: 12px;
}

.portal-role-plaque {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 13px 16px;
  overflow: hidden;
  border: 1px solid rgba(208, 173, 82, 0.24);
  border-radius: 13px;
  background:
    radial-gradient(circle at 8% 20%, rgba(208, 173, 82, 0.16), transparent 44%),
    linear-gradient(135deg, rgba(28, 39, 53, 0.98), rgba(8, 14, 22, 0.98));
  box-shadow: inset 0 0 22px rgba(208, 173, 82, 0.04);
}

.portal-role-plaque::after {
  position: absolute;
  top: 0;
  right: -35px;
  width: 120px;
  height: 100%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035));
  content: "";
}

.portal-role-emblem {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(208, 173, 82, 0.34);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 25px;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.32);
}

.portal-role-copy {
  min-width: 0;
}

.portal-role-copy strong,
.portal-role-copy small {
  display: block;
}

.portal-role-copy strong {
  color: #f0dfaa;
  font-family: Cinzel, serif;
  font-size: 15px;
  letter-spacing: 0.025em;
}

.portal-role-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.055em;
}

.role-keeper {
  border-color: rgba(238, 185, 77, 0.55);
  background-color: rgba(117, 49, 24, 0.18);
  color: #ffe28b;
}

.portal-role-plaque.role-keeper {
  background:
    radial-gradient(circle at 8% 20%, rgba(238, 185, 77, 0.28), transparent 46%),
    linear-gradient(135deg, rgba(83, 37, 25, 0.96), rgba(21, 15, 19, 0.99));
  box-shadow: inset 0 0 30px rgba(238, 185, 77, 0.07), 0 8px 28px rgba(59, 21, 13, 0.24);
}

.role-warlock { border-color: rgba(161, 105, 234, 0.48); color: #dcc4ff; }
.role-spider { border-color: rgba(121, 154, 225, 0.48); color: #c5d4ff; }
.role-knowledge { border-color: rgba(91, 181, 161, 0.48); color: #bcebdd; }
.role-economy { border-color: rgba(225, 179, 76, 0.48); color: #f1d691; }
.role-event { border-color: rgba(197, 112, 206, 0.48); color: #e8c3ed; }
.role-moderation { border-color: rgba(200, 91, 91, 0.48); color: #f0b5b5; }

.portal-role-plaque.role-warlock { background: linear-gradient(135deg, rgba(54, 27, 80, 0.96), rgba(12, 12, 24, 0.99)); }
.portal-role-plaque.role-spider { background: linear-gradient(135deg, rgba(25, 38, 71, 0.96), rgba(9, 13, 25, 0.99)); }
.portal-role-plaque.role-knowledge { background: linear-gradient(135deg, rgba(27, 65, 59, 0.96), rgba(10, 20, 23, 0.99)); }
.portal-role-plaque.role-economy { background: linear-gradient(135deg, rgba(77, 57, 22, 0.96), rgba(21, 17, 9, 0.99)); }
.portal-role-plaque.role-event { background: linear-gradient(135deg, rgba(66, 31, 70, 0.96), rgba(17, 12, 25, 0.99)); }
.portal-role-plaque.role-moderation { background: linear-gradient(135deg, rgba(73, 29, 32, 0.96), rgba(22, 11, 15, 0.99)); }

.portal-notification-link {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
}

.portal-notification-link b {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 21px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #a83939;
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.portal-sidebar {
  position: sticky;
  top: 74px;
  grid-area: sidebar;
  height: calc(100vh - 74px);
  overflow: auto;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(rgba(7, 13, 21, 0.94), rgba(7, 13, 21, 0.98)),
    url("/assets/img/background-board2.png") center / cover;
}

.portal-sidebar nav {
  display: grid;
  gap: 5px;
  padding: 20px 14px;
}

.portal-nav-group {
  margin: 17px 10px 7px;
  color: #8e8b80;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #cec8b8;
  text-decoration: none;
  transition: 160ms ease;
}

.portal-nav-link:hover,
.portal-nav-link.active {
  border-color: var(--line);
  background: linear-gradient(90deg, rgba(208, 173, 82, 0.13), rgba(208, 173, 82, 0.025));
  color: var(--gold-light);
  transform: translateX(2px);
}

.portal-sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 20px;
  padding: 12px;
  border: 1px solid rgba(110, 180, 147, 0.2);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.portal-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.portal-live-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.portal-main {
  grid-area: main;
  min-width: 0;
  padding: clamp(20px, 3vw, 42px);
  outline: none;
}

.portal-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.portal-title {
  margin: 0;
  color: var(--gold-light);
  font-size: clamp(25px, 3vw, 40px);
  line-height: 1.15;
  text-shadow: 0 2px 18px rgba(208, 173, 82, 0.18);
}

.portal-subtitle {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.portal-span-3 { grid-column: span 3; }
.portal-span-4 { grid-column: span 4; }
.portal-span-5 { grid-column: span 5; }
.portal-span-6 { grid-column: span 6; }
.portal-span-7 { grid-column: span 7; }
.portal-span-8 { grid-column: span 8; }
.portal-span-9 { grid-column: span 9; }
.portal-span-12 { grid-column: 1 / -1; }

.portal-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(26, 38, 52, 0.72), rgba(9, 16, 25, 0.95)),
    var(--panel);
  box-shadow: var(--shadow);
}

.portal-card::before {
  position: absolute;
  inset: 6px;
  z-index: 0;
  border: 1px solid rgba(208, 173, 82, 0.08);
  border-radius: calc(var(--radius) - 5px);
  pointer-events: none;
  content: "";
}

.portal-card > * {
  position: relative;
}

.portal-card h2,
.portal-card h3 {
  margin: 0 0 14px;
  color: var(--gold-light);
}

.portal-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 110px;
}

.portal-stat strong {
  display: block;
  color: var(--gold-light);
  font-family: Cinzel, serif;
  font-size: 34px;
}

.portal-stat span {
  color: var(--muted);
}

.portal-stat-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(208, 173, 82, 0.08);
  font-size: 25px;
}

.portal-button,
.portal-ghost-button,
.portal-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: 150ms ease;
}

.portal-button {
  border: 1px solid #e2c46d;
  background: linear-gradient(145deg, #d4af53, #8c681f);
  color: #090b0e;
  box-shadow: 0 9px 24px rgba(159, 119, 35, 0.22);
}

.portal-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.portal-ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
}

.portal-danger-button {
  border: 1px solid rgba(201, 92, 92, 0.45);
  background: rgba(201, 92, 92, 0.12);
  color: #ffd1d1;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.portal-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(208, 173, 82, 0.15);
  border-radius: 12px;
  background: rgba(4, 9, 15, 0.55);
}

.portal-list-item:hover {
  border-color: var(--line);
  background: rgba(25, 36, 50, 0.55);
}

.portal-list-copy {
  min-width: 0;
}

.portal-list-copy strong,
.portal-list-copy small {
  display: block;
}

.portal-list-copy small {
  margin-top: 5px;
  color: var(--muted);
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(208, 173, 82, 0.09);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.portal-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.portal-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.portal-status.success { color: #9fdfbd; background: rgba(72, 145, 105, 0.18); }
.portal-status.warning { color: #f0ca79; background: rgba(173, 123, 34, 0.18); }
.portal-status.danger { color: #ffaaaa; background: rgba(177, 60, 60, 0.18); }
.portal-status.info { color: #9ac7e5; background: rgba(65, 117, 152, 0.18); }

.portal-form {
  display: grid;
  gap: 16px;
}

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

.portal-form label {
  display: grid;
  gap: 7px;
  color: #d9d2c2;
  font-size: 13px;
  font-weight: 600;
}

.portal-form label.full {
  grid-column: 1 / -1;
}

.portal-input,
.portal-form input,
.portal-form select,
.portal-form textarea,
.portal-filterbar input,
.portal-filterbar select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(208, 173, 82, 0.25);
  border-radius: 9px;
  outline: none;
  background: rgba(2, 7, 12, 0.72);
  color: var(--ink);
}

.portal-form textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}

.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus,
.portal-filterbar input:focus,
.portal-filterbar select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(208, 173, 82, 0.09);
}

.portal-form-help {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.portal-formula-note {
  padding: 14px 16px;
  border: 1px solid rgba(91, 181, 161, 0.3);
  border-radius: 11px;
  background: rgba(40, 111, 98, 0.1);
  color: #bde6dc;
  line-height: 1.55;
}

.portal-questionnaire {
  display: grid;
  gap: 12px;
}

.portal-question-section,
.portal-world-create details {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 9, 15, 0.48);
}

.portal-question-section summary,
.portal-world-create summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  color: var(--gold-light);
  font-family: Cinzel, serif;
  cursor: pointer;
  list-style: none;
}

.portal-question-section summary::-webkit-details-marker,
.portal-world-create summary::-webkit-details-marker {
  display: none;
}

.portal-question-section summary span:last-child {
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: 11px;
}

.portal-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.portal-question {
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(208, 173, 82, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.portal-question textarea {
  min-height: 88px;
}

.portal-answer {
  padding: 12px 0;
  border-bottom: 1px solid rgba(208, 173, 82, 0.1);
}

.portal-answer:last-child {
  border-bottom: 0;
}

.portal-answer p {
  margin: 7px 0 0;
  color: #d8d2c7;
  line-height: 1.6;
}

.portal-muted {
  color: var(--muted);
}

.portal-formula-grid,
.portal-formula-live {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.portal-formula-grid > div,
.portal-formula-live > div {
  padding: 10px;
  border: 1px solid rgba(208, 173, 82, 0.14);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
}

.portal-formula-grid strong,
.portal-formula-grid span,
.portal-formula-live strong,
.portal-formula-live span {
  display: block;
}

.portal-formula-grid strong,
.portal-formula-live strong {
  color: var(--gold-light);
  font-size: 16px;
}

.portal-formula-grid span,
.portal-formula-live span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.portal-formula-grid .success,
.portal-formula-live .success {
  border-color: rgba(72, 145, 105, 0.42);
  background: rgba(72, 145, 105, 0.12);
}

.portal-formula-grid .danger,
.portal-formula-live .danger {
  border-color: rgba(177, 60, 60, 0.42);
  background: rgba(177, 60, 60, 0.12);
}

.portal-world-create {
  margin-bottom: 18px;
}

.portal-world-create form {
  padding: 0 16px 16px;
}

.portal-support-list {
  display: grid;
  gap: 10px;
}

.portal-support-thread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(208, 173, 82, 0.15);
  border-radius: 12px;
  background: rgba(4, 9, 15, 0.55);
  color: inherit;
  text-decoration: none;
}

.portal-support-thread:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}

.portal-support-thread > span:last-child {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.portal-support-thread > span:last-child small {
  color: var(--muted);
}

.portal-chat {
  display: grid;
  gap: 14px;
}

.portal-chat-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  max-width: 88%;
  padding: 13px;
  border: 1px solid rgba(208, 173, 82, 0.15);
  border-radius: 14px 14px 14px 4px;
  background: rgba(6, 12, 20, 0.78);
}

.portal-chat-message.staff {
  justify-self: end;
  border-color: rgba(91, 181, 161, 0.34);
  border-radius: 14px 14px 4px 14px;
  background: rgba(28, 75, 68, 0.18);
}

.portal-chat-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #0b131e;
}

.portal-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-chat-message header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-chat-message header small {
  color: var(--muted);
}

.portal-chat-message p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.portal-chat-reply {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.portal-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.portal-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  padding: 12px 13px;
  border-bottom: 1px solid rgba(208, 173, 82, 0.12);
  text-align: left;
  vertical-align: top;
}

.portal-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111b28;
  color: var(--gold-light);
  font-family: Cinzel, serif;
  font-size: 12px;
}

.portal-table tbody tr:hover {
  background: rgba(208, 173, 82, 0.04);
}

.portal-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 18px;
  padding-bottom: 4px;
}

.portal-tab {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
}

.portal-tab.active {
  background: rgba(208, 173, 82, 0.12);
  color: var(--gold-light);
}

.portal-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.portal-sticky {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.portal-rubric-section {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(208, 173, 82, 0.18);
  border-radius: 12px;
  background: rgba(4, 9, 15, 0.5);
}

.portal-rubric-criterion {
  display: grid;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(208, 173, 82, 0.1);
}

.portal-rubric-criterion:last-child {
  border-bottom: 0;
}

.portal-rank-progress {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #060a10;
}

.portal-rank-progress > span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #70501b, #dfbd65);
  box-shadow: 0 0 14px rgba(208, 173, 82, 0.4);
}

.portal-empty,
.portal-error,
.portal-loading {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 35px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.portal-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(208, 173, 82, 0.18);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: portal-spin 0.8s linear infinite;
}

@keyframes portal-spin {
  to { transform: rotate(360deg); }
}

.portal-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101a27;
  box-shadow: var(--shadow);
}

.portal-modal[aria-hidden="true"] {
  display: none;
}

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.portal-modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
}

.portal-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--gold-light);
}

.space-between {
  justify-content: space-between;
}

.portal-ghost-button.tiny {
  min-height: 30px;
  margin-top: 6px;
  padding: 4px 9px;
  font-size: 12px;
}

.portal-warning-text {
  color: #f0bd69;
}

.reference-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 10, 16, 0.72);
}

.reference-tab {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.reference-tab.active {
  border-color: rgba(208, 173, 82, 0.52);
  background: rgba(208, 173, 82, 0.13);
  color: var(--gold-light);
}

.reference-tab-panel[hidden] {
  display: none;
}

.reference-hero {
  background:
    radial-gradient(circle at 90% 0%, rgba(208, 173, 82, 0.13), transparent 35%),
    linear-gradient(145deg, rgba(18, 29, 43, 0.96), rgba(8, 14, 22, 0.96));
}

.reference-guide {
  padding: clamp(14px, 3vw, 32px);
  border-left: 3px solid rgba(208, 173, 82, 0.55);
  background: rgba(3, 8, 13, 0.4);
  line-height: 1.75;
}

.reference-guide h1,
.reference-guide h2,
.reference-guide h3 {
  color: var(--gold-light);
}

.reference-guide table {
  width: 100%;
  border-collapse: collapse;
}

.reference-guide th,
.reference-guide td {
  padding: 10px;
  border: 1px solid var(--line);
}

.ability-tutorial {
  display: grid;
  gap: 18px;
}

.ability-tutorial > section {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(208, 173, 82, 0.2);
  border-radius: 14px;
  background: rgba(2, 7, 12, 0.34);
}

.ability-tutorial h3 {
  margin-top: 0;
  color: var(--gold-light);
  font-family: Cinzel, serif;
}

.tutorial-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding-left: 26px;
}

.tutorial-field-grid li {
  padding: 9px 11px;
  border: 1px solid rgba(111, 164, 200, 0.22);
  border-radius: 9px;
  background: rgba(111, 164, 200, 0.06);
}

.tutorial-example {
  border-color: rgba(110, 180, 147, 0.32) !important;
  background: rgba(110, 180, 147, 0.06) !important;
}

.tutorial-example > strong {
  display: block;
  margin-bottom: 12px;
  color: #baf3d3;
  font-size: 20px;
}

.tutorial-paragraphs {
  display: grid;
  gap: 10px;
}

.tutorial-paragraphs p {
  margin: 0;
  padding: 11px 13px;
  border-left: 2px solid rgba(208, 173, 82, 0.26);
  background: rgba(255, 255, 255, 0.018);
  line-height: 1.65;
}

.reference-chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}

.reference-chip-list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(208, 173, 82, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.reference-chip-list small {
  color: var(--muted);
}

.economy-section {
  margin-top: 16px;
}

.economy-section .portal-table {
  min-width: 1220px;
}

.rank-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.rank-guide-grid > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(208, 173, 82, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.rank-guide-grid span {
  color: var(--muted);
  line-height: 1.5;
}

.religion-group-card {
  margin-top: 16px;
  border-color: rgba(148, 116, 204, 0.33);
}

.religion-group-card .portal-table {
  min-width: 1180px;
}

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

.audit-entry {
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.audit-entry.audit-create {
  border-left-color: var(--success);
}

.audit-entry.audit-update {
  border-left-color: var(--warning);
}

.audit-entry.audit-delete {
  border-left-color: var(--danger);
}

.audit-entry-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.audit-entry-head small {
  color: var(--muted);
}

.audit-pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(111, 164, 200, 0.13);
  color: #bfe3ff;
  font-size: 12px;
}

.audit-create .audit-pill {
  background: rgba(110, 180, 147, 0.14);
  color: #baf3d3;
}

.audit-update .audit-pill {
  background: rgba(214, 168, 75, 0.15);
  color: #ffe0a0;
}

.audit-delete .audit-pill {
  background: rgba(201, 92, 92, 0.15);
  color: #ffbaba;
}

.audit-diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.audit-json {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

.audit-json.audit-create {
  border-color: rgba(110, 180, 147, 0.35);
}

.audit-json.audit-update {
  border-color: rgba(214, 168, 75, 0.35);
}

.audit-json.audit-delete {
  border-color: rgba(201, 92, 92, 0.38);
}

.audit-json pre {
  max-height: 340px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #05090e;
  color: #d9e2ea;
  white-space: pre-wrap;
  word-break: break-word;
}

.wow-model-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(400px, 1.4fr);
  gap: 18px;
}

.wow-model-stage {
  position: relative;
  display: grid;
  min-height: 390px;
  align-content: center;
  justify-items: center;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(110, 164, 200, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 42%, rgba(87, 137, 181, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(14, 25, 38, 0.96), rgba(4, 9, 15, 0.96));
  text-align: center;
}

.wow-model-orbit {
  position: absolute;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(208, 173, 82, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 70px rgba(111, 164, 200, 0.13);
}

.wow-model-figure {
  z-index: 1;
  font-size: 115px;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.7));
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 9px;
}

.equipment-slot {
  display: grid;
  gap: 3px;
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.equipment-slot span,
.equipment-slot small {
  color: var(--muted);
}

.equipment-slot.quality-2 { border-left-color: #2fcb67; }
.equipment-slot.quality-3 { border-left-color: #3698ff; }
.equipment-slot.quality-4 { border-left-color: #ad5cff; }
.equipment-slot.quality-5 { border-left-color: #ff8a2a; }

@media (max-width: 1100px) {
  .portal-span-3 { grid-column: span 6; }
  .portal-span-4 { grid-column: span 6; }
  .portal-span-8 { grid-column: span 12; }
  .portal-span-9 { grid-column: span 12; }
  .portal-review-layout { grid-template-columns: 1fr; }
  .portal-sticky { position: static; max-height: none; }
  .wow-model-layout { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .portal-shell {
    grid-template:
      "header" 68px
      "main" 1fr / 1fr;
  }

  .portal-header {
    padding: 9px 14px;
  }

  .portal-menu-button {
    display: grid;
    place-items: center;
    order: -1;
  }

  .portal-brand span,
  .portal-user-copy,
  #logoutButton {
    display: none;
  }

  .portal-sidebar {
    position: fixed;
    top: 68px;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(290px, 88vw);
    height: auto;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .portal-sidebar.open {
    transform: translateX(0);
  }

  .portal-main {
    padding: 20px 14px 40px;
  }

  .portal-page-head,
  .portal-list-item,
  .portal-filterbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .portal-profile-card,
  .portal-question-grid {
    grid-template-columns: 1fr;
  }

  .portal-profile-photo {
    width: 120px;
  }

  .portal-support-thread,
  .portal-chat-message {
    max-width: 100%;
  }

  .portal-form label.full {
    grid-column: auto;
  }

  .portal-span-3,
  .portal-span-4,
  .portal-span-5,
  .portal-span-6,
  .portal-span-7,
  .portal-span-8,
  .portal-span-9,
  .portal-span-12 {
    grid-column: 1 / -1;
  }

  .rank-guide-grid,
  .audit-diff-grid,
  .equipment-grid {
    grid-template-columns: 1fr;
  }

  .audit-entry-head {
    grid-template-columns: 1fr;
  }
}
