.character-create { flex: 1; min-height: 0; overflow-y: auto; background: radial-gradient(ellipse at 30% 40%, color-mix(in srgb, var(--hud-title) 7%, transparent), transparent 60%), var(--hud-bg); color: var(--hud-text); padding: 12px 24px 32px; }
.character-create-card { display: grid; grid-template-columns: minmax(270px, .85fr) minmax(420px, 1.15fr); max-width: 1050px; margin: clamp(18px, 4vh, 48px) auto 20px; border: 1px solid var(--hud-frame); border-radius: 14px; overflow: hidden; background: var(--hud-bg-2); box-shadow: 0 20px 60px color-mix(in srgb, var(--hud-bg) 70%, transparent); }
.character-create-art { position: relative; min-height: 640px; overflow: hidden; margin: 0; }
.character-create-art > div { position: absolute; inset: 0; }
.character-create-art__image { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.character-create-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, var(--hud-bg), color-mix(in srgb, var(--hud-bg) 80%, transparent) 12%, transparent 50%); }
.character-create-art figcaption { position: absolute; z-index: 1; bottom: 28px; left: 28px; right: 28px; text-align: center; }
.character-create-eyebrow { color: var(--hud-title); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; line-height: 1.6; }
.character-create-wordmark { display: block; width: min(260px, 100%); height: auto; margin: 6px auto; }
.character-create-art figcaption > p:last-child { font-size: 12px; line-height: 1.7; color: var(--hud-text); max-width: 310px; margin-inline: auto; }
.character-create-form { display: flex; flex-direction: column; gap: 25px; padding: 40px 38px 32px; min-width: 0; justify-content: center; }
.character-create-form h1 { font-size: clamp(24px, 2.7vw, 32px); line-height: 1.2; color: var(--hud-title); font-weight: 600; margin: 8px 0 10px; letter-spacing: -.025em; }
.character-create-intro { color: var(--hud-text-dim); font-size: 13px; line-height: 1.7; }
.character-create-name > label { display: block; color: var(--hud-text); font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.character-create-name__input { width: 100%; font-size: 20px; min-height: 52px; padding: 12px 14px; }
.character-create-status { min-height: 36px; font-size: 11px; line-height: 1.7; margin-top: 9px; }
.character-create-appearance { display: grid; grid-template-columns: minmax(170px, 1fr) 1fr; align-items: center; gap: 18px; border-top: 1px solid var(--hud-frame); padding-top: 12px; }
.character-create-stage { position: relative; width: 100%; height: 252px; overflow: hidden; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--hud-title) 10%, transparent), transparent 65%); }
.character-create-stage__floor { position: absolute; bottom: 38px; left: 15%; right: 15%; height: 24px; border: 1px solid color-mix(in srgb, var(--hud-title) 30%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--hud-title) 5%, transparent); box-shadow: 0 8px 20px color-mix(in srgb, var(--hud-bg) 65%, transparent); }
.character-create-preview { position: absolute; top: 0; bottom: 36px; width: 100%; }
.character-create-preview canvas { display: block; width: 100%; height: 100%; object-fit: contain; position: relative; opacity: 0; }
.character-create-preview.is-ready canvas { opacity: 1; }
.character-create-preview__fallback { position: absolute; width: 100%; height: 100%; }
.character-create-preview.is-ready .character-create-preview__fallback { display: none; }
.character-create-motion { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; align-items: center; border: 0; background: transparent; color: var(--hud-text-dim); font-size: 10px; white-space: nowrap; cursor: pointer; padding: 7px; }
.character-create-motion[hidden] { display: none; }
.character-create-motion:disabled { cursor: default; opacity: .6; }
.character-create-options { min-width: 0; }
.character-create-options h2 { color: var(--hud-text); font-size: 15px; font-weight: 500; line-height: 1.5; margin: 8px 0 14px; }
.character-create-options > p:last-child { font-size: 11px; line-height: 1.7; color: var(--hud-text-dim); margin-top: 14px; }
.character-create-options [role=group] { display: flex; width: fit-content; border-color: var(--hud-frame); }
.character-create-options [role=group] button { padding: 8px 12px; font-size: 12px; }
.character-create-actions { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--hud-frame); padding-top: 24px; }
.character-create-actions .hud-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 1000px) {
  .character-create { padding-inline: 16px; }
  .character-create-card { grid-template-columns: minmax(220px, .75fr) minmax(380px, 1.25fr); }
  .character-create-form { padding: 30px 26px; gap: 20px; }
}
@media (max-width: 760px) {
  .character-create-card { display: flex; flex-direction: column; max-width: 520px; margin-top: 14px; }
  .character-create-art { min-height: 185px; height: 185px; }
  .character-create-art__image { object-position: 50% 20%; }
  .character-create-art::after { background: linear-gradient(0deg, var(--hud-bg), color-mix(in srgb, var(--hud-bg) 50%, transparent) 40%, transparent); }
  .character-create-art figcaption { bottom: 8px; left: 20px; right: 20px; }
  .character-create-art figcaption > p { display: none; }
  .character-create-wordmark { width: 200px; margin-bottom: 0; }
  .character-create-form { padding: 22px; gap: 20px; }
  .character-create-appearance { grid-template-columns: minmax(145px, 1fr) 1fr; gap: 10px; }
  .character-create-stage { height: 225px; }
  .character-create-actions { flex-direction: column; align-items: stretch; padding-top: 20px; }
  .character-create-options [role=group] button { padding-inline: 10px; }
}
@media (max-height: 500px) and (min-width: 761px) {
  .character-create-card { margin-top: 12px; }
  .character-create-art { min-height: 560px; }
}

/* ---- phones ---------------------------------------------------------------------------------
   Portrait phones (<= 760px) and landscape phones (<= 500px tall) share one treatment: content
   inside the safe areas, and the primary action pinned to the bottom of the scrolling page so it
   is always visible and reachable — without the keyboard, and above the install card (the page
   box already ends where the card starts). Every rule is scoped to body[data-phone] (set by layouts/application for phones only): a narrow or short
   desktop window, and the desktop shell, keep the layout above. */
@media (max-width: 760px), (max-height: 500px) {
  /* No bottom padding or margin: a sticky bar docks to the scroller's content edge, so any padding below
     the card would leave a gap under the bar. */
  body[data-phone] .character-create { padding: 12px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); scroll-padding-bottom: 84px; } /* focusing a field scrolls it clear of the pinned bar */
  body[data-phone] .character-create-card { overflow: clip; margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } /* hidden would make the card the scroll container and break the sticky bar */
  body[data-phone] .character-create-actions {
    position: sticky; bottom: 0; z-index: 2; flex-direction: row-reverse; align-items: stretch; gap: 10px;
    margin: 0 -22px -22px; padding: 10px 22px 12px;
    background: var(--hud-bg-2); border-top: 1px solid var(--hud-frame);
  }
  body[data-phone] .character-create-actions .hud-btn--primary { flex: 1 1 auto; min-width: 0; }
  body[data-phone] .character-create-actions .hud-btn--ghost { flex: 0 0 auto; }
  body[data-phone] .character-create-name__input { font-size: 18px; min-height: 48px; }
}
/* Small portrait phones (iPhone SE class): the key art shrinks to a banner and the intro goes, so the name
   field and its hint (the validation message lives there) clear the pinned button and the install card. */
@media (max-width: 760px) and (max-height: 740px) {
  body[data-phone] .character-create-art { min-height: 96px; height: 96px; }
  body[data-phone] .character-create-form { padding-top: 16px; gap: 14px; }
  body[data-phone] .character-create-form h1 { font-size: 24px; margin: 4px 0 0; }
  body[data-phone] .character-create-intro { display: none; }
}
/* Landscape phones (any width, so a 667px-wide one too): the card is two columns and the form is the tall one — tighten it so the name,
   its hint and the primary button share the first screen. */
@media (max-height: 500px) {
  body[data-phone] .character-create { padding-top: 6px; }
  body[data-phone] .character-create-card { grid-template-columns: minmax(150px, .5fr) minmax(0, 1.5fr); margin: 8px auto 0; }
  body[data-phone] .character-create-card { display: grid; }
  body[data-phone] .character-create-art { min-height: 0; height: auto; }
  body[data-phone] .character-create-art figcaption { bottom: 12px; left: 12px; right: 12px; }
  body[data-phone] .character-create-art figcaption > p:last-child { display: none; }
  body[data-phone] .character-create-wordmark { width: min(150px, 100%); }
  body[data-phone] .character-create-form { padding: 16px 22px 22px; gap: 12px; }
  body[data-phone] .character-create-form h1 { font-size: 22px; margin: 2px 0 0; }
  body[data-phone] .character-create-intro { display: none; }
  body[data-phone] .character-create-status { min-height: 0; margin-top: 6px; }
  body[data-phone] .character-create-stage { height: 170px; }
  body[data-phone] .character-create-appearance { padding-top: 8px; }
  body[data-phone] .character-create-options h2 { margin: 4px 0 8px; }
  body[data-phone] .character-create-options > p:last-child { display: none; }
  body[data-phone] .character-create-actions { margin: 0 -22px -22px; }
}
/* Phone landscape: the class dossier's "Choose <Class>" button is bottom-pinned from md up, which on a
   wide-but-short screen puts it a full scroll below the stats — keep it under the class name. */
@media (max-height: 500px) {
  body[data-phone] .class-picker-cta { order: 0; margin-top: 0.75rem; padding-top: 0; }
}
