:root {
  color-scheme: dark;
  --background: #050817;
  --panel: rgba(9, 15, 37, 0.78);
  --panel-border: rgba(145, 176, 255, 0.17);
  --text: #f5f7ff;
  --muted: #a5acc8;
  --blue: #77a9ff;
  --blue-bright: #9cc6ff;
  --violet: #927dff;
  --peach: #ffc0a8;
  --presence-color: #23a55a;
  --presence-glow: rgba(35, 165, 90, 0.62);
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.55);
  --radius: 30px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

html[data-presence-status="idle"] {
  --presence-color: #f0b232;
  --presence-glow: rgba(240, 178, 50, 0.62);
}

html[data-presence-status="dnd"] {
  --presence-color: #f23f43;
  --presence-glow: rgba(242, 63, 67, 0.62);
}

html[data-presence-status="offline"] {
  --presence-color: #80848e;
  --presence-glow: rgba(128, 132, 142, 0.46);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(49, 89, 190, 0.2), transparent 44%),
    linear-gradient(160deg, #050817 0%, #080d22 48%, #060817 100%);
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sky,
.sky::before,
.sky::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.sky {
  z-index: 0;
  overflow: hidden;
}

.sky::before {
  content: "";
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(104, 139, 226, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 139, 226, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.sky::after {
  content: "";
  background: linear-gradient(to bottom, transparent 55%, rgba(5, 8, 23, 0.7));
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb--blue {
  top: -14rem;
  left: -11rem;
  width: 33rem;
  height: 33rem;
  background: radial-gradient(circle, rgba(47, 116, 255, 0.3), transparent 68%);
}

.orb--violet {
  top: 18%;
  right: -17rem;
  width: 38rem;
  height: 38rem;
  background: radial-gradient(circle, rgba(128, 80, 255, 0.24), transparent 67%);
  animation-delay: -7s;
}

.orb--peach {
  bottom: -18rem;
  left: 18%;
  width: 30rem;
  height: 30rem;
  opacity: 0.26;
  background: radial-gradient(circle, rgba(255, 155, 130, 0.2), transparent 68%);
  animation-delay: -12s;
}

.star {
  position: absolute;
  top: var(--star-y);
  left: var(--star-x);
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 50%;
  opacity: var(--star-max-opacity);
  background: var(--star-color);
  box-shadow: 0 0 calc(var(--star-size) * 4) var(--star-color);
  animation: twinkle var(--star-duration) ease-in-out var(--star-delay) infinite alternate;
}

.star--bright::before,
.star--bright::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--star-color), transparent);
  opacity: 0.42;
  transform: translate(-50%, -50%);
}

.star--bright::before {
  width: calc(var(--star-size) * 5.5);
  height: 1px;
}

.star--bright::after {
  width: 1px;
  height: calc(var(--star-size) * 5.5);
  background: linear-gradient(transparent, var(--star-color), transparent);
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 48px 20px;
}

.profile-card {
  --mouse-x: 50%;
  --mouse-y: 20%;
  position: relative;
  width: min(100%, 690px);
  perspective: 1800px;
}

.profile-card__inner {
  display: grid;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 850ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.profile-card.is-flipped .profile-card__inner {
  transform: rotateY(180deg);
}

.card-starts-flipped .profile-card__inner {
  transform: rotateY(180deg);
  transition: none;
}

.card-face {
  position: relative;
  isolation: isolate;
  grid-area: 1 / 1;
  width: 100%;
  padding: 48px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 35%),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.06);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  backdrop-filter: blur(24px) saturate(130%);
}

.card-face--back {
  transform: rotateY(180deg);
}

.card-face::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(
    520px circle at var(--mouse-x) var(--mouse-y),
    rgba(111, 157, 255, 0.105),
    transparent 44%
  );
  opacity: 0;
  transition: opacity 350ms ease;
}

.profile-card:hover .card-face::before {
  opacity: 1;
}

.profile-card__glow {
  position: absolute;
  z-index: -1;
  top: -7rem;
  left: 50%;
  width: 28rem;
  height: 18rem;
  border-radius: 50%;
  background: rgba(75, 123, 255, 0.15);
  filter: blur(70px);
  transform: translateX(-50%);
}

.profile-card__glow--back {
  top: 12%;
  left: 88%;
  background: rgba(126, 83, 255, 0.18);
}

.flip-tab {
  position: absolute;
  z-index: 4;
  top: 20px;
  right: -1px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-width: 128px;
  padding: 10px 13px 9px 11px;
  border: 1px solid rgba(137, 173, 255, 0.28);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  color: #e8eeff;
  background:
    linear-gradient(115deg, rgba(119, 169, 255, 0.2), rgba(146, 125, 255, 0.1)),
    rgba(10, 17, 42, 0.92);
  box-shadow: -8px 10px 30px rgba(34, 73, 164, 0.2), inset 0 1px rgba(255, 255, 255, 0.07);
  text-align: left;
  cursor: pointer;
  transform: translateZ(32px);
  transition: color 180ms ease, background-color 180ms ease, padding-right 180ms ease;
  backdrop-filter: blur(14px);
}

.flip-tab:hover {
  color: white;
  background-color: rgba(87, 119, 215, 0.3);
  padding-right: 17px;
}

.flip-tab:focus-visible {
  outline: 3px solid rgba(145, 185, 255, 0.78);
  outline-offset: 3px;
}

.flip-tab__icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-right: 8px;
  border-radius: 9px;
  color: var(--blue-bright);
  background: rgba(119, 169, 255, 0.12);
}

.flip-tab__icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.flip-tab:hover .flip-tab__icon svg {
  transform: rotate(-180deg);
}

.flip-tab__label {
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.1;
}

.card-face--front {
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.card-face--back {
  pointer-events: none;
}

.profile-card.is-flipped .card-face--front {
  pointer-events: none;
}

.profile-card.is-flipped .card-face--back {
  pointer-events: auto;
}

.character-sheet {
  --sheet-block-gap: 12px;
  --sheet-footer-gap: 20px;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  padding-bottom: var(--sheet-footer-gap);
  border-color: rgba(137, 173, 255, 0.24);
  background:
    linear-gradient(145deg, rgba(119, 169, 255, 0.08), transparent 24%),
    linear-gradient(325deg, rgba(146, 125, 255, 0.07), transparent 38%),
    rgb(7, 13, 33);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.character-sheet .flip-tab {
  position: static;
  flex: 0 0 auto;
  margin-right: -48px;
}

.character-sheet__grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(119, 169, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 169, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sheet-meta {
  min-width: 0;
}

.sheet-kicker {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #667390;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-kicker span {
  color: var(--blue-bright);
}

.sheet-kicker .sheet-kicker__id {
  color: #667390;
}

.character-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: 77px 24px;
  align-items: center;
  column-gap: 24px;
  row-gap: 11px;
  margin-top: var(--sheet-block-gap);
  padding: 18px 22px;
  border: 1px solid rgba(132, 166, 241, 0.16);
  border-radius: 23px;
  background:
    linear-gradient(115deg, rgba(119, 169, 255, 0.11), transparent 55%),
    rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.character-portrait {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: start;
  width: 112px;
  height: 112px;
  padding: 3px;
  border-radius: 26px;
  background: linear-gradient(145deg, var(--blue-bright), var(--violet) 58%, var(--peach));
  box-shadow: 0 16px 38px rgba(66, 107, 235, 0.22);
}

.character-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid #0b1026;
  border-radius: 23px;
}

.character-level {
  position: relative;
  z-index: 1;
  display: inline-flex;
  grid-column: 1;
  grid-row: 2;
  align-items: center;
  align-self: start;
  justify-self: end;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(156, 198, 255, 0.36);
  border-radius: 8px;
  color: #dceaff;
  background: #111a3a;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.35);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  transform: translateX(11px);
}

.character-identity {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  min-width: 0;
}

.character-badges {
  display: contents;
}

.character-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0;
  color: var(--presence-color);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.character-status .presence-indicator {
  position: relative;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--presence-color);
  box-shadow: 0 0 12px var(--presence-glow);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.character-identity h2 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 2.8rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.character-class {
  margin: 8px 0 0;
  color: var(--blue-bright);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.character-tags {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  flex-wrap: wrap;
  gap: 6px;
}

.character-tags span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(146, 125, 255, 0.18);
  border-radius: 7px;
  color: #aeb8d8;
  background: rgba(146, 125, 255, 0.07);
  font-size: 0.58rem;
  font-weight: 650;
  line-height: 1;
}

.experience {
  --experience-value: 0%;
  margin-top: var(--sheet-block-gap);
  padding: 13px 15px 12px;
  border: 1px solid rgba(132, 166, 241, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgba(119, 169, 255, 0.075), rgba(146, 125, 255, 0.04)),
    rgba(255, 255, 255, 0.018);
}

.experience__summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.experience__summary {
  align-items: flex-end;
}

.experience__metric {
  display: grid;
  gap: 3px;
}

.experience__metric--next {
  justify-items: end;
  text-align: right;
}

.experience__metric h3,
.experience__metric > span,
.experience__metric strong {
  margin: 0;
  font-size: 0.61rem;
  text-transform: uppercase;
}

.experience__metric h3,
.experience__metric > span {
  color: #aab5d5;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.experience__metric strong {
  color: var(--blue-bright);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.experience__metric--next strong {
  color: #c1b4ff;
}

.experience__track {
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid rgba(119, 169, 255, 0.12);
  border-radius: 999px;
  background: rgba(3, 7, 22, 0.58);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.36);
}

.experience__fill {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #527fdf, var(--blue-bright) 72%, #b9aaff);
  box-shadow: 0 0 14px rgba(119, 169, 255, 0.58);
  transition: width 1.1s 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.experience__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.34) 48%, transparent 70%);
  transform: translateX(-100%);
  animation: experience-shimmer 3.8s 1.2s ease-in-out infinite;
}

.profile-card.is-flipped .experience__fill {
  width: var(--experience-value);
}

.character-lore {
  margin: var(--sheet-block-gap) 2px 0;
  padding-left: 16px;
  border-left: 2px solid rgba(119, 169, 255, 0.45);
  color: #b9c1db;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.65;
}

.sheet-section {
  margin-top: var(--sheet-block-gap);
}

.sheet-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.sheet-title h3 {
  margin: 0;
  color: #e9edff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sheet-title span {
  color: #626d89;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sheet-pager {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sheet-pager button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0 0 2px;
  border: 1px solid rgba(119, 169, 255, 0.16);
  border-radius: 7px;
  color: #8796ba;
  background: rgba(119, 169, 255, 0.06);
  font-size: 0.92rem;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.sheet-pager button:hover:not(:disabled) {
  border-color: rgba(119, 169, 255, 0.34);
  color: var(--blue-bright);
  background: rgba(119, 169, 255, 0.12);
}

.sheet-pager button:focus-visible {
  outline: 2px solid rgba(145, 185, 255, 0.72);
  outline-offset: 2px;
}

.sheet-pager button:disabled {
  opacity: 0.25;
  cursor: default;
}

.sheet-title .sheet-pager span {
  display: inline-block;
  min-width: 28px;
  color: #707d9c;
  text-align: center;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sheet-block-gap);
  margin: 0;
}

.stat {
  --stat-start: #638fe7;
  --stat-end: var(--blue-bright);
  --stat-glow: rgba(119, 169, 255, 0.45);
  padding: 10px;
  border: 1px solid rgba(119, 169, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
}

.stat dt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: #97a2c1;
  font-size: 0.57rem;
}

.stat dt span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat dt strong {
  color: #dce7ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.67rem;
}

.stat dd {
  height: 4px;
  margin: 8px 0 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(119, 169, 255, 0.1);
}

.stat dd span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--stat-start), var(--stat-end));
  box-shadow: 0 0 8px var(--stat-glow);
  transition: width 850ms 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.profile-card.is-flipped .stat dd span {
  width: var(--stat-value);
}

.stat--technomancy {
  --stat-start: #b87932;
  --stat-end: #f0c66f;
  --stat-glow: rgba(232, 178, 83, 0.42);
}

.stat--curiosity {
  --stat-start: #7665d8;
  --stat-end: #b2a4ff;
  --stat-glow: rgba(146, 125, 255, 0.45);
}

.stat--versatility {
  --stat-start: #3b98ad;
  --stat-end: #80dce6;
  --stat-glow: rgba(83, 190, 207, 0.42);
}

.stat--creativity {
  --stat-start: #df8d75;
  --stat-end: var(--peach);
  --stat-glow: rgba(255, 192, 168, 0.42);
}

.stat--perseverance {
  --stat-start: #3d9674;
  --stat-end: #79d9aa;
  --stat-glow: rgba(83, 194, 142, 0.42);
}

.sheet-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--sheet-block-gap);
  margin-top: var(--sheet-block-gap);
}

.sheet-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid rgba(132, 166, 241, 0.13);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.022);
}

.inventory-panel {
  display: flex;
  flex-direction: column;
}

.passive-list,
.inventory-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.passive-list {
  display: grid;
  grid-template-rows: repeat(4, 36px);
  gap: var(--sheet-block-gap);
}

.passive-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.passive-list li.is-entering {
  animation: passive-entry 340ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--passive-delay) both;
}

.passive-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(119, 169, 255, 0.15);
  border-radius: 11px;
  background: rgba(119, 169, 255, 0.07);
  font-size: 1rem;
}

.passive-list div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.passive-list strong,
.inventory-list strong {
  color: #dce2f6;
  font-size: 0.7rem;
}

.passive-list small,
.inventory-list small {
  color: #7f8aa8;
  font-size: 0.59rem;
  line-height: 1.35;
}

.inventory-list {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, 86px);
  gap: var(--sheet-block-gap);
}

.inventory-list li {
  display: grid;
  min-width: 0;
  min-height: 74px;
  align-content: center;
  justify-items: center;
  padding: 8px 5px;
  border: 1px solid rgba(137, 173, 255, 0.11);
  border-radius: 11px;
  background: rgba(6, 11, 29, 0.42);
  text-align: center;
}

.inventory-list li.is-entering {
  animation: passive-entry 340ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--inventory-delay) both;
}

.inventory-list li > span {
  margin-bottom: 4px;
  color: var(--blue-bright);
  font-size: 1rem;
}

.inventory-list strong {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inventory-list small {
  margin-top: 2px;
  color: #697694;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.quest-browser {
  position: relative;
  margin-top: var(--sheet-block-gap);
}

.quest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sheet-block-gap);
}

.quest-pager-button {
  position: absolute;
  z-index: 1;
  top: 50%;
  display: grid;
  place-items: center;
  width: 24px;
  height: 46px;
  padding: 0 0 2px;
  border: 1px solid rgba(119, 169, 255, 0.2);
  border-radius: 8px;
  color: #8796ba;
  background: rgba(8, 14, 34, 0.92);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.quest-pager-button--previous {
  left: -12px;
}

.quest-pager-button--next {
  right: -12px;
}

.quest-pager-button:hover:not(:disabled) {
  border-color: rgba(119, 169, 255, 0.42);
  color: var(--blue-bright);
  background: rgba(17, 31, 67, 0.96);
}

.quest-pager-button:focus-visible {
  outline: 2px solid rgba(145, 185, 255, 0.72);
  outline-offset: 2px;
}

.quest-pager-button:disabled {
  opacity: 0.25;
  cursor: default;
}

.quest-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 192, 168, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(100deg, rgba(255, 192, 168, 0.09), transparent 64%),
    rgba(255, 255, 255, 0.02);
}

.quest-card.is-entering {
  animation: passive-entry 340ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--quest-delay) both;
}

.quest-card--placeholder {
  visibility: hidden;
  pointer-events: none;
}

.quest-card--secondary {
  border-color: rgba(119, 169, 255, 0.18);
  background:
    linear-gradient(100deg, rgba(119, 169, 255, 0.09), transparent 64%),
    rgba(255, 255, 255, 0.02);
}

.quest-card--secondary .quest-marker {
  border-color: rgba(119, 169, 255, 0.35);
  background: #111f43;
  box-shadow:
    inset 0 0 14px rgba(119, 169, 255, 0.1),
    0 0 24px rgba(119, 169, 255, 0.18);
}

.quest-card.quest-card--secondary .quest-type {
  color: var(--blue-bright);
}

.quest-marker {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 192, 168, 0.35);
  border-radius: 50%;
  background: #26192b;
  box-shadow:
    inset 0 0 14px rgba(255, 192, 168, 0.1),
    0 0 24px rgba(255, 192, 168, 0.18);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

.quest-card p,
.quest-card h3 {
  margin: 0;
}

.quest-card .quest-type {
  color: var(--peach);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quest-card h3 {
  margin-top: 4px;
  color: #f0f2fa;
  font-size: 0.84rem;
}

.quest-card .quest-objective {
  margin-top: 4px;
  color: #9aa5c3;
  font-size: 0.58rem;
  line-height: 1.35;
}

.quest-card .quest-objective--optional {
  color: #929dbc;
}

.session-log {
  margin-top: var(--sheet-block-gap);
  padding: 17px;
  border: 1px solid rgba(132, 166, 241, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(100deg, rgba(119, 169, 255, 0.04), transparent 60%),
    rgba(3, 8, 23, 0.42);
}

.session-log ol {
  display: grid;
  grid-template-rows: repeat(4, minmax(0.84rem, auto));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.session-log li {
  display: grid;
  grid-template-columns: 63px 1fr;
  gap: 10px;
  color: #7f8aa8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6rem;
  line-height: 1.4;
}

.session-log li.is-entering {
  animation: log-entry 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.session-log li:last-child span {
  color: #a5b0cf;
}

.session-log li.session-entry--connection span {
  color: #23a55a;
}

.session-log li.session-entry--disconnection span {
  color: #f23f43;
}

.session-log time {
  color: #708fc5;
}

.session-log time::before {
  content: ">";
  margin-right: 5px;
  color: #76d9a3;
}

.sheet-title .live-feed-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a87f88;
  transition: color 220ms ease;
}

.live-feed-indicator i {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5267;
  box-shadow: 0 0 10px rgba(255, 82, 103, 0.75);
  animation: rec-blink 1.35s ease-in-out infinite;
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.sheet-title .live-feed-indicator[data-feed-state="idle"] {
  color: #a58a57;
}

.live-feed-indicator[data-feed-state="idle"] i {
  background: #f0b232;
  box-shadow: none;
  animation: none;
}

.sheet-title .live-feed-indicator[data-feed-state="offline"] {
  color: #626d89;
}

.live-feed-indicator[data-feed-state="offline"] i {
  background: #80848e;
  box-shadow: none;
  animation: none;
}

.sheet-footer {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  margin-top: auto;
  margin-bottom: 0;
  padding-top: var(--sheet-footer-gap);
  color: #4f5b78;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.sheet-footer p {
  position: relative;
  margin: 0;
  overflow: hidden;
  color: #697693;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sheet-footer p::before,
.sheet-footer p::after {
  content: "";
  display: inline-block;
  width: 12%;
  height: 1px;
  margin: 0 9px 3px;
  background: rgba(119, 169, 255, 0.14);
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  padding: 4px;
  border-radius: 38px;
  background: linear-gradient(145deg, var(--blue-bright), var(--violet) 55%, var(--peach));
  box-shadow:
    0 18px 50px rgba(66, 107, 235, 0.25),
    0 0 0 7px rgba(116, 159, 255, 0.06);
  animation: reveal 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid #0b1026;
  border-radius: 34px;
  background: #eadbd6;
}

.status-dot {
  position: absolute;
  right: -3px;
  bottom: 10px;
  width: 23px;
  height: 23px;
  border: 5px solid #0b1026;
  border-radius: 50%;
  background: var(--presence-color);
  box-shadow: 0 0 20px var(--presence-glow);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.status-dot::after,
.presence-indicator::after {
  content: "";
  position: absolute;
}

.presence-symbol {
  display: none;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--presence-color);
}

.presence-symbol circle {
  fill: currentColor;
}

.status-dot .presence-symbol rect {
  fill: #0b1026;
}

.character-status .presence-symbol rect {
  fill: #071021;
}

html[data-presence-status="idle"] .status-dot::after {
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0b1026;
}

html[data-presence-status="idle"] .presence-indicator::after {
  top: -1px;
  right: -1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #071021;
}

html[data-presence-status="dnd"] .status-dot,
html[data-presence-status="dnd"] .presence-indicator {
  background: transparent;
}

html[data-presence-status="dnd"] .presence-symbol--dnd {
  display: block;
}

html[data-presence-status="offline"] .status-dot::after {
  inset: 3px;
  border-radius: 50%;
  background: #0b1026;
}

html[data-presence-status="offline"] .presence-indicator::after {
  inset: 2px;
  border-radius: 50%;
  background: #071021;
}

h1 {
  margin: 16px 0 0;
  font-size: clamp(2.7rem, 9vw, 4rem);
  font-weight: 790;
  line-height: 1;
  letter-spacing: -0.055em;
  animation: reveal 650ms 90ms both;
}

h1 span {
  color: var(--blue);
  text-shadow: 0 0 24px rgba(119, 169, 255, 0.4);
}

.bio {
  position: relative;
  max-width: 470px;
  margin: 7px auto 0;
  padding: 0 22px;
  color: #aeb5cf;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.84rem;
  font-style: italic;
  line-height: 1.5;
  animation: reveal 650ms 140ms both;
}

.bio::before,
.bio::after {
  position: absolute;
  color: var(--blue-bright);
  font-size: 1.75rem;
  font-style: normal;
  line-height: 1;
}

.bio::before {
  content: "“";
  top: -0.16em;
  left: 0;
}

.bio::after {
  content: "”";
  right: 0;
  bottom: -0.48em;
}

.interests {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  animation: reveal 650ms 190ms both;
}

.interests li {
  padding: 7px 11px;
  border: 1px solid rgba(136, 168, 239, 0.14);
  border-radius: 999px;
  color: #aeb6d3;
  background: rgba(103, 130, 197, 0.07);
  font-size: 0.75rem;
  font-weight: 600;
}

.interests .partner-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.partner-tag svg {
  display: block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.social-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.social-link {
  --brand: 119, 169, 255;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 10px 14px 10px 15px;
  overflow: hidden;
  border: 1px solid rgba(var(--brand), 0.16);
  border-radius: 18px;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(var(--brand), 0.1), transparent 62%),
    rgba(255, 255, 255, 0.025);
  text-decoration: none;
  text-align: left;
  appearance: none;
  cursor: pointer;
  font: inherit;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
  animation: reveal 600ms both;
}

.social-link:nth-child(1) { animation-delay: 240ms; }
.social-link:nth-child(2) { animation-delay: 290ms; }
.social-link:nth-child(3) { animation-delay: 340ms; }
.social-link:nth-child(4) { animation-delay: 390ms; }
.social-link:nth-child(5) { animation-delay: 440ms; }
.social-link:nth-child(6) { animation-delay: 490ms; }
.social-link:nth-child(7) { animation-delay: 540ms; }
.social-link:nth-child(8) { animation-delay: 590ms; }
.social-link:nth-child(9) { animation-delay: 640ms; }
.social-link:nth-child(10) { animation-delay: 690ms; }

.social-link:hover {
  z-index: 1;
  border-color: rgba(var(--brand), 0.42);
  background-color: rgba(var(--brand), 0.07);
  box-shadow: 0 12px 30px rgba(var(--brand), 0.1);
  transform: translateY(-3px);
}

.social-link:focus-visible,
.copy-button:focus-visible,
.contact a:focus-visible {
  outline: 3px solid rgba(145, 185, 255, 0.72);
  outline-offset: 3px;
}

.social-link--discord { --brand: 134, 151, 255; }
.social-link--telegram { --brand: 38, 165, 228; }
.social-link--github { --brand: 215, 220, 235; }
.social-link--twitter { --brand: 210, 219, 245; }
.social-link--instagram { --brand: 238, 92, 153; }
.social-link--youtube { --brand: 255, 102, 120; }
.social-link--twitch { --brand: 166, 107, 255; }
.social-link--steam { --brand: 102, 192, 244; }
.social-link--vrchat { --brand: 215, 220, 235; }
.social-link--kofi { --brand: 109, 202, 255; }

.social-link__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 45px;
  height: 45px;
  margin-right: 12px;
  border: 1px solid rgba(var(--brand), 0.18);
  border-radius: 14px;
  color: rgb(var(--brand));
  background: rgba(var(--brand), 0.1);
}

.social-link__icon svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.social-link__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.social-link__text strong {
  overflow: hidden;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-link__text small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.muted {
  color: #8f96b1;
  font-weight: 500;
}

.social-link__arrow {
  margin-left: auto;
  padding-left: 8px;
  color: rgba(var(--brand), 0.55);
  font-size: 1rem;
  transition: transform 220ms ease, color 220ms ease;
}

.social-link__arrow svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.social-link:hover .social-link__arrow {
  color: rgb(var(--brand));
  transform: translate(2px, -2px);
}

.contact {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 192, 168, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(255, 192, 168, 0.08), transparent 56%),
    rgba(255, 255, 255, 0.02);
  animation: reveal 600ms 740ms both;
}

.contact__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 45px;
  height: 45px;
  border: 1px solid rgba(255, 192, 168, 0.17);
  border-radius: 14px;
  color: var(--peach);
  background: rgba(255, 192, 168, 0.08);
}

.contact__icon svg,
.copy-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.contact__text {
  min-width: 0;
}

.contact__text p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.contact__text a {
  display: block;
  overflow: hidden;
  color: #f1f3fd;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact__text a:hover {
  color: var(--peach);
}

.copy-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  color: #9fa7c3;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.copy-button:hover {
  color: var(--peach);
  background: rgba(255, 192, 168, 0.1);
  transform: scale(1.04);
}

footer {
  margin-top: 28px;
  color: #7f87a4;
  text-align: center;
  animation: reveal 600ms 790ms both;
}

.card-face--front > footer {
  margin-top: auto;
  padding-top: 28px;
}

footer p {
  margin: 0;
  font-size: 0.72rem;
}

footer .copyright {
  margin-top: 5px;
  color: #5f6681;
  font-size: 0.67rem;
}

.toast {
  position: fixed;
  z-index: 10;
  bottom: 24px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(145, 176, 255, 0.22);
  border-radius: 999px;
  color: #e9edff;
  background: rgba(12, 18, 42, 0.93);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 220ms ease, transform 220ms ease;
  backdrop-filter: blur(15px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from { transform: translate3d(-2%, -2%, 0) scale(0.98); }
  to { transform: translate3d(5%, 4%, 0) scale(1.06); }
}

@keyframes twinkle {
  from {
    opacity: var(--star-min-opacity);
    transform: scale(0.72);
  }
  to {
    opacity: var(--star-max-opacity);
    transform: scale(1);
  }
}

@keyframes rec-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.28;
    transform: scale(0.72);
  }
}

@keyframes log-entry {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(-7px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes passive-entry {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes experience-shimmer {
  0%,
  62% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 620px) {
  .page-shell {
    align-items: start;
    padding: 18px 12px;
  }

  .card-face {
    padding: 36px 20px 28px;
    border-radius: 25px;
  }

  .character-sheet {
    padding-top: 20px;
    padding-bottom: var(--sheet-footer-gap);
  }

  .flip-tab {
    top: 20px;
    grid-template-columns: 1fr;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
  }

  .flip-tab:hover {
    padding-right: 0;
  }

  .flip-tab__icon {
    width: 24px;
    height: 24px;
    margin-right: 0;
  }

  .flip-tab__label {
    display: none;
  }

  .character-sheet .flip-tab {
    margin-right: -20px;
  }

  .sheet-toolbar {
    gap: 8px;
  }

  .avatar-wrap {
    width: 116px;
    height: 116px;
    border-radius: 34px;
  }

  .avatar {
    border-radius: 30px;
  }

  .social-links {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .character-hero {
    grid-template-columns: 86px minmax(0, 1fr);
    grid-template-rows: 60px 22px;
    column-gap: 17px;
    row-gap: 4px;
    padding: 16px 17px;
  }

  .character-identity {
    width: 100%;
  }

  .character-portrait {
    width: 86px;
    height: 86px;
    border-radius: 22px;
  }

  .character-level {
    height: 22px;
    transform: translateX(7px);
  }

  .character-portrait img {
    border-radius: 19px;
  }

  .character-identity h2 {
    font-size: clamp(1.7rem, 8vw, 2.1rem);
  }

  .character-status {
    white-space: nowrap;
  }

  .character-class {
    margin-top: 3px;
    white-space: nowrap;
  }

  .character-tags {
    gap: 5px;
  }

  .character-tags span {
    height: 22px;
  }

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

  .stat:last-child {
    grid-column: 1 / -1;
  }

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

  .quest-list {
    grid-template-columns: 1fr;
  }

  .sheet-footer p::before,
  .sheet-footer p::after {
    display: none;
  }
}

@media (max-width: 460px) {
  .sheet-footer p {
    overflow: visible;
    line-height: 1.45;
    white-space: normal;
  }
}

@media (max-width: 380px) {
  .card-face {
    padding-inline: 15px;
  }

  .bio {
    padding-inline: 18px;
    font-size: 0.8rem;
  }

  .interests {
    gap: 6px;
  }

  .interests li {
    padding-inline: 9px;
  }

  .character-hero {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: 48px 22px;
    column-gap: 13px;
    row-gap: 6px;
    padding: 13px 14px;
  }

  .character-sheet .flip-tab {
    margin-right: -15px;
  }

  .character-portrait {
    width: 76px;
    height: 76px;
  }

  .character-level {
    transform: translateX(5px);
  }

  .character-status {
    font-size: 0.55rem;
  }

  .character-class {
    margin-top: 2px;
    font-size: 0.62rem;
  }

  .character-tags {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .character-tags span {
    padding-inline: 5px;
    font-size: 0.5rem;
    white-space: nowrap;
  }

  .sheet-title span {
    display: none;
  }

}

@media (hover: none), (pointer: coarse) {
  .card-face {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 35%),
      rgba(9, 15, 37, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .card-face--back {
    background:
      linear-gradient(145deg, rgba(119, 169, 255, 0.08), transparent 24%),
      linear-gradient(325deg, rgba(146, 125, 255, 0.07), transparent 38%),
      rgb(7, 13, 33);
  }

  .star,
  .orb {
    animation: none;
  }
}

.reduced-effects .card-face {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 35%),
    rgba(9, 15, 37, 0.96);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.reduced-effects .card-face--back {
  background:
    linear-gradient(145deg, rgba(119, 169, 255, 0.08), transparent 24%),
    linear-gradient(325deg, rgba(146, 125, 255, 0.07), transparent 38%),
    rgb(7, 13, 33);
}

.reduced-effects .profile-card:hover .card-face::before {
  opacity: 0;
}

.reduced-effects .profile-card__glow {
  display: none;
}

.reduced-effects .flip-tab,
.reduced-effects .toast {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.reduced-effects .star,
.reduced-effects .orb,
.reduced-effects .experience__fill::after {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .card-face {
    background: rgba(9, 15, 37, 0.96);
  }

  .card-face--back {
    background: rgb(7, 13, 33);
  }
}
