/* Panel-specific layer on top of the shared sign-in shell. */

.panel-shell { width: min(72rem, calc(100% - 2rem)); }

.panel-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: .55rem .8rem;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  background: rgba(255, 252, 248, .78);
  box-shadow: inset 0 1px 0 #fff, 0 .55rem 1.5rem rgba(90, 52, 26, .1);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}
.panel-top .brand { padding-inline-start: .4rem; }
.panel-account { display: flex; align-items: center; gap: .6rem; }

/* The way into the profile: the crest, the alias and a small brass chevron —
   a chip in the same glass family as the landing's header pills. */
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 3rem;
  padding: .25rem .5rem .25rem .3rem;
  border: 1px solid rgba(154, 111, 38, .35);
  border-radius: 999px;
  background: linear-gradient(160deg, #fff8e8, #f3e2bf);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 .3rem .7rem rgba(69, 42, 26, .12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.account-chip:hover, .account-chip:focus-visible { transform: translateY(-1px); box-shadow: inset 0 1px 0 #fff, 0 .5rem 1rem rgba(69, 42, 26, .16); outline: none; }
.account-chip:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.account-chip[aria-expanded="true"] { background: linear-gradient(160deg, #f3d98b, #d9a83f); }
.account-copy { display: grid; gap: 0; text-align: right; line-height: 1.2; }
.account-copy small { color: #7b6357; font-size: .66rem; font-weight: 700; }
.account-name { color: var(--ink); font-size: .86rem; font-weight: 800; }
.account-chip > i {
  width: 1.4rem; height: 1.4rem;
  border-radius: 50%;
  border: 1px solid rgba(154, 111, 38, .5);
  background: rgba(255, 255, 255, .7);
  position: relative;
}
.account-chip > i::before {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: .45rem; height: .45rem;
  border-left: 2px solid #9a6f26; border-bottom: 2px solid #9a6f26;
  transform: translateY(-1px) rotate(-45deg);
  transition: transform .2s ease;
}
.account-chip[aria-expanded="true"] > i::before { transform: translateY(1px) rotate(135deg); }
.account-avatar, .profile-avatar {
  display: block;
  object-fit: contain;
  border: 2px solid rgba(255, 255, 255, .86);
  border-radius: 50%;
  background: linear-gradient(145deg, #fffaf4, #eddbc9);
  box-shadow: 0 0 0 1px rgba(238, 112, 32, .5), 0 .4rem 1rem rgba(0, 0, 0, .18);
}
.account-avatar { width: 2.4rem; height: 2.4rem; }
.profile-avatar { width: 4.5rem; height: 4.5rem; animation: profile-avatar-idle 5.4s ease-in-out infinite; }
.account-avatar[hidden], .profile-avatar[hidden] { display: none; }
@keyframes profile-avatar-idle {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50% { transform: translateY(-4px) rotate(.6deg); }
}

#panel-main { flex: 1; padding: .2rem 0 clamp(2rem, 5vw, 3.5rem); }
.loading { color: var(--ink-3); font-size: .85rem; }

/* ── the map, which is the page ───────────────────────────────── */
.panel-map { margin: 0 0 1rem; }
.panel-map .scene { max-width: none; animation: none; }
.panel-map .journey-stage:focus { outline: none; }
/* The one action under the board, as a game button: brass, wide, sticky
   above the thumb so a long map never hides the way back in. */
.panel-map .scene-actions { position: sticky; bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 6; }
.panel-map #journey-resume {
  min-height: 3.25rem; padding: .8rem 1.6rem; border: 1px solid rgba(154, 111, 38, .55); border-radius: 999px;
  background: linear-gradient(160deg, #f3d98b, #d9a83f); color: #4a3410;
  font: inherit; font-size: .95rem; font-weight: 800; cursor: pointer;
  box-shadow: inset 0 1px 0 #fff8e0, 0 .7rem 1.6rem rgba(70, 45, 10, .3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.panel-map #journey-resume:hover { transform: translateY(-1px); }
.panel-map #journey-resume:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* ── the start card: only before there is a map ───────────────── */
.gateway { display: grid; grid-template-columns: minmax(0, 30rem); justify-content: center; }
.route {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: clamp(1.3rem, 3vw, 1.8rem);
  border: 1px solid rgba(154, 111, 38, .35);
  border-radius: 1.3rem;
  background:
    linear-gradient(rgba(255, 250, 238, .55), rgba(255, 250, 238, .55)),
    url("/media/journey-board/paper-tile-v1.webp") center / 256px repeat,
    #f3e6cf;
  box-shadow: 0 .8rem 2rem rgba(84, 56, 14, .14);
}
.route > header { display: flex; gap: .9rem; align-items: flex-start; }
.route-icon {
  display: grid; place-items: center; flex: none;
  width: 2.6rem; height: 2.6rem; padding: .2rem;
  border-radius: 50%;
  border: 1px solid rgba(154, 111, 38, .5);
  background: linear-gradient(160deg, #fff8e8, #f3e2bf);
}
.route-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.route h2 { margin: 0 0 .35rem; font-size: 1.1rem; }
.route header p { margin: 0; color: var(--ink-3); font-size: .82rem; line-height: 1.85; }
.route > footer { display: flex; align-items: center; gap: .8rem; padding-top: 1rem; border-top: 1px solid rgba(154, 111, 38, .3); }
.badge { padding: .22rem .6rem; border-radius: 99px; background: rgba(238, 112, 32, .16); color: var(--orange-soft); font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.route-cta {
  flex: 1; min-height: 3rem; border: 0; border-radius: 999px;
  background: linear-gradient(160deg, #f3d98b, #d9a83f); color: #4a3410;
  font: inherit; font-size: .92rem; font-weight: 800; cursor: pointer;
  box-shadow: inset 0 1px 0 #fff8e0, 0 .5rem 1.2rem rgba(70, 45, 10, .25);
}
.route-cta:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* ── the profile: three cards on the same paper ───────────────── */
.panel-profile { max-width: 34rem; margin: 0 auto; }
.panel-profile__head { margin-bottom: 1.2rem; }
.panel-profile__head .ghost {
  min-height: 2.6rem; margin-bottom: .9rem; padding: .4rem .9rem;
  border: 1px solid rgba(154, 111, 38, .45); border-radius: 999px;
  background: rgba(255, 252, 248, .8); color: var(--ink); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.panel-profile__head .ghost:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.panel-profile__head h1 {
  margin: .3rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.35;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.pcards { display: grid; gap: 1rem; }
.pcard {
  position: relative;
  padding: clamp(1.2rem, 3vw, 1.6rem);
  border: 1px solid rgba(154, 111, 38, .4);
  border-radius: 1.3rem;
  background:
    linear-gradient(rgba(255, 250, 238, .58), rgba(255, 250, 238, .58)),
    url("/media/journey-board/paper-tile-v1.webp") center / 256px repeat,
    #f3e6cf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 .8rem 2rem rgba(84, 56, 14, .14);
}
/* A brass corner stud on each card: the same object language as the coins. */
.pcard::before {
  content: "";
  position: absolute; top: .8rem; left: .8rem;
  width: .55rem; height: .55rem; border-radius: 50%;
  background: conic-gradient(from 230deg, #9c7124, #ecd287 30%, #8a5f1c 55%, #e3c06a 80%, #9c7124);
  box-shadow: 0 1px 2px rgba(70, 45, 10, .4);
}
.pcard h2 { margin: 0; font-size: 1.1rem; }
.pcard__head, .profile-card__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.pcard__head p, .profile-card__head p, .invite-card__head p {
  margin: 0 0 .2rem; color: #9a6f26; font-size: .68rem; font-weight: 800; letter-spacing: .04em;
}
.profile-card__head h2 { margin: 0; }

#profile-list, .member-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .9rem 1.4rem;
  margin: 0 0 .8rem;
}
#profile-list div, .member-list div { min-width: 0; }
#profile-list dt, .member-list dt { color: var(--ink-3); font-size: .7rem; font-weight: 700; margin-bottom: .25rem; }
#profile-list dd, .member-list dd { margin: 0; font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.pcard .field-note { margin: .2rem 0 0; }

.member-actions, .invite-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.member-actions a, .member-actions button, .invite-actions button, .invite-actions a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .7rem 1.1rem; border-radius: 999px;
  font: inherit; font-size: .84rem; font-weight: 800; text-decoration: none; cursor: pointer;
}
.member-cta, .invite-actions button { border: 1px solid rgba(154, 111, 38, .55); background: linear-gradient(160deg, #f3d98b, #d9a83f); color: #4a3410; box-shadow: inset 0 1px 0 #fff8e0, 0 .4rem 1rem rgba(70, 45, 10, .22); }
.member-actions .ghost, .invite-actions a { border: 1px solid rgba(154, 111, 38, .45); color: var(--ink); background: rgba(255, 252, 248, .8); }
.member-actions a:focus-visible, .member-actions button:focus-visible, .invite-actions button:focus-visible, .invite-actions a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.invite-code {
  margin: 0 0 .4rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 800;
  letter-spacing: .28em;
  text-align: center;
  padding: .7rem .5rem;
  border: 1px dashed rgba(154, 111, 38, .6);
  border-radius: .9rem;
  background: rgba(255, 255, 255, .45);
  color: #4a3410;
}
.invite-seats { margin: 0 0 .5rem; color: var(--ink-3); font-size: .82rem; }
.invite-status:empty { display: none; }

@media (max-width: 480px) {
  .panel-shell { width: calc(100% - 1rem); }
  .panel-top { padding: .4rem .5rem; }
  .account-copy small { display: none; }
  .route, .pcard { border-radius: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-avatar { animation: none; }
}
.account-switch {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  line-height: 1.9;
  font-size: .84rem;
  min-height: 44px;
  cursor: pointer;
}
.account-switch input {
  width: 1.3rem;
  height: 1.3rem;
  margin: .35rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--orange);
}
.account-status:empty { display: none; }
.account-danger { margin-top: 1rem; border-top: 1px solid rgba(154, 111, 38, .35); padding-top: .8rem; }
.account-danger > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: .84rem;
  font-weight: 800;
  color: var(--danger);
}
.account-danger > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.account-danger p { margin: .5rem 0; color: var(--ink-3); font-size: .82rem; line-height: 1.85; }
.account-danger button {
  margin-top: .6rem;
  min-height: 44px;
  padding: .7rem 1.2rem;
  border-radius: .8rem;
  border: 1px solid rgba(154, 111, 38, .45);
  background: rgba(255, 252, 248, .8);
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
}
.account-danger button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.account-danger button:disabled { opacity: .5; cursor: not-allowed; }
