﻿    :root {
      --bg: #252525;
      --panel: #192125;
      --panel-alt: #212b30;
      --line: #304047;
      --text: #eaf1ef;
      --muted: #96a8a2;
      --accent: #4400c2;
      --accent-2: #4400c2;
      --danger: #d86a5b;
      --success: #5eba95;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--text);
      font-family: "Roboto", sans-serif;
      background: var(--bg);
      padding: 24px;
    }

    main {
      max-width: 1100px;
      margin: 0 auto;
    }

    h1,
    h2,
    h3 {
      margin: 0;
      font-family: "Roboto", sans-serif;
      letter-spacing: 0.04em;
      font-weight: 700;
    }

    h1 {
      text-transform: uppercase;
      font-size: clamp(1.35rem, 2.6vw, 2rem);
      margin-bottom: 8px;
    }

    p {
      margin-top: 0;
      color: var(--muted);
    }

    .page-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .page-head-copy {
      min-width: 0;
    }

    .page-head-copy p {
      margin-bottom: 0;
    }

    .alerts {
      display: grid;
      gap: 10px;
      margin: 16px 0 20px;
    }

    .notice-list {
      display: grid;
      gap: 10px;
      margin: 0 0 16px;
    }

    .notice-banner {
      border: none;
      border-radius: 0;
      padding: 10px 12px;
      font-size: 0.95rem;
      font-weight: 700;
    }

    .notice-red {
      background: #b53a2e;
      color: #ffffff;
    }

    .notice-green {
      background: #2f8f5a;
      color: #ffffff;
    }

    .notice-yellow {
      background: #d6ba4b;
      color: #1f1a00;
    }

    .notice-blue {
      background: #2f5fb8;
      color: #ffffff;
    }

    .alert {
      border: 1px solid var(--line);
      border-left-width: 4px;
      border-radius: 10px;
      padding: 10px 12px;
      background: rgba(0, 0, 0, 0.25);
      font-size: 0.95rem;
    }

    .alert.error {
      border-left-color: var(--danger);
    }

    .alert.success {
      border-left-color: var(--success);
    }

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

    .panel {
      border: 1px solid var(--accent);
      border-radius: 14px;
      padding: 16px;
      background: var(--bg);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }

    .panel h2 {
      font-size: 1.1rem;
      margin-bottom: 10px;
    }

    .panel p {
      margin-bottom: 14px;
      font-size: 0.92rem;
    }

    .create-character {
      max-width: 520px;
      margin: 10vh auto 0;
    }

    .game-layout {
      display: grid;
      grid-template-columns: 300px minmax(0, 1fr) 340px;
      gap: 16px;
      align-items: start;
    }

    .stats-panel {
      display: grid;
      gap: 8px;
    }

    .badge-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
      flex-wrap: wrap;
    }

    .char-id {
      min-width: 44px;
      height: 28px;
      padding: 0 10px;
      border-radius: 9999px;
      background: linear-gradient(135deg, #ffffff 0%, #b8b8b8 100%);
      color: black;
      display: inline-grid;
      place-items: center;
      justify-self: start;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.05em;
    }

    .role-badge {
      min-width: 72px;
      height: 28px;
      padding: 0 10px;
      border-radius: 9999px;
      display: inline-grid;
      place-items: center;
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      border: 1px solid var(--bg);
    }

    .badge-moderator {
      background: linear-gradient(135deg, #d8f0d6 0%, #abdba7 100%);
      color: black;
    }

    .badge-admin {
      background: linear-gradient(135deg, #f5cece 0%, #e8a4a4 100%);
      color: black;
    }

    .badge-developer {
      background: linear-gradient(135deg, #4400c2 0%, #6b2bff 100%);
      color: #ffffff;
    }

    .badge-supporter {
      background: linear-gradient(135deg, #f7df8f 0%, #d9a534 100%);
      color: #000000;
    }

    .badge-tester {
      background: linear-gradient(135deg, #4d1212 0%, #7a2323 100%);
      color: #ffffff;
    }

    .stat-line {
      color: var(--muted);
      font-size: 0.95rem;
    }

    .stat-line strong {
      color: var(--text);
      font-weight: 700;
    }

    .divider {
      border: 0;
      border-top: 1px solid var(--line);
      margin: 8px 0;
    }

    .qi-rate {
      font-weight: 700;
      color: skyblue;
    }

    .game-surface {
      min-height: 520px;
      display: grid;
      align-content: start;
      gap: 12px;
    }

    .game-center {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      justify-content: center;
      align-items: stretch;
      min-height: 180px;
      padding: 8px 0;
      gap: 10px;
    }

    .customise-card {
      width: 100%;
      min-width: 0;
      border: 1px solid var(--bg);
      border-radius: 14px;
      background: rgba(0, 0, 0, 0.18);
      padding: 10px 8px;
      display: grid;
      justify-items: center;
      gap: 8px;
      cursor: pointer;
      transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
    }

    .customise-card:hover,
    .customise-card:focus-visible {
      border-color: var(--accent);
      transform: translateY(-1px);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
      outline: none;
    }

    .customise-card img {
      width: min(84px, 100%);
      height: auto;
      display: block;
      border-radius: 10px;
    }

    .panel-card-static {
      cursor: default;
    }

    .panel-card-static:hover,
    .panel-card-static:focus-visible {
      border-color: var(--bg);
      transform: none;
      box-shadow: none;
      outline: none;
    }

    .customise-label {
      color: var(--text);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: uppercase;
      display: inline-block;
      max-width: 100%;
      text-align: center;
      line-height: 1.1;
      white-space: normal;
      overflow: visible;
      overflow-wrap: normal;
      word-break: normal;
    }

    .customise-label-wrap {
      max-width: 100%;
    }

    .surface-default[hidden] {
      display: none;
    }

    .customise-panel {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

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

    .customise-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .customise-top h3 {
      font-size: 1rem;
      margin: 0;
    }

    .customise-close {
      padding: 6px 10px;
      font-size: 0.8rem;
    }

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

    .title-sections {
      display: grid;
      gap: 14px;
      max-height: 520px;
      overflow-y: auto;
      overflow-x: hidden;
      cursor: grab;
      user-select: none;
      touch-action: pan-y;
      padding-right: 2px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .title-sections.dragging {
      cursor: grabbing;
    }

    .title-sections::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .title-section {
      display: grid;
      gap: 8px;
    }

    .title-section-heading {
      color: var(--text);
      font-size: 0.88rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .title-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      border: 1px solid var(--bg);
      border-radius: 10px;
      padding: 10px 12px;
      background: rgba(0, 0, 0, 0.22);
    }

    .title-row-form {
      display: block;
    }

    .title-row-btn {
      width: 100%;
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      color: var(--text);
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      padding: 10px 12px;
      font: inherit;
      cursor: pointer;
      transition: border-color 140ms ease, transform 140ms ease;
    }

    .title-row-btn:hover,
    .title-row-btn:focus-visible {
      border-color: var(--accent);
      transform: translateY(-1px);
      outline: none;
    }

    .title-name {
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .title-main {
      min-width: 0;
      display: grid;
      gap: 3px;
      text-align: left;
    }

    .title-description {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.3;
      overflow-wrap: anywhere;
    }

    .title-action {
      color: var(--muted);
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .title-locked {
      color: #ff8a7a;
      font-weight: 700;
      font-size: 0.84rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .title-selected {
      color: #34c759;
      font-weight: 700;
      font-size: 0.84rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .roots-panel {
      border: 1px solid var(--accent);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.2);
      padding: 12px;
      display: grid;
      gap: 10px;
    }

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

    .roots-upgrade-row {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      padding: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .roots-upgrade-info {
      min-width: 0;
      display: grid;
      gap: 6px;
    }

    .roots-level-line {
      color: var(--text);
      font-weight: 700;
      font-size: 0.94rem;
      overflow-wrap: anywhere;
    }

    .roots-cost-line {
      color: var(--muted);
      font-size: 0.9rem;
      display: flex;
      align-items: center;
      gap: 6px;
      overflow-wrap: anywhere;
    }

    .roots-cost-icon {
      width: 18px;
      height: 18px;
      border-radius: 5px;
      object-fit: cover;
      display: inline-block;
      vertical-align: middle;
      flex: 0 0 auto;
    }

    .roots-cost-note {
      color: #ff8a7a;
      font-size: 0.84rem;
    }

    .roots-cost-amount {
      color: var(--accent);
      font-weight: 700;
    }

    .roots-actions {
      flex: 0 0 auto;
    }

    .ranking-view {
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

    .ranking-view[hidden] {
      display: none;
    }

    .ranking-summary {
      color: var(--muted);
      font-size: 0.88rem;
      font-weight: 700;
    }

    .ranking-viewport {
      border-radius: 12px;
      background: var(--bg);
      min-height: 340px;
      max-height: 520px;
      overflow-y: auto;
      overflow-x: hidden;
      cursor: grab;
      user-select: none;
      touch-action: none;
      padding: 14px 10px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .ranking-viewport.dragging {
      cursor: grabbing;
    }

    .ranking-viewport::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .ranking-map {
      display: grid;
      gap: 10px;
      width: 100%;
      justify-content: center;
    }

    .ranking-row {
      display: grid;
      grid-template-columns: 172px 172px;
      align-items: stretch;
      column-gap: 12px;
    }

    .ranking-position {
      width: 172px;
      border: 1px;
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.2);
      padding: 10px 9px;
      display: grid;
      gap: 5px;
      align-content: center;
      justify-items: center;
      text-align: center;
      min-height: 176px;
    }

    .ranking-position.current {
      border: 1px solid;
      border-color: var(--accent);
      box-shadow: 0 0 0 1px rgba(255, 174, 43, 0.28);
    }

    .ranking-position-index {
      color: white;
      font-size: 0.82rem;
      font-weight: 800;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .ranking-position-title {
      font-size: 0.88rem;
      font-weight: 700;
      line-height: 1.2;
      overflow-wrap: anywhere;
      min-height: 1.2em;
    }

    .ranking-position-title.empty {
      color: var(--muted);
    }

    .ranking-position-name {
      color: var(--text);
      font-size: 0.92rem;
      font-weight: 700;
      overflow-wrap: anywhere;
      min-height: 1.3em;
    }

    .ranking-position-realm {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.25;
      overflow-wrap: anywhere;
      min-height: 1.2em;
    }

    .ranking-position-empty-line {
      color: var(--muted);
      font-size: 0.82rem;
      min-height: 1.2em;
    }

    .ranking-position-action {
      margin-top: 0;
      display: grid;
      gap: 4px;
      justify-items: center;
    }

    .ranking-position-note {
      color: var(--muted);
      font-size: 0.75rem;
      line-height: 1.2;
    }

    .ranking-position-action .btn {
      width: 100%;
    }

    .explore-view {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

    .explore-view[hidden] {
      display: none;
    }

    .explore-viewport {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.22);
      min-height: 340px;
      max-height: 420px;
      overflow-y: auto;
      overflow-x: hidden;
      cursor: grab;
      user-select: none;
      touch-action: pan-y;
      padding: 22px 16px;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .explore-viewport.dragging {
      cursor: grabbing;
    }

    .explore-viewport::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .explore-map {
      display: grid;
      gap: 10px;
      width: 100%;
      justify-content: center;
    }

    .explore-row {
      display: grid;
      grid-template-columns: 160px 160px;
      align-items: start;
      column-gap: 28px;
    }

    .explore-zone {
      width: 160px;
      display: grid;
      justify-items: center;
      gap: 6px;
      text-align: center;
      flex: 0 0 auto;
    }

    .explore-zone-button {
      width: 100%;
      border: 0;
      background: none;
      padding: 0;
      margin: 0;
      color: inherit;
      font: inherit;
      cursor: pointer;
      display: grid;
      justify-items: center;
      gap: 6px;
    }

    .explore-zone-button:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-radius: 10px;
    }

    .explore-zone-button:disabled {
      cursor: not-allowed;
    }

    .explore-zone img {
      width: 108px;
      height: auto;
      border-radius: 10px;
      display: block;
      transition: border-color 140ms ease, transform 140ms ease;
    }

    .explore-zone:not(.locked):not(.unavailable) .explore-zone-button:hover img,
    .explore-zone:not(.locked):not(.unavailable) .explore-zone-button:focus-visible img {
      border-color: var(--accent);
      transform: translateY(-1px);
    }

    .explore-zone.locked img {
      opacity: 0.45;
      filter: grayscale(0.5);
    }

    .explore-zone.unavailable img {
      opacity: 0.4;
      filter: grayscale(0.6);
    }

    .explore-zone-name {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: 0.03em;
    }

    .explore-zone-lock {
      color: #ff8a7a;
      font-size: 0.82rem;
      min-height: 1.2em;
    }

    .explore-run-panel {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.18);
      padding: 12px;
      display: grid;
      gap: 8px;
    }

    .explore-rest-state {
      display: grid;
      gap: 6px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.2);
      padding: 8px 10px;
    }

    .explore-rest-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .explore-rest-title {
      color: var(--text);
      font-size: 0.84rem;
      font-weight: 700;
    }

    .explore-rest-count {
      color: var(--text);
      font-size: 0.84rem;
      font-weight: 700;
    }

    .explore-rest-progress {
      width: 100%;
      height: 7px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.1);
      overflow: hidden;
    }

    .explore-rest-progress[hidden] {
      display: none;
    }

    .explore-rest-progress-fill {
      height: 100%;
      width: 0;
      background: linear-gradient(90deg, #7fc2ff 0%, #b6f2cf 100%);
      transition: width 0.2s linear;
    }

    .explore-rest-meta {
      color: var(--muted);
      font-size: 0.8rem;
      line-height: 1.3;
    }

    .explore-run-status {
      color: var(--text);
      font-weight: 700;
      font-size: 0.92rem;
      line-height: 1.35;
    }

    .explore-run-progress {
      color: var(--muted);
      font-size: 0.86rem;
    }

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

    .explore-run-log {
      max-height: 190px;
      overflow-y: auto;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0);
      padding: 8px;
      display: grid;
      gap: 6px;
    }

    .explore-run-entry {
      border-radius: 8px;
      padding: 6px 8px;
      background: rgba(0, 0, 0, 0);
      display: grid;
      gap: 4px;
    }

    .explore-run-entry-title {
      color: var(--text);
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .explore-run-entry-body {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.3;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .events-view {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

    .events-view[hidden] {
      display: none;
    }

    .events-list-view[hidden] {
      display: none;
    }

    .events-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      align-content: start;
    }

    .events-card {
      min-width: 0;
    }

    .events-card-button {
      width: 100%;
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.24);
      color: inherit;
      font: inherit;
      padding: 10px;
      display: grid;
      gap: 6px;
      text-align: center;
      cursor: pointer;
      transition: border-color 140ms ease, transform 140ms ease;
    }

    .events-card-button:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-color: var(--accent);
    }

    .events-card-button:hover:not(:disabled) {
      border-color: var(--accent);
      transform: translateY(-1px);
    }

    .events-card-button:disabled {
      cursor: not-allowed;
      opacity: 0.66;
    }

    .events-card-button img {
      width: 100%;
      aspect-ratio: 4 / 3;
      object-fit: cover;
      border-radius: 10px;
      display: block;
    }

    .events-card-title {
      color: var(--text);
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-align: center;
      overflow-wrap: anywhere;
    }

    .events-card-meta {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.25;
      text-align: center;
      overflow-wrap: anywhere;
    }

    .events-countdown {
      color: var(--accent);
      font-weight: 700;
    }

    .events-battle-view {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.2);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
      align-content: start;
    }

    .events-battle-view[hidden] {
      display: none;
    }

    .events-battle-subtitle {
      color: var(--text);
      font-size: 1.02rem;
      font-weight: 700;
    }

    .events-battle-hp-line {
      color: var(--muted);
      font-size: 0.92rem;
      font-weight: 700;
    }

    .events-battle-hp-bar {
      width: 100%;
      height: 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.12);
      overflow: hidden;
    }

    .events-battle-hp-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, #8f2a2a 0%, #d74f4f 100%);
      transition: width 180ms ease;
    }

    .events-battle-command {
      color: var(--muted);
      font-size: 0.84rem;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.24);
      padding: 8px;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .events-battle-player,
    .events-battle-cooldown,
    .events-battle-reward {
      color: var(--muted);
      font-size: 0.9rem;
      font-weight: 700;
    }

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

    .events-battle-result {
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.24);
      padding: 10px;
      color: var(--muted);
      font-size: 0.86rem;
      line-height: 1.35;
      white-space: pre-wrap;
      word-break: break-word;
      min-height: 54px;
    }

    .sects-view {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

    .sects-view[hidden] {
      display: none;
    }

    .sects-tier-list {
      display: grid;
      gap: 12px;
      max-height: 520px;
      overflow-y: auto;
      overflow-x: hidden;
      padding-right: 2px;
      cursor: grab;
      user-select: none;
      touch-action: pan-y;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .sects-tier-list.dragging {
      cursor: grabbing;
    }

    .sects-tier-list::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .sects-tier {
      display: grid;
      gap: 8px;
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.16);
      padding: 10px;
    }

    .sects-tier-heading {
      color: var(--text);
      font-size: 0.94rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

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

    .sect-row {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      padding: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .sect-row-main {
      min-width: 0;
      flex: 1 1 auto;
      display: grid;
      gap: 4px;
    }

    .sect-row-name {
      color: var(--text);
      font-size: 0.95rem;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .sect-row-meta {
      color: var(--muted);
      font-size: 0.82rem;
      overflow-wrap: anywhere;
    }

    .sect-row-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      min-width: 120px;
      flex: 0 0 auto;
    }

    .sect-requires {
      color: #ff5f5f;
      font-size: 0.84rem;
      font-weight: 700;
      text-align: left;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .sect-join-form {
      display: block;
    }

    .sect-active-view {
      min-height: 420px;
      display: grid;
      align-content: start;
      gap: 12px;
    }

    .sect-contribution {
      text-align: center;
      color: white;
      font-size: 1.02rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }

    .sect-position {
      text-align: center;
      color: var(--text);
      font-size: 0.92rem;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .sect-master-box {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.22);
      min-height: 240px;
      display: grid;
      align-content: center;
      justify-items: center;
      text-align: center;
      gap: 8px;
      padding: 18px 12px;
    }

    .sect-master-title {
      color: var(--accent);
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: 0.03em;
    }

    .sect-master-name {
      color: var(--text);
      font-size: 1.08rem;
      font-weight: 700;
    }

    .sect-master-realm {
      color: var(--muted);
      font-size: 0.92rem;
    }

    .sect-master-empty-line {
      color: var(--muted);
      font-size: 0.92rem;
      line-height: 1.35;
    }

    .sect-actions {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: auto;
    }

    .sect-actions .btn {
      min-width: 110px;
    }

    .sect-skills-panel {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.2);
      padding: 10px;
      display: grid;
      gap: 8px;
    }

    .sect-skills-panel[hidden] {
      display: none;
    }

    .sect-skills-panel-title {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

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

    .sect-skill-row {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.18);
      padding: 8px 10px;
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .sect-skill-row img {
      width: 34px;
      height: 34px;
      border-radius: 7px;
      object-fit: cover;
      display: block;
    }

    .sect-skill-main {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .sect-skill-name {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .sect-skill-subtext {
      color: var(--muted);
      font-size: 0.8rem;
      overflow-wrap: anywhere;
    }

    .sect-skill-action {
      display: grid;
      justify-items: end;
      gap: 4px;
    }

    .sect-skill-action form {
      display: block;
    }

    .sect-skill-locked {
      color: #ff8a7a;
      font-size: 0.78rem;
      text-align: right;
      white-space: nowrap;
    }

    .sect-position-panel {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.2);
      padding: 10px;
      display: grid;
      gap: 8px;
    }

    .sect-position-panel[hidden] {
      display: none;
    }

    .sect-position-panel-title {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

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

    .sect-position-row {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.18);
      padding: 8px 10px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .sect-position-row.current {
      border-color: var(--accent);
    }

    .sect-position-row-main {
      min-width: 0;
      display: grid;
      gap: 4px;
    }

    .sect-position-row-name {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .sect-position-row-meta {
      color: var(--muted);
      font-size: 0.8rem;
      overflow-wrap: anywhere;
    }

    .sect-position-row-action {
      display: grid;
      justify-items: end;
      gap: 4px;
    }

    .sect-position-row-action form {
      display: block;
    }

    .sect-position-needs {
      color: #ff8a7a;
      font-size: 0.78rem;
      text-align: right;
    }

    .sect-missions-panel {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.2);
      padding: 10px;
      display: grid;
      gap: 8px;
    }

    .sect-missions-panel[hidden] {
      display: none;
    }

    .sect-missions-panel-title {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .sect-mission-active {
      border: 1px solid var(--accent);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      padding: 8px 10px;
      display: grid;
      gap: 6px;
    }

    .sect-mission-active-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: var(--text);
      font-size: 0.84rem;
      font-weight: 700;
    }

    .sect-mission-active-name {
      overflow-wrap: anywhere;
    }

    .sect-mission-next {
      color: var(--muted);
      font-size: 0.8rem;
      font-weight: 600;
      white-space: nowrap;
    }

    .sect-mission-progress {
      width: 100%;
      height: 8px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
      overflow: hidden;
    }

    .sect-mission-progress-fill {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, #7fc2ff 0%, #b6f2cf 100%);
      transition: width 0.3s ease;
    }

    .sect-mission-active-meta {
      color: var(--muted);
      font-size: 0.78rem;
      overflow-wrap: anywhere;
    }

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

    .sect-mission-row {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.18);
      padding: 8px 10px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .sect-mission-row.active {
      border-color: var(--accent);
    }

    .sect-mission-row-main {
      min-width: 0;
      display: grid;
      gap: 4px;
    }

    .sect-mission-row-name {
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .sect-mission-row-meta {
      color: var(--muted);
      font-size: 0.8rem;
      overflow-wrap: anywhere;
    }

    .sect-mission-row-action {
      display: grid;
      justify-items: end;
      gap: 4px;
    }

    .sect-mission-row-action form {
      display: block;
    }

    .sect-mission-needs {
      color: #ff8a7a;
      font-size: 0.78rem;
      text-align: right;
    }

    .sect-leave-wrap {
      display: flex;
      justify-content: center;
    }

    .inventory-panel {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

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

    .market-panel {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

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

    .market-sections {
      display: grid;
      gap: 12px;
      max-height: 520px;
      overflow-y: auto;
      overflow-x: hidden;
      cursor: grab;
      user-select: none;
      touch-action: pan-y;
      padding-right: 2px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .market-sections.dragging {
      cursor: grabbing;
    }

    .market-sections::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .market-section {
      display: grid;
      gap: 8px;
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.16);
      padding: 10px;
    }

    .market-section h4 {
      margin: 0;
      font-size: 0.94rem;
      color: var(--text);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .market-copy {
      margin: 0;
      color: var(--muted);
      font-size: 0.84rem;
      line-height: 1.35;
    }

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

    .market-item {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      padding: 10px;
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: start;
    }

    .market-item img {
      width: 42px;
      height: 42px;
      border-radius: 8px;
      object-fit: cover;
      display: block;
    }

    .market-main {
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .market-name-line {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .market-name {
      color: var(--text);
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .market-realm {
      color: var(--accent);
      font-size: 0.82rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .market-stats {
      color: #cfdffd;
      font-size: 0.84rem;
      overflow-wrap: anywhere;
    }

    .market-cost {
      color: var(--muted);
      font-size: 0.84rem;
      overflow-wrap: anywhere;
    }

    .market-actions {
      display: grid;
      align-items: center;
      justify-items: end;
      gap: 6px;
      min-width: 76px;
    }

    .market-actions form {
      display: grid;
      gap: 6px;
      justify-items: end;
    }

    .market-pill-form {
      display: grid;
      gap: 6px;
      justify-items: end;
    }

    .market-owned {
      color: #ff4d4d;
      font-size: 0.84rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .market-qty {
      display: grid;
      gap: 4px;
      color: var(--muted);
      font-size: 0.72rem;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      justify-items: end;
    }

    .market-qty input {
      width: 76px;
      padding: 6px 8px;
      border-radius: 6px;
      text-align: right;
    }

    .skills-view {
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      padding: 12px;
      display: grid;
      gap: 10px;
      min-height: 420px;
    }

    .skills-view[hidden] {
      display: none;
    }

    .skills-list {
      display: grid;
      gap: 8px;
      max-height: 520px;
      overflow-y: auto;
      overflow-x: hidden;
      padding-right: 2px;
      cursor: grab;
      user-select: none;
      touch-action: pan-y;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .skills-list.dragging {
      cursor: grabbing;
    }

    .skills-list::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .skills-item {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      padding: 10px;
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: start;
    }

    .skills-item img {
      width: 42px;
      height: 42px;
      border-radius: 8px;
      object-fit: cover;
      display: block;
    }

    .skills-main {
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .skills-name-line {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .skills-name {
      color: var(--text);
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .skills-level {
      color: var(--accent);
      font-weight: 700;
      white-space: nowrap;
      font-size: 0.86rem;
    }

    .skills-meta {
      color: var(--muted);
      font-size: 0.84rem;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .skills-bonus {
      color: #cfdffd;
      font-size: 0.85rem;
      overflow-wrap: anywhere;
    }

    .skills-cost {
      color: var(--muted);
      font-size: 0.84rem;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      overflow-wrap: anywhere;
    }

    .skills-cost-amount {
      color: var(--accent);
      font-weight: 700;
    }

    .skills-max {
      color: #34c759;
      font-size: 0.82rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .skills-need {
      color: #ff8a7a;
      font-size: 0.82rem;
      overflow-wrap: anywhere;
    }

    .skills-action {
      align-self: stretch;
      display: grid;
      align-items: center;
    }

    .skills-action form {
      display: block;
    }

    .inventory-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 8px;
    }

    .inventory-heading {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .inventory-top img {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      display: block;
    }

    .inventory-top h3 {
      font-size: 1rem;
      margin: 0;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .inventory-list {
      display: grid;
      gap: 8px;
      max-height: 520px;
      overflow-y: auto;
      overflow-x: hidden;
      cursor: grab;
      user-select: none;
      touch-action: pan-y;
      padding-right: 2px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .inventory-list.dragging {
      cursor: grabbing;
    }

    .inventory-list::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .inventory-item {
      border: 1px solid var(--bg);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.22);
      padding: 10px;
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: start;
    }

    .inventory-item.useable {
      cursor: pointer;
      transition: border-color 140ms ease, transform 140ms ease;
    }

    .inventory-item.useable:hover,
    .inventory-item.useable:focus-visible {
      border-color: var(--accent);
      transform: translateY(-1px);
      outline: none;
    }

    .inventory-item img {
      width: 42px;
      height: 42px;
      border-radius: 8px;
      object-fit: cover;
      display: block;
    }

    .inventory-main {
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .inventory-name-line {
      display: flex;
      align-items: baseline;
      gap: 6px;
      min-width: 0;
    }

    .inventory-amount {
      color: var(--accent);
      font-weight: 700;
      white-space: nowrap;
    }

    .inventory-name {
      color: var(--text);
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .inventory-description {
      color: var(--muted);
      font-size: 0.88rem;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .inventory-use {
      border: 0;
      background: transparent;
      padding: 0;
      margin: 0;
      color: #34c759;
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      align-self: center;
      white-space: nowrap;
      cursor: pointer;
      font-family: inherit;
      line-height: 1;
    }

    .inventory-use:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-radius: 4px;
    }

    .inventory-use-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.55);
      z-index: 40;
      display: grid;
      place-items: center;
      padding: 16px;
    }

    .inventory-use-modal-backdrop[hidden] {
      display: none;
    }

    .inventory-use-modal {
      width: min(460px, 100%);
      border: 1px solid var(--accent);
      border-radius: 12px;
      background: #10171a;
      box-shadow: 0 14px 26px rgba(0, 0, 0, 0.38);
      padding: 12px;
      display: grid;
      gap: 10px;
    }

    .inventory-use-modal-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .inventory-use-modal-title {
      margin: 0;
      font-size: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .inventory-use-modal-close {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: #1c2428;
      color: #ffffff;
      cursor: pointer;
      font: inherit;
      line-height: 1;
      padding: 0;
    }

    .inventory-use-modal-message {
      margin: 0;
      color: var(--muted);
      font-size: 0.92rem;
      line-height: 1.35;
    }

    .inventory-use-name-wrap[hidden] {
      display: none;
    }

    .inventory-use-name-wrap input {
      margin-top: 6px;
    }

    .inventory-use-qty-wrap[hidden] {
      display: none;
    }

    .inventory-use-qty-wrap input {
      margin-top: 6px;
    }

    .inventory-use-modal-error {
      color: #ff8a7a;
      font-size: 0.86rem;
      line-height: 1.3;
    }

    .inventory-use-modal-error[hidden] {
      display: none;
    }

    .inventory-use-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .dev-command-open {
      border-color: #3f2f0e;
      background: var(--bg);
      color: #1f1300;
      min-height: 40px;
      align-self: flex-start;
    }

    .dev-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.58);
      z-index: 45;
      display: grid;
      place-items: center;
      padding: 16px;
    }

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

    .dev-modal {
      width: min(620px, 100%);
      border: 1px solid var(--bg);
      border-radius: 12px;
      background: var(--bg);
      box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42);
      padding: 12px;
      display: grid;
      gap: 10px;
    }

    .dev-modal-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .dev-modal-title {
      margin: 0;
      font-size: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .dev-modal-close {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: #1c2428;
      color: #ffffff;
      cursor: pointer;
      font: inherit;
      line-height: 1;
      padding: 0;
    }

    .dev-form {
      display: grid;
      gap: 10px;
    }

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

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

    .dev-field textarea {
      width: 100%;
      border: 1px solid #394a52;
      border-radius: 8px;
      padding: 10px 12px;
      background: #10171a;
      color: var(--text);
      outline: none;
      font: inherit;
      resize: vertical;
      min-height: 92px;
      max-height: 220px;
    }

    .dev-field select {
      width: 100%;
      border: 1px solid #394a52;
      border-radius: 8px;
      padding: 10px 12px;
      background: #10171a;
      color: var(--text);
      outline: none;
      font: inherit;
    }

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

    .dev-invite-list-field {
      grid-column: 1 / -1;
      display: grid;
      gap: 8px;
    }

    .dev-invite-table-wrap {
      border: 1px solid #394a52;
      border-radius: 8px;
      background: #10171a;
      max-height: 260px;
      overflow: auto;
    }

    .dev-invite-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 980px;
      font-size: 0.82rem;
      line-height: 1.3;
    }

    .dev-invite-table th,
    .dev-invite-table td {
      border-bottom: 1px solid rgba(70, 90, 100, 0.6);
      padding: 6px 8px;
      text-align: left;
      white-space: nowrap;
    }

    .dev-invite-table th {
      position: sticky;
      top: 0;
      z-index: 1;
      background: #172126;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      font-size: 0.74rem;
    }

    .dev-invite-status {
      font-weight: 700;
      font-size: 0.76rem;
      letter-spacing: 0.02em;
    }

    .dev-invite-status-active {
      color: #74e38f;
    }

    .dev-invite-status-exhausted {
      color: #f2cd64;
    }

    .dev-invite-status-inactive {
      color: #ff8a7a;
    }

    .dev-invite-empty {
      padding: 12px;
      color: var(--muted);
      font-size: 0.9rem;
    }

    .chat-panel {
      position: relative;
      min-height: 520px;
      display: grid;
      grid-template-rows: auto minmax(220px, 1fr) auto;
      gap: 10px;
    }

    .chat-history {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 10px;
      overflow-y: auto;
      overflow-x: hidden;
      height: 280px;
      min-height: 280px;
      max-height: 280px;
      background: rgba(0, 0, 0, 0.18);
      display: grid;
      gap: 10px;
      cursor: grab;
      user-select: none;
      touch-action: none;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .chat-history.dragging {
      cursor: grabbing;
    }

    .chat-history::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .chat-empty {
      color: var(--muted);
      font-size: 0.9rem;
    }

    .chat-entry {
      display: grid;
      gap: 4px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      padding-bottom: 8px;
    }

    .chat-entry:last-child {
      border-bottom: 0;
      padding-bottom: 0;
    }

    .chat-meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      font-size: 0.85rem;
      line-height: 1.25;
    }

    .chat-title {
      font-weight: 700;
    }

    .chat-name-button {
      color: #ffffff;
      font-weight: 700;
      background: none;
      border: 0;
      padding: 0;
      margin: 0;
      cursor: pointer;
      font: inherit;
      text-decoration: none;
    }

    .chat-name-button:hover,
    .chat-name-button:focus-visible {
      text-decoration: underline;
      text-underline-offset: 2px;
      outline: none;
    }

    .chat-time {
      color: #ffffff;
      font-weight: 700;
      margin-left: auto;
      white-space: nowrap;
    }

    .chat-message {
      color: var(--text);
      white-space: pre-wrap;
      word-break: break-word;
      font-size: 0.92rem;
      line-height: 1.35;
    }

    .chat-entry.system-message .chat-name-system {
      color: #ff0000;
    }

    .chat-entry.system-message .chat-message {
      color: skyblue;
    }

    .chat-name-system {
      font-weight: 700;
    }

    .chat-form {
      gap: 8px;
    }

    .chat-form textarea {
      width: 100%;
      border: 1px solid #394a52;
      border-radius: 8px;
      padding: 10px 12px;
      background: #10171a;
      color: var(--text);
      outline: none;
      font: inherit;
      resize: vertical;
      min-height: 78px;
      max-height: 180px;
    }

    .chat-form textarea:focus {
      border-color: var(--accent-2);
      box-shadow: 0 0 0 2px rgba(147, 213, 198, 0.2);
    }

    .chat-profile-popup {
      position: absolute;
      top: 56px;
      left: 0;
      right: 0;
      width: auto;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #10171a;
      box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
      padding: 10px;
      z-index: 10;
      display: grid;
      gap: 8px;
    }

    .chat-profile-popup[hidden] {
      display: none;
    }

    .chat-profile-top {
      display: flex;
      justify-content: flex-end;
    }

    .chat-profile-close {
      width: 24px;
      height: 24px;
      border-radius: 6px;
      border: 1px solid var(--line);
      background: #1c2428;
      color: #ffffff;
      cursor: pointer;
      font: inherit;
      line-height: 1;
      padding: 0;
    }

    .chat-profile-badges {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .chat-profile-badges .role-badge {
      min-width: 0;
      height: 24px;
      font-size: 0.72rem;
      padding: 0 8px;
    }

    .chat-profile-badges .char-id {
      min-width: 36px;
      height: 24px;
      font-size: 0.72rem;
      padding: 0 8px;
    }

    .chat-profile-title {
      font-size: 0.9rem;
      font-weight: 700;
    }

    .chat-profile-name {
      color: #ffffff;
      font-size: 1rem;
      font-weight: 700;
      line-height: 1.2;
    }

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

    .game-surface h2 {
      margin-bottom: 2px;
    }

    .stub {
      border: 1px dashed #3f525a;
      border-radius: 12px;
      padding: 14px;
      color: var(--muted);
      background: var(--bg);
      font-size: 0.95rem;
    }

    form {
      display: grid;
      gap: 10px;
    }

    label {
      font-size: 0.85rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      display: grid;
      gap: 5px;
    }

    input {
      width: 100%;
      border: 1px solid #394a52;
      border-radius: 8px;
      padding: 10px 12px;
      background: #10171a;
      color: var(--text);
      outline: none;
      font: inherit;
    }

    input:focus {
      border-color: var(--accent-2);
      box-shadow: 0 0 0 2px rgba(147, 213, 198, 0.2);
    }

    .btn {
      border: 1px solid var(--bg);
      border-radius: 8px;
      background: lime;
      color: #1f1300;
      font-weight: 700;
      font-family: "Roboto", sans-serif;
      padding: 10px 14px;
      cursor: pointer;
      transition: transform 140ms ease, filter 140ms ease;
    }

    .btn:hover {
      transform: translateY(-1px);
      filter: brightness(1.02);
    }

    .btn.secondary {
      border-color: var(--bg);
      background: red;
      color: var(--text);
    }

    .btn.third {
      border-color: var(--bg);
      background: var(--accent);
      color: var(--text);
    }

    .btn.orange {
      border-color: var(--bg);
      background: #ff8c26;
      color: #1f1300;
    }

    .btn.white {
      border-color: #d9d9d9;
      background: #ffffff;
      color: #111111;
    }

    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      background: #1b252a;
      transform: none;
      filter: none;
    }

    .back-link {
      display: inline-block;
      margin-top: 18px;
      color: var(--accent-2);
      text-decoration: none;
      font-weight: 700;
    }

    @media (max-width: 960px) {
      body {
        padding: 16px;
      }

      .auth-grid,
      .game-layout {
        grid-template-columns: 1fr;
      }

      .create-character {
        margin-top: 28px;
      }

      .game-surface {
        min-height: 320px;
      }

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

      .roots-upgrade-row {
        flex-direction: column;
        align-items: stretch;
      }

      .roots-actions form,
      .roots-actions .btn {
        width: 100%;
      }

      .ranking-view {
        min-height: 360px;
      }

      .ranking-viewport {
        min-height: 300px;
        padding: 10px 6px;
      }

      .ranking-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 8px;
        width: 100%;
      }

      .ranking-position {
        width: 100%;
        min-width: 0;
        min-height: 184px;
        padding: 10px 7px;
      }

      .explore-view {
        min-height: 360px;
      }

      .explore-viewport {
        min-height: 300px;
        padding: 16px 10px;
      }

      .explore-map {
        gap: 8px;
      }

      .explore-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 10px;
        width: 100%;
      }

      .explore-zone {
        width: 100%;
        min-width: 0;
      }

      .explore-zone img {
        width: clamp(84px, 28vw, 108px);
      }

      .explore-zone-name {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.2;
        font-size: 0.82rem;
      }

      .explore-run-actions .btn {
        flex: 1 1 140px;
      }

      .events-view {
        min-height: 360px;
      }

      .customise-panel,
      .inventory-panel,
      .market-panel {
        min-height: 360px;
      }

      .skills-view {
        min-height: 360px;
      }

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

      .events-battle-actions .btn {
        width: 100%;
      }

      .sects-view {
        min-height: 360px;
      }

      .sect-row {
        flex-direction: column;
        align-items: flex-start;
      }

      .sect-row-actions {
        width: 100%;
        justify-content: flex-end;
      }

      .sect-actions .btn {
        flex: 1 1 120px;
      }

      .sect-position-row {
        grid-template-columns: 1fr;
        justify-items: start;
      }

      .sect-mission-active-head {
        flex-direction: column;
        align-items: flex-start;
      }

      .sect-mission-row {
        grid-template-columns: 1fr;
        justify-items: start;
      }

      .sect-skill-row {
        grid-template-columns: 34px minmax(0, 1fr);
      }

      .sect-skill-action {
        grid-column: 1 / -1;
        width: 100%;
        justify-items: start;
      }

      .sect-skill-locked {
        text-align: left;
        white-space: normal;
      }

      .sect-position-row-action {
        width: 100%;
        justify-items: start;
      }

      .sect-position-needs {
        text-align: left;
      }

      .sect-mission-row-action {
        width: 100%;
        justify-items: start;
      }

      .sect-mission-needs {
        text-align: left;
      }

      .sect-leave-wrap .btn {
        width: 100%;
      }

      .market-item {
        grid-template-columns: 42px minmax(0, 1fr);
      }

      .market-actions,
      .market-actions form,
      .market-pill-form,
      .market-qty {
        justify-items: start;
      }

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