* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #fff;
  color: #111;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: #000;
  padding: 0.9rem 1.6rem;
  min-height: 7.25rem;
}

/* (26 Oct 2026) The crest is an image and the name beside it is live text, so it always reads
   "Immanuel Virtual World". logo-gold.png still has the old words drawn in and is no longer used here. */
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 0 0 auto;
  color: #f7f4ec;
}

.logo img {
  display: block;
  height: 3.85rem;
  width: auto;
}

.bar .logo .wordmark {
  display: flex;
  flex-direction: column;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: #f7f4ec;
  white-space: nowrap;
}

.bar nav {
  display: flex;
  gap: 1.35rem;
  align-items: center;
}

.bar a {
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
}

.bar nav span {
  color: #fff !important;
  font-size: 0.92rem;
  font-weight: 560;
}

.badge-username { display: inline-block; background: #f3f1ea; color: #333; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 999px; line-height: 1; border: 1px solid #e5e1da; }

.bar nav button, header button {
  display: none !important;
}

.bar nav *:not(a):not(span) {
  display: none !important;
}

.bar a:hover { opacity: 0.65; }

.bar nav a, .bar nav .also-btn { white-space: nowrap; }
.bar nav a[href="/signup"] { border: 1px solid #e4c36a; border-radius: 999px; padding: 0.4rem 0.95rem; color: #e4c36a; }
.bar a:focus-visible, .bar nav .also-btn:focus-visible { outline: 3px solid #e4c36a; outline-offset: 3px; border-radius: 4px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #b8860b; outline-offset: 2px; }

main {
  width: min(40rem, calc(100% - 2.5rem));
  margin: 0 auto;
  text-align: center;
  padding: 4.5rem 0 1rem;
}

h1 {
  margin: 0;
  font-weight: 560;
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

main > p {
  margin: 1.15rem auto 0;
  max-width: 34rem;
  font-size: 0.98rem;
  line-height: 1.45;
  color: #2a2a2a;
}

.stage {
  position: relative;
  width: min(44rem, 100%);
  margin: 0.2rem auto 0;
  background: transparent;
}

.stage img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  background: transparent;
  transition: opacity 0.45s ease;
}

.stage img.on {
  position: relative;
  opacity: 1;
}

.stage img:not(.on) {
  position: absolute;
  left: 0;
  top: 0;
}

.join {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.5rem 1.15rem;
  border: 1px solid rgba(17, 17, 17, 0.45);
  border-radius: 999px;
  color: #111;
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  background: transparent;
}

.join:hover { background: #111; color: #fff; }

footer {
  width: min(40rem, calc(100% - 2.5rem));
  margin: 3.2rem auto 0;
  padding: 0 0 2.8rem;
  text-align: center;
  font-size: 0.95rem;
}

footer p { margin: 0.2rem 0; }

footer a { color: #111; }

footer form {
  margin-top: 1.35rem;
}

footer form label {
  display: block;
  margin-bottom: 0.45rem;
}

.row {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

footer input[type="email"] {
  border: 0;
  border-bottom: 1px solid #ccc;
  background: transparent;
  padding: 0.35rem 0.15rem;
  font: inherit;
  width: 14rem;
  outline: none;
}

footer button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  padding: 0.35rem 0.2rem;
  color: #111;
}

.sheet {
  width: min(32rem, calc(100% - 2.5rem));
  margin: 2.5rem auto 3rem;
  text-align: left;
  padding-top: 0;
}

.sheet h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  text-align: left;
}

.sheet label {
  display: block;
  margin: 1rem 0 0.3rem;
  font-size: 0.92rem;
}

.sheet input[type="text"],
.sheet input[type="email"],
.sheet input[type="password"],
.sheet input[type="date"],
.sheet select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #ccc;
  background: transparent;
  padding: 0.45rem 0;
  min-height: 44px;
  font: inherit;
  outline: none;
}

/* Number and search boxes were left out of the rule above, so they showed as the
   browser's own widget. Same box everywhere a sheet uses them. */
.sheet input[type="number"],
.sheet input[type="search"],
.sheet input[type="url"],
.sheet input[type="tel"] {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: #111;
  background: #fff;
  border: 1.5px solid #d4cbb8;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  min-height: 2.6rem;
}
.sheet input[type="search"] { appearance: none; -webkit-appearance: none; }
.sheet input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.sheet input[type="number"]::-webkit-outer-spin-button,
.sheet input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sheet input[type="number"]:focus,
.sheet input[type="search"]:focus,
.sheet input[type="url"]:focus,
.sheet input[type="tel"]:focus {
  outline: none;
  border-color: #c4a24a;
  box-shadow: 0 0 0 3px rgba(228, 195, 106, 0.45);
}

.pw-wrap { position: relative; display: block; width: 100%; }
.sheet .pw-wrap input { padding-right: 2.75rem; }
.pw-eye {
  position: absolute; right: 0; top: 0; bottom: 0; width: 2.75rem;
  display: grid; place-items: center; border: 0; background: transparent;
  color: #6b6558; cursor: pointer; padding: 0;
}
.pw-eye svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

.sheet .check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.85rem 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.sheet .check input { margin-top: 0.2rem; }

.sheet button[type="submit"] {
  margin-top: 1.2rem;
  border: 1px solid #111;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  min-height: 44px;
  background: #111;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.hint { color: #555; font-size: 0.88rem; }
.error { color: #8a2a2a; min-height: 1.2rem; }
/* (26 Oct 2026) the sign-up error is repeated just above the button, where the pupil is looking */
.error-near:empty { display: none; }
.error-near { margin: 0.9rem 0 0.4rem; padding: 0.6rem 0.8rem; border-left: 3px solid #8a2a2a; background: #fbf1f1; text-align: left; }
.link-sent { margin: 0.9rem 0 0.4rem; padding: 0.6rem 0.8rem; border-left: 3px solid #e4c36a; background: #faf6ea; text-align: left; font-size: 0.92rem; line-height: 1.45; }
.dob-lists { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 0.6rem; }
.sheet .dob-lists select { min-height: 44px; }
.sheet a { color: #111; }

.note { min-height: 1.2rem; color: #444; font-size: 0.88rem; }

.desk {
  display: grid;
  grid-template-columns: 11rem minmax(0, 32rem);
  justify-content: center;
  gap: 2.2rem;
  width: min(52rem, calc(100% - 2.4rem));
  margin: 2rem auto 3rem;
  align-items: start;
}

.side {
  position: sticky;
  top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-height: calc(100vh - 10.5rem);
  padding-top: 0.35rem;
  font-size: 1.05rem;
}

.side a {
  color: #111;
  text-decoration: none;
}

.side a.on { font-weight: 650; }

.side .out { margin-top: auto; }

.desk main.sheet {
  width: auto;
  margin: 0;
  padding: 0;
}

.panel { display: none; }
.panel.on { display: block; }

.face {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0.6rem 0 1rem;
}

.stats { list-style: none; margin: 1rem 0 0; padding: 0; }
.stats li { padding: 0.7rem 0; border-bottom: 1px solid #eee; }

/* (6 Oct 2026) cookie notice in the house style: black, gold and white */
.cookies {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 79;   /* under the information panel and its veil */
  width: min(26rem, calc(100vw - 2rem));
  margin-bottom: env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem 0.9rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: #0c0c0e;
  color: #f7f4ec;
  border: 1px solid #e4c36a;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  font: 14px/1.5 Arial, "Helvetica Neue", Helvetica, sans-serif;
  text-align: left;
}
.cookies .ck-eb { grid-column: 1 / -1; margin: 0; font: 700 10px/1.2 Arial, sans-serif; letter-spacing: 0.15em; text-transform: uppercase; color: #e4c36a; }
.cookies p { margin: 0; }
.cookies a { color: #e4c36a; text-underline-offset: 3px; }
.cookies button {
  border: 1px solid #e4c36a;
  background: #e4c36a;
  color: #0c0c0e;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  min-height: 2.6rem;
  font: 700 14px Arial, sans-serif;
  cursor: pointer;
}
.cookies button:hover { background: #f0d58a; }
.cookies button:focus-visible, .cookies a:focus-visible { outline: 3px solid #f7f4ec; outline-offset: 2px; }

/* (6 Oct 2026) sign-up consents */
.consents { margin: 1.4rem 0 0.4rem; padding: 1rem 1.1rem 0.6rem; border: 1px solid #e4c36a; border-radius: 12px; background: rgba(228, 195, 106, 0.08); }
.consents-head { margin: 0 0 0.3rem; font: 700 11px/1.2 Arial, sans-serif; letter-spacing: 0.15em; text-transform: uppercase; color: #8a6a1c; }
.consents-links { margin: 0 0 0.6rem; font-size: 0.9rem; line-height: 1.7; color: #444; }
.consents a { color: #111; text-decoration-color: #e4c36a; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.sheet .consents .check { margin: 0.75rem 0; }
.sheet .consents .check input { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; accent-color: #b0902f; }
.guardian-box { margin: 1.1rem 0 0.2rem; padding: 1rem 1.1rem 0.4rem; border: 1px solid #e4c36a; border-radius: 12px; background: rgba(228, 195, 106, 0.08); }
.guardian-box h2 { margin: 0 0 0.45rem; font: 700 11px/1.2 Arial, sans-serif; letter-spacing: 0.15em; text-transform: uppercase; color: #8a6a1c; }
.age-note { margin-top: 0.35rem; }
.signin-easy { margin-top: 1.6rem; padding-top: 0.2rem; }

@media (max-width: 640px) {
  .logo { gap: 0.5rem; }
  .logo img { height: 2.8rem; }
  .bar .logo .wordmark { font-size: 0.9rem; }
  .bar { min-height: 5.4rem; padding: 0.65rem 1rem; }
  .stage { height: 22rem; }
  .bar nav { gap: 0.85rem; }
  .desk { grid-template-columns: 1fr; }
  .side {
    position: static;
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.8rem 1.1rem;
  }
  .side .out { margin-top: 0; }
}

/* ---------------- Friends (Phase 4) ---------------- */
.fr-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; font-size: 1.25rem; user-select: all; }
.fr-list { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.fr-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid #e6e1d6; }
.fr-row .fr-name { flex: 1 1 12rem; text-align: left; }
.fr-none { color: #555; padding: .5rem 0; text-align: left; }
.fr-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #777; background: #fff; flex: 0 0 auto; }
.fr-dot.on { background: #1f9d3a; border-color: #1f9d3a; }
.fr-report { flex: 1 0 100%; text-align: left; }
.fr-report textarea { width: 100%; font: inherit; padding: .6rem; border: 1px solid #bbb; border-radius: 8px; margin: .3rem 0 .5rem; }
#friends button { font: inherit; padding: .5rem 1rem; border-radius: 8px; border: 1px solid #111; background: #111; color: #fff; cursor: pointer; }
#friends button.ghost { background: #fff; color: #111; }
#friends button:focus-visible, #friends input:focus-visible, #friends textarea:focus-visible { outline: 3px solid #b8860b; outline-offset: 2px; }
#friends h2 { font-size: 1.15rem; margin: 1.8rem 0 .75rem; text-align: left; }

/* ---------------- Avatar Studio (Phase 5) ---------------- */
.avatar-studio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: #fdfaf5;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e6e1d6;
}
.studio-preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#studio-viewport {
  aspect-ratio: 1;
  background: #d9d4cc;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
#studio-viewport canvas {
  width: 100%;
  height: 100%;
}
.studio-actions {
  display: flex;
  justify-content: center;
}
.studio-controls {
  overflow-y: auto;
  max-height: 600px;
  padding-right: 0.5rem;
}
.control-group h3 {
  font-size: 1rem;
  margin: 1.2rem 0 0.6rem;
  border-bottom: 1px solid #e6e1d6;
  padding-bottom: 0.3rem;
}
.options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.choice-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #bbb;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.choice-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}
.swatch {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #bbb;
  cursor: pointer;
  padding: 0;
}
.swatch.active {
  box-shadow: 0 0 0 2px #111;
}
.slider {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #444;
}
.slider input {
  width: 100%;
  accent-color: #111;
}
@media (max-width: 900px) {
  .avatar-studio { grid-template-columns: 1fr; }
  .studio-controls { max-height: none; }
}


/* ---------------------------------------------------------------
   Breathing room under headings (5 Oct 2026)
   Every page title and section heading gets a clear gap before the
   text beneath it, so nothing looks squashed.
   --------------------------------------------------------------- */
.sheet h1 { margin-bottom: 1.4rem; }
.sheet h2 { margin-top: 1.8rem; margin-bottom: 0.75rem; }
.sheet h3 { margin-top: 1.4rem; margin-bottom: 0.6rem; }
.sheet h1 + p, .sheet h2 + p { margin-top: 0; }

/* ---------------------------------------------------------------
   Avatar page tidy-up (5 Oct 2026)
   Everything centred with room to breathe (the left-hand swatches
   were being clipped), each group of buttons on its own line, the
   chosen option in black and gold (Girl and Boy especially clear),
   and a Whole figure / Face switch under the picture.
   --------------------------------------------------------------- */
.avatar-studio { align-items: start; }
.studio-controls { padding: 0 8px 8px; box-sizing: border-box; }
.control-group h3 { text-align: center; }
.options-grid { flex-direction: column; align-items: center; gap: 0.6rem; }
.opt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; width: 100%; padding: 3px; box-sizing: border-box; }
.choice-btn { min-height: 36px; font: inherit; font-size: 0.9rem; color: #111; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.choice-btn:hover { border-color: #b8911c; }
.choice-btn.active { background: #111; color: #e4c36a; border-color: #e4c36a; box-shadow: 0 0 0 2px rgba(228,195,106,.45); }
.choice-btn:focus-visible, .swatch:focus-visible { outline: 3px solid #b8911c; outline-offset: 2px; }
.body-row { flex-wrap: nowrap; }
.body-row .choice-btn { min-width: 0; flex: 1 1 0; max-width: 7rem; min-height: 42px; font-size: 1rem; font-weight: 600; }
.body-row .choice-btn.active { box-shadow: 0 0 0 3px rgba(228,195,106,.6), 0 0 14px rgba(228,195,106,.55); }
.swatch.active { box-shadow: 0 0 0 3px #e4c36a, 0 0 0 4px #111; }
.view-switch { display: flex; justify-content: center; gap: 0.5rem; }
#save-look { min-height: 40px; padding: 0.45rem 1.4rem; border-radius: 999px; border: 1px solid #e4c36a; background: #111; color: #e4c36a; font: inherit; font-weight: 600; cursor: pointer; }
#save-look:hover { background: #e4c36a; color: #111; }
#save-look:disabled { opacity: .7; cursor: default; }
#controls-shop { flex-direction: row; flex-wrap: wrap; justify-content: center; }
#controls-sculpt .slider { width: 100%; }
.opt-label { width: 100%; margin: 0.9rem 0 0.1rem; text-align: center; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #6b6558; }
.control-group:first-child .opt-label:first-child { margin-top: 0; }

/* (6 Oct 2026, mobile tap targets) Phones only. Bigger tap areas for the
   header links and the "keep me signed in" and sign-up checkboxes. The look is
   unchanged: only padding and the checkbox size grow. */
@media (max-width: 640px) {
  .bar nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.3rem 0.3rem; min-width: 44px; }
  .logo { min-height: 44px; }
  .bar nav a[href="/signup"] { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.8rem; }
  .sheet .check { padding: 0.3rem 0; min-height: 44px; }
  .sheet .check input[type="checkbox"] { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
  .cookies .ck-eb { font-size: 11px; }   /* the notice's small gold label, a little larger on phones */
}
@media (max-width: 420px) {
  .bar { gap: 0.5rem; padding-left: 0.7rem; padding-right: 0.7rem; }
  .bar nav { gap: 0.3rem; }
  .logo { gap: 0.4rem; }
  .logo img { height: 2.4rem; }
  .bar .logo .wordmark { font-size: 0.8rem; }
  .bar a, .bar nav span { font-size: 0.86rem; }
  .bar nav a[href="/signup"] { padding: 0 0.6rem; }
}
