/* src/index.css */
* {
  box-sizing: border-box;
}

html, body, #root {
  overflow: hidden;
  background: #0a131a;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Press Start 2P", ui-monospace, Courier New, monospace;
}

.game-root {
  position: absolute;
  inset: 0;
}

.ca-chip {
  position: absolute;
  z-index: 11;
  display: inline-flex;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  text-decoration: none;
  white-space: nowrap;
  background: #0f17209e;
  border: 1px solid #ffffff29;
  border-radius: 18px;
  align-items:  center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  top: 104px;
  left: 50%;
  transform: translateX(-50%);
}

.ca-chip:hover {
  background: #0f1720d1;
}

.ca-chip-tick {
  color: #f5d76e;
  font-weight: 800;
}

.ca-chip-ca {
  opacity: .9;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
}

.home {
  position: absolute;
  z-index: 100;
  display: flex;
  pointer-events: auto;
  color: #fff;
  overflow-y: auto;
  flex-direction: column;
  align-items:  center;
  font-family: "Press Start 2P", ui-monospace, Courier New, monospace;
  inset: 0;
}

.home-veil {
  position: absolute;
  background: radial-gradient(120% 90% at 50% 0%, #08121a0f, #060e1447 70%), linear-gradient(#060e140d, #040a0e52);
  inset: 0;
}

.home-content {
  position: relative;
  text-align: center;
  animation: home-rise .6s cubic-bezier(.2, .7, .2, 1) both;
  max-width: 640px;
  margin: auto 0;
  padding: 24px 24px 56px;
}

@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-logo-img {
  display: block;
  filter: drop-shadow(0 6px 24px #f5d76e66);
  width: clamp(88px, 16vw, 140px);
  height: auto;
  margin: 0 auto 10px;
}

.home-kicker {
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f5d76e;
  opacity: .85;
  margin-bottom: 14px;
  font-size: 9px;
  line-height: 1.6;
}

.home-title {
  letter-spacing: clamp(1px, .4vw, 4px);
  background: linear-gradient(#fff6d8 0%, #f5d76e 55%, #c8932e 100%);
  color: #0000;
  filter: drop-shadow(0 4px 24px #f5d76e59);
  -webkit-background-clip: text;
  background-clip: text;
  margin: 0;
  font-size: clamp(26px, 6.5vw, 58px);
  font-weight: 400;
  line-height: 1.25;
}

.home-tagline {
  color: #cfe0e8;
  opacity: .9;
  max-width: 480px;
  margin: 18px auto 0;
  font-size: clamp(9px, 1.6vw, 11px);
  line-height: 1.9;
}

.token-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  max-width: 560px;
  margin: 22px auto 0;
}

.token-ticker {
  letter-spacing: 1px;
  color: #2a1d05;
  background: linear-gradient(#f7e08a, #e9b93f);
  border-radius: 9px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 400;
}

.token-ca {
  display: inline-flex;
  color: #fff;
  cursor: pointer;
  background: #ffffff14;
  border: 1px solid #fff3;
  border-radius: 9px;
  align-items:  center;
  gap: 8px;
  max-width: min(380px, 78vw);
  padding: 8px 11px;
  font-size: 9px;
  line-height: 1.5;
}

.token-ca:hover {
  background: #ffffff24;
}

.token-ca-label {
  color: #f5d76e;
  letter-spacing: 1px;
  font-weight: 800;
}

.token-ca-addr {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
}

.token-copy {
  opacity: .85;
}

.token-buy {
  color: #0b3b25;
  text-decoration: none;
  background: linear-gradient(#5fd0a0, #1f9e6e);
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 10px;
  font-weight: 400;
}

.token-buy:hover {
  filter: brightness(1.05);
}

.token-soon {
  color: #f5d76e;
  text-decoration: none;
  background: #f5d76e1f;
  border: 1px dashed #f5d76e80;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 400;
}

.home-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 82vw);
  margin: 28px auto 0;
}

.home-btn {
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  background: #ffffff14;
  border: 1px solid #ffffff2e;
  border-radius: 12px;
  width: 100%;
  padding: 14px 18px;
  transition: transform .12s, background .15s, border-color .15s;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

.home-btn:hover {
  background: #ffffff24;
  border-color: #ffffff52;
  transform: translateY(-1px);
}

.home-btn.primary {
  letter-spacing: 1px;
  color: #2a1d05;
  background: linear-gradient(#f7e08a, #e9b93f);
  border: none;
  padding: 16px 18px;
  font-size: 13px;
  box-shadow: 0 8px 24px #e9b93f59;
}

.home-btn.primary:hover {
  filter: brightness(1.05);
}

.home-btn.ghost {
  opacity: .85;
  background: none;
  font-size: 10px;
  font-weight: 600;
}

.portal-gate {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.home-btn.primary.locked {
  color: #f3e6c8;
  cursor: not-allowed;
  opacity: .95;
  background: linear-gradient(#3a4a55, #232f38);
  box-shadow: 0 8px 24px #0000004d;
}

.portal-req {
  color: #f4d77a;
  font-size: 10px;
  line-height: 1.6;
}

.portal-req b {
  color: #fff3cf;
}

.portal-bal {
  color: #ffffffb3;
  font-size: 9px;
  line-height: 1.5;
}

.portal-bal b {
  color: #fff;
}

.portal-ok {
  letter-spacing: .5px;
  color: #5fd0a0;
  font-size: 9px;
}

.portal-actions {
  display: flex;
  gap: 8px;
}

.portal-actions .home-btn {
  flex: 1;
}

.home-panel {
  text-align: left;
  backdrop-filter: blur(8px);
  background: #0a141c99;
  border: 1px solid #ffffff1f;
  border-radius: 14px;
  max-width: 520px;
  margin: 28px auto 0;
  padding: 20px 22px;
}

.home-panel h2 {
  color: #f5d76e;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
}

.home-panel p {
  color: #dbe7ed;
  margin: 0 0 14px;
  font-size: 10px;
  line-height: 2;
}

.home-panel ul {
  margin: 0 0 14px;
  padding-left: 18px;
}

.home-panel li {
  color: #dbe7ed;
  margin-bottom: 12px;
  font-size: 10px;
  line-height: 1.9;
}

.home-panel .home-btn {
  width: auto;
  padding: 11px 16px;
  font-size: 10px;
}

.home-muted {
  opacity: .6;
  font-size: 9px !important;
}

.x-corner-btn {
  position: fixed;
  z-index: 110;
  display: flex;
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(6px);
  background: #ffffff14;
  border: 1px solid #ffffff2e;
  border-radius: 12px;
  justify-content: center;
  align-items:  center;
  width: 42px;
  height: 42px;
  transition: background .15s, transform .12s;
  font-size: 20px;
  font-weight: 700;
  bottom: 16px;
  right: 16px;
}

.x-corner-btn:hover {
  background: #ffffff29;
  transform: translateY(-1px);
}

.home-footer {
  position: fixed;
  z-index: 110;
  letter-spacing: 1px;
  color: #ffffff73;
  font-size: 11px;
  bottom: 16px;
}

.hud {
  position: absolute;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 3px #0009;
  font-family: "Press Start 2P", ui-monospace, Courier New, monospace;
  inset: 0;
}

.hud-top {
  position: absolute;
  top: 18px;
  left: 22px;
}

.hud-title {
  letter-spacing: 2px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
}

.hud-zone {
  opacity: .9;
  letter-spacing: 1px;
  margin-top: 6px;
  font-size: 9px;
  line-height: 1.5;
}

.vitals {
  position: absolute;
  text-align: center;
  backdrop-filter: blur(8px);
  background: linear-gradient(#101821a8, #0a1017bd);
  border: 1px solid #f5d76e47;
  border-radius: 14px;
  width: 292px;
  padding: 11px 14px 12px;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 10px 28px #00000073, inset 0 1px #ffffff0d;
}

.vitals-name {
  letter-spacing: 1px;
  color: #f5d76e;
  margin-bottom: 9px;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.5;
}

.hp-bar {
  position: relative;
  overflow: hidden;
  background: #0000008c;
  border: 1px solid #f5d76e73;
  border-radius: 9px;
  height: 18px;
  box-shadow: inset 0 2px 5px #0009;
}

.hp-fill {
  position: absolute;
  background: linear-gradient(90deg, #e74c3c 0%, #f1c40f 50%, #2ecc71 100%);
  height: 100%;
  transition: width .2s;
  inset: 0 auto 0 0;
  box-shadow: inset 0 2px #ffffff47, inset 0 -3px 4px #0000004d;
}

.hp-text {
  position: absolute;
  z-index: 1;
  display: flex;
  letter-spacing: .5px;
  text-shadow: 0 1px 2px #000000e6;
  justify-content: center;
  align-items:  center;
  font-size: 8px;
  font-weight: 400;
  inset: 0;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 11px;
  font-size: 11px;
  font-weight: 400;
}

.stats span {
  display: inline-flex;
  background: #ffffff12;
  border: 1px solid #ffffff24;
  border-radius: 8px;
  align-items:  center;
  gap: 4px;
  padding: 4px 8px;
}

.toasts {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 6px;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
}

.toast {
  animation: toast-in .18s ease;
  background: #00000073;
  border: 1px solid #ffffff24;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.6;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-label {
  pointer-events: none;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 2px #000c;
  background: #00000080;
  border: 1px solid #fff3;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
}

.hud-controls {
  position: absolute;
  backdrop-filter: blur(6px);
  background: linear-gradient(#10182199, #0a1017ad);
  border: 1px solid #f5d76e33;
  border-radius: 12px;
  padding: 12px 16px;
  bottom: 22px;
  left: 22px;
  box-shadow: 0 8px 22px #0006;
}

.hud-row {
  display: flex;
  align-items:  center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 9px;
}

.hud-row:last-child {
  margin-bottom: 0;
}

.hud-row span {
  opacity: .85;
  margin-left: 6px;
}

kbd {
  display: inline-block;
  text-align: center;
  color: #1a1a1a;
  text-shadow: none;
  background: #f4f4f4;
  border: 1px solid #cfcfcf;
  border-radius: 5px;
  min-width: 24px;
  padding: 4px 7px;
  font-size: 9px;
  font-weight: 400;
  box-shadow: 0 2px #b9b9b9;
}

.craft {
  position: absolute;
  z-index: 10;
  pointer-events: auto;
  color: #fff;
  width: 260px;
  top: 74px;
  left: 22px;
}

.craft-toggle {
  color: #1a1a1a;
  cursor: pointer;
  background: linear-gradient(#f5d76e, #e6b800);
  border: none;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.craft-toggle:hover {
  filter: brightness(1.06);
}

.craft-body {
  overflow-y: auto;
  backdrop-filter: blur(6px);
  background: #0f1720a8;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
  max-height: 62vh;
  margin-top: 8px;
  padding: 10px 12px;
}

.craft-section {
  margin-bottom: 12px;
}

.craft-section h4 {
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .7;
  margin: 0 0 6px;
  font-size: 11px;
}

.mat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  font-size: 9px;
  line-height: 1.6;
}

.mat b {
  color: #f5d76e;
}

.item-chip {
  background: #ffffff1a;
  border: 1px solid #ffffff29;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 8px;
  line-height: 1.5;
}

.muted {
  opacity: .5;
  font-size: 8px;
  font-style: italic;
  line-height: 1.6;
}

.recipe {
  display: flex;
  border-top: 1px solid #ffffff14;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  padding: 7px 0;
}

.recipe-name {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
}

.recipe-cost {
  opacity: .75;
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.6;
}

.rarity {
  vertical-align: middle;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 7px;
  font-weight: 700;
}

.rarity.common {
  background: #5d6d7e;
}

.rarity.rare {
  background: #2980b9;
}

.rarity.epic {
  background: #8e44ad;
}

.rarity.mythic, .rarity.pusaka {
  color: #1a1a1a;
  background: #c0932e;
}

.recipe-btn {
  color: #1a1a1a;
  cursor: pointer;
  background: #f5d76e;
  border: none;
  border-radius: 7px;
  flex-shrink: 0;
  padding: 7px 11px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
}

.recipe-btn:hover {
  filter: brightness(1.06);
}

.recipe-btn:disabled {
  opacity: .4;
  cursor: default;
  background: #888;
}

.recipe-btn.mint {
  color: #fff;
  background: linear-gradient(#b07cf0, #8e44ad);
}

.onchain {
  display: flex;
  border-top: 1px solid #ffffff14;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  padding: 6px 0;
}

.onchain code {
  background: #ffffff1a;
  border-radius: 4px;
  padding: 2px 5px;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 8px;
}

.recipe-btn.sell, .recipe-btn.buy {
  color: #08231a;
  background: linear-gradient(#5fd0a0, #1f9e6e);
}

.recipe-btn.ghost-btn {
  color: #fff;
  background: none;
  border: 1px solid #ffffff4d;
}

.listed-badge {
  color: #f1c40f;
  border: 1px solid #f1c40f80;
  border-radius: 6px;
  flex-shrink: 0;
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
}

.market {
  position: absolute;
  z-index: 10;
  pointer-events: auto;
  color: #fff;
  text-align: right;
  width: 290px;
  top: 168px;
  right: 18px;
}

.market-toggle {
  color: #08231a;
  cursor: pointer;
  background: linear-gradient(#5fd0a0, #1f9e6e);
  border: none;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.market-toggle:hover {
  filter: brightness(1.06);
}

.market-body {
  overflow-y: auto;
  text-align: left;
  backdrop-filter: blur(6px);
  background: #0f1720a8;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
  max-height: 44vh;
  margin-top: 8px;
  padding: 10px 12px;
}

.listing {
  display: flex;
  border-top: 1px solid #ffffff14;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  padding: 7px 0;
}

.listing:first-child {
  border-top: none;
}

.name-tag {
  pointer-events: none;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 2px #000c;
  background: #00000080;
  border: 1px solid #ffffff2e;
  border-radius: 7px;
  padding: 2px 8px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
}

.chat {
  position: absolute;
  z-index: 10;
  display: flex;
  backdrop-filter: blur(6px);
  color: #fff;
  pointer-events: auto;
  background: #0f172099;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
  flex-direction: column;
  gap: 6px;
  width: 300px;
  padding: 10px 12px;
  bottom: 18px;
  right: 18px;
}

.chat-head {
  display: flex;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .85;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  align-items:  center;
  gap: 7px;
  width: 100%;
  padding: 0;
  font-size: 11px;
}

.chat-caret {
  opacity: .8;
  margin-left: auto;
}

.chat-icon {
  display: none;
}

.chat.closed {
  gap: 0;
  width: auto;
}

.chat-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 150px;
  padding-right: 4px;
  font-size: 9px;
  line-height: 1.7;
}

.chat-empty {
  opacity: .45;
  font-style: italic;
}

.chat-msg b {
  color: #f5d76e;
}

.chat-msg.system {
  opacity: .7;
  font-size: 8px;
}

.chat input {
  color: #fff;
  outline: none;
  background: #00000059;
  border: 1px solid #ffffff2e;
  border-radius: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 9px;
}

.chat input:focus {
  border-color: #f5d76e;
}

.wallet-panel {
  position: absolute;
  z-index: 10;
  backdrop-filter: blur(6px);
  color: #fff;
  text-shadow: none;
  pointer-events: auto;
  background: #0f17209e;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
  min-width: 200px;
  padding: 12px 14px;
  font-size: 10px;
  line-height: 1.6;
  top: 18px;
  right: 18px;
}

.wallet-net {
  display: flex;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .8;
  align-items:  center;
  gap: 7px;
  margin-bottom: 9px;
  font-size: 11px;
}

.net-dot {
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.net-dot.local {
  background: #f1c40f;
  box-shadow: 0 0 6px #f1c40f;
}

.net-dot.main {
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}

.wallet-btn {
  color: #1a1a1a;
  cursor: pointer;
  background: linear-gradient(#f5d76e, #e6b800);
  border: none;
  border-radius: 9px;
  width: 100%;
  padding: 9px 12px;
  transition: filter .15s;
  font-size: 10px;
  font-weight: 700;
}

.wallet-btn:hover {
  filter: brightness(1.06);
}

.wallet-btn:disabled {
  opacity: .6;
  cursor: default;
}

.wallet-row {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  margin-bottom: 6px;
}

.wallet-label {
  opacity: .65;
  font-size: 9px;
}

.wallet-addr {
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-weight: 600;
}

.wallet-balance {
  color: #f5d76e;
  font-weight: 700;
}

.wallet-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.wallet-mini {
  color: #fff;
  cursor: pointer;
  background: #ffffff1f;
  border: 1px solid #ffffff2e;
  border-radius: 7px;
  flex: 1;
  padding: 7px 8px;
  font-size: 9px;
  font-weight: 600;
}

.wallet-mini:hover {
  background: #fff3;
}

.wallet-mini.ghost {
  background: none;
}

.wallet-mini:disabled {
  opacity: .5;
  cursor: default;
}

.craft-body, .market-body, .chat, .wallet-panel {
  backdrop-filter: blur(11px) saturate(1.1);
  background: linear-gradient(#101821c7, #0a1017d1);
  border: 1px solid #f5d76e38;
  border-radius: 14px;
  box-shadow: 0 12px 34px #00000080, inset 0 1px #ffffff0f;
}

.craft-toggle, .market-toggle, .wallet-btn, .craft-section h4, .chat-head, .wallet-net {
  font-family: "Press Start 2P", ui-monospace, Courier New, monospace;
  font-weight: 400;
}

.craft-toggle, .market-toggle, .wallet-btn {
  letter-spacing: .5px;
  font-size: 10px;
  line-height: 1.5;
  box-shadow: 0 4px 14px #00000059;
}

.craft-section h4, .chat-head, .wallet-net {
  font-size: 8px;
  line-height: 1.6;
}

.craft-toggle:hover, .market-toggle:hover, .wallet-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.move-zone {
  position: fixed;
  z-index: 6;
  display: none;
  pointer-events: auto;
  touch-action: none;
  inset: 0;
}

.joystick {
  position: fixed;
  pointer-events: none;
  background: radial-gradient(circle, #ffffff1f, #ffffff0a);
  border: 2px solid #ffffff40;
  border-radius: 50%;
  width: 132px;
  height: 132px;
  margin: 0;
  transform: translate(-50%, -50%);
}

.joystick-knob {
  position: absolute;
  background: #f5d76ed9;
  border: 2px solid #fff9;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 10px #0006;
}

.attack-btn {
  position: fixed;
  z-index: 111;
  display: none;
  color: #fff;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  background: radial-gradient(circle at 35% 30%, #e0564a, #b0271c);
  border: 2px solid #ffffff59;
  border-radius: 50%;
  width: 78px;
  height: 78px;
  font-size: 30px;
  bottom: 34px;
  right: 26px;
  box-shadow: 0 4px 16px #00000073;
}

.attack-btn:active {
  transform: scale(.92);
}

@media (pointer: coarse) {
  .move-zone, .attack-btn {
    display: block;
  }

  .hud-controls {
    display: none;
  }
}

.rotate-gate {
  display: none;
  position: fixed;
  z-index: 9999;
  text-align: center;
  color: #fff;
  background: radial-gradient(120% 90% at 50% 30%, #14241b 0%, #07110b 72%), #06100b;
  justify-content: center;
  align-items:  center;
  padding: 32px;
  font-family: "Press Start 2P", ui-monospace, Courier New, monospace;
  inset: 0;
}

@media (orientation: portrait) and (pointer: coarse) {
  .rotate-gate {
    display: flex;
  }
}

.rotate-inner {
  max-width: 320px;
}

.rotate-phone {
  animation: rotate-hint 1.8s ease-in-out infinite;
  font-size: 64px;
  line-height: 1;
}

@keyframes rotate-hint {
  0%, 15% {
    transform: rotate(0);
  }

  55%, 100% {
    transform: rotate(-90deg);
  }
}

.rotate-title {
  letter-spacing: 1px;
  color: #f5d76e;
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.5;
}

.rotate-text {
  color: #cfe0e8;
  opacity: .85;
  margin-top: 16px;
  font-size: 9px;
  line-height: 1.9;
}

@media (prefers-reduced-motion: reduce) {
  .rotate-phone {
    animation: none;
  }
}

@media (width <= 768px) {
  .hud-top {
    top: calc(12px + env(safe-area-inset-top));
    left: calc(14px + env(safe-area-inset-left));
  }

  .hud-title {
    letter-spacing: 1px;
    font-size: 13px;
  }

  .hud-zone {
    font-size: 8px;
  }

  .vitals {
    top: calc(54px + env(safe-area-inset-top));
    left: calc(14px + env(safe-area-inset-left));
    width: min(44vw, 170px);
    transform: none;
  }

  .vitals-name {
    display: none;
  }

  .hp-bar {
    height: 16px;
  }

  .hp-text {
    font-size: 10px;
  }

  .stats {
    gap: 10px;
    margin-top: 5px;
    font-size: 12px;
  }

  .wallet-panel {
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    min-width: 138px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .craft {
    top: calc(106px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
    width: min(70vw, 230px);
  }

  .craft-body {
    max-height: 46vh;
  }

  .market {
    top: calc(150px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    width: min(72vw, 250px);
  }

  .market-body {
    max-height: 36vh;
  }

  .toasts {
    top: calc(150px + env(safe-area-inset-top));
  }

  .ca-chip {
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 9;
    padding: 4px 10px;
    font-size: 11px;
    left: 50%;
    transform: translateX(-50%);
  }

  .chat.closed {
    left: 50%;
    right: auto;
    bottom: calc(56px + env(safe-area-inset-bottom));
    overflow: hidden;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    transform: translateX(-50%);
  }

  .chat.closed .chat-head {
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .chat.closed .chat-icon {
    display: inline;
    font-size: 19px;
  }

  .chat.closed .net-dot, .chat.closed .chat-label, .chat.closed .chat-caret {
    display: none;
  }

  .chat.open {
    left: 50%;
    right: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(82vw, 300px);
    transform: translateX(-50%);
  }

  .chat.open .chat-list {
    height: 96px;
  }

  .attack-btn {
    right: calc(24px + env(safe-area-inset-right));
    bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .home-menu {
    width: min(300px, 86vw);
  }
}

@media (orientation: landscape) and (pointer: coarse) and (height <= 600px) {
  .hud-top {
    top: calc(10px + env(safe-area-inset-top));
    left: calc(14px + env(safe-area-inset-left));
  }

  .hud-title {
    letter-spacing: 1px;
    font-size: 13px;
  }

  .hud-zone {
    font-size: 8px;
  }

  .vitals {
    top: calc(10px + env(safe-area-inset-top));
    text-align: center;
    width: 200px;
    left: 50%;
    transform: translateX(-50%);
  }

  .vitals-name {
    display: none;
  }

  .hp-bar {
    height: 16px;
  }

  .hp-text {
    font-size: 10px;
  }

  .stats {
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
  }

  .craft {
    top: calc(58px + env(safe-area-inset-top));
    left: calc(14px + env(safe-area-inset-left));
    width: min(40vw, 230px);
  }

  .craft-body {
    max-height: 52vh;
  }

  .wallet-panel {
    top: calc(10px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    min-width: 138px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .market {
    top: calc(96px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    width: min(40vw, 250px);
  }

  .market-body {
    max-height: 40vh;
  }

  .toasts {
    top: calc(64px + env(safe-area-inset-top));
  }

  .ca-chip {
    top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 9;
    padding: 4px 10px;
    font-size: 11px;
    left: 50%;
    transform: translateX(-50%);
  }

  .chat.closed {
    left: 50%;
    right: auto;
    bottom: calc(48px + env(safe-area-inset-bottom));
    overflow: hidden;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    transform: translateX(-50%);
  }

  .chat.closed .chat-head {
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .chat.closed .chat-icon {
    display: inline;
    font-size: 19px;
  }

  .chat.closed .net-dot, .chat.closed .chat-label, .chat.closed .chat-caret {
    display: none;
  }

  .chat.open {
    left: 50%;
    right: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: min(60vw, 300px);
    transform: translateX(-50%);
  }

  .chat.open .chat-list {
    height: 72px;
  }

  .attack-btn {
    right: calc(20px + env(safe-area-inset-right));
    bottom: calc(20px + env(safe-area-inset-bottom));
    width: 68px;
    height: 68px;
  }
}

.home-embers {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  inset: 0;
}

.home-embers span {
  position: absolute;
  bottom: -12px;
  left: calc((var(--i) * 7%)  + 3%);
  opacity: 0;
  animation: ember-rise calc(7s + (var(--i) * .6s)) linear infinite;
  animation-delay: calc(var(--i) * -.9s);
  background: #f5d76e;
  border-radius: 50%;
  width: 4px;
  height: 4px;
  box-shadow: 0 0 8px 2px #f5d76eb3;
}

@keyframes ember-rise {
  0% {
    transform: translateY(0)translateX(0);
    opacity: 0;
  }

  12% {
    opacity: .8;
  }

  80% {
    opacity: .5;
  }

  100% {
    transform: translateY(-92vh)translateX(18px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-embers {
    display: none;
  }
}

.home-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
}

.home-badge {
  color: #f5d76e;
  letter-spacing: .5px;
  background: #f5d76e14;
  border: 1px solid #f5d76e66;
  border-radius: 999px;
  padding: 7px 11px;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 7px;
  line-height: 1.5;
}

.home-menu-row {
  display: flex;
  gap: 12px;
}

.home-menu-row .home-btn {
  flex: 1;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: min(440px, 86vw);
  margin: 22px auto 0;
}

.feature-card {
  text-align: left;
  background: linear-gradient(#101821b3, #0a1017c7);
  border: 1px solid #f5d76e2e;
  border-radius: 12px;
  padding: 12px 13px;
  box-shadow: inset 0 1px #ffffff0d;
}

.feature-ico {
  font-size: 20px;
  line-height: 1;
}

.feature-title {
  color: #f5d76e;
  margin: 8px 0 6px;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 9px;
  line-height: 1.5;
}

.feature-desc {
  color: #cfe0e8;
  opacity: .82;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 8px;
  line-height: 1.7;
}

.home-settings {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.setting-pill {
  color: #cfe0e8;
  cursor: pointer;
  background: #ffffff0f;
  border: 1px solid #ffffff2e;
  border-radius: 999px;
  padding: 9px 13px;
  transition: background .15s, border-color .15s;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 8px;
  line-height: 1.5;
}

.setting-pill:hover {
  background: #ffffff1f;
  border-color: #f5d76e80;
}

@media (width <= 520px) {
  .home-features {
    grid-template-columns: 1fr;
    width: min(340px, 88vw);
  }
}

.dmg-num {
  pointer-events: none;
  user-select: none;
  color: #ffe7a0;
  text-shadow: 0 2px 4px #000000e6, 0 0 6px #ffb43c99;
  animation: dmg-float .65s ease-out forwards;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 11px;
}

@keyframes dmg-float {
  0% {
    transform: translateY(0)scale(.7);
    opacity: 0;
  }

  20% {
    transform: translateY(-6px)scale(1.1);
    opacity: 1;
  }

  100% {
    transform: translateY(-34px)scale(1);
    opacity: 0;
  }
}

.dmg-num.crit {
  color: #ff5a3c;
  text-shadow: 0 2px 5px #000000f2, 0 0 10px #ff5a28cc;
  animation: dmg-crit .7s ease-out forwards;
  font-size: 16px;
}

@keyframes dmg-crit {
  0% {
    transform: translateY(0)scale(.6)rotate(-6deg);
    opacity: 0;
  }

  18% {
    transform: translateY(-8px)scale(1.5)rotate(3deg);
    opacity: 1;
  }

  40% {
    transform: translateY(-14px)scale(1.15)rotate(0);
  }

  100% {
    transform: translateY(-42px)scale(1.1);
    opacity: 0;
  }
}

.boot {
  position: absolute;
  z-index: 1000;
  display: flex;
  opacity: 1;
  background: radial-gradient(120% 90% at 50% 30%, #14241b 0%, #07110b 70%), #06100b;
  justify-content: center;
  align-items:  center;
  transition: opacity .45s;
  inset: 0;
}

.boot-out {
  opacity: 0;
  pointer-events: none;
}

.boot-inner {
  text-align: center;
  max-width: 420px;
  padding: 24px;
}

.boot-logo {
  filter: drop-shadow(0 6px 24px #f5d76e66);
  animation: boot-pulse 1.8s ease-in-out infinite;
  width: clamp(76px, 14vw, 112px);
  height: auto;
}

@keyframes boot-pulse {
  0%, 100% {
    transform: translateY(0)scale(1);
  }

  50% {
    transform: translateY(-5px)scale(1.03);
  }
}

.boot-title {
  letter-spacing: 2px;
  background: linear-gradient(#fff6d8 0%, #f5d76e 55%, #c8932e 100%);
  color: #0000;
  -webkit-background-clip: text;
  background-clip: text;
  margin: 18px 0 8px;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: clamp(20px, 5vw, 34px);
  line-height: 1.3;
}

.boot-kicker {
  letter-spacing: 2px;
  color: #f5d76e;
  opacity: .8;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 8px;
}

.boot-bar {
  overflow: hidden;
  background: #ffffff14;
  border: 1px solid #f5d76e4d;
  border-radius: 999px;
  width: min(280px, 70vw);
  height: 10px;
  margin: 22px auto 12px;
}

.boot-fill {
  background: linear-gradient(90deg, #c8932e, #f5d76e);
  border-radius: 999px;
  height: 100%;
  transition: width .18s;
  box-shadow: 0 0 10px #f5d76e99;
}

.boot-tip {
  color: #cfe0e8;
  opacity: .7;
  min-height: 18px;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 8px;
  line-height: 1.7;
}

.minimap {
  position: absolute;
  z-index: 10;
  pointer-events: auto;
  text-align: center;
  width: 128px;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.minimap-label {
  letter-spacing: .5px;
  color: #f5d76e;
  text-shadow: 0 1px 3px #000c;
  margin-bottom: 6px;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 7px;
  line-height: 1.5;
}

.minimap-canvas {
  background: radial-gradient(circle, #101c16d1, #060e0ae6);
  border: 2px solid #f5d76e59;
  border-radius: 50%;
  width: 128px;
  height: 128px;
  box-shadow: 0 8px 24px #00000080, inset 0 0 18px #0009;
}

.minimap-legend {
  display: flex;
  color: #cfe0e8;
  text-shadow: 0 1px 2px #000c;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 9px;
  margin-top: 7px;
  font-size: 9px;
}

.minimap-legend span {
  display: inline-flex;
  align-items:  center;
  gap: 4px;
}

.minimap-legend i {
  display: inline-block;
  border-radius: 50%;
  width: 7px;
  height: 7px;
}

@media (width <= 768px), (pointer: coarse) {
  .minimap {
    display: none;
  }
}

.boss-banner {
  position: absolute;
  z-index: 60;
  pointer-events: none;
  letter-spacing: 3px;
  text-align: center;
  background: linear-gradient(#fff6d8 0%, #f5d76e 55%, #c8932e 100%);
  color: #0000;
  filter: drop-shadow(0 4px 18px #f5d76e99);
  animation: boss-banner 2.4s ease-out forwards;
  -webkit-background-clip: text;
  background-clip: text;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: clamp(18px, 4.5vw, 38px);
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes boss-banner {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%)scale(.6);
  }

  14% {
    opacity: 1;
    transform: translate(-50%, -50%)scale(1.08);
  }

  26% {
    transform: translate(-50%, -50%)scale(1);
  }

  78% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -54%)scale(1);
  }
}

.toast.rare {
  color: #fff6d8;
  animation: rare-pulse .9s ease-in-out infinite alternate;
  background: linear-gradient(#503c10b3, #281e08b8);
  border-color: #f5d76ed9;
  box-shadow: 0 0 16px #f5d76e8c;
}

@keyframes rare-pulse {
  from {
    box-shadow: 0 0 10px #f5d76e66;
  }

  to {
    box-shadow: 0 0 22px #f5d76ecc;
  }
}

.loot-flash {
  position: fixed;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  animation: loot-flash .7s ease-out forwards;
  background: radial-gradient(circle at 50% 55%, #f5d76e73 0%, #f5d76e00 60%);
  inset: 0;
}

@keyframes loot-flash {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.portal-compass {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  inset: 0;
}

.pc-marker {
  position: absolute;
  display: flex;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  opacity: 0;
  background: #060e0a9e;
  border: 1px solid;
  border-radius: 999px;
  align-items:  center;
  gap: 6px;
  padding: 5px 10px;
  transition: opacity .35s;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 7px;
  line-height: 1.4;
  top: 50%;
  left: 50%;
  box-shadow: 0 2px 10px #00000073;
}

.pc-arrow {
  display: inline-block;
  font-size: 11px;
}

.pc-label {
  color: #eaf2ee;
}

.pc-dist {
  color: #eaf2ee;
  opacity: .65;
}

@media (width <= 520px) {
  .pc-label {
    display: none;
  }
}

.zone-fade {
  position: absolute;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  animation: zone-flash .78s ease forwards;
  background: radial-gradient(120% 90% at 50% 45%, #0b1a12 0%, #06100b 75%);
  inset: 0;
}

@keyframes zone-flash {
  0% {
    opacity: 0;
  }

  32% {
    opacity: .94;
  }

  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zone-fade {
    animation-duration: .3s;
  }
}

.zone-flash {
  position: absolute;
  opacity: 0;
  animation: zone-flash-glow .6s ease-out forwards;
  background: radial-gradient(circle, #f5d76ed9 0%, #f5d76e00 55%);
  inset: 0;
}

@keyframes zone-flash-glow {
  0% {
    opacity: 0;
    transform: scale(.6);
  }

  22% {
    opacity: .9;
  }

  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}
