/*
 * Gunny On Chain — the login page and the world (server) choice.
 * Loaded after site.css, whose tokens, top bar, PLAY button, cursor and switches it reuses.
 */

/* ---------------- stage: the cover art, darkened toward the content ---------------- */
.auth {
  position: relative; min-height: 100vh; overflow: hidden;
  background: url("capa.jpg") center right / cover no-repeat;
}
.auth::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgb(28 10 36 / 78%) 0%, rgb(28 10 36 / 55%) 36%, rgb(28 10 36 / 5%) 62%);
}
.auth--worlds::before { background: rgb(22 10 30 / 72%); }
.auth::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 160px;
  background: linear-gradient(to bottom, rgb(28 14 36 / 0%), var(--night));
}
.auth-inner { position: relative; z-index: 2; }

/* the top bar on these pages is solid from the start and shows the logo */
.topbar--static .brand img { opacity: 1; }
.topbar--static nav a.is-quiet { font: 700 16px "Nunito", sans-serif; letter-spacing: 0; text-shadow: none; color: var(--cream-dim); }
.topbar--static nav a.is-quiet:hover { color: var(--gold-1); }
.who { margin-left: auto; font-weight: 700; font-size: 16px; color: var(--cream-dim); }
.who strong { color: var(--gold-1); }
.who + nav { margin-left: 0; }

/* ---------------- login ---------------- */
.auth--login .auth-inner {
  min-height: 100vh; width: min(52vw, 980px); padding: 92px 0 36px 4vw;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px;
}
.auth-logo { width: 340px; height: auto; filter: drop-shadow(0 12px 20px rgb(0 0 0 / 55%)); animation: drop-in 1s cubic-bezier(.2,1.4,.4,1) both; }

.card {
  width: 470px; padding: 22px 30px 22px;
  border: 5px solid var(--brown); border-radius: 26px;
  background: linear-gradient(to bottom, #fff0c4, #f4d488);
  box-shadow: 0 8px 0 var(--brown-2), 0 24px 44px rgb(0 0 0 / 55%);
  color: var(--brown);
  animation: rise .7s ease-out .3s both;
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; padding: 5px; border-radius: 999px; background: rgb(59 23 6 / 14%); }
.tab {
  padding: 9px 12px; border: 0; border-radius: 999px; background: none;
  font: 400 20px "Lilita One", sans-serif; letter-spacing: .4px; color: rgb(59 23 6 / 65%);
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--brown); }
.tab[aria-selected="true"] { background: var(--brown); color: var(--gold-1); box-shadow: 0 3px 0 rgb(0 0 0 / 25%); }
.tab:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; }

.form { display: grid; gap: 11px; }
.form[hidden] { display: none; }
.field { display: grid; gap: 5px; font-weight: 800; font-size: 15px; letter-spacing: .3px; }
.field input {
  width: 100%; padding: 11px 14px; border: 3px solid rgb(59 23 6 / 55%); border-radius: 14px;
  background: #fffaf0; color: var(--brown); font: 700 17px "Nunito", sans-serif;
  box-shadow: inset 0 2px 0 rgb(59 23 6 / 10%);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: rgb(59 23 6 / 38%); }
.field input:focus { outline: none; border-color: var(--gold-3); box-shadow: 0 0 0 4px rgb(255 178 28 / 35%); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.captcha { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.captcha img { display: block; height: 42px; width: auto; border-radius: 10px; border: 3px solid rgb(59 23 6 / 55%); background: #fff; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--brown);
  background: var(--gold-1); color: var(--brown); font: 400 22px/1 "Lilita One", sans-serif;
  box-shadow: 0 3px 0 var(--brown-2); transition: transform .12s;
}
.icon-btn:hover { transform: rotate(-90deg); }
.icon-btn:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; }

.form-msg { min-height: 1.4em; margin: -2px 0 -4px; font-weight: 800; font-size: 15px; color: #b3261e; text-align: center; }
.form-msg.is-ok { color: #2f6b23; }

.play--form { width: 100%; padding: 13px 20px 16px; font-size: 32px; -webkit-text-stroke-width: 5px; }
.play[disabled], .play[aria-busy="true"] { filter: grayscale(.5) brightness(.95); pointer-events: none; }
.fine { margin: 0; text-align: center; font-size: 14px; font-weight: 700; color: rgb(59 23 6 / 70%); }

body.wallet-page { min-width: 0; }
.wallet-card { display: grid; gap: 16px; text-align: center; }
.wallet-card h1 { margin: 0; font: 400 40px/1.05 "Lilita One", sans-serif; color: var(--brown); }
.wallet-intro { margin: 0; font-size: 17px; line-height: 1.5; }
.wallet-address { margin: 0; font-family: monospace; font-size: 17px; }
.wallet-connect { font-size: 27px; }
.wallet-switch { padding: 8px; border: 0; background: transparent; color: var(--brown); text-decoration: underline; font: 800 15px "Nunito", sans-serif; cursor: pointer; }
.wallet-switch:disabled { opacity: .5; cursor: wait; }
.wallet-note { margin: 0; padding-top: 12px; border-top: 1px solid rgb(59 23 6 / 20%); font-size: 12px; font-weight: 700; }
.wallet-card select { width: 100%; padding: 10px; border: 2px solid var(--brown); border-radius: 10px; background: #fffaf0; }
.wallet-card button:focus-visible { outline: 3px solid var(--brown); outline-offset: 4px; }
@media (max-width: 700px) {
  .auth--login .auth-inner { width: 100%; padding: 100px 18px 40px; }
  .auth--login .card { width: min(470px, 100%); padding: 24px 18px; }
  .auth-logo { width: min(300px, 85vw); }
  .wallet-card h1 { font-size: 34px; }
  .topbar--static nav { display: none; }
}

/* ---------------- world choice ---------------- */
body.worlds-page { min-width: 0; }
.auth--worlds .auth-inner { width: min(1180px, 92vw); margin: 0 auto; padding: 62px 0 90px; }
.worlds-lead { margin: 0 auto 38px; text-align: center; color: var(--cream-dim); font-size: 18px; }
.worlds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 26px; }
.world {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 24px;
  border: 5px solid var(--brown); border-radius: 26px;
  background: linear-gradient(to bottom, #fff0c4, #f4d488);
  box-shadow: 0 8px 0 var(--brown-2), 0 22px 40px rgb(0 0 0 / 50%);
  color: var(--brown);
  min-height: 430px;
  transition: box-shadow .15s ease;
}
.world:not(.is-closed):hover { box-shadow: 0 8px 0 var(--brown-2), 0 22px 40px rgb(0 0 0 / 50%), 0 0 36px rgb(255 190 40 / 35%); }
.world.is-closed { filter: grayscale(.7); opacity: .75; }

.world-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.world-name { margin: 0; font: 400 34px/1.05 "Lilita One", sans-serif; letter-spacing: .4px; color: var(--brown-2); overflow-wrap: anywhere; }
.pill { flex: none; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; }
.pill.open { background: #2f6b23; color: #d8f7c4; }
.pill.busy { background: #8a5a0a; color: #ffe9b0; }
.pill.full, .pill.down { background: #7a2323; color: #ffd0d0; }

.hero-line { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 18px; background: rgb(59 23 6 / 10%); }
/* the character, built from the same layer images the game draws (servers.aspx) */
.avatar {
  position: relative; flex: none; box-sizing: content-box; width: 136px; height: 170px;
  overflow: hidden; border-radius: 16px;
  border: 3px solid rgb(59 23 6 / 30%);
  background:
    radial-gradient(ellipse 55% 9% at 50% 93%, rgb(59 23 6 / 28%), transparent 70%),
    radial-gradient(circle at 50% 42%, #fffaf0 0 30%, transparent 70%),
    linear-gradient(to bottom, #ffeec2, #f3cf7c);
}
/* every layer is 250 x 312 art, shown whole (the box keeps that ratio, the weapon stands
   beside the character as in the game's bag view); some layers hold extra animation frames
   side by side, so they are sized by height and cropped to the first frame */
.avatar img { position: absolute; left: 0; top: 0; height: 100%; width: auto; max-width: none; }
.avatar.is-new { display: grid; place-items: center; font: 400 44px/1 "Lilita One", sans-serif; color: rgb(59 23 6 / 45%); }
.hero-text { display: grid; line-height: 1.25; min-width: 0; }
.hero-text small { font-weight: 800; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; opacity: .65; }
.hero-text strong { font-size: 21px; line-height: 1.1; font-family: "Lilita One", sans-serif; font-weight: 400; letter-spacing: .3px; overflow-wrap: anywhere; }
.level {
  justify-self: start; margin-top: 6px; padding: 2px 10px; border-radius: 999px;
  background: var(--brown); color: var(--gold-1); font-weight: 800; font-size: 13px; letter-spacing: .4px;
}
@keyframes hop { 40% { transform: translateY(-8px) } 70% { transform: translateY(0) } 85% { transform: translateY(-3px) } }

.world-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.world-balance { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 10px 0; border-top: 1px solid rgb(59 23 6 / 18%); }
.world-balance > span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; }
.world-balance img { display: block; flex: 0 0 20px; width: 20px; height: 20px; max-width: 20px; object-fit: contain; }
.world-balance strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.worlds-balance-note { margin: 28px auto 0; text-align: center; color: var(--cream-dim); font-size: 13px; }
.online { font-weight: 800; font-size: 15px; }
.online::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; background: #3fae2a; box-shadow: 0 0 0 3px rgb(63 174 42 / 25%); }
.is-closed .online::before { background: #9a8a7a; box-shadow: none; }
.world .play--small { padding: 8px 34px 10px; }
.world-closed-note { font-weight: 800; font-size: 15px; opacity: .8; }

.worlds-empty { padding: 30px; text-align: center; border-radius: 22px; background: rgb(0 0 0 / 30%); }

/* Static placeholders reserve the same world-card layout while balances load. */
.world--placeholder { pointer-events: none; }
.world-placeholder { display: block; border-radius: 7px; background: rgb(59 23 6 / 12%); }
.world-placeholder--name { width: 60%; height: 36px; }
.world-placeholder--pill { width: 64px; height: 26px; border-radius: 999px; }
.world-placeholder--line { width: 88px; max-width: 100%; height: 17px; }
.world-placeholder--level { width: 58px; max-width: 100%; height: 24px; border-radius: 999px; }
.world-placeholder--button { width: 124px; height: 51px; border-radius: 14px; }
.world--placeholder .hero-text { flex: 1; gap: 9px; }
.world--placeholder .world-balance { min-height: 44px; }
.world--placeholder .avatar { background: rgb(59 23 6 / 8%); }

@media (prefers-reduced-motion: reduce) {
  .auth-logo, .card, .world { animation: none; }
  .world:not(.is-closed):hover, .icon-btn:hover { transform: none; }
  .world:not(.is-closed):hover .avatar img { animation: none; }
}

/* Account pages enter in place, with room reserved while wallet sign-in starts. */
.wallet-page .auth-logo, .wallet-page .wallet-card { animation: none; }
.wallet-card { min-height: 402px; align-content: start; }
.wallet-card .form-msg { min-height: 24px; }

/* Intro, restored identity and the wallet picker share one fixed row. */
.wallet-context { height: 78px; min-width: 0; display: grid; align-content: center; justify-items: stretch; gap: 4px; }
.wallet-context .wallet-address { line-height: 26px; }
.wallet-context .wallet-switch { justify-self: center; padding: 4px 8px; min-height: 28px; line-height: 20px; }
.wallet-picker { position: relative; display: block; min-width: 0; }
.wallet-picker > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wallet-context select { height: 42px; padding: 7px 10px; }
