/* Shared look for every Friend Builder page: palette, LEGO-scale bricks, header, account menu, footer. */

:root {
  /* LEGO Friends palette: official LEGO colors (Rebrickable names/values) that are among the most used
     in LEGO Friends sets (rank by pieces across 706 Friends sets in brackets). */
  --pink: #C870A0;         /* Dark Pink           [#10, 403 sets] head, buttons, accents */
  --azure: #36AEBF;        /* Medium Azure        [#7, 481 sets]  about page */
  --yellow: #F2CD37;       /* Yellow              [#6, 436 sets]  torso */
  --dark-orange: #A95500;  /* Dark Orange         [#28, 201 sets] icons on yellow */
  --lavender: #AC78BA;     /* Medium Lavender     [#17, 295 sets] */
  --green: #4B9F4A;        /* Bright Green        [#16, 354 sets] legs */
  --sun: #F8BB3D;          /* Bright Light Orange [#13, 394 sets] "selected" rings */
  --sky: #9FC3E9;          /* Bright Light Blue   [#35, 111 sets] background (as a soft tint) */
  --page: #fdf3fa;
  --ink: #3b2a3f;
  --muted: #8a7690;
  /* Real LEGO proportions at 25px per stud (8mm pitch): brick 9.6mm -> 30px tall,
     1x4 face 32x9.6mm -> 100x30px, stud 4.8x1.7mm -> 15x5px seen head-on. */
  --pitch: 25px;
  --brick-h: 30px;
  /* 1x4 bricks in running bond (offset half a brick per row); dark joint + light edge works on any color */
  --seams: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='60'%3E%3Cg fill='none'%3E%3Cpath d='M0 29.5H100M0 59.5H100M99.5 0V30M49.5 30V60' stroke='rgba(0,0,0,.18)'/%3E%3Cpath d='M0 .5H100M0 30.5H100M.5 1V29M50.5 31V59' stroke='rgba(255,255,255,.3)'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
/* sign-in-only pages stay blank until js/account.js confirms you're signed in */
html.auth-pending body { visibility: hidden; }
body {
  margin: 0; padding: 0 0 56px; color: var(--ink);
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* faint baby-blue baseplate (a light tint of LEGO Bright Light Blue) at the same scale as the bricks:
     8mm stud pitch -> 25px, 4.8mm stud diameter -> 15px */
  background: radial-gradient(circle, #D9E7F7 0 7.5px, transparent 8px) 0 0 / var(--pitch) var(--pitch), #D3E4F6;
}
.wrap { max-width: 492px; margin: 26px auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 26px; }
.wrap .wrap { margin: 0; padding: 0; }

/* A wall of bricks: width snapped to whole studs, height snapped to whole brick rows (in JS),
   so there are no half bricks or cut-off studs. */
.brick {
  position: relative; align-self: center; width: 100%; width: round(down, 100%, var(--pitch));
  display: flex; flex-direction: column; justify-content: center; padding: 0 10px; margin-top: 5px;
  border-radius: 2px; background: var(--seams) 0 0 / 100px 60px, var(--c);
  box-shadow: inset 0 -1.5px 0 rgba(0,0,0,.14), 0 4px 10px rgba(80,30,70,.15);
}
/* Studs, seen head-on: flat rectangles with cylinder shading, centered on each stud position */
.brick::before, .dock-brick::before {
  content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 5px;
  background:
    linear-gradient(90deg, transparent 5px, rgba(0,0,0,.14) 5px, rgba(255,255,255,.32) 9px,
                    transparent 13px, rgba(0,0,0,.14) 20px, transparent 20px) 0 0 / var(--pitch) 100%,
    var(--c);
  -webkit-mask: repeating-linear-gradient(90deg, transparent 0 5px, #000 5px 20px, transparent 20px 25px);
          mask: repeating-linear-gradient(90deg, transparent 0 5px, #000 5px 20px, transparent 20px 25px);
}

/* Full-width white brick header flush with the top of the page (its studs would be off-screen) */
header.brick {
  --c: #fff; width: 100%; margin: 0; border-radius: 0; text-align: center; align-items: center;
  z-index: 3;  /* keeps the account menu above the part containers */
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08), 0 4px 10px rgba(80,30,70,.12);
}
header.brick::before { display: none; }

.logo { margin: 0; padding: 8px 0; line-height: 0; }
.logo a { display: inline-block; }
.logo img { width: min(44vw, 280px); height: auto; }

/* ── Account (top right of the header) ─────────────────────────────────────────── */
.account { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.acct-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--pink); color: #fff; font: 600 15px "Fredoka", system-ui, sans-serif;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 2px 4px rgba(0,0,0,.15);
}
.acct-btn.signin { padding: 7px 14px; }
.acct-btn .initials {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--pink); font-weight: 700; font-size: 13px;
}
.acct-btn .name { display: none; padding-right: 8px; }
@media (min-width: 640px) { .acct-btn .name { display: inline; } }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; min-width: 200px; padding: 6px;
  background: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(60,20,60,.22); text-align: left;
}
.menu[hidden] { display: none; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid #f0e6ee; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.menu .who strong { display: block; color: var(--ink); font-size: 15px; }
.menu a, .menu button {
  display: block; width: 100%; padding: 9px 10px; border: none; border-radius: 6px; background: none;
  color: var(--ink); font: 500 15px "Fredoka", system-ui, sans-serif; text-align: left; text-decoration: none; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: #fbeef6; }

/* ── Forms ─────────────────────────────────────────────────────────────────────── */
.panel h2 { margin: 0 0 14px; font-size: 20px; color: var(--pink); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 14px; }
.field input {
  width: 100%; min-width: 0; padding: 9px 11px; border: 2px solid #ead9e5; border-radius: 8px; font: 16px "Fredoka", system-ui, sans-serif; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--pink); }
.field input[readonly] { background: #f8f3f7; color: var(--muted); }
.form-msg { min-height: 20px; margin: 4px 0 10px; font-size: 14px; }
.form-msg.error { color: #c42452; }
.form-msg.ok { color: #2e8a4b; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn {
  padding: 9px 16px; border: none; border-radius: 999px; cursor: pointer; font: 600 15px "Fredoka", system-ui, sans-serif;
  background: var(--pink); color: #fff; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.btn.secondary { background: #f3e8f0; color: var(--ink); box-shadow: none; }
.btn:disabled { opacity: .6; cursor: default; }

/* ── Footer: disclaimer pinned to the bottom of the window ─────────────────────── */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  background: rgba(255,255,255,.85); backdrop-filter: blur(4px); box-shadow: 0 -1px 4px rgba(80,30,70,.08);
}
.credit { margin: 0; padding: 8px 16px; text-align: center; font-size: 12px; color: var(--muted); }
.credit a { color: inherit; }
