:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f1014;
  color: #f7f4ea;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(118, 79, 31, 0.28), transparent 36rem),
    linear-gradient(180deg, #17181d 0%, #0f1014 65%);
}

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

a {
  color: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
.button {
  min-height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.035);
  color: #f7f4ea;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

button:hover,
.button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.065);
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #e8c986;
  outline-offset: 2px;
}

button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-primary {
  border-color: rgba(232, 201, 134, 0.42);
  background: rgba(232, 201, 134, 0.11);
  color: #f0d89f;
}

.button-primary:hover {
  border-color: rgba(232, 201, 134, 0.58);
  background: rgba(232, 201, 134, 0.16);
}

.button-success {
  border-color: rgba(124, 198, 141, 0.35);
  background: rgba(124, 198, 141, 0.07);
  color: #b9dfc1;
}

.button-success:hover {
  border-color: rgba(124, 198, 141, 0.5);
  background: rgba(124, 198, 141, 0.11);
}

.button-destructive {
  border-color: rgba(198, 105, 105, 0.34);
  background: rgba(198, 105, 105, 0.07);
  color: #e0aaaa;
}

.button-destructive:hover {
  border-color: rgba(198, 105, 105, 0.5);
  background: rgba(198, 105, 105, 0.11);
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  min-height: 2.65rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  background: #17181d;
  color: #f7f4ea;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
textarea:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

input:not([type="checkbox"]):not([type="radio"]):focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: rgba(232, 201, 134, 0.5);
  box-shadow: 0 0 0 3px rgba(232, 201, 134, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #77736b;
}

input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #c9c5ba;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.switch-control {
  position: relative;
  width: 2.5rem;
  height: 1.4rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  transition:
    border-color 140ms ease,
    background-color 140ms ease;
}

.switch-control::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 50%;
  background: #c9c5ba;
  transform: translateY(-50%);
  transition:
    transform 140ms ease,
    background-color 140ms ease;
}

.switch input[type="checkbox"]:checked + .switch-control {
  border-color: rgba(232, 201, 134, 0.48);
  background: rgba(232, 201, 134, 0.17);
}

.switch input[type="checkbox"]:checked + .switch-control::after {
  background: #e8c986;
  transform: translate(1.04rem, -50%);
}

.switch input[type="checkbox"]:focus-visible + .switch-control {
  outline: 2px solid #e8c986;
  outline-offset: 2px;
}

.switch:has(input[type="checkbox"]:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.action-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 16, 20, 0.92);
  backdrop-filter: blur(18px);
}

.action-bar-inner {
  width: min(100%, 72rem);
  min-height: 4rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-bar-spacer {
  flex: 1;
}

.desktop-nav {
  display: none;
}

.desktop-nav a,
.menu-panel a,
.menu-panel button {
  text-decoration: none;
}

.menu-surface {
  position: relative;
}

.menu-surface > summary {
  list-style: none;
  cursor: pointer;
}

.menu-surface > summary::-webkit-details-marker {
  display: none;
}

.icon-control {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-content: center;
  gap: 0.28rem;
  border-radius: 999px;
}

.icon-control span {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 999px;
  background: #f7f4ea;
}

.me-control {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.2rem 0;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 650;
  white-space: nowrap;
}

.account-visual {
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.account-visual-generic {
  border: 1px solid rgba(232, 201, 134, 0.35);
  background: rgba(255, 255, 255, 0.035);
}

.account-visual-portrait {
  border: 1px solid rgba(232, 201, 134, 0.5);
  background: #15161b;
}

.account-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-glyph {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  min-width: 11rem;
  padding: 0.45rem;
  border: 1px solid rgba(238, 201, 124, 0.18);
  border-radius: 0.9rem;
  background: #17181d;
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.42);
}

.menu-panel-left {
  left: 0;
}

.menu-panel-right {
  right: 0;
}

.menu-panel a,
.menu-panel button {
  width: 100%;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  padding: 0.65rem 0.8rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: #c9c5ba;
  text-align: left;
  cursor: pointer;
}

.menu-panel a:hover,
.menu-panel a:focus-visible,
.menu-panel button:hover,
.menu-panel button:focus-visible {
  background: rgba(255, 255, 255, 0.055);
  color: #f7f4ea;
  outline: none;
}

.mobile-nav-panel {
  width: min(18rem, calc(100vw - 2rem));
}

.mobile-nav-panel a[aria-current="page"] {
  background: rgba(232, 201, 134, 0.08);
  color: #e8c986;
}

.me-menu-panel {
  width: min(21rem, calc(100vw - 2rem));
  padding: 0.75rem;
}

.me-menu-section {
  padding: 0.8rem;
}

.me-menu-section + .me-menu-section {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.me-character-summary {
  display: grid;
  gap: 0.22rem;
}

.me-character-name {
  font-weight: 700;
}

.me-character-meta,
.me-character-context {
  color: #aaa69c;
  font-size: 0.82rem;
}

.guild-rank {
  color: #e8c986;
}

.me-change-main {
  width: auto !important;
  min-height: 0 !important;
  margin-top: 0.45rem;
  padding: 0 !important;
  color: #e8c986 !important;
  font-size: 0.78rem;
  font-weight: 650;
}

.me-change-main:hover,
.me-change-main:focus-visible {
  background: transparent !important;
}

.me-character-summary-empty .me-character-name {
  color: #c9c5ba;
}

.me-discord-section {
  display: grid;
  gap: 0.55rem;
}

.discord-connection {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.discord-connection-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7cc68d;
  box-shadow: 0 0 0.8rem rgba(124, 198, 141, 0.42);
}

.discord-connection-copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.discord-connection-name,
.discord-connection-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-connection-name {
  font-size: 0.88rem;
  font-weight: 650;
}

.discord-connection-status {
  color: #8e8a81;
  font-size: 0.72rem;
}

.me-menu-panel .discord-connect {
  min-height: 0;
  padding: 0;
  color: #c9c5ba;
  font-size: 0.84rem;
}

.me-menu-panel .discord-connect:hover,
.me-menu-panel .discord-connect:focus-visible {
  background: transparent;
  color: #f7f4ea;
}

.me-session-section {
  padding-bottom: 0.45rem;
}

.me-menu-panel .me-sign-out {
  min-height: 2.6rem;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  font-weight: 650;
}

.me-menu-panel .me-sign-out:hover,
.me-menu-panel .me-sign-out:focus-visible {
  border-color: rgba(232, 201, 134, 0.24);
  background: rgba(255, 255, 255, 0.075);
}

.secondary-navigation-zone,
.page-header,
.app-main,
.app-footer {
  width: min(100%, 72rem);
  margin-inline: auto;
}

.secondary-navigation-zone {
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
}

.secondary-navigation {
  width: min(100%, 46rem);
  min-width: 0;
  min-height: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #aaa69c;
  font-size: 0.84rem;
  font-weight: 650;
}

.secondary-navigation a {
  color: inherit;
  text-decoration: none;
}

.secondary-navigation a:hover,
.secondary-navigation a:focus-visible {
  color: #f7f4ea;
}

.secondary-navigation-back a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-navigation-breadcrumb {
  flex-wrap: nowrap;
  overflow: hidden;
  color: #aaa69c;
  font-weight: 700;
}

.secondary-navigation-breadcrumb > a,
.secondary-navigation-breadcrumb > span:not([aria-current="page"]):not(.secondary-navigation-separator) {
  flex: 0 0 auto;
  color: #aaa69c;
}

.secondary-navigation-breadcrumb [aria-current="page"] {
  min-width: 0;
  overflow: hidden;
  color: #e8c986;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-navigation-separator {
  flex: 0 0 auto;
  color: #77736b;
}

@media (max-width: 40rem) {
  .secondary-navigation-breadcrumb > :nth-last-child(n + 4) {
    display: none;
  }

  .secondary-navigation-breadcrumb:has(> :nth-child(4))::before {
    content: "…";
    flex: 0 0 auto;
    color: #77736b;
  }
}

.page-header {
  padding: clamp(1.35rem, 3vw, 2rem) 1.25rem 1.35rem;
}

.page-header-after-secondary-navigation {
  padding-top: 1rem;
}

.home-header-copy {
  width: min(100%, 46rem);
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e8c986;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 7vw, 4.15rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 34rem;
  margin: 0.85rem 0 0;
  font-size: clamp(0.98rem, 2.2vw, 1.1rem);
  line-height: 1.5;
  color: #c9c5ba;
}

.app-main {
  flex: 1;
  padding: 0 1.25rem 4rem;
}

.home-panel {
  width: min(100%, 46rem);
  padding: 1.4rem 1.5rem;
  border: 1px solid rgba(238, 201, 124, 0.18);
  border-radius: 1.2rem;
  background: rgba(18, 19, 24, 0.72);
  box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: #aaa69c;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #7cc68d;
  box-shadow: 0 0 1rem rgba(124, 198, 141, 0.48);
}

.app-footer {
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #7f7c74;
  font-size: 0.78rem;
}

.main-picker {
  width: 100%;
  max-width: none;
  max-height: min(86vh, 52rem);
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: 1.25rem 1.25rem 0 0;
  background: #15161b;
  color: #f7f4ea;
  overflow: hidden;
  box-shadow: 0 -1.5rem 5rem rgba(0, 0, 0, 0.5);
}

.main-picker::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.main-picker-sheet {
  max-height: min(86vh, 52rem);
  overflow-y: auto;
  padding: 1.25rem 1rem max(1.5rem, env(safe-area-inset-bottom));
}

.main-picker-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.main-picker-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
}

.main-picker-heading .eyebrow {
  margin-bottom: 0.35rem;
}

.dialog-close {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #d8d4ca;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.main-picker-intro {
  margin: 0.8rem 0 1.2rem;
  color: #aaa69c;
  line-height: 1.5;
}

.refresh-characters-action {
  width: 100%;
  min-height: 2.9rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(232, 201, 134, 0.24);
  border-radius: 0.75rem;
  background: rgba(232, 201, 134, 0.055);
  color: #e8c986;
  text-align: left;
  font-weight: 650;
  cursor: pointer;
}

.refresh-characters-action:hover,
.refresh-characters-action:focus-visible {
  border-color: rgba(232, 201, 134, 0.42);
  background: rgba(232, 201, 134, 0.09);
}

.refresh-characters-action:disabled {
  cursor: wait;
  color: #aaa69c;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.character-choices {
  display: grid;
  gap: 0.65rem;
}

.character-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.character-choice:hover,
.character-choice:focus-visible {
  border-color: rgba(232, 201, 134, 0.3);
  background: rgba(232, 201, 134, 0.06);
  outline: none;
}

.character-choice-current {
  border-color: rgba(124, 198, 141, 0.32);
  background: rgba(124, 198, 141, 0.055);
}

.character-portrait,
.character-portrait-placeholder {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #101116;
}

.character-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-choice-copy {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.character-choice-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-weight: 700;
}

.current-main-label {
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(232, 201, 134, 0.12);
  color: #e8c986;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.character-choice-meta,
.character-choice-submeta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-choice-meta {
  color: #c9c5ba;
  font-size: 0.86rem;
}

.character-choice-submeta {
  color: #858178;
  font-size: 0.78rem;
}

.main-picker-status,
.main-picker-empty {
  min-height: 1.25rem;
  margin: 0.9rem 0 0;
  color: #aaa69c;
  font-size: 0.86rem;
}

@media (min-width: 52rem) {
  .mobile-nav {
    display: none;
  }

  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .desktop-nav a {
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    color: #c9c5ba;
    text-decoration: none;
    font-size: 0.9rem;
  }

  .desktop-nav a:hover,
  .desktop-nav a:focus-visible,
  .desktop-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.055);
    color: #f7f4ea;
  }

  .action-bar-inner {
    padding-inline: 1.25rem;
  }

  .main-picker {
    width: min(42rem, calc(100% - 2rem));
    margin: auto;
    border-radius: 1.25rem;
  }

  .main-picker-sheet {
    padding: 1.5rem;
  }
}
