/* Seven Steps — Player Profile / Who’s Climbing (ornate museum edition) */

:root {
  --navy-950: #020b15;
  --navy-900: #07182a;
  --navy-800: #0c2239;
  --navy-700: #173653;
  --profile-gold: #d4af37;
  --profile-gold-light: #ffd66a;
  --profile-gold-mid: #e4a518;
  --profile-gold-dark: #ad6f00;
  --profile-cream: #f6f1e8;
  --profile-muted: #9bb4c9;
  --profile-cyan: #6ec8ef;
}

body:has(#setupScreen.active) .app-shell {
  background: #02060d;
}

body:has(#setupScreen.active) .history-rail {
  display: grid !important;
  opacity: 0.48;
  filter: saturate(0.75) contrast(1.08) brightness(0.78);
}

body:has(#setupScreen.active)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 50% 48%, rgba(2, 11, 21, 0.2), rgba(0, 7, 16, 0.7) 72%),
    rgba(0, 7, 16, 0.58);
}

#setupScreen.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: none;
  height: calc(100dvh - 72px);
  min-height: calc(100dvh - 72px);
  max-height: calc(100dvh - 72px);
  padding: 6px 14px 10px;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

body:has(#setupScreen.active) .global-header {
  height: 72px;
  padding-top: 6px;
  padding-bottom: 6px;
}

body:has(#setupScreen.active),
body:has(#setupScreen.active) .app-shell {
  overflow: hidden !important;
  height: 100dvh;
  max-height: 100dvh;
}

#setupScreen .player-profile-panel {
  position: relative;
  width: min(96vw, 1080px);
  max-width: 1080px;
  max-height: 100%;
  margin: 0 auto;
  padding: 14px clamp(16px, 2.5vw, 28px) 12px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 78% 48% at 50% 0%, rgba(40, 90, 140, 0.2), transparent 58%),
    linear-gradient(180deg, #0d2744 0%, #081829 52%, #040e1a 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.72);
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.22),
    inset 0 0 0 1px rgba(110, 200, 239, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.5),
    0 0 32px rgba(41, 91, 147, 0.18);
  text-align: center;
  animation: profilePanelIn 0.55s ease both;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Ornate corner flourishes */
#setupScreen .player-profile-panel:before,
#setupScreen .player-profile-panel:after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
  border: 2px solid rgba(212, 175, 55, 0.85);
  z-index: 2;
}
#setupScreen .player-profile-panel:before {
  top: 10px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 10px;
}
#setupScreen .player-profile-panel:after {
  top: 10px;
  right: 10px;
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 10px;
}

#setupScreen .player-profile-panel .panel-flourish {
  display: none;
}

@keyframes profilePanelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

#setupScreen .section-kicker {
  margin: 0 0 4px;
  font: 800 10px var(--orbitron);
  letter-spacing: 0.34em;
  color: var(--profile-gold);
  text-transform: uppercase;
  flex: 0 0 auto;
}

#setupScreen .section-kicker span {
  display: inline-block;
  margin: 0 0.35em;
  font-size: 0.95em;
}

#setupScreen .player-profile-panel > h2 {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", Cinzel, serif;
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  flex: 0 0 auto;
}

#setupScreen .section-sub {
  margin: 0 auto 10px;
  max-width: 52ch;
  font-family: var(--orbitron);
  font-size: clamp(9px, 0.95vw, 11px);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
  color: rgba(246, 241, 232, 0.82);
  flex: 0 0 auto;
}

#setupScreen .name-field {
  display: block;
  width: min(420px, 100%);
  margin: 0 auto 12px;
  text-align: center;
  flex: 0 0 auto;
}

#setupScreen .name-field > span:first-child {
  display: block;
  margin-bottom: 4px;
  font: 800 9px var(--orbitron);
  letter-spacing: 0.3em;
  color: var(--profile-gold);
}

#setupScreen .name-field-shell {
  position: relative;
  display: block;
}

#setupScreen .name-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid rgba(110, 200, 239, 0.55);
  border-radius: 999px;
  background: #040c16;
  color: var(--profile-cream);
  font-family: Georgia, "Times New Roman", Cinzel, serif;
  font-size: clamp(16px, 1.7vw, 22px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  padding: 8px 44px 8px 18px;
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(110, 200, 239, 0.12);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#setupScreen .name-field input:focus {
  border-color: rgba(110, 200, 239, 0.95);
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(110, 200, 239, 0.16),
    0 0 22px rgba(110, 200, 239, 0.2);
}

#setupScreen .name-quill {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%) rotate(-18deg);
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 42%, #e8f2fa 42% 58%, transparent 58%),
    linear-gradient(180deg, #d9e7f3, #8aa4b8);
  clip-path: polygon(15% 0, 45% 0, 100% 85%, 78% 100%, 0 42%);
  opacity: 0.9;
}

#setupScreen .role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 14px);
  margin: 0 0 10px;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

#setupScreen .role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 0;
  height: 100%;
  padding: 10px 10px 12px;
  border: 1px solid rgba(70, 110, 150, 0.45);
  border-radius: 16px;
  background: linear-gradient(180deg, #163a5f 0%, #0a1c30 58%, #071524 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.28);
  color: var(--profile-cream);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  animation: roleCardIn 0.5s ease both;
  animation-delay: var(--role-delay, 0ms);
}

@keyframes roleCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

#setupScreen .role-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.55);
}

#setupScreen .role-card:hover .role-art img {
  filter: brightness(1.08) saturate(1.05) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
  transform: translateY(-2px);
}

#setupScreen .role-card:focus-visible {
  outline: 2px solid var(--profile-gold-light);
  outline-offset: 3px;
}

#setupScreen .role-card.selected,
#setupScreen .role-card[aria-pressed="true"] {
  transform: translateY(-3px);
  border: 2px solid #f0c24a;
  background: linear-gradient(180deg, #1c4268 0%, #0b2034 58%, #081828 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 16px 34px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(240, 194, 74, 0.35),
    0 0 34px rgba(240, 180, 41, 0.38);
}

#setupScreen .role-art {
  position: relative;
  z-index: 1;
  width: min(100%, 160px);
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: visible;
  background:
    radial-gradient(circle at 50% 42%, rgba(92, 140, 190, 0.28), rgba(10, 28, 46, 0.15) 58%, transparent 72%);
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  max-height: min(38vh, 180px);
}

#setupScreen .role-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65));
  transition: filter 0.22s ease, transform 0.22s ease;
}

#setupScreen .role-meta {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 100%;
}

#setupScreen .role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--profile-gold);
  font-size: 10px;
  letter-spacing: 0.2em;
}

#setupScreen .role-badge:before,
#setupScreen .role-badge:after {
  content: "★";
  opacity: 0.9;
}

#setupScreen .role-badge i {
  display: block;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--profile-gold);
  border-radius: 3px;
  position: relative;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

#setupScreen .role-card[data-icon="book"] .role-badge i {
  background:
    linear-gradient(90deg, transparent 20%, var(--profile-gold) 20% 24%, transparent 24%),
    linear-gradient(90deg, transparent 70%, var(--profile-gold) 70% 74%, transparent 74%),
    rgba(212, 175, 55, 0.15);
}

#setupScreen .role-card[data-icon="compass"] .role-badge i {
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--profile-gold) 0 2px, transparent 2.5px),
    conic-gradient(from 0deg, transparent 0 20deg, var(--profile-gold) 20deg 25deg, transparent 25deg 110deg, var(--profile-gold) 110deg 115deg, transparent 115deg 200deg, var(--profile-gold) 200deg 205deg, transparent 205deg 290deg, var(--profile-gold) 290deg 295deg, transparent 295deg);
}

#setupScreen .role-card[data-icon="archive"] .role-badge i {
  background:
    linear-gradient(180deg, var(--profile-gold) 0 3px, transparent 3px),
    linear-gradient(180deg, transparent 55%, rgba(212, 175, 55, 0.35) 55%),
    rgba(212, 175, 55, 0.12);
}

#setupScreen .role-card b {
  font-family: Georgia, "Times New Roman", Cinzel, serif;
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
}

#setupScreen .role-card small {
  position: relative;
  font-family: var(--orbitron);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--profile-gold);
  padding: 0 16px;
}

#setupScreen .role-card small:before,
#setupScreen .role-card small:after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 1px;
  background: rgba(212, 175, 55, 0.7);
}

#setupScreen .role-card small:before { left: 0; }
#setupScreen .role-card small:after { right: 0; }

#setupScreen .rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(12, 34, 57, 0.92), rgba(4, 12, 22, 0.96));
  border: 1px solid rgba(212, 175, 55, 0.22);
  text-align: left;
  flex: 0 0 auto;
  margin-bottom: 8px;
}

#setupScreen .rule-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#setupScreen .rule-scales {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  position: relative;
  opacity: 0.95;
}
#setupScreen .rule-scales:before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 2px;
  height: 18px;
  background: var(--profile-gold);
  transform: translateX(-50%);
}
#setupScreen .rule-scales:after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 8px;
  height: 10px;
  border: 2px solid var(--profile-gold);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  clip-path: polygon(0 0, 45% 0, 45% 100%, 0 100%, 0 0, 100% 0, 100% 100%, 55% 100%, 55% 0);
}

#setupScreen .rule-row strong {
  display: block;
  font: 800 11px var(--orbitron);
  letter-spacing: 0.22em;
  color: var(--profile-gold);
}

#setupScreen .rule-row span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(246, 241, 232, 0.78);
}

#setupScreen .panel-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0;
  flex: 0 0 auto;
}

#setupScreen .action-star {
  color: var(--profile-gold);
  font-size: 14px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}

#setupScreen .panel-actions .btn {
  min-width: 132px;
  border-radius: 999px;
  font: 800 12px var(--orbitron);
  letter-spacing: 0.14em;
  padding: 10px 22px;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

#setupScreen .segmented {
  display: flex;
  flex: 0 0 auto;
  background: #050b13;
  border: 1px solid #29445f;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

#setupScreen .segmented button {
  border: 0;
  background: transparent;
  color: var(--profile-muted);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  font: 800 11px var(--orbitron);
  letter-spacing: 0.14em;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

#setupScreen .segmented button.selected {
  background: linear-gradient(180deg, var(--profile-gold-light), var(--profile-gold-mid) 45%, var(--profile-gold-dark));
  color: #1a1002;
  box-shadow: 0 4px 0 #5a3403, 0 8px 16px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

#setupScreen .segmented button:focus-visible {
  outline: 2px solid var(--profile-gold-light);
  outline-offset: 2px;
}

#setupScreen .panel-actions .btn-secondary {
  background: var(--navy-900);
  border: 1px solid #3a5874;
  color: var(--profile-cream);
  box-shadow: none;
}

#setupScreen .panel-actions .btn-primary {
  background: linear-gradient(180deg, #ffd66a 0%, #e4a518 48%, #ad6f00 100%);
  color: #1a1002;
  border: 0;
  box-shadow: 0 6px 0 #5a3403, 0 12px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(240, 180, 41, 0.22);
}

#setupScreen .panel-actions .btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

#setupScreen .panel-actions .btn:active {
  transform: translateY(1px);
}

#setupScreen .panel-actions .btn:focus-visible {
  outline: 2px solid var(--profile-gold-light);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  #setupScreen .role-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #setupScreen .role-card:last-child {
    grid-column: auto;
    max-width: none;
  }
  #setupScreen .role-art {
    width: min(100%, 120px);
    max-height: 120px;
  }
  #setupScreen .role-card b {
    font-size: 14px;
  }
  #setupScreen .role-card small {
    font-size: 8px;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 720px) {
  #setupScreen.active {
    height: calc(100dvh - 64px);
    min-height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
    padding: 4px 8px 8px;
  }
  body:has(#setupScreen.active) .global-header {
    height: 64px;
  }
  #setupScreen .player-profile-panel {
    border-radius: 18px;
    padding: 10px 10px 8px;
  }
  #setupScreen .player-profile-panel > h2 {
    font-size: clamp(24px, 7vw, 32px);
  }
  #setupScreen .section-sub {
    display: none;
  }
  #setupScreen .role-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  #setupScreen .role-card,
  #setupScreen .role-card:last-child {
    max-width: none;
    min-height: 0;
    padding: 6px 4px 8px;
    gap: 4px;
  }
  #setupScreen .role-art {
    width: min(100%, 88px);
    max-height: 88px;
  }
  #setupScreen .role-badge {
    display: none;
  }
  #setupScreen .rule-row {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 6px 8px;
  }
  #setupScreen .rule-row span {
    display: none;
  }
  #setupScreen .action-star {
    display: none;
  }
  #setupScreen .panel-actions .btn {
    min-width: 0;
    flex: 1 1 auto;
    width: auto;
    padding: 10px 14px;
  }
}

@media (max-height: 760px) and (min-width: 900px) {
  #setupScreen .role-art {
    width: min(100%, 110px);
    max-height: 110px;
  }
  #setupScreen .section-sub {
    margin-bottom: 4px;
    font-size: 9px;
  }
  #setupScreen .name-field {
    margin-bottom: 8px;
  }
  #setupScreen .rule-row {
    padding: 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #setupScreen .player-profile-panel,
  #setupScreen .role-card {
    animation: none !important;
  }
  #setupScreen .role-card,
  #setupScreen .panel-actions .btn {
    transition: none !important;
  }
}

/* ——— No-scroll modes / eras under top ribbon ——— */
body:has(#modeScreen.active),
body:has(#eraScreen.active),
body:has(#modeScreen.active) .app-shell,
body:has(#eraScreen.active) .app-shell {
  overflow: hidden !important;
  height: 100dvh;
  max-height: 100dvh;
}

body:has(#modeScreen.active) .global-header,
body:has(#eraScreen.active) .global-header {
  height: 72px;
  padding-top: 6px;
  padding-bottom: 6px;
}

#modeScreen.active,
#eraScreen.active {
  align-items: flex-start !important;
  justify-content: center !important;
  height: calc(100dvh - 72px) !important;
  min-height: calc(100dvh - 72px) !important;
  max-height: calc(100dvh - 72px) !important;
  padding: 8px 14px 12px !important;
  overflow: hidden !important;
}

#modeScreen .console-panel,
#eraScreen .console-panel {
  width: min(96vw, 1100px);
  max-height: 100%;
  margin: 0 auto;
  padding: 18px clamp(16px, 2.5vw, 28px) 14px !important;
  overflow: hidden;
}

#modeScreen .mode-grid {
  margin-top: 14px !important;
  gap: 12px !important;
}

#modeScreen .mode-card {
  min-height: 0 !important;
  padding: 18px 16px !important;
}

#modeScreen h2,
#eraScreen h2 {
  margin: 6px 0 0 !important;
  font-size: clamp(28px, 4vw, 42px) !important;
}


#setupScreen .gender-row{margin:12px 0 6px}
#setupScreen .role-art-climber{
  display:grid;place-items:end center;
  height:168px;overflow:hidden;border-radius:14px;
  background:
    radial-gradient(ellipse at 50% 92%, rgba(255, 214, 120, 0.22), transparent 42%),
    radial-gradient(circle at 50% 55%, rgba(70, 120, 175, 0.28), transparent 62%),
    linear-gradient(180deg, #1c4068 0%, #0e243c 55%, #081522 100%);
}
#setupScreen .role-art-climber img{
  width:auto;height:164px;max-width:100%;
  object-fit:contain;object-position:center bottom;
  background:transparent;
  image-rendering:auto;
  filter:drop-shadow(0 10px 12px rgba(0,0,0,.45));
}
@media(max-width:620px){
  #setupScreen .role-art-climber{height:124px}
  #setupScreen .role-art-climber img{height:120px}
}
