/* ══ the way in ══════════════════════════════════════════════════════════
 * The one screen a stranger sees. Everywhere else in Orbis is a working
 * surface and earns its quiet; this is the front door, and it is allowed to be
 * a picture: a planet hanging in a drifting sky on one side, the form on the
 * other. The whole thing is drawn out of the same tokens as the rest of the
 * app - there is no second palette here, only more room given to the accent.
 * `Stage` in `ui/entry.rs` is the markup all of this describes.
 */
/* The dotted sheet keeps going behind the sky, so the front door is standing on
   the same ground as every room behind it. */
.entry { position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
  /* Centred, but never at the cost of the top of the card. A grid item taller
     than its track overflows past the *start* edge, where nothing can scroll
     it back into view - which on a short window silently eats the first field.
     `safe center` centres while there is room and falls back to the start when
     there is not. */
  display: grid; align-items: center; align-items: safe center; }

/* Everything behind the glass. Decoration only: `aria-hidden` in the markup,
   `pointer-events: none` here, and motionless for anyone who has asked the
   system for less of it (bottom of this file). */
.entry-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.aurora { position: absolute; border-radius: 50%; filter: blur(38px); }
.aurora.cool { width: 72%; height: 72%; left: -4%; top: -16%;
  background: radial-gradient(closest-side, rgba(75, 123, 236, .34), rgba(75, 123, 236, 0) 70%);
  animation: aurora-a 22s ease-in-out infinite; }
.aurora.warm { width: 62%; height: 62%; right: -10%; bottom: -18%;
  background: radial-gradient(closest-side, rgba(141, 91, 212, .2), rgba(141, 91, 212, 0) 70%);
  animation: aurora-b 28s ease-in-out infinite; }
/* Six dots on a tile, drifting slowly enough to be felt rather than watched. */
.star-field { position: absolute; inset: -10%; opacity: .6;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 68% 8%, #9fc0ff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 84% 42%, #ffffff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 32% 62%, #b9d2ff 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 55% 84%, #dbe8ff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 4% 88%, #a8c6ff 50%, transparent 51%);
  background-size: 340px 340px; animation: star-drift 90s linear infinite; }
/* Weight at the bottom of the frame, so the card is not floating in a void. */
.horizon { position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(9, 11, 22, 0) 38%, rgba(9, 11, 22, .8) 100%); }

.entry-stage { position: relative; width: 100%; max-width: 1040px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 56px; align-items: center;
  padding: max(40px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-left))
           max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-right));
  animation: entry-rise .8s cubic-bezier(.2, .8, .2, 1) both; }

/* ── the world half ───────────────────────────────────────── */
.entry-hero { display: grid; justify-items: start; }
.orb { position: relative; width: 300px; max-width: 100%; aspect-ratio: 1;
  margin: 0 auto 30px; animation: orb-float 9s ease-in-out infinite; }
.orb-halo { position: absolute; inset: 6%; border-radius: 50%; filter: blur(22px);
  background: radial-gradient(closest-side, rgba(75, 123, 236, .55), rgba(75, 123, 236, 0) 72%);
  animation: orb-glow 6s ease-in-out infinite; }
/* Orbits: a circle squashed and turned. The tilt lives in a custom property so
   the spin keyframes can carry it too - a keyframe that named only `rotate()`
   would drop the squash and the ring would swell into a circle mid-turn. */
.orb-ring { --tilt: .34; position: absolute; inset: -6%; border-radius: 50%;
  border: 1.5px solid rgba(126, 166, 255, .3);
  transform: scaleY(var(--tilt)); animation: orb-spin 26s linear infinite; }
.orb-ring.wide { --tilt: .5; inset: -14%; border-style: dashed;
  border-color: rgba(194, 172, 255, .24); animation: orb-spin-rev 40s linear infinite; }
.orb-art { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain;
  filter: drop-shadow(0 22px 55px rgba(45, 85, 184, .6)); }

.wordmark { font-family: var(--font-display);
  font-size: clamp(46px, 7vw, 72px); line-height: .92; font-weight: 600;
  letter-spacing: -.02em; margin-bottom: 16px;
  /* The name is the one place in Orbis that gets a gradient. It is also the
     one word that never changes with the language. */
  background: linear-gradient(120deg, #ffffff 12%, #9dc3ff 58%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.entry-tagline { max-width: 440px; margin-bottom: 24px; font-size: 17px;
  line-height: 1.6; color: var(--muted); text-wrap: pretty; }

/* The six words for what a life here is made of. Pills rather than the square
   chips used inside the app: nothing on this page is a fact about a character
   yet, and these are read the way a subtitle is. */
.entry-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 460px; }
.entry-chips .chip { margin: 0; padding: 7px 13px; border-radius: 999px;
  background: rgba(26, 31, 57, .6); border-color: var(--border);
  font-size: 13px; color: #c3cee8; backdrop-filter: blur(6px);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), border-color .2s, background .2s; }
@media (hover: hover) {
  .entry-chips .chip:hover { transform: translateY(-3px);
    border-color: var(--border-hi); background: var(--panel-2); }
}

/* ── the card half ────────────────────────────────────────── */
/* A hairline of light down the top-left edge, brightest where the aurora is.
   Drawn as a gradient behind the card rather than as a border, because a
   gradient border on a rounded box is four mitred corners of trouble. */
.entry-panel { position: relative; }
.entry-panel::before { content: ""; position: absolute; inset: -2px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(126, 166, 255, .55),
    rgba(126, 166, 255, 0) 42%, rgba(194, 172, 255, .3) 100%); }
.entry-card { position: relative; display: grid; gap: 12px;
  padding: 30px 28px 24px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(33, 38, 60, .96), rgba(26, 30, 48, .98));
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .05); }

/* Register and log in, side by side. The kit's segment is an inline capsule row;
   here it is the width of the card and reads as the card's two faces. */
.entry-card .segment { display: flex; width: 100%; padding: 4px; margin-bottom: 12px;
  border-radius: var(--r-pill); background: rgba(20, 23, 38, .8);
  border: 1.5px solid var(--border); }
.entry-card .seg { flex: 1; padding: 10px 4px; font-size: 13px; }

.entry-title { font-family: var(--font-display);
  font-size: 27px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15;
  color: var(--text-hi); }
/* A subtitle belongs to the line above it, not to the gap the card hands every
   other row - it is pulled back up against its heading. */
.entry-title + .entry-sub { margin-top: -7px; }
.entry-sub { margin-bottom: 6px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.entry-fields { display: grid; gap: 10px; }
/* Deeper and rounder than a field inside the app: this card holds four of them
   at most, and they are the only thing on the page anybody has to touch. */
.entry-card input:not([type="checkbox"]) { padding: 13px 17px;
  background: rgba(20, 23, 38, .8); }
.entry-card input:not([type="checkbox"]):focus { border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(75, 123, 236, .18); }

/* The line the card ends on, and the language it is read in. */
.entry-foot { display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.entry-foot .fine { flex: 1; }

/* The two things a new player has to say yes to. The whole label is the
   target: a 13px box is a poor thing to ask a finger to find. */
.consent { align-items: flex-start; gap: 10px; text-align: left; cursor: pointer;
  flex-wrap: nowrap; padding: 4px 2px; border-radius: var(--r-md); }
.consent input { width: 17px; height: 17px; margin: 1px 0 0; }
@media (hover: hover) { .consent:hover { background: var(--panel-2); } }

.consent-block { display: grid; gap: 4px; margin: 2px 0; }

/* Where the documents behind that consent live. */
.legal-links { justify-content: center; gap: 16px; margin-top: 4px; }

/* ── the roster ─────────────────────────────────────────────────────── */
/* A life on the roster: the initial, who and where, and the way in. */
.char-row { display: flex; align-items: center; gap: 13px; padding: 11px 12px;
  background: var(--panel-2);
  border: 2px solid var(--border); border-radius: var(--r-lg);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), border-color .2s; }
@media (hover: hover) {
  .char-row:hover { transform: translateY(-2px); border-color: var(--border-hi); }
}
/* A life that ended is still yours to look at, and no longer competes for the
   eye with the one you can play. */
.char-row.gone { opacity: .62; }
.char-mark { display: flex; align-items: center; justify-content: center;
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(150deg, var(--accent), var(--magic-btn));
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; color: var(--on-accent); }
/* `pick-`, not `char-`: the character card in the rail owns `.char-id` and
   `.char-name`, its file loads after this one, and the two rules were quietly
   crossing - a name on this screen was drawn at the card's weight, and the
   card's name block inherited a `display: grid` from a roster row it has never
   been. Nothing looked broken, which is what makes it worth naming. */
.pick-id { display: grid; flex: 1; min-width: 0; }
.pick-name { font-weight: 600; }

/* ── narrower ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* One column, and the planet keeps its place at the top of it: it is the
     only thing here that says what Orbis is before anybody has an account. */
  .entry-stage { grid-template-columns: minmax(0, 440px); gap: 32px; justify-content: center; }
  .entry-hero { justify-items: center; text-align: center; }
  .orb { width: 200px; margin-bottom: 22px; }
  .entry-tagline { margin-bottom: 20px; }
  .entry-chips { justify-content: center; }
}
@media (max-width: 560px) {
  .orb { width: 158px; }
  .entry-tagline { font-size: 15px; }
  .entry-card { padding: 24px 18px 20px; border-radius: 20px; }
  .entry-panel::before { border-radius: 21px; }
  .entry-title { font-size: 23px; }
}

@keyframes entry-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes aurora-a {
  50% { transform: translate(8%, 6%) scale(1.15); }
}
@keyframes aurora-b {
  50% { transform: translate(-8%, -6%) scale(1.1); }
}
@keyframes star-drift { to { transform: translate3d(-160px, -120px, 0); } }
@keyframes orb-float { 50% { transform: translateY(-10px); } }
@keyframes orb-glow { 50% { opacity: .6; transform: scale(1.06); } }
@keyframes orb-spin {
  from { transform: rotate(0deg) scaleY(var(--tilt)); }
  to { transform: rotate(360deg) scaleY(var(--tilt)); }
}
@keyframes orb-spin-rev {
  from { transform: rotate(0deg) scaleY(var(--tilt)); }
  to { transform: rotate(-360deg) scaleY(var(--tilt)); }
}
/* None of the above carries meaning, so all of it goes when the player says
   so - `body.calm`, the ✨ toggle, not the OS media query, which Windows
   raises on machines whose owners never chose it (see `juice.css`). */
body.calm .entry-stage, body.calm .aurora, body.calm .star-field,
body.calm .orb, body.calm .orb-halo, body.calm .orb-ring { animation: none; }

/* ══ building a face ═════════════════════════════════════════════════════
 * The first thing anybody does in Orbis, so it sits above the name field: a
 * big preview and three rows of swatches. The preview is the ordinary
 * `.avatar`, scaled - the same element the whole app draws a face with, so
 * what is chosen here cannot look different once it is real.
 */
.face-builder { display: grid; gap: 10px; justify-items: stretch; margin-bottom: 12px; }
.face-preview { display: grid; place-items: center; }
/* Big, because on this screen the face *is* the screen: it is the only thing
   the six pickers underneath are for, and a decision you cannot see the result
   of is not a decision.
   Sized off the viewport *height* rather than fixed, because that is the axis
   this screen runs out of: the preview, six pickers, a name field and a button
   have to fit above the fold on a laptop, and on a phone. The clamp is what
   makes the picture the thing that gives way first. */
.avatar.face-big { width: clamp(84px, 19vh, 168px); height: clamp(84px, 19vh, 168px);
  font-size: clamp(34px, 8vh, 64px); }
.face-swatches { display: grid; gap: 8px; justify-items: center; }
.face-row { display: grid; gap: 4px; justify-items: center; }
.face-shade { width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset;
  cursor: pointer; }
.face-shade.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
/* The six features wrap into as many columns as the panel is wide, and each one
   is a single line - label, then its drawings. Stacked and centred they were
   twelve lines of vertical space for six choices, which is what put the name
   field and the "start a life" button below the fold. */
.face-features { display: grid; gap: 6px 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.face-row.inline { grid-template-columns: 1fr auto; align-items: center;
  justify-items: start; gap: 8px; }
.face-row.inline .fine { text-align: left; }
.face-row.inline .chip { min-width: 26px; padding: 3px 7px; cursor: pointer; }

/* A short window - a laptop, or a phone in landscape - has to fit the same
   decision in half the height. Nothing is removed, because everything here is
   a choice somebody makes once and lives with; it is the air between the rows
   that goes, and the planet, which has already said what it had to say by the
   time anybody is building a face. */
@media (max-height: 780px) {
  .entry-stage { padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom)); gap: 24px; }
  .entry-card { padding: 20px 20px 18px; gap: 9px; }
  .entry-title { font-size: 22px; }
  .entry-sub { margin-bottom: 2px; font-size: 12.5px; }
  .face-builder { gap: 7px; margin-bottom: 6px; }
  .face-swatches { gap: 5px; }
  .face-shade { width: 22px; height: 22px; }
  .orb { width: 150px; margin-bottom: 12px; }
}
@media (max-height: 620px) {
  /* The planet is the first thing to go: on a window this short it is the
     difference between the "start a life" button being on the screen and being
     below it, and a button nobody can reach is worse than no decoration. */
  .entry-hero { display: none; }
  .entry-stage { grid-template-columns: minmax(0, 460px); justify-content: center; }
}
