/* The player profile as a game screen (views/playerProfilePartial.jsx): the
   trophy-hall frame from public/achievements-hall.css, a cover across the top
   (the player's match intro image, or the siege painting), their banner big
   where the castle used to be, and the old sections as dark stone panels.
   The theme's colour tokens are re-pointed inside the hall, so the shared
   pieces it hosts (decks, play style, replays, achievement badges) read
   light-on-dark in both themes without each being restyled. */

.pf-hall.profile-wrapper {
  width: auto;
  max-width: none;
  margin: 0;
  font-family: "Comfortaa", sans-serif;
  --text: #f6e9cc;
  --papyrus-text: #f6e9cc;
  --cloud-bg2: rgba(18, 14, 10, 0.58);
  --panel-bg: rgba(0, 0, 0, 0.32);
  --panel-texture-url: none;
  --resource-panel-border: rgba(255, 220, 160, 0.16);
  --surface-border: rgba(255, 220, 160, 0.16);
  --pf-gold: #ffd23a;
  --pf-ink-dim: #d4c39f;
  --pf-edge: rgba(255, 220, 160, 0.16);
}
.pf-hall .pf-frame { max-width: 1000px; padding: 0 0 22px; overflow: visible; }
.pf-hall .ach-hall-bracket { z-index: 3; }

/* ── Cover ── */
.pf-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 340px;
  padding: 34px 18px 22px;
  border-radius: 2px 2px 0 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0 2px 0 rgba(255, 220, 160, 0.12);
}
.pf-cover-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("/assets/menu/siege-story-dark-v1.webp") center 35% / cover no-repeat;
  transform: scale(1.02);
}
.pf-cover.has-image .pf-cover-art { background-position: center 30%; }
/* Darken toward the bottom so the name, plates and buttons stay readable on
   any picture, and fade into the stone wall below. */
.pf-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 70%),
    linear-gradient(180deg, rgba(10, 8, 6, 0.15) 0%, rgba(10, 8, 6, 0.35) 45%, rgba(14, 12, 10, 0.92) 100%);
}
.pf-cover-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 220, 160, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: #f6e9cc;
  font: 700 0.78rem/1 "Comfortaa", sans-serif;
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.pf-cover-edit:hover { background: rgba(0, 0, 0, 0.75); color: #fff; }

.pf-cover-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  text-align: center;
}

/* The banner, big, where the castle stood. */
.pf-banner {
  position: relative;
  display: block;
  margin: 0;
}
.pf-hall .pf-crest { margin: 0; }
.pf-hall .pf-crest svg,
.pf-hall .pf-crest img {
  width: 132px;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 14px rgba(0, 0, 0, 0.35));
}
.pf-color-dot { width: 96px; height: 96px; border: 4px solid rgba(255, 255, 255, 0.6); }
.pf-banner-edit {
  position: absolute;
  right: -8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe48a, #c98a12);
  border: 2px solid #7a5310;
  color: #3d2000;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  text-decoration: none;
}
.pf-banner-edit:hover { filter: brightness(1.08); }

.pf-hall .pf-name-ribbon { width: min(460px, 100%); margin: -10px 0 -6px; }
.pf-hall .pf-name-ribbon h2.profile-name {
  max-width: 64%;
  margin: 0 0 6%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 clamp(1rem, 0.7rem + 1.5vw, 1.5rem)/1.1 "Cinzel", serif;
  color: #3d2000;
}

.pf-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 0;
}
.pf-badges:empty { display: none; }
.pf-hall .profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: rgba(0, 0, 0, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.pf-hall .profile-badge i { font-size: 0.9em; }

.pf-plates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.pf-plate {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 8px;
  min-width: 104px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 210, 58, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 8px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}
.pf-plate i { grid-row: span 2; color: var(--pf-gold); font-size: 1.2rem; }
.pf-plate b { font: 700 1.15rem/1.1 "Cinzel", serif; color: #fff; text-align: left; }
.pf-plate span {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pf-ink-dim);
  text-align: left;
}

.pf-hall .pf-actions {
  display: flex;
  width: auto;
  grid-template-columns: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.pf-hall .profile-action-btn {
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(48, 44, 40, 0.92), rgba(22, 20, 18, 0.95));
  border: 1px solid rgba(200, 150, 12, 0.55);
  color: #f6e9cc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 8px rgba(0, 0, 0, 0.45);
}
.pf-hall .profile-action-btn i { color: var(--pf-gold); }
.pf-hall .profile-action-btn:hover { border-color: rgba(230, 206, 106, 0.9); color: #fff; transform: translateY(-1px); }
.pf-hall .profile-action-btn.profile-train-btn {
  background: linear-gradient(180deg, #ffe48a 0%, #f0b52e 55%, #c98a12 100%);
  border-color: #7a5310;
  color: #3d2000;
}
.pf-hall .profile-action-btn.profile-train-btn i { color: #3d2000; }

/* ── Sections ── */
.pf-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 18px 0;
  align-items: start;
}
.pf-sections > .pf-wide { grid-column: 1 / -1; }
.pf-hall .profile-section {
  margin: 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(18, 14, 10, 0.62);
  background-image: none;
  border: 1px solid var(--pf-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.35);
  color: var(--text);
}
.pf-hall .profile-section-title {
  font: 700 1rem/1.2 "Cinzel", serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--pf-edge);
}
.pf-hall .profile-section-title i { color: var(--pf-gold); opacity: 1; }
.pf-hall .profile-section-collapsible:not([open]) > summary.profile-section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.pf-hall .profile-section-note { color: var(--pf-ink-dim); opacity: 1; }

.pf-hall .profile-stats-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pf-hall .profile-stat {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--pf-edge);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.pf-hall .profile-stat-value { font-family: "Cinzel", serif; color: #ffe27a; }
.pf-hall .profile-stat-label { color: var(--pf-ink-dim); opacity: 1; }

.pf-hall .profile-campaign-total { color: var(--pf-gold); }
.pf-hall .profile-campaign-level {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--pf-edge);
  color: var(--text);
}
.pf-hall .profile-campaign-level.clickable:hover { border-color: rgba(255, 210, 58, 0.6); }

.pf-hall .profile-achievements-bar-wrap { background: rgba(0, 0, 0, 0.45); border: 1px solid var(--pf-edge); }
.pf-hall .profile-achievements-bar { background: linear-gradient(90deg, #c98a12, #ffd23a); }
.pf-hall .profile-achievements-count { color: var(--pf-ink-dim); }
.pf-hall .profile-view-all-link { color: var(--pf-gold); }
.pf-hall .profile-view-all-link:hover { color: #ffe27a; }

.pf-hall .profile-deck-item,
.pf-hall .profile-match,
.pf-hall .profile-replay {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--pf-edge);
  color: var(--text);
}
.pf-hall .profile-deck-item-active { border-color: rgba(255, 210, 58, 0.6); background: rgba(255, 210, 58, 0.1); }
.pf-hall .profile-deck-meta,
.pf-hall .profile-deck-group-label,
.pf-hall .profile-match-meta,
.pf-hall .profile-match-duration,
.pf-hall .profile-match-date,
.pf-hall .profile-empty { color: var(--pf-ink-dim); opacity: 1; }
.pf-hall .profile-match-link { color: #ffe27a; }

@media (max-width: 760px) {
  .pf-sections { grid-template-columns: minmax(0, 1fr); padding: 14px 10px 0; gap: 12px; }
  .pf-hall .pf-frame { padding-bottom: 14px; }
}
@media (max-width: 600px) {
  .pf-hall.ach-hall { padding: 18px 6px 30px; }
  .pf-cover { min-height: 300px; padding: 30px 10px 16px; }
  .pf-hall .pf-crest svg,
  .pf-hall .pf-crest img { width: 108px; }
  .pf-plate { min-width: 0; padding: 6px 10px; }
  .pf-hall .profile-section { padding: 14px 12px; }
  .pf-hall .profile-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pf-cover-edit span { display: none; }
}

/* style.css lays a dirt texture over every .profile-section (meant for the
   settings modal); in light theme it washes the stone panels out. */
.pf-hall .profile-section::before { display: none; }
.pf-hall .splash-image-btn {
  border: 1px solid rgba(200, 150, 12, 0.55);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(48, 44, 40, 0.92), rgba(22, 20, 18, 0.95));
  color: #f6e9cc;
}
.pf-hall .splash-image-btn.danger {
  border-color: rgba(255, 120, 100, 0.55);
  background: linear-gradient(180deg, #8f2a20, #5e170f);
  color: #ffe9e4;
}
