:root {
  color-scheme: dark;
  --ink: #edf3e8;
  --muted: #a0afa8;
  --lime: #cdf5a4;
  --panel: #16212a;
  --border: #ffffff15;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #101a23;
  color: var(--ink);
}
body {
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
  color: inherit;
  background: none;
  touch-action: manipulation;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button {
  min-height: 44px;
}
button:active {
  filter: brightness(1.12);
  transform: scale(0.98);
}
[hidden] {
  display: none !important;
}
#world,
#vignette {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#vignette {
  pointer-events: none;
  background: radial-gradient(
    ellipse at 65% 50%,
    transparent 28%,
    #07111c66 100%
  );
}
body.home-open #vignette {
  background: linear-gradient(
    90deg,
    #0c1725e8 0%,
    #0c1725bd 32%,
    #0c17253b 60%,
    #0c172582 100%
  );
}
#topbar {
  position: fixed;
  inset: calc(24px + var(--safe-top)) 36px auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  text-align: left;
  letter-spacing: -1px;
  font-size: 25px;
  font-weight: 800;
  padding: 0;
}
.brandmark {
  width: 42px;
  height: 42px;
  background: var(--lime);
  color: #182923;
  display: grid;
  place-items: center;
  border-radius: 14px 14px 14px 4px;
  font-size: 32px;
  box-shadow: 0 4px 24px #b2ee9020;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  color: #a6b5b0;
  margin-top: 1px;
  font-weight: 500;
}
.top-actions {
  display: flex;
  gap: 8px;
}
.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #14212a8f;
  font-size: 23px;
  backdrop-filter: blur(16px);
}
#connection {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #afbcb6;
  font-size: 11px;
  margin-left: auto;
  margin-right: 20px;
}
#connection i,
.home-footer i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e7b96d;
  box-shadow: 0 0 12px #e7b96d80;
  display: inline-block;
}
#connection.online i {
  background: var(--lime);
  box-shadow: 0 0 12px #cdf5a480;
}
.home {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  padding: 110px max(6vw, 36px) 100px;
  gap: 6vw;
  pointer-events: none;
}
.home > * {
  pointer-events: auto;
}
.intro-copy {
  align-self: center;
}
.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.3px;
  color: var(--lime);
  line-height: 1.7;
  display: block;
}
.intro-copy .eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}
.eyebrow > span {
  width: 20px;
  height: 1px;
  background: var(--lime);
}
h1 {
  font-size: clamp(40px, 4.8vw, 76px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -3.5px;
  margin: 24px 0;
  color: #f0f3e9;
}
h1 em {
  font-style: normal;
  color: var(--lime);
}
.intro-copy p {
  font-size: 14px;
  line-height: 1.8;
  color: #b0bcb4;
  letter-spacing: 0.1px;
}
.intro-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #a6b4aa;
  margin-top: 35px;
}
.intro-meta b {
  font-size: 14px;
  color: var(--lime);
  font-weight: 400;
}
.menu-card {
  max-width: 420px;
  width: 100%;
  justify-self: end;
  background: linear-gradient(145deg, #1b2a31eb, #101b25e8);
  padding: 26px;
  border: 1px solid #d4f6bf20;
  border-radius: 26px;
  box-shadow: 0 24px 90px #0005;
  backdrop-filter: blur(24px);
  position: relative;
}
.menu-card:before {
  content: "";
  position: absolute;
  top: -45px;
  right: 48px;
  width: 1px;
  height: 45px;
  background: linear-gradient(transparent, #d5f9d080);
  animation: silk 1.1s both;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.card-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 1.8px;
}
.chapter {
  color: #82938b;
  font-size: 8px;
  letter-spacing: 1px;
}
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 14px;
  padding: 19px 14px;
  margin-bottom: 11px;
  border: 1px solid #ffffff13;
  background: #ffffff04;
  border-radius: 14px;
  min-height: 90px;
  position: relative;
  transition:
    background 0.2s,
    border-color 0.2s;
  animation: assemble 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.menu-item:nth-of-type(1) {
  animation-name: swing;
  transform-origin: 90% -50px;
}
.menu-item:nth-of-type(2) {
  animation-delay: 0.12s;
}
.menu-item:nth-of-type(3) {
  animation-name: portal;
  animation-delay: 0.25s;
}
.menu-item:hover {
  background: #ffffff09;
  border-color: #d3f3b666;
}
.menu-item.campaign {
  background: var(--lime);
  color: #233323;
  box-shadow: 0 5px 28px #cdf5a411;
  border-color: var(--lime);
}
.menu-item strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.menu-item small {
  display: block;
  font-size: 10px;
  margin-top: 7px;
  opacity: 0.65;
  font-weight: 400;
  line-height: 1.4;
}
.menu-item b {
  margin-left: auto;
  font-size: 22px;
  font-weight: 400;
}
.menu-icon {
  width: 39px;
  height: 39px;
  border: 1px solid #ffffff20;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 26px;
  flex: none;
  color: #c6e4d1;
}
.campaign .menu-icon {
  background: #263b2610;
  border-color: #263b2620;
  color: #253b27;
}
.pvp .menu-icon {
  color: #efc395;
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
}
.card-bottom button {
  font-size: 10px;
  color: #a4b2aa;
}
.home-footer {
  position: absolute;
  bottom: calc(27px + var(--safe-bottom));
  left: 36px;
  right: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.4px;
  color: #8d9e96;
}
.home-footer span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-footer i {
  background: var(--lime);
}
.home-footer button {
  border: 1px solid #ffffff20;
  border-radius: 30px;
  padding: 0 20px;
  font-size: 10px;
  color: #c9d8cc;
  background: #1a2934a0;
}
.world-heading {
  position: fixed;
  top: calc(108px + var(--safe-top));
  left: 36px;
  pointer-events: none;
}
.world-heading h2 {
  margin: 3px 0;
  font-size: 24px;
  letter-spacing: -0.7px;
  font-weight: 600;
}
.world-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
}
.resources {
  position: fixed;
  top: calc(103px + var(--safe-top));
  right: 36px;
  display: flex;
  gap: 6px;
}
.resources span {
  padding: 10px 14px;
  background: #14222bc9;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--lime);
  font-size: 17px;
  backdrop-filter: blur(10px);
}
.resources b {
  font-size: 12px;
  color: var(--ink);
  margin-left: 7px;
  font-weight: 500;
}
.quest {
  position: fixed;
  top: calc(185px + var(--safe-top));
  left: 36px;
  display: flex;
  gap: 13px;
  align-items: start;
  background: #101e29c9;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 14px;
  max-width: 300px;
  backdrop-filter: blur(14px);
}
.quest-dot {
  width: 7px;
  height: 7px;
  border: 1px solid var(--lime);
  transform: rotate(45deg);
  margin-top: 7px;
  flex: none;
}
.quest small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.8px;
  color: #93a393;
}
.quest strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin-top: 6px;
}
.quest p {
  font-size: 10px;
  color: #97a99e;
  line-height: 1.5;
  margin: 6px 0 0;
}
.quest button {
  margin: -12px -7px 0 auto;
  color: #819587;
}
.quest.compact div p,
.quest.compact div small {
  display: none;
}
.quest.compact {
  padding: 6px 12px;
}
.bottom-dock {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: #14212bdb;
  border: 1px solid #ffffff17;
  backdrop-filter: blur(20px);
  padding: 5px 10px;
  border-radius: 19px;
  box-shadow: 0 7px 30px #0003;
}
.bottom-dock button {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 20px;
  padding: 0 13px;
  color: #d3e4d3;
}
.bottom-dock span {
  font-size: 10px;
  color: #b4c5b8;
  white-space: nowrap;
}
.bottom-dock button:hover {
  background: #ffffff08;
  border-radius: 12px;
}
#control-status {
  position: fixed;
  bottom: calc(94px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  background: #14222ac9;
  padding: 1px 6px 1px 13px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 11px;
  white-space: nowrap;
}
#control-status strong {
  font-weight: 500;
}
#control-status button {
  font-size: 9px;
  color: #adbdaf;
  padding: 0 10px;
}
.status-orb {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
}
#restore-ui {
  position: fixed;
  right: 20px;
  top: calc(20px + var(--safe-top));
  z-index: 12;
}
#touch-controls {
  position: fixed;
  bottom: calc(108px + var(--safe-bottom));
  left: max(24px, env(safe-area-inset-left));
  right: max(24px, env(safe-area-inset-right));
  height: 135px;
  pointer-events: none;
  z-index: 8;
}
#stick {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: #c0eed70c;
  border: 1px solid #d6f8d92b;
  backdrop-filter: blur(9px);
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-items: center;
}
#stick-knob {
  display: block;
  width: 49px;
  height: 49px;
  border: 1px solid #dbf4d950;
  background: #c7e8d52b;
  border-radius: 50%;
  box-shadow: 0 3px 20px #0003;
}
#stick i {
  position: absolute;
  top: 7px;
  color: #b6d7b760;
  font-size: 15px;
  font-style: normal;
  pointer-events: none;
}
.action-pad {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: end;
  gap: 10px;
  pointer-events: auto;
}
.action-pad button {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid #e1f9d530;
  background: #20352cd9;
  box-shadow: 0 4px 20px #0003;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  touch-action: none;
  backdrop-filter: blur(8px);
}
.action-pad span {
  font-size: 23px;
  line-height: 1.2;
}
.action-pad small {
  font-size: 6px;
  letter-spacing: 1px;
  margin-top: 3px;
}
.action-pad .jump {
  width: 78px;
  height: 78px;
  color: #203323;
  background: #c8f29bd9;
  border-color: #c8f29b;
}
.action-pad .jump span {
  font-size: 33px;
}
.action-pad .ability {
  align-self: start;
  margin-top: 0;
  width: 50px;
  height: 50px;
}
.action-pad .attack {
  color: #ffd19f;
  background: #554633bb;
}
.ability.cooldown {
  opacity: 0.45;
}
.hero-context {
  position: fixed;
  z-index: 20;
  width: 270px;
  background: #192931f2;
  backdrop-filter: blur(25px);
  padding: 10px;
  border-radius: 20px;
  border: 1px solid #d2edca30;
  box-shadow: 0 18px 60px #0007;
}
.context-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 4px;
}
.context-heading > span {
  font-size: 26px;
  color: var(--lime);
}
.context-heading strong {
  display: block;
  font-size: 13px;
}
.context-heading small {
  display: block;
  font-size: 10px;
  color: #9bb09e;
  margin-top: 3px;
}
.context-heading button {
  margin-left: auto;
  font-size: 23px;
}
.hero-context > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
}
.hero-context > button:hover {
  background: #ffffff0c;
}
#take-control {
  background: var(--lime);
  color: #243a28;
  margin-bottom: 4px;
}
.hero-context small {
  font-size: 8px;
  opacity: 0.6;
}
kbd {
  font-size: 10px;
  border: 1px solid #3c5b3c35;
  padding: 2px 4px;
  border-radius: 4px;
}
dialog {
  width: min(580px, calc(100% - 32px));
  max-height: calc(100dvh - 64px - var(--safe-top) - var(--safe-bottom));
  color: var(--ink);
  background: #15232cf5;
  border: 1px solid #d4ecc52a;
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 40px 100px #0008;
  overscroll-behavior: contain;
  touch-action: pan-y;
  backdrop-filter: blur(30px);
}
dialog::backdrop {
  background: #07101bbd;
  backdrop-filter: blur(7px);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-heading h2 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 6px 0;
}
.panel-heading .eyebrow {
  font-size: 8px;
}
#panel-content p {
  font-size: 12px;
  line-height: 1.8;
  color: #b0c0b2;
}
.world-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.world-card {
  border: 1px solid #cbeabd20;
  border-radius: 15px;
  text-align: left;
  padding: 15px;
  background: linear-gradient(140deg, #385b3f60, #141d3070);
  min-height: 110px;
  overflow: hidden;
  position: relative;
}
.world-card.active {
  border-color: var(--lime);
}
.world-card span {
  display: block;
  font-size: 27px;
  margin-bottom: 13px;
}
.world-card strong {
  display: block;
  font-size: 12px;
}
.world-card small {
  font-size: 8px;
  color: #b3c4b7;
  display: block;
  margin-top: 5px;
}
.world-card:nth-child(2) {
  background: linear-gradient(140deg, #14686e60, #2c1d4570);
}
.world-card:nth-child(3) {
  background: linear-gradient(140deg, #768e7460, #28496270);
}
.world-card:nth-child(4) {
  background: linear-gradient(140deg, #175d6860, #12262c70);
}
.world-card:nth-child(5) {
  background: linear-gradient(140deg, #525a8860, #1a243870);
}
.primary,
.secondary {
  display: block;
  min-height: 48px;
  width: 100%;
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  font-size: 12px;
  margin-top: 10px;
}
.primary {
  background: var(--lime);
  color: #1e3425;
  font-weight: 600;
}
.secondary {
  border: 1px solid #cce1c92b;
  background: #ffffff04;
}
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 14px 0;
  color: #c5d4c6;
  font-size: 12px;
}
.field select,
.field input {
  border: 1px solid #c9dec42a;
  background: #111d24;
  color: var(--ink);
  padding: 11px;
  border-radius: 9px;
  min-width: 100px;
  max-width: 60%;
  user-select: text;
  touch-action: manipulation;
  font-size: 12px;
}
.field input[type="checkbox"] {
  min-width: auto;
  accent-color: var(--lime);
  width: 20px;
  height: 20px;
}
.roster-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff04;
  border: 1px solid #ffffff0e;
  border-radius: 12px;
  padding: 8px 13px;
  margin-bottom: 8px;
  width: 100%;
  text-align: left;
}
.roster-row .portrait {
  font-size: 27px;
  width: 36px;
  text-align: center;
}
.roster-row strong {
  font-size: 13px;
  display: block;
}
.roster-row small {
  font-size: 9px;
  color: #a1b79e;
}
.roster-row > span:last-child {
  margin-left: auto;
  color: var(--lime);
}
.recovery-code {
  display: block;
  padding: 15px;
  background: #09151e;
  border: 1px solid var(--border);
  font: 12px monospace;
  word-break: break-all;
  user-select: all;
}
.keyboard-hint {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0;
}
.keyboard-hint > div {
  padding: 12px;
  background: #ffffff05;
  border-radius: 10px;
  font-size: 10px;
  color: #b0c0b2;
}
.keyboard-hint kbd {
  display: inline-block;
  margin-right: 6px;
  color: var(--lime);
  border-color: #ffffff20;
}
#cinematic {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  text-align: center;
  padding: 0 20px 12vh;
  background: linear-gradient(transparent 40%, #0b142de8);
}
#cinematic h2 {
  font-size: clamp(30px, 4vw, 55px);
  letter-spacing: -2px;
  font-weight: 550;
  margin: 14px 0;
  line-height: 1.2;
}
#cinematic p {
  font-size: 11px;
  color: #b2c3b8;
  max-width: 280px;
  line-height: 1.6;
}
#cinematic .eyebrow {
  font-size: 8px;
}
#toast {
  position: fixed;
  z-index: 100;
  bottom: calc(90px + var(--safe-bottom));
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  max-width: min(460px, 90%);
  background: #e2f5cd;
  color: #203321;
  padding: 13px 20px;
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 7px 30px #0005;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#reconnect {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #0d1824d9;
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
#reconnect strong {
  font-size: 30px;
  letter-spacing: -1px;
}
#reconnect span {
  font-size: 12px;
  color: #afc0b0;
  margin: 20px;
  max-width: 280px;
  line-height: 1.6;
}
#reconnect button {
  background: var(--lime);
  color: #213625;
  border-radius: 14px;
  padding: 0 25px;
}
.ui-hidden #topbar,
.ui-hidden #game-hud,
.ui-hidden #touch-controls {
  display: none !important;
}
@keyframes swing {
  from {
    opacity: 0;
    transform: translateY(-50px) rotate(-9deg);
  }
  65% {
    transform: translateY(4px) rotate(2deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes assemble {
  from {
    opacity: 0;
    transform: translateX(45px) rotate(4deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes portal {
  from {
    opacity: 0;
    transform: scale(0.65);
    filter: blur(9px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes silk {
  from {
    transform: scaleY(0);
    transform-origin: top;
  }
  to {
    transform: scaleY(1);
  }
}
@media (min-width: 1500px) {
  .home {
    padding-left: 9vw;
    padding-right: 9vw;
    gap: 10vw;
  }
  .menu-card {
    max-width: 450px;
    padding: 32px;
  }
  .menu-item {
    min-height: 100px;
  }
}
@media (max-width: 900px) {
  #topbar {
    left: 22px;
    right: 22px;
  }
  .home {
    padding-left: 28px;
    padding-right: 28px;
    gap: 30px;
  }
  h1 {
    font-size: 46px;
    letter-spacing: -2px;
  }
  .menu-card {
    padding: 18px;
  }
  .menu-item {
    padding: 16px 10px;
  }
  .menu-item strong {
    font-size: 13px;
  }
  .menu-item small {
    font-size: 9px;
  }
  .home-footer span:last-child {
    display: none;
  }
  .intro-meta {
    gap: 8px;
    font-size: 8px;
  }
  .world-heading {
    left: 22px;
  }
  .quest {
    left: 22px;
  }
  .resources {
    right: 22px;
  }
  .bottom-dock span {
    display: none;
  }
  .bottom-dock button {
    padding: 0 17px;
  }
  #connection {
    margin-right: 0;
  }
  .brand {
    font-size: 22px;
  }
}
@media (max-width: 600px) and (min-height: 500px) {
  #topbar {
    top: calc(14px + var(--safe-top));
    left: 20px;
    right: 20px;
    gap: 8px;
  }
  .brandmark {
    width: 34px;
    height: 34px;
    font-size: 26px;
    border-radius: 11px 11px 11px 3px;
  }
  .brand {
    font-size: 20px;
    gap: 8px;
  }
  .brand small {
    font-size: 5px;
    letter-spacing: 1.4px;
  }
  .top-actions {
    gap: 6px;
  }
  .icon-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    font-size: 20px;
  }
  #sound {
    display: none;
  }
  #connection {
    position: absolute;
    top: 48px;
    left: 2px;
    font-size: 8px;
    gap: 5px;
  }
  #connection i {
    width: 4px;
    height: 4px;
  }
  .home {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 22px;
    padding: calc(105px + var(--safe-top)) 23px calc(85px + var(--safe-bottom));
  }
  .intro-copy {
    align-self: stretch;
  }
  .intro-copy .eyebrow {
    font-size: 7px;
    letter-spacing: 1.6px;
  }
  h1 {
    font-size: clamp(33px, 8.6vw, 45px);
    letter-spacing: -1.9px;
    line-height: 1.08;
    margin: 14px 0 9px;
  }
  .intro-copy p {
    font-size: 10px;
    line-height: 1.6;
    margin: 12px 0 0;
  }
  .intro-meta {
    display: none;
  }
  .menu-card {
    max-width: none;
    align-self: stretch;
    padding: 18px;
    border-radius: 21px;
  }
  .card-heading {
    margin-bottom: 15px;
  }
  .menu-item {
    min-height: 73px;
    margin-bottom: 8px;
    padding: 12px;
  }
  .menu-item strong {
    font-size: 13px;
  }
  .menu-item small {
    font-size: 9px;
    margin-top: 5px;
  }
  .menu-icon {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }
  .card-bottom {
    padding-top: 2px;
  }
  .card-bottom button {
    min-height: 33px;
    font-size: 9px;
  }
  .home-footer {
    bottom: calc(15px + var(--safe-bottom));
    left: 23px;
    right: 23px;
    gap: 8px;
  }
  .home-footer span:first-child {
    font-size: 7px;
    letter-spacing: 0;
    gap: 5px;
  }
  .home-footer button {
    font-size: 8px;
    padding: 0 12px;
    min-height: 34px;
  }
  .world-heading {
    top: calc(98px + var(--safe-top));
    left: 20px;
  }
  .world-heading h2 {
    font-size: 19px;
  }
  .world-heading .eyebrow {
    font-size: 7px;
  }
  .resources {
    top: calc(157px + var(--safe-top));
    left: 20px;
    right: auto;
    gap: 5px;
  }
  .resources span {
    padding: 6px 10px;
    font-size: 15px;
    border-radius: 9px;
  }
  .resources b {
    font-size: 10px;
  }
  .quest {
    top: calc(204px + var(--safe-top));
    left: 20px;
    max-width: 260px;
    padding: 10px 12px;
    gap: 10px;
  }
  .quest strong {
    font-size: 10px;
  }
  .quest p {
    font-size: 8px;
  }
  .quest small {
    font-size: 6px;
  }
  .bottom-dock {
    bottom: calc(15px + var(--safe-bottom));
    gap: 0;
    padding: 3px 7px;
    border-radius: 15px;
  }
  .bottom-dock button {
    padding: 0 17px;
    font-size: 20px;
  }
  .bottom-dock span {
    display: none;
  }
  #control-status {
    bottom: calc(79px + var(--safe-bottom));
    font-size: 10px;
  }
  #touch-controls {
    bottom: calc(125px + var(--safe-bottom));
    left: 18px;
    right: 18px;
    height: 110px;
  }
  #stick {
    width: 105px;
    height: 105px;
  }
  .action-pad {
    gap: 7px;
  }
  .action-pad button {
    width: 50px;
    height: 50px;
  }
  .action-pad .jump {
    width: 67px;
    height: 67px;
  }
  .action-pad .ability {
    width: 42px;
    height: 42px;
    position: absolute;
    right: 18px;
    bottom: 87px;
  }
  .hero-context {
    left: 16px !important;
    right: 16px;
    top: auto !important;
    bottom: calc(90px + var(--safe-bottom));
    width: auto;
  }
  .hero-context > button {
    min-height: 46px;
  }
  .world-grid {
    gap: 8px;
  }
  .world-card {
    padding: 13px;
    min-height: 105px;
  }
  dialog {
    padding: 21px;
    border-radius: 22px;
  }
  .panel-heading h2 {
    font-size: 25px;
  }
  .keyboard-hint {
    grid-template-columns: 1fr;
  }
  #cinematic {
    padding-bottom: 16vh;
  }
  body.home-open #vignette {
    background: linear-gradient(
      #0d172460,
      #0c1725c9 15%,
      #0c1725d9 85%,
      #0d1724c9
    );
  }
}
@media (max-height: 740px) and (max-width: 600px) and (min-height: 500px) {
  .home {
    gap: 14px;
    padding-top: 95px;
    padding-bottom: 65px;
  }
  h1 {
    font-size: 33px;
    margin: 9px 0;
  }
  .intro-copy p {
    display: none;
  }
  .menu-card {
    padding: 14px;
  }
  .card-heading {
    margin-bottom: 10px;
  }
  .menu-item {
    min-height: 63px;
    padding: 10px;
    margin-bottom: 7px;
  }
  .menu-item small {
    font-size: 8px;
  }
  .home-footer {
    bottom: calc(10px + var(--safe-bottom));
  }
  .card-bottom button {
    min-height: 30px;
  }
  .menu-card:before {
    height: 22px;
    top: -22px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #topbar {
    top: calc(10px + var(--safe-top));
    left: max(18px, env(safe-area-inset-left));
    right: max(18px, env(safe-area-inset-right));
  }
  .brand {
    font-size: 18px;
  }
  .brandmark {
    width: 32px;
    height: 32px;
    font-size: 26px;
  }
  .brand small {
    font-size: 5px;
  }
  .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    font-size: 18px;
  }
  #connection {
    font-size: 8px;
  }
  .home {
    padding: 65px max(35px, env(safe-area-inset-right)) 50px;
    gap: 25px;
  }
  .intro-copy .eyebrow {
    font-size: 6px;
  }
  h1 {
    font-size: 32px;
    margin: 10px 0;
    letter-spacing: -1.6px;
  }
  .intro-copy p {
    font-size: 9px;
  }
  .intro-meta {
    display: none;
  }
  .menu-card {
    padding: 12px;
    max-width: 350px;
    border-radius: 18px;
  }
  .card-heading {
    margin-bottom: 8px;
  }
  .card-heading .eyebrow,
  .chapter {
    font-size: 6px;
  }
  .menu-item {
    min-height: 53px;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 10px;
  }
  .menu-item strong {
    font-size: 11px;
  }
  .menu-item small {
    font-size: 7px;
    margin-top: 3px;
  }
  .menu-icon {
    width: 28px;
    height: 28px;
    font-size: 19px;
    border-radius: 8px;
  }
  .card-bottom button {
    font-size: 8px;
    min-height: 26px;
  }
  .home-footer {
    bottom: 6px;
    font-size: 7px;
  }
  .home-footer button {
    font-size: 8px;
    min-height: 28px;
  }
  .world-heading {
    top: 66px;
    left: 20px;
  }
  .world-heading h2 {
    font-size: 16px;
  }
  .world-heading .eyebrow {
    font-size: 6px;
  }
  .resources {
    top: 65px;
    right: 20px;
  }
  .resources span {
    padding: 4px 9px;
    font-size: 13px;
  }
  .resources b {
    font-size: 10px;
  }
  .quest {
    top: 123px;
    left: 20px;
    padding: 8px 10px;
    max-width: 240px;
  }
  .quest p {
    display: none;
  }
  .quest strong {
    font-size: 9px;
  }
  .quest small {
    font-size: 6px;
  }
  .bottom-dock {
    bottom: calc(8px + var(--safe-bottom));
    padding: 2px 7px;
    border-radius: 12px;
  }
  .bottom-dock button {
    min-height: 34px;
    padding: 0 13px;
    font-size: 17px;
  }
  #control-status {
    bottom: 60px;
    font-size: 9px;
  }
  #control-status button {
    min-height: 30px;
  }
  #touch-controls {
    bottom: calc(22px + var(--safe-bottom));
    left: max(24px, env(safe-area-inset-left));
    right: max(24px, env(safe-area-inset-right));
    height: 90px;
  }
  #stick {
    width: 90px;
    height: 90px;
  }
  #stick-knob {
    width: 40px;
    height: 40px;
  }
  .action-pad .jump {
    width: 61px;
    height: 61px;
  }
  .action-pad button {
    width: 48px;
    height: 48px;
  }
  .action-pad .ability {
    width: 42px;
    height: 42px;
  }
  #cinematic {
    padding-bottom: 45px;
  }
  #cinematic h2 {
    font-size: 30px;
    margin: 8px 0;
  }
  #cinematic p {
    font-size: 9px;
  }
  .hero-context {
    max-height: 75vh;
    overflow: auto;
    touch-action: pan-y;
  }
}
@media (pointer: fine) and (min-width: 900px) {
  #touch-controls {
    opacity: 0.75;
  }
  #stick {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-height: 740px) and (max-width: 600px) and (min-height: 500px) {
  .home {
    padding-top: 90px;
    padding-bottom: 60px;
    gap: 12px;
  }
  h1 {
    font-size: 30px;
    line-height: 1.06;
    margin: 8px 0;
  }
  .menu-item {
    min-height: 60px;
    padding: 9px;
  }
  .card-heading {
    margin-bottom: 8px;
  }
  .card-bottom button {
    min-height: 26px;
  }
}
@media (max-width: 360px) and (min-height: 500px) {
  .home {
    padding-left: 18px;
    padding-right: 18px;
  }
  h1 {
    font-size: 29px;
    letter-spacing: -1.3px;
  }
  .intro-copy .eyebrow {
    font-size: 6px;
  }
  .menu-item small {
    font-size: 7px;
  }
  .menu-item strong {
    font-size: 12px;
  }
  .home-footer {
    left: 18px;
    right: 18px;
  }
  .home-footer span:first-child {
    font-size: 6px;
  }
  .top-actions {
    gap: 4px;
  }
}
.reduced-motion *,
.reduced-motion *:before,
.reduced-motion *:after {
  animation: none !important;
  transition: none !important;
}
@media (max-width: 600px) and (orientation: portrait) and (max-height: 499px) {
  #topbar {
    top: 12px;
    left: 18px;
    right: 18px;
  }
  .brand {
    font-size: 18px;
    gap: 7px;
  }
  .brandmark {
    width: 31px;
    height: 31px;
    font-size: 24px;
  }
  .brand small {
    font-size: 5px;
    letter-spacing: 1px;
  }
  .top-actions {
    gap: 4px;
  }
  .icon-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }
  #sound {
    display: none;
  }
  #connection {
    position: absolute;
    top: 43px;
    left: 0;
    font-size: 7px;
  }
  .home {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 84px 18px 55px;
    gap: 10px;
  }
  .intro-copy {
    align-self: stretch;
  }
  .intro-copy > .eyebrow,
  .intro-copy p,
  .intro-meta {
    display: none;
  }
  h1 {
    font-size: 24px;
    letter-spacing: -1px;
    line-height: 1.02;
    margin: 0;
  }
  .menu-card {
    padding: 12px;
    max-width: none;
    border-radius: 17px;
  }
  .card-heading {
    margin-bottom: 8px;
  }
  .card-heading .eyebrow,
  .chapter {
    font-size: 6px;
  }
  .menu-item {
    min-height: 49px;
    margin-bottom: 5px;
    padding: 7px 9px;
    gap: 9px;
  }
  .menu-item strong {
    font-size: 11px;
  }
  .menu-item small {
    font-size: 7px;
    margin-top: 3px;
  }
  .menu-icon {
    width: 27px;
    height: 27px;
    font-size: 19px;
    border-radius: 8px;
  }
  .card-bottom {
    padding-top: 0;
  }
  .card-bottom button {
    font-size: 8px;
    min-height: 25px;
  }
  .home-footer {
    bottom: 8px;
    left: 18px;
    right: 18px;
  }
  .home-footer span:first-child {
    font-size: 6px;
    letter-spacing: 0;
  }
  .home-footer button {
    min-height: 30px;
    font-size: 7px;
    padding: 0 12px;
  }
  .world-heading {
    top: 83px;
    left: 18px;
  }
  .world-heading h2 {
    font-size: 17px;
  }
  .resources {
    top: 128px;
    left: 18px;
    right: auto;
  }
  .resources span {
    padding: 4px 8px;
    font-size: 12px;
  }
  .resources b {
    font-size: 9px;
  }
  .quest {
    top: 167px;
    left: 18px;
    padding: 6px 10px;
    max-width: 240px;
  }
  .quest small,
  .quest p {
    display: none;
  }
  .quest strong {
    font-size: 9px;
  }
  .quest-dot {
    margin-top: 10px;
  }
  .bottom-dock {
    bottom: 8px;
    padding: 2px 6px;
  }
  .bottom-dock button {
    padding: 0 14px;
  }
  .bottom-dock span {
    display: none;
  }
  #touch-controls {
    bottom: 95px;
    left: 16px;
    right: 16px;
    height: 95px;
  }
  #stick {
    width: 88px;
    height: 88px;
  }
  #stick-knob {
    width: 40px;
    height: 40px;
  }
  .action-pad {
    gap: 6px;
  }
  .action-pad button {
    width: 47px;
    height: 47px;
  }
  .action-pad .jump {
    width: 60px;
    height: 60px;
  }
  .action-pad .ability {
    width: 40px;
    height: 40px;
    position: absolute;
    right: 12px;
    bottom: 70px;
  }
  #control-status {
    bottom: 63px;
    font-size: 9px;
  }
  #control-status button {
    min-height: 30px;
  }
  .hero-context {
    left: 16px !important;
    right: 16px;
    top: auto !important;
    bottom: 65px;
    width: auto;
    max-height: 75vh;
    overflow: auto;
    touch-action: pan-y;
  }
  .world-grid {
    grid-template-columns: 1fr 1fr;
  }
  .home-footer span:last-child {
    display: none;
  }
}

.card-bottom button,
.home-footer button {
  min-height: 44px;
}
.top-actions button {
  min-width: 44px;
  min-height: 44px;
}
.bottom-dock button {
  min-width: 44px;
  min-height: 44px;
}
#chat-toggle {
  position: relative;
}
#chat-unread {
  position: absolute;
  right: -2px;
  top: -3px;
  background: var(--lime);
  color: #192d24;
  border-radius: 10px;
  font-size: 9px;
  min-width: 14px;
}
#chat-unread:empty {
  display: none;
}
#web-update {
  color: var(--lime);
  border-color: #c9ed9c88;
}
.map-choice {
  display: flex;
  flex-direction: column;
}
.map-choice .world-card {
  width: 100%;
  flex: 1;
}
.map-pvp {
  border: 1px solid #b8ddae2b;
  border-radius: 10px;
  background: #a1ca880d;
  font-size: 10px;
  margin-top: 6px;
  min-height: 44px;
  color: var(--lime);
}
#game-chat {
  position: fixed;
  z-index: 35;
  right: max(20px, env(safe-area-inset-right));
  top: calc(85px + var(--safe-top));
  bottom: calc(96px + var(--safe-bottom));
  width: min(350px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  padding: 17px;
  background: #13232df5;
  border: 1px solid #b6d4ae3d;
  border-radius: 21px;
  box-shadow: 0 20px 70px #0008;
  backdrop-filter: blur(24px);
  touch-action: pan-y;
  user-select: text;
}
.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-heading small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.6px;
  color: var(--lime);
}
.chat-heading strong {
  display: block;
  font-size: 21px;
  margin-top: 6px;
}
.chat-heading button {
  font-size: 26px;
  width: 44px;
}
.chat-scope-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  margin: 14px 0;
  color: #a8bfae;
}
.chat-scope-label select {
  background: #14232c;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 11px;
  padding: 10px;
  border-radius: 10px;
}
#chat-messages {
  flex: 1;
  min-height: 45px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 5px 2px 12px;
  scrollbar-width: thin;
}
.chat-message {
  padding: 11px;
  background: #ffffff04;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid #ffffff08;
}
.chat-message.own {
  border-color: #c6ed9b30;
  background: #badb9808;
}
.chat-author {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: #cae3bc;
}
.chat-author time {
  font-size: 8px;
  color: #829a8d;
}
.chat-message p {
  font-size: 12px;
  line-height: 1.6;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.chat-empty {
  font-size: 11px;
  color: #91a69b;
  line-height: 1.8;
}
#chat-form {
  display: flex;
  gap: 6px;
  border: 1px solid #a7c79b40;
  border-radius: 13px;
  padding: 4px;
  background: #0c1a22;
}
#chat-input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
  padding: 8px;
  user-select: text;
  touch-action: manipulation;
}
#chat-form button {
  width: 44px;
  flex: none;
  background: var(--lime);
  border-radius: 9px;
  color: #1d3422;
  font-size: 24px;
}
.chat-note {
  font-size: 7px;
  color: #83988a;
  margin: 10px 3px 0;
}
@media (max-width: 600px) {
  #game-chat {
    left: 16px;
    right: 16px;
    width: auto;
    top: calc(84px + var(--safe-top));
    bottom: calc(80px + var(--safe-bottom));
  }
}
@media (max-width: 360px) {
  #topbar {
    left: 16px;
    right: 16px;
  }
  .brand {
    font-size: 17px;
    gap: 6px;
  }
  .top-actions {
    gap: 3px;
  }
  #fullscreen {
    display: none;
  }
  .home-footer span:first-child {
    display: none;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #game-chat {
    top: 64px;
    bottom: 12px;
    width: 330px;
  }
  .chat-heading strong {
    font-size: 16px;
  }
  .chat-scope-label {
    margin: 5px 0;
  }
  .chat-heading small {
    display: none;
  }
}
@media (max-width: 600px) {
  #chat-input {
    font-size: 16px;
  }
  .field input,
  .field select {
    font-size: 16px;
  }
  #game-chat {
    height: calc(var(--visual-height, 100dvh) - 175px - var(--safe-top));
    bottom: auto;
    max-height: calc(100dvh - 175px - var(--safe-top));
    min-height: 150px;
  }
}
.chat-glyph {
  width: 16px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  position: relative;
  display: block;
}
.chat-glyph:after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -4px;
  width: 5px;
  height: 5px;
  border-left: 1.5px solid currentColor;
  transform: skewY(-35deg);
}


/* ---------------------------------------------------------------- вход в игру */
.login {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(20px, calc(var(--safe-top) + 14px)) 18px
    max(20px, calc(var(--safe-bottom) + 14px));
  background:
    radial-gradient(120% 80% at 50% 0%, #1a2a34e8, #0b141cf2 58%, #070d13fa),
    #0b141c;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.login[hidden] {
  display: none;
}
.login-card {
  width: min(430px, 100%);
  margin: auto;
  display: grid;
  gap: 16px;
  padding: 30px 28px 26px;
  border: 1px solid #d4f6bf24;
  border-radius: 26px;
  background: linear-gradient(150deg, #1c2b34f5, #101a23f2);
  box-shadow: 0 30px 110px #0009;
  backdrop-filter: blur(22px);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.login-brand .brandmark {
  width: 38px;
  height: 38px;
  font-size: 27px;
  border-radius: 12px 12px 12px 4px;
}
.login-wordmark {
  display: grid;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.8px;
}
.login-wordmark small {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--muted);
}
#login-kicker {
  margin-top: 8px;
}
#login-title {
  margin: 0;
  font-size: clamp(25px, 4.6vw, 31px);
  font-weight: 650;
  letter-spacing: -0.9px;
  line-height: 1.2;
}
.login-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: #b3c1b8;
}
.login-field {
  display: grid;
  gap: 9px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: #9fb2a5;
}
.login-field input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid #cde0c82e;
  border-radius: 14px;
  background: #0e1a22;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
  font-weight: 400;
  user-select: text;
  -webkit-user-select: text;
  touch-action: manipulation;
}
.login-field input::placeholder {
  color: #6e807a;
}
.login .primary {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  border-radius: 14px;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.login-error {
  margin: 0;
  color: #ffb6a9;
  font-size: 12.5px;
  line-height: 1.6;
}
.login-footer {
  display: grid;
  gap: 11px;
  padding-top: 16px;
  border-top: 1px solid #ffffff12;
}
.login-footer .secondary {
  width: 100%;
  min-height: 46px;
  margin: 0;
  border-radius: 12px;
}
.login-fine {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
  color: #8fa196;
}
.login-fine.warning {
  color: #e8cd93;
}
.account-line {
  display: grid;
  gap: 7px;
  margin: 6px 0 2px;
}
.account-line strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
body.login-open #topbar,
body.login-open #home {
  opacity: 0;
  pointer-events: none;
}
body.in-telegram #install {
  display: none;
}
@media (max-width: 620px) {
  .login-card {
    padding: 24px 22px 22px;
    gap: 14px;
    border-radius: 22px;
  }
  .login-lead {
    font-size: 12.5px;
  }
}
