:root {
  color-scheme: dark;
  font: 16px/1.5 "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  background: #111114;
  color: #f7efdf;
  --muted: #d4c8b8;
  --border: #615039;
  --gold: #f5d58e;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
main { width: min(100%, 72rem); margin: auto; padding: clamp(1rem, 4vw, 3rem); }
.entry-layout {
  min-height: 100svh;
  display: grid;
  align-content: center;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 27rem);
  gap: clamp(2rem, 7vw, 7rem);
}
body:has(.entry-layout) {
  background:
    linear-gradient(90deg, #11111418 8%, #11111430 47%, #111114bd 79%, #111114f2),
    linear-gradient(0deg, #111114b3, #11111400 31%, #11111420),
    #111114 url("/assets/v21-portal-heroes.webp") calc(50% - 13rem) top /
      max(calc(100vw + 26rem), 240svh) auto no-repeat;
}
.brand { display: grid; align-content: start; justify-items: center; }
.entry-layout .brand { padding-top: 3rem; align-content: center; }
.brand img { display: block; width: min(100%, 34rem); height: auto; filter: drop-shadow(0 6px 12px #0009); }
main:not(.entry-layout) .brand { justify-items: start; margin-bottom: 1.5rem; }
main:not(.entry-layout) .brand img { width: min(50vw, 15rem); }
.panel {
  background: #151518f5;
  border: 1px solid var(--border);
  border-radius: .9rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 20px 62px #0008;
  min-width: 0;
}
.account-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
  padding: .25rem;
  background: #0d0d10;
  border-radius: .6rem;
  margin-bottom: 1.4rem;
}
.account-nav button { border: 1px solid transparent; background: transparent; color: var(--muted); }
.account-nav button[aria-pressed="true"] { color: var(--gold); background: #2d241c; border-color: #715738; }
h1 { font-size: clamp(1.3rem, 3vw, 1.65rem); margin: 0; line-height: 1.3; }
p, small { color: var(--muted); margin: 0; }
#status { margin: .55rem 0 0; }
#status[data-kind="success"] { color: #ace5b7; }
#status[data-kind="error"] { color: #ffbeb0; }
form { margin: 1rem 0 0; display: grid; gap: .4rem; min-width: 0; }
label { font-weight: 600; margin-top: .45rem; }
.password-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.password-pair > div { display: grid; align-content: start; gap: .4rem; }
input {
  width: 100%;
  min-width: 0;
  font: inherit;
  padding: .65rem .8rem;
  border: 1px solid #776751;
  background: #0d0d10;
  border-radius: .45rem;
}
small { font-size: .8rem; line-height: 1.55; }
button, .actions a, .discord-link {
  font: inherit;
  font-weight: 650;
  padding: .62rem .85rem;
  border-radius: .45rem;
  cursor: pointer;
}
button { border: 1px solid #ffe2a1; background: #ebcb83; color: #20170e; }
button:hover:not(:disabled) { background: #f9df9f; color: #20170e; }
button:disabled { opacity: .62; cursor: default; }
form button { margin-top: .65rem; }
#choices { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .85rem; }
#choices:empty { display: none; }
#world { margin-top: 1rem; height: min(54vh, 31rem); min-height: 16rem; background: #304436; overflow: hidden; border-radius: .45rem; }
canvas { display: block; }
.actions { margin-top: 1rem; display: flex; gap: .55rem; flex-wrap: wrap; }
#movement-status, #benchmark-status { margin-top: .75rem; }
#movement-buttons { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.actions a, button.secondary, .discord-link { color: #f3eadc; background: #211e23; border: 1px solid #716575; }
.discord-link { display: flex; align-items: center; justify-content: center; gap: .55rem; margin-top: .7rem; text-decoration: none; }
.discord-link:hover { background: #352c43; border-color: #a68bb5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 760px) {
  .entry-layout { grid-template-columns: minmax(0, 27rem); justify-content: center; align-content: start; gap: 1.35rem; }
  .entry-layout .brand { padding-top: clamp(2rem, 14vw, 5rem); }
  .brand img { width: min(80vw, 21rem); }
  body:has(.entry-layout) {
    background: linear-gradient(180deg, #11111408, #111114a6 46%, #111114eb),
      #111114 url("/assets/v21-portal-heroes.webp") 63% top / max(64rem, 235svh) auto no-repeat;
  }
}
