:root {
  --bg: #d9ffd6;
  --panel: rgba(255, 251, 231, 0.94);
  --panel-soft: rgba(233, 255, 214, 0.96);
  --line: rgba(18, 53, 29, 0.28);
  --accent: #ffd65a;
  --green: #5fcb4d;
  --text: #12351d;
  --muted: #42604a;
  --deep: #12351d;
  --cream: #fffbe7;
  --button-shadow: 4px 4px 0 rgba(18, 53, 29, 0.2);
  --button-shadow-hover: 6px 6px 0 rgba(18, 53, 29, 0.24);
  --card-shadow: 8px 8px 0 rgba(18, 53, 29, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24) 25%, transparent 25% 50%, rgba(255, 255, 255, 0.18) 50% 75%, transparent 75%),
    linear-gradient(180deg, #dfffd1 0%, #8bdd69 58%, #62c84f 100%);
  background-size: 34px 34px, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header,
.nav-links,
.wallet-connect,
.wallet-identity,
.maps-panel-head,
.page-hero,
.table-actions {
  display: flex;
  align-items: center;
}

.site-header {
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  min-height: 82px;
  border-bottom: 4px solid rgba(18, 53, 29, 0.16);
  background: rgba(255, 251, 231, 0.92);
  box-shadow: 0 4px 0 rgba(18, 53, 29, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  border: 3px solid var(--deep);
  border-radius: 9px;
  background: url("/assets/gamegmeta-logo.png?v=chest-logo-20260618b") center / cover no-repeat;
  box-shadow: 3px 3px 0 rgba(18, 53, 29, 0.2);
}

.nav-links {
  gap: 8px;
}

.nav-links a {
  width: 126px;
}

.nav-links a,
.wallet-button,
.hero-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 3px solid var(--deep);
  border-radius: 18px;
  background: var(--cream);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--button-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.nav-links a:hover,
.wallet-button:hover,
.hero-button:hover,
.action-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--button-shadow-hover);
}

.wallet-connect {
  gap: 10px;
}

.wallet-identity {
  gap: 10px;
  min-height: 42px;
}

.wallet-connect[data-wallet-state="connected"] .wallet-identity {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}

.wallet-address {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  color: #d9eadf;
}

.wallet-connect[data-wallet-state="connected"] .wallet-address {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border: 3px solid var(--deep);
  border-radius: 14px;
  background: linear-gradient(180deg, #a7e957, #2e8f3e);
  max-width: 128px;
}

.wallet-connect[data-standard-state="connected"] .wallet-address {
  display: none;
}

.wallet-button[data-standard-connected="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-color: var(--deep);
  color: #f1fff0;
  background: linear-gradient(180deg, #a7e957, #2e8f3e);
}

.auth-login-avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(239, 247, 233, 0.16);
}

.auth-login-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0d1914;
  background: #eaf7e2;
  font-size: 12px;
  font-weight: 900;
}

.wallet-button {
  cursor: pointer;
}

.wallet-button[data-wallet-connected="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-color: var(--deep);
  color: #f1fff0;
  background: linear-gradient(180deg, #a7e957, #2e8f3e);
}

.wallet-button[data-wallet-connected="true"] svg {
  width: 22px;
  height: 22px;
}

.wallet-game-icon {
  display: block;
}

.wallet-game-icon-back,
.wallet-game-icon-front,
.wallet-game-icon-pocket {
  fill: none;
  stroke: #effff0;
  stroke-width: 1.8;
  shape-rendering: crispEdges;
}

.wallet-game-icon-dot {
  fill: #effff0;
  shape-rendering: crispEdges;
}

.wallet-coins {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 3px solid var(--deep);
  border-radius: 14px;
  color: var(--deep);
  font-size: 14px;
  font-weight: 800;
  background: var(--accent);
  box-shadow: var(--button-shadow);
}

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

.page-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.page-hero {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 26px 28px;
  border: 4px solid var(--deep);
  border-radius: 28px;
  background: rgba(255, 251, 231, 0.94);
  box-shadow: var(--card-shadow);
}

.kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: #7a5a00;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 0.95;
}

.page-hero p {
  margin-top: 12px;
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero-button {
  border-color: var(--deep);
  background: linear-gradient(180deg, #a7e957, #5fcb4d);
}

.maps-panel {
  padding: 24px 26px 28px;
  border: 4px solid var(--deep);
  border-radius: 24px;
  background: rgba(255, 251, 231, 0.94);
  box-shadow: var(--card-shadow);
}

.maps-panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.maps-panel-head strong {
  display: block;
  font-size: 20px;
}

#myMapsStatus {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state {
  padding: 28px 24px;
  border: 3px dashed rgba(18, 53, 29, 0.28);
  border-radius: 18px;
  background: rgba(233, 255, 214, 0.82);
}

.empty-state h2 {
  font-size: 22px;
}

.empty-state p {
  margin-top: 10px;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.7;
}

.table-wrap {
  overflow: auto;
  border: 3px solid var(--deep);
  border-radius: 18px;
}

.maps-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.maps-table th,
.maps-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(196, 213, 209, 0.12);
  text-align: left;
  vertical-align: middle;
}

.maps-table th {
  color: var(--deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #e9ffd6;
}

.maps-table tbody tr:nth-child(odd) {
  background: rgba(255, 251, 231, 0.86);
}

.maps-table tbody tr:nth-child(even) {
  background: rgba(233, 255, 214, 0.72);
}

.map-id {
  color: #42604a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.rank-table {
  min-width: 820px;
}

.rank-number {
  width: 72px;
  color: #7a5a00;
  font-size: 18px;
  font-weight: 950;
}

.rank-map-link {
  display: block;
  width: fit-content;
  color: var(--deep);
  font-size: 16px;
  font-weight: 950;
}

.rank-map-link:hover {
  color: #2e8f3e;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.rank-map-link + span {
  display: block;
  margin-top: 4px;
  color: #42604a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.rank-visits {
  color: var(--deep);
  font-weight: 950;
}

.rank-creator {
  max-width: 220px;
  overflow: hidden;
  color: #42604a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 3px solid var(--deep);
  border-radius: 14px;
  background: var(--cream);
  color: var(--deep);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.action-button.share {
  border-color: var(--deep);
  color: var(--deep);
  background: var(--accent);
}

.action-button.edit {
  border-color: rgba(139, 208, 92, 0.44);
}

.action-button.social {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.action-button.social svg {
  width: 15px;
  height: 15px;
  display: block;
}

.action-button.x-share {
  border-color: rgba(18, 53, 29, 0.18);
  background: var(--cream);
  color: var(--deep);
}

.action-button.telegram-share {
  border-color: rgba(73, 168, 236, 0.5);
  background: var(--cream);
  color: #66c7ff;
}

@media (max-width: 900px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
  }

  .brand {
    min-width: 0;
  }

  .nav-links {
    grid-column: 1 / -1;
    order: 3;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .nav-links a {
    width: 112px;
    min-width: 112px;
  }

  .wallet-connect {
    justify-content: flex-end;
    min-width: 0;
  }

  .page-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .page-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 16px;
  }
}

@media (max-width: 520px) {
  .site-header {
    min-height: 0;
  }

  .brand {
    font-size: 16px;
  }

  .wallet-coins,
  .wallet-address {
    display: none;
  }

  .page-hero {
    padding: 20px;
    border-radius: 22px;
  }

  .page-hero h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .hero-button {
    width: 100%;
  }

  .maps-panel {
    padding: 18px;
    border-radius: 22px;
  }
}
