.welcome[hidden], .welcome [hidden], #game[hidden] { display: none; }

.welcome {
  --ink: #eff4e5;
  --muted: #b8c9b5;
  --line: #466150;
  --action: #d8edaa;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: safe center;
  box-sizing: border-box;
  padding: clamp(20px, 5vh, 52px) 20px;
  overflow: auto;
  background:
    radial-gradient(ellipse at center, rgb(7 18 15 / .8) 0%, rgb(7 18 15 / .64) 34%, rgb(7 18 15 / .23) 80%),
    #0f1b16 url('welcome-coast.webp') center / cover no-repeat;
  image-rendering: pixelated;
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
}

.welcome-content { width: min(100%, 540px); text-align: center; }

.welcome h1 {
  margin: 0;
  color: #ffd540;
  font-family: 'Archivo Black', 'Arial Black', sans-serif;
  font-size: clamp(3.25rem, 11vmin, 6.75rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0.0625em 0.075em #060907;
}

.welcome h1 span { display: block; }

.welcome-description { margin: 16px 0 clamp(20px, 4vh, 32px); color: var(--ink); }

.entry-options, .entry-form, .entry-status { width: min(100%, 348px); margin-inline: auto; }
.entry-options, .entry-form { display: grid; gap: 10px; }
.entry-form { text-align: left; }
.entry-hint { margin-top: -6px; color: var(--ink); font-size: 12px; }
.welcome .character-form { width: min(100%, 468px); }
.character-form h2 { margin: 0; text-align: center; font-size: 1.3rem; }
#character-username:not([hidden]) { display: grid; gap: 7px; }
#character-username .entry-hint { margin-top: 0; }
.character-builder {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.character-display {
  display: grid;
  place-items: center;
  align-self: center;
  background: #122921;
  border: 1px solid #5c7152;
  border-radius: 6px;
}
.character-display canvas { width: 100%; max-width: 108px; height: auto; }
.character-options { display: grid; gap: 7px; }
.character-options fieldset { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; border: 0; min-width: 0; }
.character-options legend { padding: 0; margin-bottom: 2px; color: var(--ink); font-size: .78rem; }
.welcome .character-choice { min-height: 28px; padding: 3px 7px; font-size: .78rem; line-height: 1.3; }
.welcome .character-swatch { width: 28px; padding: 0; background: var(--swatch); border-color: rgb(255 255 255 / .38); }
.welcome .character-swatch:hover { background: var(--swatch); border-color: #fff; }
.welcome .character-choice[aria-pressed="true"] { outline: 2px solid #ffd540; outline-offset: 1px; }
.welcome .character-choice:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.welcome .character-choice[aria-pressed="true"]:focus-visible { box-shadow: inset 0 0 0 2px #ffd540; }
.entry-account-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.welcome button, .welcome input {
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #14231c;
  color: var(--ink);
  font: inherit;
}

.welcome button {
  min-height: 46px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 650;
}

.welcome button:hover { border-color: #94af91; background: #253b2c; }
.welcome button:disabled { opacity: 0.66; cursor: wait; }
.welcome button:focus-visible, .welcome input:focus-visible, .welcome a:focus-visible, #game-menu:focus-visible {
  outline: 2px solid #ecf7bd;
  outline-offset: 3px;
}

.welcome .entry-primary {
  min-height: 52px;
  border-color: var(--action);
  background: var(--action);
  color: #172515;
}

.welcome .entry-primary:hover { background: #e6f5c1; }
.welcome .entry-text { justify-self: center; min-height: 40px; border-color: transparent; background: transparent; color: var(--ink); }
.entry-confirmation h2 { margin: 0; font-size: 1.2rem; }
.entry-confirmation p { margin: 0; color: var(--muted); }
.entry-confirmation a { min-height: 0; font-size: 0.92rem; }
.entry-form label { display: grid; gap: 4px; font-size: 0.88rem; }
.welcome input { width: 100%; min-height: 44px; padding: 8px 10px; }
.entry-status { margin-top: 14px; color: var(--ink); font-size: 0.91rem; overflow-wrap: anywhere; }
.entry-status:empty { display: none; }
.entry-status[data-error] { color: #ffd3ba; }

@media (max-width: 600px) {
  .welcome { background-position: center, 56% center; }
  .welcome h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .character-builder { grid-template-columns: clamp(72px, 21vw, 96px) minmax(0, 1fr); gap: 10px; }
  .welcome .character-swatch { width: 25px; min-height: 25px; }
}
