/* Attendee profile — Moshi-scrapbook layout re-skinned in the Gen-3 FRLG
   language: flat #F8F8F8 paper windows framed by the shared gen3-frame
   border-image family (styles.css), PokeText/PokeDialogue type, tilted taped
   labels and sticker panels. Desktop is a two-page spread; phones stack.
   `--u` is the logical GBA pixel for the reused .gen3-frame1/.gen3-frame-msg
   classes — fixed here because #console-screen is not a CSS container. */

.attendee-profile-open {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 58;
  min-width: 82px;
  min-height: 36px;
  padding: 7px 12px;
  border: 2px solid #102f44;
  border-radius: 4px;
  background: #F8F8F8;
  color: #102f44;
  box-shadow: inset 0 0 0 2px #DED5DE, 3px 3px 0 #102f44;
  font: 800 12px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .06em;
  cursor: pointer;
}

.attendee-profile-open::before {
  content: "●";
  margin-right: 5px;
  color: #E82010;
}

.attendee-profile-open:focus-visible,
.attendee-profile button:focus-visible,
.attendee-profile input:focus-visible,
.attendee-profile select:focus-visible,
.attendee-profile textarea:focus-visible,
.attendee-profile summary:focus-visible,
.attendee-profile a:focus-visible {
  outline: 3px solid #ffcd4c;
  outline-offset: 2px;
}

.attendee-profile {
  --u: 2px;
  position: absolute;
  inset: 0;
  z-index: 59;
  padding: clamp(8px, 2vw, 20px);
  overflow: hidden;
  color: #606060;
  font-family: 'PokeDialogue', 'PokeText', "Courier New", monospace;
  /* FRLG title-screen backdrop: black caps + dark-red bars + deep teal. */
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .05) 3px 4px),
    linear-gradient(180deg,
      #000 0 4%,
      #7a1818 4% 9%,
      #10283A 9% 91%,
      #7a1818 91% 96%,
      #000 96% 100%);
}

/* ---- the scrapbook itself ------------------------------------------------ */

.profile-book {
  position: relative;
  width: min(100%, 1080px);
  height: 100%;
  margin: 0 auto;
  padding: clamp(10px, 1.8vw, 20px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a13232 #4c0e0e;
  background: linear-gradient(160deg, #a13232, #7a1818 58%, #5c1010);
  border: 3px solid #2c0808;
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .14),
    0 14px 34px rgba(0, 0, 0, .5);
}

.profile-masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(10px, 1.6vw, 16px);
}

/* Big taped title label, tilted like a scrapbook cover plate. */
.profile-masthead-tag {
  position: relative;
  padding: 9px 16px 8px;
  transform: rotate(-1.1deg);
  background: #FFF4D8;
  border: 2px solid #B87830;
  border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .3);
}

.profile-masthead-tag::before,
.profile-tag::before,
.profile-sticker::before,
.profile-background::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 44px;
  height: 13px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(222, 213, 222, .78);
  border: 1px solid rgba(41, 49, 49, .28);
}

.profile-kicker,
.profile-eyebrow {
  margin: 0 0 3px;
  color: #C74637;
  font: 800 8px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .18em;
}

.profile-masthead h2 {
  margin: 0;
  color: #424242;
  font-family: 'PokeText', ui-monospace, monospace;
  font-size: clamp(15px, 2.4vw, 24px);
  letter-spacing: .03em;
  text-shadow: 1px 1px 0 #D0D0C8;
}

.profile-icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid #293131;
  border-radius: 50%;
  background: #E82010;
  color: #F8F8F8;
  box-shadow: 2px 2px 0 #293131;
  font: 900 26px/28px system-ui, sans-serif;
  cursor: pointer;
}

/* ---- two-page spread ----------------------------------------------------- */

.profile-view {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
}

/* Book spine stitches between the pages. */
.profile-view::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  border-left: 3px dashed rgba(0, 0, 0, .34);
  pointer-events: none;
}

.profile-page {
  min-width: 0;
  padding: clamp(8px, 1.4vw, 14px);
}

/* ---- tilted taped paper labels (the Moshi field tags) -------------------- */

.profile-tag {
  position: relative;
  display: inline-block;
  padding: 6px 10px 5px;
  margin: 12px 0 6px;
  background: #FFF4D8;
  border: 2px solid #D8883C;
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(41, 49, 49, .2);
}

.profile-tag > span {
  color: #D2542C;
  font: 800 9px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .1em;
}

.profile-tag-a { transform: rotate(-1.8deg); }
.profile-tag-b { transform: rotate(1.4deg); }
.profile-tag-c { transform: rotate(-2.4deg); }

.profile-tag-mini {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 7px 3px;
  transform: rotate(-1deg);
}

.profile-tag-mini::before { display: none; }
.profile-tag-mini > span { font-size: 8px; }

/* ---- left page: owner card ----------------------------------------------- */

.profile-left-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 12px;
}

.profile-owner-column { min-width: 0; }

.profile-owner-name {
  max-width: 100%;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: #424242;
  font-family: 'PokeDialogue', ui-rounded, sans-serif;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.05;
  text-shadow: 2px 2px 0 #D0D0C8;
}

/* ---- fave pickers ---------------------------------------------------------- */

.profile-fave-rows {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.profile-fave-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-fave-row select,
.profile-github-form input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 2px solid #293131;
  border-radius: 4px;
  background: #F8F8F8;
  box-shadow: inset 0 0 0 2px #DED5DE;
  color: #606060;
  font: 400 12px/1.3 'PokeDialogue', ui-rounded, sans-serif;
  text-shadow: 1px 1px 0 #D0D0C8;
}

/* ---- sticker panels (trainer, badges, avatar) ------------------------------ */

.profile-sticker {
  position: relative;
  margin: 0;
  padding: 10px;
  background: #FFFFFF;
  border: 3px solid #293131;
  border-radius: 9px;
  box-shadow: 4px 5px 0 rgba(41, 49, 49, .2);
}

.profile-trainer-column {
  min-width: 0;
  text-align: center;
}

.profile-trainer-sticker {
  transform: rotate(1.6deg);
  text-align: center;
}

.profile-trainer-sticker img {
  width: auto;
  max-width: 100%;
  height: clamp(110px, 15vw, 168px);
  image-rendering: pixelated;
}

.profile-trainer-sticker figcaption strong {
  display: block;
  margin-top: 6px;
  color: #3878C8;
  font: 800 11px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.profile-role-strength {
  margin: 8px 0 0;
  color: #606060;
  font-size: 10px;
  line-height: 1.5;
  text-shadow: 1px 1px 0 #E8E8E0;
}

/* ---- shared links + background note ---------------------------------------- */

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.profile-links a,
.profile-links span,
.profile-repository-list a {
  padding: 6px 8px;
  border: 2px solid #293131;
  border-radius: 3px;
  background: #FFFDF2;
  color: #424242;
  font: 800 8px/1.2 'PokeText', ui-monospace, monospace;
  text-decoration: none;
}

.profile-links span {
  color: #98988C;
  border-style: dashed;
  border-width: 1px;
  padding: 7px 9px;
}

.profile-background {
  position: relative;
  margin-top: 14px;
  padding: 12px 12px 10px;
  transform: rotate(.5deg);
  background: #FFF4D8;
  border: 2px solid #D8883C;
  box-shadow: 3px 3px 0 rgba(41, 49, 49, .16);
}

.profile-background > span {
  display: block;
  margin-bottom: 4px;
  color: #C74637;
  font: 800 8px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .15em;
}

.profile-background p,
.profile-activity-state,
.profile-formula p,
.profile-form-heading > p,
.profile-privacy-note {
  margin: 5px 0 0;
  color: #606060;
  font-size: 11px;
  line-height: 1.5;
  text-shadow: 1px 1px 0 #E8E8E0;
}

.profile-edit-button,
.profile-save-button,
.profile-cancel-button,
.profile-github-save,
.profile-github-change {
  min-height: 36px;
  padding: 8px 12px;
  border: 2px solid #293131;
  border-radius: 4px;
  font: 800 10px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .06em;
  cursor: pointer;
}

.profile-edit-button {
  margin-top: 14px;
  background: #F8D048;
  color: #293131;
  box-shadow: 3px 3px 0 #293131;
}

/* ---- right page: badges, chips, GitHub ------------------------------------- */

.profile-badges {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 30px);
}

.profile-badge {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.profile-badge-sticker {
  width: clamp(96px, 10vw, 118px);
  height: clamp(96px, 10vw, 118px);
  display: grid;
  place-items: center;
  transform: rotate(-2.2deg);
}

.profile-badge-sticker-alt { transform: rotate(2deg); }

/* TEAM badge: team initial on a pokeball star sticker. */
.team-star {
  position: relative;
  width: 84%;
  height: 84%;
  display: grid;
  place-items: center;
}

.team-star::before,
.team-star::after {
  content: "";
  position: absolute;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.team-star::before {
  inset: 0;
  background: #293131;
}

.team-star::after {
  inset: 6%;
  background: linear-gradient(180deg, #E82010 0 46%, #293131 46% 55%, #F8F8F8 55% 100%);
}

.team-star b {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid #293131;
  border-radius: 50%;
  background: #F8F8F8;
  color: #293131;
  font: 800 15px/1 'PokeText', ui-monospace, monospace;
}

/* LEVEL badge: stamped silver chip. */
.level-chip {
  width: 78%;
  height: 78%;
  display: grid;
  place-items: center;
  border: 3px solid #293131;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #FFFFFF, #DED5DE 56%, #B0B0C4 100%);
  box-shadow: inset 0 -6px 0 rgba(41, 49, 49, .14);
}

.level-chip b {
  color: #4A4A6A;
  font: 800 clamp(20px, 2.4vw, 26px)/1 'PokeText', ui-monospace, monospace;
  text-shadow: 1px 1px 0 #FFFFFF;
}

.profile-team-name {
  margin: 12px 0 4px;
  text-align: center;
  overflow-wrap: anywhere;
  color: #424242;
  font-family: 'PokeDialogue', ui-rounded, sans-serif;
  font-size: clamp(16px, 2.2vw, 22px);
  text-shadow: 2px 2px 0 #D0D0C8;
}

.profile-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.profile-chip-grid > .chip-blue { grid-column: 1 / -1; }

.profile-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  border: 2px solid #293131;
  border-radius: 999px;
  box-shadow: 2px 2px 0 rgba(41, 49, 49, .16);
}

.profile-chip span {
  color: #10283A;
  font: 800 7px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .08em;
}

.profile-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #10283A;
  font: 400 13px/1 'PokeDialogue', ui-rounded, sans-serif;
}

.chip-blue { background: #B8D8F8; }
.chip-green { background: #B8ECC0; }
.chip-pink { background: #F8C8D8; }
.chip-yellow { background: #F8E8A0; }
.chip-orange { background: #F8D0B0; }

/* ---- GitHub sticker section ------------------------------------------------ */

.profile-github { margin-top: 16px; }

.profile-github-body { margin-top: 8px; }

.profile-github-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border: 2px dashed #B8B8B0;
  border-radius: 8px;
  background: #FFFDF2;
}

.profile-github-form label {
  flex: 1;
  min-width: 150px;
}

.profile-github-form label span {
  display: block;
  margin-bottom: 4px;
  color: #424242;
  font: 800 8px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.profile-github-form input { display: block; width: 100%; }

.profile-github-save {
  background: #F8D048;
  color: #293131;
  box-shadow: 2px 2px 0 #293131;
}

.profile-github-note {
  width: 100%;
  margin: 2px 0 0;
  color: #98988C;
  font-size: 10px;
  line-height: 1.4;
}

.profile-github-change {
  min-height: 28px;
  padding: 5px 8px;
  background: #FFFDF2;
  color: #424242;
  font-size: 8px;
  box-shadow: 2px 2px 0 rgba(41, 49, 49, .3);
}

.profile-github-pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-github-pending b {
  color: #424242;
  font-family: 'PokeDialogue', ui-rounded, sans-serif;
  font-size: 14px;
}

.profile-github-pending span {
  color: #C74637;
  font: 800 8px/1.3 'PokeText', ui-monospace, monospace;
  letter-spacing: .06em;
}

.profile-github-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.profile-github-avatar {
  flex: 0 0 auto;
  width: 82px;
  height: 82px;
  padding: 6px;
  transform: rotate(-2.4deg);
}

.profile-github-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.profile-github-details {
  flex: 1;
  min-width: 0;
}

.profile-github-details b {
  display: block;
  overflow-wrap: anywhere;
  color: #424242;
  font-family: 'PokeDialogue', ui-rounded, sans-serif;
  font-size: 15px;
  text-shadow: 1px 1px 0 #D0D0C8;
}

.profile-github-handle {
  display: block;
  margin-top: 2px;
  color: #98988C;
  font: 800 8px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .08em;
}

.profile-github-details p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: #606060;
  font-size: 11px;
  line-height: 1.45;
}

.profile-github-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.profile-github-chips .profile-chip b {
  font-size: 12px;
  display: inline;
}

/* ---- full-width project progress strip -------------------------------------- */

.profile-activity-card {
  grid-column: 1 / -1;
  /* positioned so it paints above the spine stitches of .profile-view::before */
  position: relative;
  padding: clamp(8px, 1.4vw, 14px);
}

.profile-activity-heading,
.profile-form-heading,
.profile-form-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.profile-activity-card h3,
.profile-form-heading h3 {
  margin: 0;
  color: #424242;
  font-family: 'PokeText', ui-monospace, monospace;
  font-size: clamp(13px, 1.8vw, 17px);
  letter-spacing: .04em;
  text-shadow: 1px 1px 0 #D0D0C8;
}

.profile-verified-count {
  padding: 5px 7px;
  border: 1px dashed #C74637;
  color: #C74637;
  font: 800 8px/1 'PokeText', ui-monospace, monospace;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.profile-stat-grid > div {
  padding: 8px;
  background: #B8D8F8;
  border: 2px solid #293131;
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(41, 49, 49, .14);
  text-align: center;
}

.profile-stat-grid strong,
.profile-stat-grid span { display: block; }

.profile-stat-grid strong {
  color: #10283A;
  font-family: 'PokeDialogue', ui-rounded, sans-serif;
  font-size: 18px;
}

.profile-stat-grid span {
  margin-top: 2px;
  color: #10283A;
  font: 800 7px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .08em;
}

.profile-progress-track {
  height: 12px;
  margin-top: 12px;
  overflow: hidden;
  border: 2px solid #293131;
  border-radius: 999px;
  background: #DED5DE;
}

.profile-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(135deg, #E82010 0 8px, #F8D048 8px 16px);
  transition: width 180ms ease;
}

.profile-repository-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
}

.profile-repository-list > p {
  width: 100%;
  margin: 0 0 2px;
  color: #C74637;
  font: 800 8px/1.2 'PokeText', ui-monospace, monospace;
  letter-spacing: .15em;
}

.profile-repository-list a { overflow-wrap: anywhere; }

.profile-formula {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 2px dashed #D8883C;
}

.profile-formula summary {
  color: #424242;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

/* ---- edit form ---------------------------------------------------------------- */

.profile-edit-form { padding: clamp(10px, 1.6vw, 16px); }

.profile-form-heading {
  padding-bottom: 11px;
  border-bottom: 2px dashed #D8883C;
}

.profile-form-heading > p {
  max-width: 240px;
  text-align: right;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 13px;
  margin-top: 14px;
}

.profile-form-grid label > span {
  display: block;
  margin-bottom: 5px;
  color: #424242;
  font-size: 12px;
  font-weight: 800;
}

.profile-form-grid small {
  color: #98988C;
  font-weight: 400;
}

.profile-form-grid input:not([type="checkbox"]),
.profile-form-grid select,
.profile-form-grid textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 2px solid #293131;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 2px #DED5DE;
  color: #424242;
  font: 400 13px/1.4 'PokeDialogue', ui-rounded, sans-serif;
}

.profile-form-grid textarea { resize: vertical; }
.profile-form-wide { grid-column: 1 / -1; }

.profile-switch-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px dashed #98988C;
  border-radius: 4px;
  background: #FFFDF2;
}

.profile-switch-field input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: #E00808;
}

.profile-switch-field > span { margin: 0 !important; }
.profile-privacy-note { margin-top: 12px; font-weight: 800; }
.profile-form-actions { justify-content: flex-end; margin-top: 13px; }

.profile-save-button {
  background: #F8D048;
  color: #293131;
  box-shadow: 3px 3px 0 #293131;
}

.profile-cancel-button {
  background: #FFFDF2;
  color: #424242;
}

@media (prefers-reduced-motion: reduce) {
  .profile-progress-track span { transition: none; }
}

/* ---- phone: single stacked column ---------------------------------------------- */

@media (max-width: 640px) {
  .attendee-profile { --u: 1.5px; padding: 4px; }
  .profile-book { padding: 8px; border-radius: 8px; }
  .profile-masthead { margin-bottom: 8px; }
  .profile-masthead-tag { padding: 7px 10px 6px; }
  .profile-masthead h2 { font-size: 13px; }
  .profile-kicker { font-size: 7px; }
  .profile-icon-button { width: 34px; height: 34px; }

  .profile-view { grid-template-columns: 1fr; gap: 10px; }
  .profile-view::before { display: none; }

  .profile-left-grid {
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 8px;
  }
  .profile-owner-name { font-size: 19px; }
  .profile-tag { margin-top: 10px; }
  .profile-tag > span { font-size: 8px; }
  .profile-fave-row { flex-wrap: wrap; }
  .profile-trainer-sticker { padding: 6px; }
  .profile-trainer-sticker img { height: 92px; }
  .profile-role-strength { font-size: 9px; }
  .profile-edit-button { width: 100%; }

  .profile-badge-sticker { width: 88px; height: 88px; }
  .profile-chip-grid { grid-template-columns: 1fr; }
  .profile-chip-grid > .chip-blue { grid-column: auto; }
  .profile-github-card { flex-wrap: wrap; }

  .profile-activity-heading { display: block; }
  .profile-verified-count { display: inline-block; margin-top: 6px; }
  .profile-stat-grid { grid-template-columns: 1fr; }

  .profile-form-heading { display: block; }
  .profile-form-heading > p { max-width: none; text-align: left; }
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-form-wide { grid-column: auto; }
}
