:root {
  --bg: #091217;
  --panel: rgba(10, 20, 22, 0.72);
  --panel-border: rgba(206, 235, 217, 0.16);
  --text: #e7f3e6;
  --muted: #a8c0ae;
  --shell-topbar-height: calc(40px + env(safe-area-inset-top, 0px));
  --desktop-surface-gap: 12px;
  --desktop-surface-top: calc(var(--shell-topbar-height) + var(--desktop-surface-gap));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(120, 160, 118, 0.16), transparent 34%),
    linear-gradient(180deg, #173229 0%, #0a1217 100%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  overflow: hidden;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.startup-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(149, 194, 150, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(6, 12, 15, 0.84), rgba(6, 12, 15, 0.94));
  transition: opacity 260ms ease;
}

.app-shell.is-loading .startup-overlay {
  opacity: 1;
}

.app-shell.is-revealing .startup-overlay {
  opacity: 1;
  animation: startup-overlay-exit 700ms ease forwards;
}

.shell-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 32;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: var(--shell-topbar-height);
  padding: env(safe-area-inset-top, 0px) 10px 0;
  pointer-events: auto;
  border-bottom: 1px solid rgba(228, 236, 222, 0.08);
  background:
    radial-gradient(circle at 50% -22px, rgba(131, 176, 123, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(8, 16, 20, 0.92), rgba(8, 16, 20, 0.76));
  backdrop-filter: blur(14px);
}

.shell-topbar-group {
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
  min-width: 0;
}

.shell-topbar-group-left {
  grid-column: 1;
  justify-self: start;
}

.shell-topbar-group-right {
  grid-column: 3;
  justify-content: flex-end;
  justify-self: end;
}

.shell-topbar-spacer {
  display: none;
}

.shell-brand {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  pointer-events: none;
}

.shell-brand-title {
  position: relative;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 241, 217, 0.56);
  text-shadow:
    0 0 18px rgba(255, 247, 215, 0.08),
    0 0 32px rgba(124, 183, 126, 0.1);
}

.shell-brand-title::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 220%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(133, 181, 124, 0.16), transparent 58%);
  opacity: 0.8;
  z-index: -1;
}

.shell-chip {
  min-width: 70px;
  height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(232, 239, 226, 0.1);
  color: rgba(241, 246, 236, 0.9);
  box-shadow: none;
}

.shell-chip-compact {
  min-width: 62px;
}

.shell-chip-realm {
  min-width: 108px;
  justify-content: flex-start;
  gap: 8px;
  padding-right: 12px;
}

.shell-realm-select {
  position: relative;
}

.shell-realm-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, calc(100vw - 20px));
  padding: 8px;
  border: 1px solid rgba(232, 239, 226, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(10, 18, 22, 0.96), rgba(8, 15, 18, 0.92)),
    radial-gradient(circle at 50% 0%, rgba(131, 176, 123, 0.08), transparent 34%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

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

.shell-realm-panel-list {
  display: grid;
  gap: 6px;
}

.shell-realm-entry {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(232, 239, 226, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(241, 246, 236, 0.92);
  font: inherit;
  text-align: left;
}

.shell-realm-entry.is-current {
  border-color: rgba(204, 229, 209, 0.24);
  background: rgba(31, 55, 46, 0.42);
}

.shell-realm-entry.is-selected {
  box-shadow: inset 0 0 0 1px rgba(230, 239, 224, 0.1);
}

.shell-realm-entry-labels {
  min-width: 0;
}

.shell-realm-entry-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shell-realm-entry-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(216, 225, 207, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-realm-entry-state {
  font-size: 11px;
  color: rgba(216, 225, 207, 0.72);
  text-transform: lowercase;
}

.shell-realm-panel-note {
  margin-top: 8px;
  padding: 0 4px 2px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(216, 225, 207, 0.56);
}

.shell-realm-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: rgba(200, 208, 198, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.realm-availability-online {
  background: #88d68b;
  box-shadow: 0 0 0 1px rgba(136, 214, 139, 0.18), 0 0 12px rgba(136, 214, 139, 0.4);
}

.realm-availability-checking {
  background: #e7c970;
  box-shadow: 0 0 0 1px rgba(231, 201, 112, 0.16), 0 0 10px rgba(231, 201, 112, 0.3);
}

.realm-availability-offline {
  background: rgba(209, 119, 119, 0.9);
  box-shadow: 0 0 0 1px rgba(209, 119, 119, 0.16), 0 0 10px rgba(209, 119, 119, 0.2);
}

.realm-availability-unknown {
  background: rgba(188, 198, 191, 0.34);
}

.about-panel {
  position: fixed;
  top: var(--shell-topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 34;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
}

.about-panel.is-open {
  display: flex;
}

.about-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 11, 0.28);
}

.about-card {
  position: relative;
  width: min(430px, calc(100vw - 18px));
  height: calc(100vh - 52px - env(safe-area-inset-top, 0px));
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(225, 234, 220, 0.1);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background:
    linear-gradient(180deg, rgba(8, 15, 18, 0.95), rgba(8, 15, 18, 0.78)),
    radial-gradient(circle at 50% 14%, rgba(131, 176, 123, 0.12), transparent 32%);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  color: rgba(234, 242, 230, 0.9);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
}

.about-top-pane {
  display: block;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(228, 236, 222, 0.08);
  background:
    linear-gradient(180deg, rgba(10, 18, 22, 0.94), rgba(10, 18, 22, 0.82)),
    radial-gradient(circle at 50% 4%, rgba(131, 176, 123, 0.14), transparent 36%),
    radial-gradient(circle at 50% 0%, rgba(235, 228, 193, 0.08), transparent 36%);
}

.about-header {
  display: block;
}

.about-brand-block {
  text-align: center;
}

.about-title {
  margin-top: 4px;
  font-size: clamp(15px, 2.5vw, 18px);
  line-height: 1.28;
  letter-spacing: 0;
  color: rgba(233, 240, 228, 0.9);
}

.about-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 0;
  align-items: center;
}

.about-tabs-inline {
  padding: 0 14px 6px;
}

.about-tab {
  flex: 0 1 auto;
  min-width: 0;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(232, 240, 226, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(228, 236, 222, 0.82);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-tab.is-active {
  background: rgba(31, 55, 46, 0.76);
  border-color: rgba(204, 229, 209, 0.22);
  color: rgba(244, 250, 241, 0.96);
}

.about-divider {
  height: 1px;
  margin: 2px 0 12px;
  background: linear-gradient(90deg, transparent, rgba(223, 234, 217, 0.16), transparent);
}

.about-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 10px 0 0;
  background: linear-gradient(180deg, rgba(11, 18, 22, 0.72), rgba(8, 13, 16, 0.9));
}

.about-body {
  min-height: 0;
  overflow: auto;
  padding: 0 14px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 204, 181, 0.28) transparent;
}

.about-patch-area {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 10px 0 16px;
  background: linear-gradient(180deg, rgba(10, 17, 21, 0.82), rgba(7, 12, 16, 0.94));
}

.about-section {
  display: none;
}

.about-section.is-active {
  display: block;
}

.about-flow,
.about-patch-column {
  display: grid;
  gap: 12px;
}

.about-feature-card,
.about-patch-note {
  padding: 14px;
  border: 1px solid rgba(228, 236, 222, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 25, 28, 0.82), rgba(10, 18, 22, 0.64));
}

.about-inline-block {
  padding: 0;
  min-height: 100%;
}

.about-inline-block p {
  margin: 0;
  line-height: 1.56;
  color: rgba(220, 228, 216, 0.82);
}

.about-feature-kicker {
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(216, 225, 207, 0.58);
}

.about-feature-card h3,
.about-patch-note h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.08;
  color: rgba(245, 249, 240, 0.96);
}

.about-patch-note {
  margin: 0 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  align-self: start;
}

.about-feature-card p,
.about-patch-note p {
  margin: 0;
  line-height: 1.5;
  color: rgba(220, 228, 216, 0.82);
}

.about-scene {
  position: relative;
  margin-top: 14px;
  height: 168px;
  border-radius: 18px;
  overflow: hidden;
}

.about-scene::before,
.about-scene::after {
  content: "";
  position: absolute;
  inset: 0;
}

.about-scene-horizon {
  background:
    radial-gradient(circle at 50% 22%, rgba(240, 225, 176, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(64, 82, 72, 0.24), rgba(14, 20, 24, 0.18)),
    linear-gradient(180deg, rgba(17, 30, 35, 0.86), rgba(11, 16, 20, 0.96));
}

.about-scene-horizon::before {
  background:
    radial-gradient(circle at 18% 74%, rgba(154, 204, 145, 0.14), transparent 16%),
    radial-gradient(circle at 52% 68%, rgba(193, 136, 122, 0.2), transparent 14%),
    radial-gradient(circle at 82% 58%, rgba(109, 158, 134, 0.18), transparent 18%);
  animation: about-scene-drift 8s ease-in-out infinite alternate;
}

.about-scene-biome {
  background:
    linear-gradient(180deg, rgba(42, 52, 58, 0.72), rgba(14, 20, 24, 0.96)),
    radial-gradient(circle at 22% 72%, rgba(144, 121, 93, 0.3), transparent 18%),
    radial-gradient(circle at 66% 42%, rgba(202, 152, 103, 0.16), transparent 16%);
}

.about-scene-biome::before {
  background:
    linear-gradient(90deg, transparent 0%, rgba(220, 231, 223, 0.06) 18%, transparent 36%, rgba(220, 231, 223, 0.06) 56%, transparent 78%),
    radial-gradient(circle at 32% 64%, rgba(92, 117, 101, 0.34), transparent 15%),
    radial-gradient(circle at 74% 76%, rgba(103, 131, 111, 0.28), transparent 14%);
  animation: about-scene-drift 10s ease-in-out infinite alternate;
}

.about-scene-encounter {
  background:
    radial-gradient(circle at 50% 50%, rgba(126, 184, 148, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(26, 34, 39, 0.82), rgba(11, 16, 20, 0.96));
}

.about-scene-encounter::before {
  background:
    radial-gradient(circle at 24% 46%, rgba(208, 188, 123, 0.28), transparent 7%),
    radial-gradient(circle at 56% 60%, rgba(214, 126, 145, 0.26), transparent 8%),
    radial-gradient(circle at 72% 42%, rgba(168, 207, 137, 0.24), transparent 7%),
    radial-gradient(circle at 42% 76%, rgba(192, 160, 120, 0.2), transparent 9%);
  animation: about-scene-pulse 4.2s ease-in-out infinite;
}


.startup-card {
  width: min(680px, calc(100vw - 48px));
  min-height: min(320px, calc(100vh - 96px));
  padding: 36px 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: transparent;
  color: rgba(231, 243, 230, 0.9);
  text-align: center;
  transform: translateY(10px) scale(0.985);
  opacity: 0;
}

.app-shell.is-loading .startup-card {
  animation: startup-card-enter 520ms ease forwards;
}

.app-shell.is-revealing .startup-card {
  animation: startup-card-exit 700ms ease forwards;
}

.startup-kicker {
  margin: 0;
  color: rgba(248, 242, 220, 0.18);
  font-size: clamp(72px, 15vw, 164px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0 0 36px rgba(255, 247, 215, 0.08);
}

.startup-title {
  margin-top: 28px;
  color: rgba(239, 246, 238, 0.88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.startup-status {
  margin-top: 8px;
  color: rgba(224, 232, 226, 0.78);
  font-size: 15px;
  line-height: 1.45;
}

.startup-log {
  display: none;
  margin: 18px auto 0;
  padding: 10px 12px;
  width: min(420px, 100%);
  min-height: 82px;
  border: 1px solid rgba(223, 235, 222, 0.08);
  border-radius: 14px;
  background: rgba(8, 15, 18, 0.52);
  color: rgba(198, 220, 206, 0.76);
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
  overflow: hidden;
}

.startup-overlay.is-fatal .startup-log {
  display: block;
}

.app-shell.is-loading canvas {
  opacity: 0.08;
  filter: saturate(0.7) blur(6px);
}

.app-shell.is-revealing canvas {
  animation: startup-scene-enter 700ms ease forwards;
}

@keyframes startup-card-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes startup-card-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-18px) scale(1.02);
  }
}

@keyframes startup-overlay-exit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes startup-scene-enter {
  from {
    opacity: 0.08;
    filter: saturate(0.7) blur(6px);
  }
  to {
    opacity: 1;
    filter: saturate(1) blur(0);
  }
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  filter: none;
  transition: opacity 180ms ease, filter 180ms ease;
}

.debug-panel {
  position: absolute;
  top: var(--desktop-surface-top);
  left: 20px;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.app-shell.is-loading .debug-panel,
.app-shell.is-loading .character-panel,
.app-shell.is-loading .orb-panel,
.app-shell.is-loading .loot-panel,
.app-shell.is-loading .mobile-character-panel,
.app-shell.is-loading .touch-hud,
.app-shell.is-loading .realm-toast {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.debug-panel,
.character-panel,
.orb-panel,
.loot-panel,
.mobile-character-panel,
.touch-hud,
.realm-toast {
  transition: opacity 220ms ease, transform 220ms ease;
}

.app-shell.is-revealing .debug-panel {
  opacity: 0;
  transform: translate(-18px, -6px);
  pointer-events: none;
  animation: startup-panel-enter-left 520ms 280ms ease forwards;
}

.app-shell.is-revealing .character-panel {
  opacity: 0;
  transform: translateX(-24px);
  pointer-events: none;
  animation: startup-panel-enter-left 560ms 320ms ease forwards;
}

.app-shell.is-revealing .orb-panel,
.app-shell.is-revealing .loot-panel-desktop,
.app-shell.is-revealing .realm-toast {
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  animation: startup-panel-enter-right 560ms 360ms ease forwards;
}

.app-shell.is-revealing .mobile-character-panel,
.app-shell.is-revealing .loot-panel-mobile,
.app-shell.is-revealing .touch-hud.is-visible {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  animation: startup-panel-enter-up 560ms 340ms ease forwards;
}

@keyframes startup-panel-enter-left {
  from {
    opacity: 0;
    transform: translate(-24px, -4px);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes startup-panel-enter-right {
  from {
    opacity: 0;
    transform: translate(24px, 0);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes startup-panel-enter-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes about-scene-drift {
  from {
    transform: translate3d(-6px, 0, 0) scale(1);
  }
  to {
    transform: translate3d(8px, -4px, 0) scale(1.03);
  }
}

@keyframes about-scene-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.025);
    opacity: 1;
  }
}

.debug-toggle {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 1px solid rgba(231, 243, 230, 0.38);
  border-radius: 999px;
  background: rgba(231, 243, 230, 0.72);
  cursor: pointer;
  pointer-events: auto;
}

.debug-panel.is-collapsed .debug-toggle {
  background: rgba(147, 173, 159, 0.5);
}

.debug-panel.is-collapsed .debug-text {
  display: none;
}

.debug-panel.is-collapsed .debug-card {
  display: none;
}

.debug-card {
  min-width: 220px;
  max-width: min(520px, calc(100vw - 52px));
  padding: 12px 14px 13px;
  border: 1px solid rgba(223, 235, 222, 0.14);
  background: linear-gradient(180deg, rgba(8, 15, 18, 0.72), rgba(8, 15, 18, 0.48));
  color: rgba(231, 243, 230, 0.88);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 2px rgba(8, 16, 21, 0.6);
}

.debug-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.debug-button {
  min-width: 108px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(223, 235, 222, 0.18);
  border-radius: 999px;
  background: rgba(25, 39, 36, 0.84);
  color: rgba(237, 245, 235, 0.94);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}

.debug-button:hover {
  background: rgba(35, 52, 47, 0.9);
}

.debug-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.debug-text {
  margin: 0;
  padding: 0;
  background: none;
  color: rgba(231, 243, 230, 0.85);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  text-shadow: 0 1px 2px rgba(8, 16, 21, 0.72);
}

.character-panel {
  position: absolute;
  top: var(--desktop-card-top, var(--desktop-surface-top));
  right: var(--desktop-card-right, 20px);
  z-index: 20;
  pointer-events: none;
}

.realm-toast {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 24;
  display: none;
  min-width: 132px;
  max-width: min(280px, calc(100vw - 40px));
  padding: 8px 12px;
  border: 1px solid rgba(232, 241, 231, 0.16);
  border-radius: 999px;
  background: rgba(18, 24, 27, 0.78);
  color: rgba(242, 246, 240, 0.94);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.realm-toast.is-visible {
  display: block;
}

.realm-toast.realm-status-offline {
  border-color: rgba(189, 140, 140, 0.22);
  background: rgba(47, 25, 29, 0.84);
  color: rgba(248, 212, 212, 0.94);
}

.realm-toast.realm-status-connecting {
  border-color: rgba(214, 186, 124, 0.26);
  background: rgba(55, 42, 20, 0.84);
  color: rgba(248, 231, 188, 0.94);
}

.realm-toast.realm-status-connected {
  border-color: rgba(125, 194, 151, 0.24);
  background: rgba(25, 49, 38, 0.84);
  color: rgba(214, 246, 223, 0.94);
}

.realm-toast.realm-status-error {
  border-color: rgba(199, 109, 109, 0.26);
  background: rgba(68, 27, 29, 0.86);
  color: rgba(255, 214, 214, 0.96);
}

.orb-panel {
  position: absolute;
  z-index: 20;
  pointer-events: none;
}

.orb-panel-desktop {
  top: var(--desktop-card-top, var(--desktop-surface-top));
  right: calc(var(--desktop-card-right, 20px) + var(--desktop-card-width, 236px) + var(--desktop-card-gap, 14px));
}

.character-card {
  width: min(var(--desktop-card-width, 236px), calc(100vw - 40px));
  padding: 12px 14px 13px;
  border: 1px solid rgba(223, 235, 222, 0.14);
  background: linear-gradient(180deg, rgba(8, 15, 18, 0.72), rgba(8, 15, 18, 0.48));
  color: rgba(231, 243, 230, 0.88);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 2px rgba(8, 16, 21, 0.6);
}

.character-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.character-header-button {
  flex: 0 0 auto;
  min-width: 64px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(230, 239, 228, 0.14);
  border-radius: 999px;
  background: rgba(8, 16, 20, 0.46);
  color: rgba(235, 244, 233, 0.84);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-kicker {
  margin: 0 0 4px;
  color: rgba(246, 238, 211, 0.92);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.character-name {
  color: rgba(235, 244, 233, 0.98);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.character-section {
  display: grid;
  gap: 6px;
}

.character-section.character-section-subtle {
  gap: 4px;
}

.character-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.character-label {
  color: rgba(168, 192, 174, 0.92);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-value {
  color: rgba(235, 244, 233, 0.94);
  font-size: 14px;
  text-align: right;
}

.character-value.character-value-status {
  max-width: 132px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-divider {
  height: 1px;
  margin: 10px 0 9px;
  background: linear-gradient(90deg, rgba(226, 236, 218, 0.04), rgba(226, 236, 218, 0.22), rgba(226, 236, 218, 0.04));
}

.character-subtitle {
  margin: 0 0 6px;
  color: rgba(246, 238, 211, 0.82);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-character-panel {
  position: absolute;
  top: calc(52px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 1;
  display: none;
  min-width: min(52vw, 214px);
  max-width: min(64vw, 248px);
  padding: 10px 10px 8px;
  border: 1px solid rgba(223, 235, 222, 0.14);
  background: linear-gradient(180deg, rgba(8, 15, 18, 0.78), rgba(8, 15, 18, 0.56));
  color: rgba(231, 243, 230, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}

.mobile-map-zoom {
  position: absolute;
  left: calc(8px + env(safe-area-inset-left, 0px));
  top: 50%;
  z-index: 1;
  display: none;
  width: 28px;
  height: min(42vh, 280px);
  transform: translateY(-50%);
  pointer-events: auto;
}

.mobile-map-zoom-slider {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(42vh, 280px);
  height: 28px;
  margin: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  accent-color: rgba(235, 244, 233, 0.86);
}

.mobile-map-zoom-slider:disabled {
  opacity: 0.42;
}

.touch-hud.touch-hud-presentation-mobile .mobile-character-panel {
  display: block;
}

.touch-hud.touch-hud-presentation-mobile .mobile-map-zoom {
  display: block;
}

.touch-hud.touch-hud-presentation-desktop .mobile-character-panel {
  display: none;
}

.touch-hud.touch-hud-presentation-desktop .mobile-map-zoom {
  display: none;
}

.touch-hud.touch-hud-presentation-mobile ~ .character-panel {
  display: none;
}

.touch-hud.touch-hud-presentation-mobile ~ .orb-panel-desktop {
  display: none;
}

.mobile-character-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.mobile-character-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.mobile-character-glance {
  flex: 1;
  display: grid;
  gap: 5px;
}

.mobile-glance-row,
.mobile-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mobile-glance-label,
.mobile-detail-label {
  color: rgba(168, 192, 174, 0.94);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-glance-value,
.mobile-detail-value {
  color: rgba(235, 244, 233, 0.96);
  font-size: 12px;
  text-align: right;
}

.mobile-character-toggle {
  flex: 0 0 auto;
  min-width: 58px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(230, 239, 228, 0.14);
  border-radius: 999px;
  background: rgba(8, 16, 20, 0.46);
  color: rgba(235, 244, 233, 0.84);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-character-toggle.is-active {
  background: rgba(31, 55, 46, 0.76);
  border-color: rgba(204, 229, 209, 0.22);
  color: rgba(244, 250, 241, 0.94);
}

.mobile-potion-count {
  min-height: 12px;
  color: rgba(235, 244, 233, 0.82);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-character-details {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 236, 218, 0.14);
  gap: 5px;
}

.mobile-character-panel.is-expanded .mobile-character-details {
  display: grid;
}

.mobile-detail-row.mobile-detail-row-status {
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px solid rgba(226, 236, 218, 0.14);
}

.legends-panel {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 10, 12, 0.48);
}

.legends-panel.is-open {
  display: flex;
}

.legends-card {
  width: min(560px, calc(100vw - 24px));
  max-height: min(72vh, 720px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(223, 235, 222, 0.14);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 15, 18, 0.96), rgba(8, 15, 18, 0.9));
  color: rgba(231, 243, 230, 0.9);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
}

.legends-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.legends-content {
  display: grid;
  gap: 8px;
}

.legends-empty {
  padding: 14px 16px;
  border: 1px solid rgba(223, 235, 222, 0.1);
  border-radius: 16px;
  color: rgba(226, 235, 225, 0.74);
}

.legends-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 0.7fr 0.8fr 0.7fr;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid rgba(223, 235, 222, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.legends-row.is-self {
  border-color: rgba(239, 201, 137, 0.2);
  background: rgba(239, 201, 137, 0.06);
}

.legends-row.is-offline {
  border-color: rgba(223, 235, 222, 0.05);
  background: rgba(255, 255, 255, 0.012);
}

.legends-row.legends-head {
  border-style: dashed;
  background: transparent;
  color: rgba(226, 235, 225, 0.68);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legends-name {
  display: grid;
  gap: 2px;
}

.legends-id {
  color: rgba(243, 247, 242, 0.94);
  font-weight: 700;
}

.legends-sub {
  color: rgba(210, 221, 211, 0.68);
  font-size: 12px;
}

.legends-value {
  text-align: right;
  color: rgba(243, 247, 242, 0.9);
  font-variant-numeric: tabular-nums;
}

.legends-row.is-offline .legends-id,
.legends-row.is-offline .legends-sub,
.legends-row.is-offline .legends-value {
  color: rgba(196, 205, 198, 0.58);
}

@media (max-width: 720px) {
  .legends-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .legends-row {
    grid-template-columns: minmax(0, 1.25fr) 0.8fr 0.85fr 0.7fr;
    gap: 8px;
    padding: 10px 11px;
  }
}

.loot-panel {
  position: absolute;
  z-index: 20;
  display: none;
  pointer-events: auto;
}

.loot-panel.is-visible {
  display: block;
}

.loot-panel-desktop {
  top: var(--desktop-card-top, var(--desktop-surface-top));
  right: calc(var(--desktop-card-right, 20px) + var(--desktop-card-width, 236px) + var(--desktop-card-gap, 14px));
}

.loot-panel-mobile {
  top: calc(52px + env(safe-area-inset-top, 0px));
  right: calc(176px + env(safe-area-inset-right, 0px));
  z-index: 1;
}

.loot-panel-mobile .loot-card {
  width: min(200px, calc(100vw - 40px));
}

.touch-hud.touch-hud-presentation-mobile ~ .loot-panel-desktop {
  display: none !important;
}

.touch-hud.touch-hud-presentation-desktop .loot-panel-mobile {
  display: none !important;
}

.loot-card {
  width: min(var(--desktop-card-width, 236px), calc(100vw - 40px));
  padding: 10px 11px 11px;
  border: 1px solid rgba(223, 235, 222, 0.14);
  background: linear-gradient(180deg, rgba(8, 15, 18, 0.78), rgba(8, 15, 18, 0.56));
  color: rgba(231, 243, 230, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.orb-card {
  width: min(188px, calc(100vw - 40px));
  padding: 10px 12px 11px;
  border: 1px solid rgba(223, 235, 222, 0.14);
  background: linear-gradient(180deg, rgba(8, 15, 18, 0.78), rgba(8, 15, 18, 0.56));
  color: rgba(231, 243, 230, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 2px rgba(8, 16, 21, 0.6);
}

.orb-header {
  margin: 0 0 10px;
}

.orb-kicker {
  margin: 0 0 4px;
  color: rgba(246, 238, 211, 0.92);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.orb-name {
  color: rgba(235, 244, 233, 0.98);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.orb-list {
  display: grid;
  gap: 7px;
}

.orb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.orb-label-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.orb-swatch {
  position: relative;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.orb-swatch::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.18);
}

.orb-label {
  color: rgba(168, 192, 174, 0.92);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.orb-value {
  color: rgba(235, 244, 233, 0.94);
  font-size: 14px;
  text-align: right;
}

.loot-header {
  margin: 0 0 10px;
}

.loot-kicker {
  margin: 0 0 4px;
  color: rgba(246, 238, 211, 0.92);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.loot-name {
  color: rgba(235, 244, 233, 0.98);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.loot-inventory {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  cursor: pointer;
}

.loot-inventory.is-disabled {
  cursor: default;
}

.loot-slot {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(218, 229, 215, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(26, 40, 35, 0.9), rgba(17, 27, 24, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.loot-slot:disabled {
  opacity: 0.45;
}

.loot-slot:not(:disabled) {
  cursor: pointer;
}

.loot-icon {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.loot-icon-potion {
  width: 16px;
  height: 22px;
  border: 2px solid rgba(252, 225, 170, 0.95);
  border-top: 0;
  border-radius: 5px 5px 8px 8px;
  background: linear-gradient(180deg, rgba(150, 78, 166, 0.92) 0%, rgba(89, 37, 115, 0.96) 100%);
}

.loot-icon-potion::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 8px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 3px 3px 0 0;
  background: rgba(210, 181, 126, 0.95);
}

.loot-icon-potion::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(235, 171, 255, 0.38);
}

.loot-icon-weapon {
  width: 18px;
  height: 18px;
}

.loot-icon-weapon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 18px;
  transform: translate(-50%, -50%) rotate(46deg);
  border-radius: 999px;
  background: rgba(246, 226, 150, 0.96);
  box-shadow: 0 0 0 1px rgba(108, 77, 36, 0.7);
}

.loot-icon-weapon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 3px;
  transform: translate(-50%, -50%) rotate(46deg);
  border-radius: 999px;
  background: rgba(126, 90, 44, 0.96);
}

.loot-stack {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: rgba(246, 240, 221, 0.96);
  font-size: 10px;
  font-weight: 700;
}

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

.loot-item-note {
  color: rgba(168, 192, 174, 0.92);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.touch-hud {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 0;
  pointer-events: none;
}

.touch-hud.is-visible {
  display: flex;
}

.touch-desktop-toggle {
  position: absolute;
  top: var(--desktop-surface-top);
  left: 50%;
  z-index: 1;
  display: none;
  min-width: 104px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(230, 239, 228, 0.14);
  border-radius: 999px;
  background: rgba(8, 16, 20, 0.46);
  color: rgba(235, 244, 233, 0.84);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateX(-50%);
  pointer-events: auto;
}

.touch-hud.touch-hud-desktop.is-collapsed .touch-desktop-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.touch-hud.touch-hud-mobile {
  justify-content: stretch;
  align-items: stretch;
}

.touch-hud.touch-hud-presentation-desktop .touch-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.touch-hud.touch-hud-presentation-desktop .touch-frame-toolbar {
  top: var(--desktop-surface-top);
}

.touch-frame {
  --touch-controls-pad-top: 86px;
  --touch-controls-pad-right: 96px;
  --touch-controls-pad-bottom: 34px;
  --touch-controls-pad-left: 96px;
  --touch-controls-gap: 0px;
  --touch-cluster-gap: 12px;
  --touch-move-pad-size: 193px;
  --touch-attack-pad-size: 164px;
  --touch-rotate-button-width: 112px;
  --touch-rotate-button-height: 40px;
  --touch-rotate-buttons-span: 240px;
  --touch-rotate-buttons-offset: 12px;
  --touch-preview-width: 520px;
  --touch-preview-height: 920px;
  --touch-preview-frame-width: min(92vw, 520px);
  --touch-preview-frame-height: min(92vh, 920px);
  --move-pad-deadzone-size: 10.88%;
  position: relative;
  width: min(84vw, 900px);
  height: min(86vh, 560px);
  border: 1px solid rgba(231, 240, 228, 0.12);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(8, 16, 20, 0.06), rgba(8, 16, 20, 0.02)),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.04), transparent 46%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 24px 64px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}

.touch-frame.touch-frame-portrait {
  width: min(92vw, 520px);
  height: min(92vh, 920px);
}

.touch-hud.touch-hud-desktop.touch-hud-presentation-mobile .touch-frame {
  width: var(--touch-preview-frame-width);
  height: var(--touch-preview-frame-height);
}

.touch-hud.touch-hud-mobile .touch-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.touch-frame-toolbar {
  position: absolute;
  top: var(--desktop-surface-top);
  left: 50%;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.touch-hud.touch-hud-desktop .touch-frame-toolbar {
  position: fixed;
  top: var(--desktop-surface-top);
  left: 50%;
  z-index: 13;
}

.touch-hud.touch-hud-mobile .touch-frame-toolbar {
  top: calc(12px + env(safe-area-inset-top, 0px));
}

.touch-hud.touch-hud-presentation-mobile.touch-hud-map .touch-controls,
.touch-hud.touch-hud-presentation-mobile.touch-hud-map .mobile-character-panel,
.touch-hud.touch-hud-presentation-mobile.touch-hud-map .loot-panel-mobile {
  display: none;
}

.touch-hud.touch-hud-presentation-mobile.touch-hud-map #touch-view-field {
  display: none;
}

.touch-hud.touch-hud-presentation-mobile.touch-hud-map .touch-frame-toolbar {
  top: calc(14px + env(safe-area-inset-top, 0px));
}

.touch-hud.touch-hud-mobile .touch-chip-desktop-only {
  display: none;
}

.touch-hud.touch-hud-presentation-desktop .touch-controls,
.touch-hud.touch-hud-presentation-desktop .touch-utility-button,
.touch-hud.touch-hud-presentation-desktop .touch-attack-dock,
.touch-hud.touch-hud-presentation-desktop .loot-panel-mobile,
.touch-hud.touch-hud-presentation-desktop .mobile-map-zoom {
  display: none;
}

.touch-hud.touch-hud-desktop.is-collapsed .touch-frame {
  display: none;
}

.touch-chip {
  min-width: 82px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(230, 239, 228, 0.14);
  border-radius: 999px;
  background: rgba(8, 16, 20, 0.46);
  color: rgba(235, 244, 233, 0.8);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: auto;
}

.touch-chip.is-active {
  background: rgba(31, 55, 46, 0.76);
  border-color: rgba(204, 229, 209, 0.22);
  color: rgba(244, 250, 241, 0.94);
}

.touch-controls {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.touch-cluster {
  display: grid;
  gap: var(--touch-cluster-gap);
  position: absolute;
  pointer-events: none;
}

.touch-cluster-left {
  left: calc(var(--touch-controls-pad-left) + env(safe-area-inset-left, 0px));
  bottom: calc(var(--touch-controls-pad-bottom) + env(safe-area-inset-bottom, 0px));
}

.touch-cluster-right {
  right: calc(var(--touch-combat-shell-edge-inset, 0px) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--touch-combat-shell-edge-inset, 0px) + env(safe-area-inset-bottom, 0px));
  width: var(--touch-combat-shell-width, 236px);
  justify-items: end;
  align-content: end;
  padding-bottom: 0;
}

.touch-frame.touch-frame-portrait .touch-cluster-right {
  width: var(--touch-combat-shell-width, 236px);
  justify-items: end;
  padding-bottom: 0;
}

.touch-utility-button {
  min-width: 74px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(230, 239, 228, 0.14);
  border-radius: 999px;
  background: rgba(36, 63, 52, 0.74);
  color: rgba(244, 250, 241, 0.94);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: auto;
}

.touch-utility-button.is-active {
  background: rgba(31, 55, 46, 0.76);
  border-color: rgba(204, 229, 209, 0.22);
  color: rgba(244, 250, 241, 0.94);
}

.touch-utility-button:disabled {
  background: rgba(32, 38, 40, 0.46);
  color: rgba(187, 199, 189, 0.62);
}

.touch-utility-stack {
  position: absolute;
  top: 50%;
  right: calc(10px + env(safe-area-inset-right, 0px));
  z-index: 2;
  display: none;
  gap: 8px;
  justify-items: end;
  transform: translateY(-50%);
  pointer-events: none;
}

.touch-hud.touch-hud-presentation-mobile .touch-utility-stack {
  display: grid;
}

.touch-hud.touch-hud-presentation-mobile.touch-hud-map .touch-utility-stack {
  display: none;
}

.touch-combat-shell {
  position: relative;
  width: var(--touch-combat-shell-width, 236px);
  height: var(--touch-combat-shell-height, 286px);
  pointer-events: none;
}

.touch-combat-shell-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: auto;
  touch-action: none;
}

.touch-combat-shell-fill {
  fill: rgba(10, 18, 22, 0.34);
  stroke: rgba(228, 238, 227, 0.12);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.16));
}

.touch-utility-button-compact {
  min-width: 0;
  width: 82px;
  height: 34px;
  padding: 0 9px;
  font-size: 11px;
  letter-spacing: 0.07em;
  border-radius: 14px;
}

.touch-combat-surfaces {
  pointer-events: none;
}

.touch-combat-surface {
  fill: rgba(239, 201, 137, 0);
  stroke: rgba(239, 201, 137, 0);
  stroke-width: 8px;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  pointer-events: none;
  transition: fill 120ms ease, opacity 120ms ease;
}

.touch-combat-surface.is-active,
.touch-combat-surface.is-pressed,
.touch-combat-surface:active {
  fill: rgba(239, 201, 137, 0.14);
  stroke: rgba(239, 201, 137, 0.06);
}

.touch-combat-center-surface {
  fill: rgba(239, 201, 137, 0.02);
}

.touch-combat-center-surface.is-active {
  fill: rgba(239, 201, 137, 0.14);
  stroke: rgba(239, 201, 137, 0.1);
}

.touch-combat-center-surface.is-auto {
  fill: rgba(239, 201, 137, 0.1);
  stroke: rgba(239, 201, 137, 0.08);
}

.touch-combat-surface.is-disabled {
  opacity: 0.5;
}

.touch-combat-label {
  fill: rgba(233, 241, 232, 0.9);
  font: 600 11px "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  user-select: none;
}

.touch-combat-label-empty {
  fill: rgba(211, 223, 214, 0.72);
}

.touch-combat-shell #attack-pad {
  position: absolute;
  left: var(--touch-combat-shell-center-x, 50%);
  top: var(--touch-combat-shell-center-y, 44%);
  transform: translate(-50%, -50%);
  width: var(--touch-combat-center-visual-size, var(--touch-attack-pad-size));
  height: var(--touch-combat-center-visual-size, var(--touch-attack-pad-size));
  pointer-events: none;
}

.touch-combat-shell #attack-pad .touch-pad-ring {
  border-color: rgba(228, 238, 227, 0.14);
  background: transparent;
  box-shadow: none;
}

.touch-pad-attack.is-manual-active .touch-pad-ring {
  background: transparent;
  border-color: rgba(239, 201, 137, 0.24);
}

.touch-pad-attack.is-auto .touch-pad-ring {
  background: transparent;
  border-color: rgba(239, 201, 137, 0.16);
}

.touch-pad {
  position: relative;
  width: var(--touch-attack-pad-size);
  height: var(--touch-attack-pad-size);
  pointer-events: auto;
  touch-action: none;
}

.touch-pad-move {
  width: var(--touch-move-pad-size);
  height: var(--touch-move-pad-size);
}

.touch-pad-attack {
  width: var(--touch-attack-pad-size);
  height: var(--touch-attack-pad-size);
}

.touch-pad-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(228, 238, 227, 0.12);
  border-radius: 50%;
  background: rgba(10, 18, 22, 0.34);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.touch-pad-attack .touch-pad-ring {
  border-color: rgba(228, 238, 227, 0.12);
  background: rgba(10, 18, 22, 0.34);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.touch-pad-toggle-core {
  display: none;
}

.touch-pad-ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.touch-pad-ring::before {
  width: var(--move-pad-deadzone-size, 8.2%);
  height: var(--move-pad-deadzone-size, 8.2%);
  border: 1px solid rgba(241, 245, 236, 0.12);
}

.touch-pad::before,
.touch-pad::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(233, 241, 232, 0.08);
  transform: translate(-50%, -50%);
}

.touch-pad-move::before,
.touch-pad-move::after,
.touch-pad-attack::before,
.touch-pad-attack::after {
  display: none;
}

.touch-pad-move .touch-pad-ring::before {
  border-color: rgba(196, 201, 205, 0.22);
}

.touch-pad-attack::before,
.touch-pad-attack::after {
  display: none;
}

.touch-pad-attack .touch-pad-ring::before {
  display: none;
}

.touch-pad::before {
  width: 1px;
  height: 68%;
}

.touch-pad::after {
  width: 68%;
  height: 1px;
}

.touch-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  min-width: 42px;
  min-height: 42px;
  border: 1.5px solid rgba(241, 245, 236, 0.7);
  border-radius: 50%;
  background: rgba(235, 244, 233, 0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  transform: translate(-50%, -50%);
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.touch-knob.is-active {
  border-color: rgba(245, 249, 242, 0.9);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 48%),
    rgba(214, 230, 220, 0.24);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.touch-pad-move .touch-knob {
  border-color: rgba(159, 159, 159, 0.98);
  background: rgba(0, 0, 0, 0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.touch-pad-move .touch-knob.is-active {
  border-color: rgba(159, 159, 159, 0.98);
  background: rgba(141, 141, 141, 0.98);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.touch-pad-attack .touch-knob {
  width: 30%;
  height: 30%;
  min-width: 34px;
  min-height: 34px;
  border: 1.5px solid rgba(239, 201, 137, 0.9);
  background: rgba(239, 201, 137, 0.03);
  box-shadow: none;
}

.touch-hud.touch-hud-mobile .touch-pad-attack .touch-knob {
  width: 32%;
  height: 32%;
  min-width: 40px;
  min-height: 40px;
}

.touch-pad-attack .touch-knob.is-active {
  border-color: rgba(239, 201, 137, 0.96);
}

.touch-pad-attack.is-auto .touch-knob {
  background: rgba(239, 201, 137, 0);
  border-color: rgba(239, 201, 137, 0.96);
}


@media (pointer: coarse), (hover: none) {
  .debug-panel {
    top: 14px;
    left: 14px;
  }

  .realm-toast {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    max-width: min(220px, calc(100vw - 32px));
    padding: 7px 11px;
    font-size: 11px;
  }

  .character-panel {
    top: 14px;
    right: 14px;
  }

  .shell-topbar {
    padding: env(safe-area-inset-top, 0px) 8px 0;
  }

  .shell-topbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .shell-topbar-group {
    gap: 6px;
  }

  .shell-chip {
    min-width: 56px;
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  .about-panel {
    top: calc(40px + env(safe-area-inset-top, 0px));
  }

  .about-card {
    width: 100%;
    height: calc(100vh - 40px - env(safe-area-inset-top, 0px));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .about-title {
    font-size: 14px;
    line-height: 1.32;
  }

  .shell-brand-title {
    font-size: 15px;
    letter-spacing: 0.16em;
    padding: 0 10px;
  }

  .about-top-pane {
    padding: 10px 12px 10px;
  }

  .about-tabs-inline {
    padding: 0 12px;
  }

  .about-body {
    padding: 0 12px 12px;
  }

  .about-patch-note {
    margin: 0 12px;
  }
}
