/* ============================================================
   Wallet Gate — Cairn world style
   Warm paper, ink and clay. Playfair for voice, Lato for body,
   Indie Flower for hand-written notes — the same fonts the
   game itself ships in assets/game/fonts/.
   ============================================================ */

@font-face {
  font-family: "WGPlayfair";
  src: url("../assets/game/fonts/PlayfairDisplay-Regular.woff2") format("woff2"),
       url("../assets/game/fonts/PlayfairDisplay-Regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "WGLato";
  src: url("../assets/game/fonts/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "WGLato";
  src: url("../assets/game/fonts/Lato-Light.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "WGScript";
  src: url("../assets/game/fonts/indieflower-regular-webfont.woff2") format("woff2"),
       url("../assets/game/fonts/indieflower-regular-webfont.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

:root {
  --pd-paper: #f5f1e8;
  --pd-card: #fbf8f1;
  --pd-ink: #1d1a16;
  --pd-ink-75: rgba(29, 26, 22, 0.75);
  --pd-ink-60: rgba(29, 26, 22, 0.6);
  --pd-ink-45: rgba(29, 26, 22, 0.45);
  --pd-line: rgba(29, 26, 22, 0.16);
  --pd-clay: #b4643c;
  --pd-clay-soft: #c98a5e;
  --pd-moss: #3e7c4f;
  --pd-red: #b0402b;
  --pd-serif: "WGPlayfair", "Playfair Display", Georgia, serif;
  --pd-sans: "WGLato", "Lato", Arial, sans-serif;
  --pd-script: "WGScript", "Indie Flower", cursive;
}

/* original portfolio contact button stays hidden */
.ContactButton { display: none !important; }

/* ---------------- gate shell ---------------- */

#wg-gate {
  position: fixed;
  inset: 0;
  z-index: 999990;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background:
    radial-gradient(1100px 700px at 88% -8%, rgba(201, 138, 94, 0.16), transparent 62%),
    radial-gradient(900px 640px at -12% 34%, rgba(62, 124, 79, 0.07), transparent 55%),
    var(--pd-paper);
  color: var(--pd-ink);
  font-family: var(--pd-sans);
  -webkit-font-smoothing: antialiased;
  opacity: 1;
  transition: opacity 0.55s ease;
}
#wg-gate.wg-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0s 0.55s;
}
#wg-gate * { box-sizing: border-box; }
#wg-gate ::selection { background: var(--pd-clay); color: var(--pd-paper); }
#wg-gate::-webkit-scrollbar { width: 10px; }
#wg-gate::-webkit-scrollbar-track { background: transparent; }
#wg-gate::-webkit-scrollbar-thumb { background: rgba(29, 26, 22, 0.22); border-radius: 6px; }

#wg-gate button { font-family: var(--pd-sans); color: var(--pd-ink); }
#wg-gate button:disabled { opacity: 0.45; pointer-events: none; }

.wg-wrap { position: relative; }

/* ---------------- header ---------------- */

.wg-header {
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(245, 241, 232, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pd-line);
}
.wg-header-in {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
}
#wg-gate .wg-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--pd-serif);
  font-size: 19px;
  letter-spacing: 0.14em;
  color: var(--pd-ink);
  padding: 0;
}
.wg-logo-img { height: 38px; width: auto; display: block; }
.wg-nav { display: flex; gap: 24px; margin-left: auto; }
#wg-gate .wg-nav button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--pd-ink-60);
  padding: 6px 0;
  transition: color 0.2s ease;
}
#wg-gate .wg-nav button:hover { color: var(--pd-ink); }
.wg-x {
  width: 36px;
  height: 36px;
  border: 1px solid var(--pd-line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pd-ink);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex: none;
}
.wg-x:hover { background: var(--pd-ink); border-color: var(--pd-ink); color: var(--pd-paper); }

/* ---------------- buttons ---------------- */

#wg-gate .wg-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--pd-ink);
  background: transparent;
  color: var(--pd-ink);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease,
              transform 0.22s ease, box-shadow 0.22s ease;
}
#wg-gate .wg-btn i { font-style: normal; transition: transform 0.22s ease; }
#wg-gate .wg-btn:hover i { transform: translateX(3px); }
#wg-gate .wg-btn-play {
  background: var(--pd-ink);
  color: var(--pd-paper);
}
#wg-gate .wg-btn-play:hover {
  background: var(--pd-clay);
  border-color: var(--pd-clay);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(120, 70, 35, 0.25);
}
#wg-gate .wg-btn-ghost { border-color: rgba(29, 26, 22, 0.35); }
#wg-gate .wg-btn-ghost:hover { border-color: var(--pd-ink); }
#wg-gate .wg-header-play { padding: 10px 20px; font-size: 12px; }

/* ---------------- hero ---------------- */

.wg-hero {
  min-height: calc(100vh - 63px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 70px;
  position: relative;
  overflow: hidden;
}
/* soft painterly wash of game scenery behind the hero */
.wg-hero::before {
  content: "";
  position: absolute;
  inset: -60px;
  background:
    url("../assets/game/images/navigations/appletree.webp") left -80px bottom -120px / 620px auto no-repeat,
    url("../assets/game/images/navigations/lighthouse.webp") right -100px top -60px / 560px auto no-repeat;
  filter: blur(46px) saturate(1.1);
  opacity: 0.3;
  pointer-events: none;
}
.wg-hero > * { position: relative; }

/* polaroid snapshots of the world */
.wg-hero-scene { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.wg-polaroid {
  position: absolute;
  width: 190px;
  padding: 9px 9px 8px;
  background: #fffdf7;
  border: 1px solid var(--pd-line);
  border-radius: 6px;
  box-shadow: 0 16px 36px rgba(96, 72, 48, 0.18);
  margin: 0;
}
.wg-polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
}
.wg-polaroid figcaption {
  font-family: var(--pd-script);
  font-size: 17px;
  color: var(--pd-ink-60);
  text-align: center;
  padding-top: 5px;
}
.wg-pol-l { left: max(18px, calc(50% - 660px)); top: 16vh; transform: rotate(-5deg); }
.wg-pol-r { right: max(18px, calc(50% - 660px)); top: 12vh; transform: rotate(4deg); }
.wg-pol-b { right: max(30px, calc(50% - 630px)); bottom: 9vh; transform: rotate(-3deg); width: 165px; }
.wg-live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border: 1px solid var(--pd-line);
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.7);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--pd-ink-60);
}
.wg-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pd-clay);
  animation: wg-pulse 2s ease-in-out infinite;
  flex: none;
}
.wg-title {
  margin: 30px 0 0;
  font-family: var(--pd-serif);
  font-weight: 400;
  font-size: clamp(46px, 7.4vw, 92px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.wg-title span { display: block; }
.wg-t-lime { font-style: italic; color: var(--pd-clay); }
.wg-sub {
  margin: 26px auto 0;
  max-width: 620px;
  font-size: 16.5px;
  line-height: 1.68;
  color: var(--pd-ink-75);
  font-weight: 300;
}
.wg-sub b { font-weight: 400; color: var(--pd-ink); border-bottom: 1px solid rgba(180, 100, 60, 0.5); }
.wg-btns {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.wg-status { min-height: 22px; margin-top: 16px; font-size: 14px; color: var(--pd-ink-60); }
.wg-status.wg-ok { color: var(--pd-moss); }
.wg-status.wg-err { color: var(--pd-red); }
.wg-status a { color: var(--pd-clay); text-decoration: underline; }
.wg-chainpill {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 10px 22px;
  border: 1px solid var(--pd-line);
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--pd-ink-60);
}
.wg-chainpill b { color: var(--pd-ink); font-weight: 400; }
#wg-gate .wg-chainpill button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pd-clay);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wg-strip {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pd-ink-45);
}
.wg-strip i { font-style: normal; color: var(--pd-clay); padding: 0 7px; }
.wg-stats {
  margin-top: 54px;
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--pd-line);
}
.wg-stat { padding: 22px 12px 4px; }
.wg-stat:not(:last-child) { border-right: 1px solid var(--pd-line); }
.wg-stat-n { font-family: var(--pd-serif); font-size: clamp(30px, 4vw, 44px); line-height: 1; }
.wg-stat-l {
  margin-top: 8px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pd-ink-45);
}
.wg-scrollhint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  font-family: var(--pd-script);
  font-size: 18px;
  color: var(--pd-ink-60);
}
.wg-scrollhint span:last-child { animation: wg-bounce 2s ease-in-out infinite; }

/* ---------------- marquee ---------------- */

.wg-marquee {
  overflow: hidden;
  border-top: 1px solid var(--pd-line);
  border-bottom: 1px solid var(--pd-line);
  background: rgba(251, 248, 241, 0.65);
  padding: 15px 0;
}
.wg-marquee-track {
  display: inline-flex;
  gap: 36px;
  white-space: nowrap;
  width: max-content;
  animation: wg-scroll 32s linear infinite;
}
.wg-marquee-item {
  font-family: var(--pd-serif);
  font-style: italic;
  font-size: 19px;
  color: var(--pd-ink-60);
}

/* ---------------- sections ---------------- */

.wg-section { max-width: 1120px; margin: 0 auto; padding: 96px 24px 20px; }
.wg-eyebrow {
  font-family: var(--pd-script);
  font-size: 22px;
  color: var(--pd-clay);
  margin-bottom: 10px;
}
.wg-h2 {
  font-family: var(--pd-serif);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.12;
  margin: 0;
}
.wg-h2sub {
  margin-top: 12px;
  max-width: 560px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--pd-ink-60);
  font-weight: 300;
}

/* cards: steps + realms */

.wg-steps {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.wg-realms {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.wg-card,
.wg-realm {
  background: var(--pd-card);
  border: 1px solid var(--pd-line);
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 14px 34px rgba(96, 72, 48, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wg-card:hover,
.wg-realm:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 44px rgba(96, 72, 48, 0.11);
}
.wg-realm-pic {
  margin: -24px -22px 16px;
  border-bottom: 1px solid var(--pd-line);
  border-radius: 17px 17px 0 0;
  overflow: hidden;
}
.wg-realm-pic img {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.wg-realm:hover .wg-realm-pic img { transform: scale(1.045); }
.wg-step-num,
.wg-realm-role {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pd-clay);
}
.wg-card h3,
.wg-realm h3 {
  font-family: var(--pd-serif);
  font-weight: 400;
  font-size: 22px;
  margin: 10px 0 8px;
}
.wg-card p,
.wg-realm p {
  font-size: 14px;
  line-height: 1.62;
  color: var(--pd-ink-75);
  font-weight: 300;
  margin: 0;
}
.wg-realm-gate { background: var(--pd-ink); border-color: var(--pd-ink); }
.wg-realm-gate .wg-realm-role { color: var(--pd-clay-soft); }
.wg-realm-gate h3 { color: var(--pd-paper); }
.wg-realm-gate p { color: rgba(245, 241, 232, 0.72); }

/* network */

.wg-net {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: start;
}
.wg-net-info h3 { font-family: var(--pd-serif); font-weight: 400; font-size: 27px; margin: 0; }
.wg-net-info p {
  margin: 12px 0 22px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--pd-ink-75);
  font-weight: 300;
}
.wg-net-rows { border-top: 1px solid var(--pd-line); }
.wg-net-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--pd-line);
  font-size: 14px;
}
.wg-net-row b {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pd-ink-45);
  padding-top: 2px;
  flex: none;
}
.wg-net-row span { text-align: right; word-break: break-all; }
.wg-net-row a { color: var(--pd-clay); text-decoration: underline; text-underline-offset: 3px; }

/* faq */

.wg-faq { margin-top: 36px; max-width: 780px; border-top: 1px solid var(--pd-line); }
.wg-faq details { border-bottom: 1px solid var(--pd-line); }
.wg-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 2px;
  font-family: var(--pd-serif);
  font-size: 19px;
}
.wg-faq summary::-webkit-details-marker { display: none; }
.wg-faq summary::after {
  content: "+";
  font-family: var(--pd-sans);
  font-size: 21px;
  color: var(--pd-clay);
  transition: transform 0.25s ease;
  flex: none;
}
.wg-faq details[open] summary::after { transform: rotate(45deg); }
.wg-a {
  padding: 0 2px 20px;
  max-width: 640px;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--pd-ink-75);
  font-weight: 300;
}
.wg-a a { color: var(--pd-clay); text-decoration: underline; text-underline-offset: 3px; }

/* footer */

.wg-foot {
  margin-top: 80px;
  border-top: 1px solid var(--pd-line);
  padding: 28px 24px 36px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pd-ink-45);
}

/* ---------------- modal ---------------- */

.wg-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(29, 26, 22, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.wg-modal.wg-open { display: flex; animation: wg-fade 0.25s ease; }
.wg-modal-panel {
  width: min(430px, 94vw);
  background: var(--pd-paper);
  border: 1px solid var(--pd-line);
  border-radius: 22px;
  padding: 30px 28px 26px;
  position: relative;
  box-shadow: 0 30px 80px rgba(30, 20, 10, 0.35);
  animation: wg-rise 0.3s ease;
}
#wg-gate .wg-modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--pd-line);
  background: none;
  cursor: pointer;
  color: var(--pd-ink-60);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
#wg-gate .wg-modal-x:hover { background: var(--pd-ink); border-color: var(--pd-ink); color: var(--pd-paper); }
.wg-modal-title { font-family: var(--pd-serif); font-weight: 400; font-size: 27px; margin: 4px 0 6px; }
.wg-modal-sub { font-size: 14px; color: var(--pd-ink-60); font-weight: 300; margin: 0 0 18px; }
#wg-gate .wg-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-top: 10px;
  background: var(--pd-card);
  border: 1px solid var(--pd-line);
  border-radius: 14px;
  cursor: pointer;
  font-size: 15.5px;
  color: var(--pd-ink);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#wg-gate .wg-opt:hover {
  border-color: var(--pd-ink);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(96, 72, 48, 0.12);
}
#wg-gate .wg-opt i { margin-left: auto; font-style: normal; color: var(--pd-clay); transition: transform 0.2s ease; }
#wg-gate .wg-opt:hover i { transform: translateX(3px); }
.wg-wicon { width: 28px; height: 28px; border-radius: 8px; display: block; }
#wg-modal-status { margin-top: 14px; }

/* ---------------- HUD ---------------- */

#wg-hud {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1000001;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: rgba(245, 241, 232, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--pd-line);
  border-radius: 999px;
  font-family: var(--pd-sans);
  font-size: 13px;
  color: var(--pd-ink);
  box-shadow: 0 12px 30px rgba(50, 35, 20, 0.18);
}
#wg-hud.wg-show { display: flex; }
.wg-hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pd-moss);
  animation: wg-pulse 2s ease-in-out infinite;
  flex: none;
}
#wg-hud b { font-weight: 400; }
#wg-hud small {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pd-ink-45);
}
#wg-hud button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--pd-sans);
  font-size: 12.5px;
  color: var(--pd-clay);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- keyframes ---------------- */

@keyframes wg-scroll { to { transform: translateX(-50%); } }
@keyframes wg-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}
@keyframes wg-fade { from { opacity: 0; } }
@keyframes wg-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes wg-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------------- responsive ---------------- */

@media (max-width: 1020px) {
  .wg-steps { grid-template-columns: repeat(2, 1fr); }
  .wg-realms { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1150px) {
  .wg-polaroid { display: none; }
}
@media (max-width: 900px) {
  .wg-nav { display: none; }
  .wg-header-in { gap: 14px; }
}
@media (max-width: 640px) {
  .wg-hero { padding-top: 60px; }
  .wg-btns { flex-direction: column; width: 100%; }
  .wg-btns .wg-btn { width: 100%; justify-content: center; }
  .wg-stats { grid-template-columns: repeat(2, 1fr); }
  .wg-stat:not(:last-child) { border-right: none; }
  .wg-stat:nth-child(odd) { border-right: 1px solid var(--pd-line); }
  .wg-realms { grid-template-columns: 1fr; }
  .wg-net { grid-template-columns: 1fr; gap: 28px; }
  .wg-chainpill { flex-wrap: wrap; justify-content: center; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .wg-marquee-track, .wg-live-dot, .wg-hud-dot, .wg-scrollhint span:last-child { animation: none; }
}
