:root {
  --bg: #0a1118;
  --panel: rgba(20, 28, 35, 0.92);
  --panel-strong: rgba(13, 20, 27, 0.98);
  --ink: #f6e5bc;
  --muted: #c7b58f;
  --gold: #d6a642;
  --gold-bright: #f0c666;
  --red: #bc4a3b;
  --green: #71a868;
  --blue: #5d91b9;
  --border: rgba(246, 229, 188, 0.22);
  --shadow: rgba(0, 0, 0, 0.45);
  --sand: #2f261c;
  --card: #151e26;
  --radius: 22px;
}

/* v0.5.0: XP, levels, pirate ranks and post-match progression. */
.profile-progression {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.4fr) minmax(190px, .8fr);
  gap: 16px;
  align-items: stretch;
  margin: 18px 0 22px;
  padding: 16px;
  border: 2px solid rgba(61, 30, 16, .72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 244, 197, .68), rgba(207, 161, 81, .28)),
    rgba(246, 222, 159, .72);
  box-shadow: inset 0 0 0 2px rgba(255, 247, 210, .35), 0 5px 12px rgba(38, 18, 9, .18);
  color: #2c180f;
}

.progression-rank-block,
.progression-bar-block,
.daily-xp-status {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.progression-rank-block {
  padding-right: 16px;
  border-right: 1px solid rgba(74, 38, 19, .35);
}

.progression-label,
.progression-bar-heading span,
.daily-xp-status span {
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.progression-rank-block strong {
  margin: 3px 0;
  color: #681f16;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.05;
}

.progression-rank-block > span:last-child,
.progression-bar-block > small,
.post-match-progression > small {
  color: #5b3a23;
  font-weight: 800;
}

.progression-bar-heading {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.progression-bar-heading strong {
  white-space: nowrap;
  color: #681f16;
}

.xp-progress-track {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 16px;
  margin-bottom: 7px;
  border: 2px solid #3c1f12;
  border-radius: 999px;
  background: #301910;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 244, 196, .45);
}

.xp-progress-fill {
  display: block;
  width: var(--xp-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9f531d, #e5b743 60%, #fff0a4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 10px rgba(229, 183, 67, .55);
}

.post-match-xp-progress .xp-progress-fill {
  animation: xp-progress-fill 900ms cubic-bezier(.22, .8, .32, 1) both;
}

@keyframes xp-progress-fill {
  from { width: 0; }
  to { width: var(--xp-progress, 0%); }
}

.daily-xp-status {
  padding: 10px 12px;
  border: 1px solid rgba(67, 34, 17, .38);
  border-radius: 6px;
  text-align: center;
}

.daily-xp-status.available {
  background: rgba(91, 118, 55, .18);
  color: #30441f;
}

.daily-xp-status.claimed {
  background: rgba(95, 78, 62, .12);
  color: #59412d;
}

.daily-xp-status strong {
  margin-top: 3px;
  font-size: .84rem;
}

.compact-progression {
  display: block;
  margin-top: 3px;
  color: #6a321b;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .025em;
  line-height: 1.2;
}

.ready-pirate .compact-progression {
  color: #ead48d;
  text-align: center;
}

.lobby-progression {
  color: #d2b86d;
  font-size: .64rem;
}

.summary-progression {
  margin: -3px 0 8px;
  color: #6b311b;
  text-align: center;
}

.account-profile-button > span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.account-profile-button > span small {
  margin-top: 3px;
  max-width: 175px;
  overflow: hidden;
  color: #dbc47e;
  font-size: .58rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-rewards {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.history-xp strong {
  color: #9a4f1e;
}

.xp-award-panel {
  width: min(720px, calc(100% - 24px));
  margin: 22px auto 4px;
  padding: 18px;
  border: 2px solid #8f6426;
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(255, 246, 207, .97), rgba(218, 175, 94, .94)),
    #ead39a;
  box-shadow: inset 0 0 0 2px rgba(80, 42, 19, .2), 0 8px 18px rgba(0, 0, 0, .34);
  color: #2c180f;
  text-align: left;
}

.xp-award-panel .eyebrow {
  margin-bottom: 2px;
  color: #7b2b1c;
}

.xp-award-panel h3,
.xp-award-panel p {
  color: inherit;
}

.xp-award-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(64, 31, 16, .3);
}

.xp-award-heading h3 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
}

.xp-award-grand-total,
.xp-award-total > strong {
  color: #7e2b17;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  white-space: nowrap;
}

.xp-breakdown {
  display: grid;
  gap: 3px;
  margin: 12px 0 15px;
}

.xp-breakdown > div {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(255, 250, 224, .44);
}

.xp-breakdown span,
.xp-breakdown strong,
.xp-breakdown small {
  display: block;
}

.xp-breakdown small {
  margin-top: 2px;
  color: #68462c;
}

.xp-breakdown b {
  color: #7e2b17;
  white-space: nowrap;
}

.post-match-progression {
  padding-top: 13px;
  border-top: 1px solid rgba(64, 31, 16, .3);
}

.post-match-xp-progress {
  height: 19px;
}

.level-up-callout,
.rank-up-callout {
  display: flex;
  gap: 8px 14px;
  align-items: baseline;
  justify-content: center;
  margin-top: 12px;
  padding: 10px;
  border: 2px solid rgba(112, 62, 22, .55);
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(128, 44, 22, .1), rgba(255, 239, 155, .58), rgba(128, 44, 22, .1));
  color: #5c2417;
  text-align: center;
}

.level-up-callout strong,
.rank-up-callout strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
}

.rank-up-callout {
  border-color: #8c5b1f;
  background: linear-gradient(90deg, rgba(81, 31, 15, .15), rgba(239, 193, 71, .65), rgba(81, 31, 15, .15));
}

.xp-award-pending {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.xp-tally-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid rgba(82, 43, 21, .2);
  border-top-color: #8c3a20;
  border-radius: 50%;
  animation: xp-tally-spin .8s linear infinite;
}

@keyframes xp-tally-spin { to { transform: rotate(360deg); } }

.xp-award-total {
  display: flex;
  gap: 12px;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
  text-align: center;
}

.xp-award-error,
.xp-award-ineligible,
.guest-xp-panel {
  text-align: center;
}

.xp-award-error {
  border-color: #8f3325;
  background: #f0c7a8;
}

.progression-guide-section {
  margin-top: 24px;
}

.xp-rules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}

.xp-rules-grid > div {
  display: flex;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(214, 166, 66, .38);
  border-radius: 8px;
  flex-direction: column;
  justify-content: center;
  background: rgba(7, 12, 16, .45);
  text-align: center;
}

.xp-rules-grid strong {
  color: #f0c666;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.3rem;
}

.xp-rules-grid span {
  margin-top: 4px;
  color: #f6e5bc;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.25;
}

@media (max-width: 780px) {
  .profile-progression {
    grid-template-columns: 1fr;
  }

  .progression-rank-block {
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(74, 38, 19, .35);
  }

  .history-rewards {
    width: 100%;
    justify-content: space-between;
  }

  .xp-rules-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .xp-award-heading,
  .progression-bar-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 520px) {
  .xp-award-panel {
    width: 100%;
    padding: 14px;
  }

  .xp-breakdown > div {
    align-items: flex-start;
  }

  .level-up-callout,
  .rank-up-callout {
    flex-direction: column;
    align-items: center;
  }

  .account-profile-button > span small {
    max-width: 112px;
  }

  .xp-rules-grid {
    grid-template-columns: 1fr;
  }
}

/* v0.5.1: The Warden's Ledger leaderboards. */
.header-leaderboards-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  min-width: 46px;
  height: 46px;
  border: 1px solid rgba(240, 198, 102, .5);
  border-radius: 10px 14px 10px 14px;
  background: linear-gradient(145deg, rgba(100, 57, 25, .92), rgba(36, 22, 15, .98));
  box-shadow: inset 0 1px 0 rgba(255, 239, 185, .22), 0 4px 10px rgba(0, 0, 0, .34);
  color: var(--gold-bright);
  cursor: pointer;
}

.header-leaderboards-button svg,
.leaderboard-hero-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-leaderboards-button:hover:not(:disabled),
.header-leaderboards-button.selected {
  border-color: #f0c666;
  background: linear-gradient(145deg, #8c4b22, #3a2115);
  box-shadow: inset 0 1px 0 rgba(255, 239, 185, .3), 0 0 16px rgba(214, 166, 66, .28);
  transform: translateY(-1px);
}

.header-leaderboards-button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.leaderboards-page {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.leaderboards-top-actions {
  margin-bottom: 14px;
}

.leaderboard-ledger {
  overflow: hidden;
  border: 3px solid #4e2b18;
  border-radius: 8px;
  padding: clamp(16px, 3vw, 30px);
  background:
    linear-gradient(135deg, rgba(255, 249, 218, .92), rgba(210, 164, 87, .9)),
    #e1bd72;
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 199, .42),
    inset 0 0 45px rgba(91, 48, 21, .18),
    0 18px 38px rgba(0, 0, 0, .42);
  color: #2e1a10;
}

.leaderboard-hero {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(75, 38, 18, .44);
}

.leaderboard-hero-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 3px double #6e391a;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe89a, #c67f29 56%, #6f3517);
  box-shadow: inset 0 0 0 4px rgba(255, 240, 174, .28), 0 5px 10px rgba(62, 29, 12, .3);
  color: #4b2112;
}

.leaderboard-hero-icon svg {
  width: 45px;
  height: 45px;
  stroke-width: 1.45;
}

.leaderboard-hero .eyebrow,
.leaderboard-board-heading .eyebrow {
  color: #7d2c1e;
}

.leaderboard-hero h2 {
  margin: 2px 0 5px;
  color: #421d12;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1;
}

.leaderboard-hero p:last-child,
.leaderboard-board-heading p:last-child {
  margin: 0;
  color: #68452d;
  font-weight: 700;
}

.leaderboard-category-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: 18px;
  padding: 5px;
  border: 2px solid #4b2817;
  border-radius: 7px;
  background: #2b1810;
}

.leaderboard-category-tab,
.leaderboard-metric-tab,
.leaderboard-period-toggle button {
  border: 0;
  color: #ead7aa;
  font-weight: 900;
  cursor: pointer;
}

.leaderboard-category-tab {
  min-height: 42px;
  border-radius: 4px;
  background: transparent;
  font-family: Cinzel, Georgia, serif;
  letter-spacing: .025em;
}

.leaderboard-category-tab:hover,
.leaderboard-category-tab.selected {
  background: linear-gradient(#b66b29, #703318);
  color: #fff0b9;
  box-shadow: inset 0 1px 0 rgba(255, 241, 180, .32);
}

.leaderboard-control-deck {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.leaderboard-metric-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.leaderboard-metric-tab {
  min-height: 36px;
  border: 1px solid rgba(72, 37, 17, .42);
  border-radius: 999px;
  padding: 7px 13px;
  background: rgba(255, 250, 221, .32);
  color: #5b321e;
}

.leaderboard-metric-tab:hover,
.leaderboard-metric-tab.selected {
  border-color: #6e351a;
  background: #6e351a;
  color: #ffe9aa;
}

.leaderboard-period-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid #542b17;
  border-radius: 999px;
  background: rgba(63, 31, 16, .13);
}

.leaderboard-period-toggle button {
  border-radius: 999px;
  padding: 8px 13px;
  background: transparent;
  color: #654128;
}

.leaderboard-period-toggle button.selected {
  background: #6d3018;
  color: #ffe9aa;
  box-shadow: 0 2px 5px rgba(68, 31, 14, .25);
}

.leaderboard-lifetime-only {
  flex: 0 0 auto;
  border: 1px solid rgba(76, 40, 20, .34);
  border-radius: 999px;
  padding: 8px 13px;
  color: #654128;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-board-heading {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 22px 0 12px;
}

.leaderboard-board-heading h3 {
  margin: 2px 0 3px;
  color: #411e12;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
}

.leaderboard-board-heading > strong {
  max-width: 360px;
  color: #734025;
  font-size: .8rem;
  text-align: right;
}

.leaderboard-own-standing {
  display: grid;
  grid-template-columns: minmax(120px, .6fr) minmax(180px, 1fr);
  gap: 3px 18px;
  margin-bottom: 12px;
  border: 2px solid #835018;
  border-radius: 6px;
  padding: 11px 15px;
  background: linear-gradient(90deg, rgba(255, 233, 144, .82), rgba(190, 122, 43, .27));
  box-shadow: inset 0 0 0 2px rgba(255, 249, 211, .35);
}

.leaderboard-own-standing > span {
  grid-row: 1 / 3;
  align-self: center;
  color: #7c2b1c;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-own-standing strong {
  color: #3e2114;
}

.leaderboard-own-standing small {
  color: #684329;
  font-weight: 700;
}

.leaderboard-own-standing.guest {
  grid-template-columns: auto 1fr;
}

.leaderboard-own-standing.guest > span {
  grid-row: auto;
}

.leaderboard-table {
  overflow: hidden;
  border: 2px solid #4a2818;
  border-radius: 7px;
  background: rgba(255, 249, 219, .36);
  box-shadow: 0 6px 14px rgba(69, 31, 14, .17);
}

.leaderboard-table-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 150px;
  align-items: center;
}

.leaderboard-table-head {
  min-height: 38px;
  padding: 0 16px;
  background: #352016;
  color: #e6ce96;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.leaderboard-table-head span:last-child {
  text-align: right;
}

.leaderboard-row {
  position: relative;
  min-height: 72px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(75, 37, 17, .22);
  background: rgba(255, 250, 223, .34);
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row:nth-child(odd) {
  background: rgba(122, 73, 29, .07);
}

.leaderboard-row.is-current-player {
  background: linear-gradient(90deg, rgba(255, 225, 112, .68), rgba(185, 106, 31, .19));
  box-shadow: inset 5px 0 0 #9b481e;
}

.leaderboard-row.podium-1 {
  background: linear-gradient(90deg, rgba(255, 231, 128, .58), rgba(255, 250, 223, .42));
}

.leaderboard-row.podium-2 {
  background: linear-gradient(90deg, rgba(210, 216, 215, .46), rgba(255, 250, 223, .38));
}

.leaderboard-row.podium-3 {
  background: linear-gradient(90deg, rgba(198, 125, 66, .35), rgba(255, 250, 223, .38));
}

.leaderboard-rank span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #70401f;
  border-radius: 50%;
  background: #f1d38a;
  color: #4b2615;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
}

.podium-1 .leaderboard-rank span {
  background: linear-gradient(145deg, #fff0a6, #d19a30);
}

.podium-2 .leaderboard-rank span {
  background: linear-gradient(145deg, #f1f3ef, #aab2b2);
}

.podium-3 .leaderboard-rank span {
  background: linear-gradient(145deg, #e6ad70, #9b542b);
}

.leaderboard-pirate {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: #3c2014;
  text-decoration: none;
}

.leaderboard-pirate:hover strong {
  color: #8a321d;
  text-decoration: underline;
}

.leaderboard-pirate img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 2px solid #6c3b20;
  border-radius: 50%;
  object-fit: cover;
  background: #c7964d;
}

.leaderboard-pirate > span,
.leaderboard-pirate strong,
.leaderboard-pirate small {
  display: block;
  min-width: 0;
}

.leaderboard-pirate strong {
  overflow: hidden;
  font-family: Cinzel, Georgia, serif;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-pirate small {
  margin-top: 2px;
  color: #735039;
  font-weight: 700;
}

.leaderboard-score {
  text-align: right;
}

.leaderboard-score strong,
.leaderboard-score span {
  display: block;
}

.leaderboard-score strong {
  color: #722919;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.22rem;
}

.leaderboard-score span {
  color: #765039;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.leaderboard-you-marker {
  position: absolute;
  top: 4px;
  right: 5px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #7d2d1c;
  color: #ffe9ac;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.leaderboard-empty,
.leaderboard-loading {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 28px;
  color: #65442c;
  text-align: center;
}

.leaderboard-loading {
  grid-auto-flow: column;
  justify-content: center;
  gap: 12px;
}

.leaderboard-pagination {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 140px;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.leaderboard-pagination span {
  color: #6a472e;
  font-size: .82rem;
  font-weight: 800;
  text-align: center;
}

.leaderboard-scope-note {
  margin: 16px 0 0;
  color: #735039;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
}

.leaderboard-error {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 760px) {
  .leaderboard-category-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .leaderboard-category-tab {
    flex: 0 0 auto;
    padding: 0 18px;
  }

  .leaderboard-control-deck,
  .leaderboard-board-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-board-heading > strong {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 680px) {
  .header-actions {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .header-matchmaking-button {
    grid-column: 1 / -1;
  }

  .account-profile-button {
    grid-column: 2;
  }

  .leaderboard-ledger {
    padding: 14px;
  }

  .leaderboard-hero {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
  }

  .leaderboard-hero-icon {
    width: 56px;
    height: 56px;
  }

  .leaderboard-hero-icon svg {
    width: 34px;
    height: 34px;
  }

  .leaderboard-table-head,
  .leaderboard-row {
    grid-template-columns: 48px minmax(0, 1fr) 92px;
  }

  .leaderboard-table-head,
  .leaderboard-row {
    padding-right: 10px;
    padding-left: 10px;
  }

  .leaderboard-pirate img {
    width: 40px;
    height: 40px;
  }

  .leaderboard-pirate {
    gap: 8px;
  }

  .leaderboard-pirate small {
    font-size: .67rem;
  }

  .leaderboard-own-standing {
    grid-template-columns: 1fr;
  }

  .leaderboard-own-standing > span {
    grid-row: auto;
  }

  .leaderboard-pagination {
    grid-template-columns: 1fr 1fr;
  }

  .leaderboard-pagination span {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (max-width: 460px) {
  .leaderboard-table-head {
    display: none;
  }

  .leaderboard-row {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 94px;
  }

  .leaderboard-score {
    grid-column: 2;
    margin-top: 2px;
    text-align: left;
  }

  .leaderboard-score strong,
  .leaderboard-score span {
    display: inline;
  }

  .leaderboard-score span {
    margin-left: 5px;
  }

  .leaderboard-pirate strong {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xp-progress-fill,
  .xp-tally-spinner {
    animation: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 20%, rgba(214, 166, 66, 0.15), transparent 28rem),
    radial-gradient(circle at 20% 80%, rgba(188, 74, 59, 0.11), transparent 24rem),
    linear-gradient(145deg, #081018 0%, #0c1620 48%, #05090e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 44px;
  color: #111820;
  background: radial-gradient(circle at 35% 35%, #fff0c8, var(--gold) 55%, #8b5a19 100%);
  border: 3px solid rgba(255, 241, 202, 0.5);
  box-shadow: 0 14px 32px var(--shadow), inset 0 -8px 16px rgba(0, 0, 0, 0.3);
}

h1, h2, h3, h4 {
  font-family: Cinzel, Georgia, serif;
  letter-spacing: 0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.9;
  color: var(--gold-bright);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.36);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  color: var(--gold-bright);
}

h3 {
  font-size: 1.35rem;
  color: var(--gold-bright);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0 0 8px;
}

.view {
  display: grid;
  gap: 18px;
}

.hero-card,
.panel,
.player-card,
.event-card,
.chat-card,
.action-card,
.summary-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(29, 39, 48, 0.94), rgba(13, 19, 25, 0.96));
  box-shadow: 0 22px 60px var(--shadow);
  border-radius: var(--radius);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 18px;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 26px solid rgba(214, 166, 66, 0.08);
}

.hero-copy p:last-child {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.core-rules {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: 18px;
}

.core-rules ul {
  padding-left: 1.15rem;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.menu-panel,
.panel {
  padding: 22px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-bright);
  font-weight: 800;
}

.text-input,
select {
  width: 100%;
  border: 1px solid rgba(246, 229, 188, 0.24);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

.text-input:focus,
select:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(214, 166, 66, 0.14);
}

select option {
  color: #111820;
}

.button-row,
.join-row,
.lobby-actions,
.action-grid,
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.button-row {
  margin-top: 14px;
}

.join-box {
  margin-top: 22px;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr auto;
}

.primary-button,
.secondary-button,
.ghost-button,
.action-button,
.small-button {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  padding: 12px 18px;
  color: #101820;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.24);
}

.secondary-button {
  background: linear-gradient(180deg, #d7e3ef, #93adc0);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
}

.small-button {
  padding: 8px 12px;
  font-size: 0.86rem;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.small-note,
.muted {
  color: var(--muted);
}

.small-note {
  font-size: 0.92rem;
  margin: 16px 0 0;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.room-code {
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 5rem);
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  margin: 12px 0;
}

.copy-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.player-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.player-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(246, 229, 188, 0.16);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 900;
  color: #0d151d;
  background: var(--gold);
}

.status-pill.waiting {
  background: #95a6b8;
}

.status-pill.ready {
  background: var(--green);
}

.status-pill.danger {
  background: var(--red);
  color: #fff8ee;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.4fr) minmax(230px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.match-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 18px;
}

.turn-label {
  font-weight: 900;
  color: var(--gold-bright);
}

.phase-label {
  text-align: center;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.2rem;
  color: var(--ink);
}

.timer {
  text-align: right;
  color: var(--muted);
  font-weight: 800;
}

.fury-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.fury-track {
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(246, 229, 188, 0.2);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.fury-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width 260ms ease;
}

.player-card,
.event-card,
.chat-card,
.action-card,
.summary-card {
  padding: 18px;
}

.player-card.you {
  border-color: rgba(240, 198, 102, 0.5);
}

.player-name {
  font-family: Cinzel, Georgia, serif;
  font-size: 1.35rem;
  color: var(--gold-bright);
  word-break: break-word;
}

.stat-grid {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-bottom: 1px solid rgba(246, 229, 188, 0.12);
  padding-bottom: 8px;
}

.stat-line strong {
  color: var(--ink);
}

.center-column {
  display: grid;
  gap: 16px;
}

.event-card {
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -54px;
  top: -54px;
  border-radius: 50%;
  background: rgba(214, 166, 66, 0.08);
}

.event-card h3 {
  position: relative;
}

.event-card p {
  color: var(--muted);
  line-height: 1.55;
}

.rule-text {
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(246, 229, 188, 0.14);
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.chat-entry {
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(246, 229, 188, 0.13);
}

.chat-entry.you {
  border-color: rgba(240, 198, 102, 0.45);
}

.chat-entry strong {
  color: var(--gold-bright);
  display: block;
  margin-bottom: 4px;
}

.builder-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-box,
.reveal-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(246, 229, 188, 0.18);
  border-radius: 16px;
  padding: 14px;
  color: var(--ink);
  line-height: 1.5;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.action-button {
  border-radius: 18px;
  min-height: 105px;
  padding: 12px;
  display: grid;
  gap: 6px;
  justify-items: center;
  align-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
}

.action-button:hover,
.action-button.selected {
  background: linear-gradient(180deg, rgba(240, 198, 102, 0.22), rgba(214, 166, 66, 0.12));
  border-color: rgba(240, 198, 102, 0.7);
}

.action-icon {
  font-size: 1.8rem;
}

.action-title {
  font-weight: 900;
  color: var(--gold-bright);
}

.action-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.lock-info {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.reveal-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  margin: 12px 0 0;
  padding-left: 1rem;
}

.summary-card {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.score-tile {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(246, 229, 188, 0.14);
  border-radius: 16px;
  padding: 14px;
}

.score-tile h4 {
  color: var(--gold-bright);
  margin-bottom: 8px;
}

.error-banner {
  background: rgba(188, 74, 59, 0.24);
  border: 1px solid rgba(188, 74, 59, 0.6);
  color: #ffe6df;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .hero-card,
  .lobby-grid,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .match-topbar {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .phase-label,
  .timer {
    text-align: left;
  }

  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slot-grid,
  .scoreboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .site-header {
    align-items: flex-start;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    font-size: 34px;
  }

  .copy-line,
  .join-row {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }
}


/* v0.3.1: two-column play area, persistent chat and click-through phrase workflow */
.ai-box {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(246, 229, 188, 0.12);
}

.match-shell {
  display: grid;
  gap: 16px;
}

.match-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.play-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.player-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.player-strip .player-card {
  min-width: 0;
}

.persistent-chat-card {
  position: sticky;
  top: 16px;
  min-height: 620px;
  max-height: calc(100vh - 48px);
  padding: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(29, 39, 48, 0.94), rgba(13, 19, 25, 0.96));
  box-shadow: 0 22px 60px var(--shadow);
  border-radius: var(--radius);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-log.persistent {
  max-height: none;
  min-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.chat-turn-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 8px 0 2px;
}

.workflow-builder {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.workflow-heading {
  font-family: Cinzel, Georgia, serif;
  color: var(--gold-bright);
  font-weight: 800;
}

.workflow-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trail-chip,
.choice-chip {
  border: 1px solid rgba(246, 229, 188, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 12px;
  box-shadow: none;
  text-align: left;
}

.trail-chip.active,
.choice-chip:hover {
  border-color: rgba(240, 198, 102, 0.72);
  background: rgba(214, 166, 66, 0.16);
}

.trail-chip.complete {
  border-color: rgba(113, 168, 104, 0.55);
  background: rgba(113, 168, 104, 0.12);
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.phrase-choice-grid {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 5px;
}

.intention-chip {
  font-family: Cinzel, Georgia, serif;
  font-weight: 800;
  min-width: 120px;
  text-align: center;
}

.forfeit-row {
  display: flex;
  justify-content: flex-start;
}

.danger-button {
  border-radius: 999px;
  padding: 10px 15px;
  font-weight: 900;
  background: rgba(188, 74, 59, 0.18);
  color: #ffe6df;
  border: 1px solid rgba(188, 74, 59, 0.56);
  box-shadow: none;
}

.score-tile.winner {
  background: rgba(113, 168, 104, 0.19);
  border-color: rgba(113, 168, 104, 0.8);
  box-shadow: 0 0 0 2px rgba(113, 168, 104, 0.13), 0 16px 38px rgba(0, 0, 0, 0.28);
}

.winner-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green);
  color: #0b1710;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.summary-subtitle {
  margin-top: 10px;
}

.rematch-alert {
  margin: 16px auto 0;
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(214, 166, 66, 0.16);
  border: 1px solid rgba(240, 198, 102, 0.46);
  color: var(--gold-bright);
  font-weight: 800;
}

@media (max-width: 900px) {
  .match-columns,
  .player-strip {
    grid-template-columns: 1fr;
  }

  .persistent-chat-card {
    position: static;
    min-height: 420px;
    max-height: none;
  }

  .chat-log.persistent {
    min-height: 300px;
    max-height: 460px;
  }
}


/* v0.3.2: event positioning, generated names, AI cards, talk yielding and in-app confirmation */
.contestant-event-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(300px, 1.25fr) minmax(0, 0.8fr);
  gap: 14px;
  align-items: stretch;
}

.contestant-event-row > * {
  min-width: 0;
}

.compact-event-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.name-picker {
  display: grid;
  gap: 8px;
}

.generated-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(246, 229, 188, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.generated-name {
  flex: 1 1 220px;
  font-family: Cinzel, Georgia, serif;
  color: var(--gold-bright);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.ai-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ai-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(246, 229, 188, 0.16);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.ai-card strong {
  font-family: Cinzel, Georgia, serif;
  color: var(--gold-bright);
}

.ai-card span {
  color: var(--ink);
  font-weight: 800;
}

.ai-card small {
  color: var(--muted);
  line-height: 1.4;
}

.ai-card:hover,
.ai-card.selected {
  border-color: rgba(240, 198, 102, 0.76);
  background: rgba(214, 166, 66, 0.14);
  transform: translateY(-1px);
}

.ai-card.selected {
  box-shadow: 0 0 0 2px rgba(214, 166, 66, 0.12);
}

.ai-play-row {
  margin-top: 12px;
}

.remain-silent-row {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(246, 229, 188, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 10, 0.78);
  backdrop-filter: blur(6px);
}

.confirm-dialog {
  width: min(520px, 100%);
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid rgba(188, 74, 59, 0.58);
  background: linear-gradient(180deg, rgba(34, 29, 30, 0.99), rgba(13, 19, 25, 0.99));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.confirm-dialog h2 {
  margin-bottom: 8px;
}

.confirm-dialog .button-row {
  margin-top: 20px;
}

@media (max-width: 1100px) {
  .ai-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .contestant-event-row {
    grid-template-columns: 1fr;
  }

  .contestant-event-row .compact-event-card {
    order: -1;
  }
}

@media (max-width: 620px) {
  .ai-card-grid {
    grid-template-columns: 1fr;
  }
}

/* v0.4.0 accounts and persistent profiles */
.site-header .brand-copy {
  min-width: 0;
}

.account-bar {
  margin-left: auto;
  align-self: flex-start;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.account-chip.signed-in {
  color: var(--gold-bright);
  border-color: rgba(214, 166, 66, 0.42);
}

.profile-card,
.account-panel,
.recent-matches,
.online-match-box,
.guest-profile {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.2);
}

.online-match-box,
.ai-box,
.account-panel,
.recent-matches,
.join-box {
  margin-top: 18px;
}

.profile-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.2fr);
  gap: 18px;
  align-items: center;
}

.profile-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat-grid > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.profile-stat-grid strong {
  font-family: Cinzel, Georgia, serif;
  color: var(--gold-bright);
  font-size: 1.35rem;
}

.profile-stat-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.selected {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #101820;
  border-color: transparent;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  align-items: end;
}

.auth-form .field-label {
  margin: 0;
  align-self: end;
}

.auth-form .text-input {
  grid-row: 2;
}

.auth-form .field-label:nth-of-type(2) {
  grid-column: 2;
  grid-row: 1;
}

.auth-form #auth-password {
  grid-column: 2;
  grid-row: 2;
}

.register-name-choice,
.auth-submit {
  grid-column: 1 / -1;
}

.register-name-choice {
  margin-top: 8px;
}

.auth-submit {
  justify-self: start;
  margin-top: 4px;
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.auth-tab:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.35);
}

.recent-match-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.recent-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  border-left: 4px solid var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.recent-match-row > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.recent-match-row span,
.recent-match-row small {
  color: var(--muted);
}

.recent-match-row.result-win {
  border-left-color: var(--green);
}

.recent-match-row.result-loss {
  border-left-color: var(--red);
}

.recent-match-row.result-draw {
  border-left-color: var(--gold);
}

.profile-loading {
  color: var(--muted);
  padding: 18px;
}

@media (max-width: 760px) {
  .site-header {
    flex-wrap: wrap;
  }

  .account-bar {
    width: 100%;
    margin-left: 0;
  }

  .profile-card,
  .auth-form {
    grid-template-columns: 1fr;
  }

  .profile-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-form .field-label,
  .auth-form .text-input,
  .auth-form .field-label:nth-of-type(2),
  .auth-form #auth-password,
  .register-name-choice,
  .auth-submit {
    grid-column: 1;
    grid-row: auto;
  }

  .recent-match-row,
  .recent-match-row > div {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v0.4.1 open matchmaking */
.matchmaking-box {
  margin-top: 18px;
  border: 1px solid rgba(214, 166, 66, 0.48);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(145deg, rgba(214, 166, 66, 0.13), rgba(0, 0, 0, 0.24));
  box-shadow: inset 0 0 0 1px rgba(240, 198, 102, 0.07);
}

.matchmaking-lead {
  margin: 8px 0 4px;
  font-weight: 700;
}

.matchmaking-button {
  min-width: 210px;
  font-size: 1rem;
}

.matchmaking-search-panel,
.matchmaking-ready-panel {
  max-width: 820px;
  margin: 28px auto 0;
  text-align: center;
  padding: 34px;
}

.matchmaking-pulse {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  border: 2px solid rgba(214, 166, 66, 0.55);
  border-radius: 50%;
  color: var(--gold-bright);
  font-size: 2.2rem;
  background: rgba(214, 166, 66, 0.08);
  animation: matchmaking-pulse 1.8s ease-in-out infinite;
}

@keyframes matchmaking-pulse {
  0%, 100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(214, 166, 66, 0.28); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 18px rgba(214, 166, 66, 0); }
}

.matchmaking-feedback {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  justify-content: center;
  gap: 14px;
  margin: 26px 0;
}

.matchmaking-feedback > div {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
}

.matchmaking-feedback strong,
.ready-countdown {
  color: var(--gold-bright);
  font-family: Cinzel, Georgia, serif;
  font-size: 1.65rem;
}

.matchmaking-feedback span,
.ready-pirate span,
.ready-pirate small {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.matchmaking-notice {
  margin: 18px auto 0;
  padding: 12px 14px;
  max-width: 620px;
  border-radius: 13px;
  color: var(--ink);
  background: rgba(93, 145, 185, 0.16);
  border: 1px solid rgba(93, 145, 185, 0.35);
}

.matchmaking-actions {
  justify-content: center;
}

.ready-countdown {
  margin: 18px 0;
}

.matchmaking-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 24px 0 28px;
}

.ready-pirate {
  display: grid;
  gap: 7px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.04);
}

.ready-pirate strong {
  font-family: Cinzel, Georgia, serif;
  font-size: 1.2rem;
}

.ready-pirate.is-ready {
  border-color: rgba(113, 168, 104, 0.68);
  background: rgba(113, 168, 104, 0.13);
}

.ready-pirate.is-ready small {
  color: #a9d4a1;
}

.versus-mark {
  color: var(--gold-bright);
  font-family: Cinzel, Georgia, serif;
  font-weight: 800;
}

@media (max-width: 640px) {
  .matchmaking-feedback,
  .matchmaking-versus {
    grid-template-columns: 1fr;
  }

  .versus-mark {
    padding: 2px 0;
  }

  .matchmaking-search-panel,
  .matchmaking-ready-panel {
    padding: 24px 18px;
  }
}

/* v0.4.2: wanted-poster profiles, avatars, speech bubbles and history */
.account-profile-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px 7px 7px;
  box-shadow: none;
  font-weight: 800;
}

.account-profile-button img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.home-profile-area {
  margin-bottom: 20px;
}

.home-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(240, 198, 102, 0.28);
  background: rgba(214, 166, 66, 0.07);
}

.home-profile-avatar,
.mini-avatar,
.player-avatar,
.ready-avatar,
.summary-avatar,
.lobby-avatar,
.chat-avatar,
.history-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  background: #f4e5bf;
}

.home-profile-avatar {
  width: 74px;
  height: 74px;
}

.home-profile-copy {
  min-width: 0;
}

.home-profile-copy .small-note {
  margin-top: 5px;
}

.profile-cta-button {
  margin-top: 14px;
}

.mini-avatar {
  width: 54px;
  height: 54px;
}

.wanted-poster {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px);
  color: #2c2117;
  border: 7px solid #6d4724;
  border-radius: 10px 18px 12px 20px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,0.35), transparent 24%),
    radial-gradient(circle at 90% 85%, rgba(93,53,20,0.13), transparent 28%),
    repeating-linear-gradient(0deg, rgba(89,55,22,0.025) 0 2px, transparent 2px 6px),
    linear-gradient(145deg, #f4e0aa, #d6b878 62%, #c89f5b);
  box-shadow: 0 28px 80px rgba(0,0,0,0.58), inset 0 0 0 3px rgba(80,45,18,0.24);
  position: relative;
  overflow: hidden;
}

.wanted-poster::before,
.wanted-poster::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 18px solid rgba(86,48,19,0.08);
}

.wanted-poster::before {
  left: -56px;
  top: -48px;
}

.wanted-poster::after {
  right: -50px;
  bottom: -52px;
}

.wanted-poster h2,
.wanted-poster h3,
.wanted-poster .eyebrow,
.wanted-poster .field-label {
  color: #4a2b17;
}

.wanted-poster h2 {
  text-align: center;
  font-size: clamp(3.2rem, 9vw, 7rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 0.9;
  text-shadow: 0 3px 0 rgba(255,255,255,0.25);
}

.poster-kicker,
.wanted-subtitle,
.wanted-id {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 900;
}

.poster-kicker {
  font-size: 0.74rem;
  margin-bottom: 8px;
}

.wanted-subtitle {
  margin: 10px 0 24px;
  font-family: Cinzel, Georgia, serif;
}

.wanted-id {
  font-size: 0.72rem;
  color: #6e4b2e;
  text-align: left;
  margin-top: 7px;
}

.wanted-identity {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin: 24px auto;
  padding: 20px;
  width: min(620px, 100%);
  border-top: 3px double rgba(74,43,23,0.6);
  border-bottom: 3px double rgba(74,43,23,0.6);
}

.wanted-identity h3 {
  font-size: clamp(1.7rem, 5vw, 3rem);
}

.wanted-avatar {
  width: clamp(120px, 22vw, 190px);
  height: clamp(120px, 22vw, 190px);
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #9a6a2d;
  box-shadow: 0 10px 20px rgba(62,32,12,0.28);
  background: #f8eac5;
}

.profile-mode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 22px 0;
}

.profile-mode-tab,
.auth-tab {
  border: 1px solid rgba(74,43,23,0.45);
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.16);
  color: #3e2515;
  font-weight: 900;
  box-shadow: none;
}

.profile-mode-tab.selected,
.auth-tab.selected {
  color: #f8e9c1;
  background: #4d2d18;
}

.poster-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 14px;
  color: #4a2b17;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.poster-section-heading::before,
.poster-section-heading::after {
  content: "";
  flex: 1;
  border-top: 2px solid rgba(74,43,23,0.35);
}

.wanted-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wanted-stat {
  padding: 14px 9px;
  text-align: center;
  border: 2px solid rgba(74,43,23,0.3);
  background: rgba(255,255,255,0.15);
}

.wanted-stat strong {
  display: block;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.55rem;
}

.wanted-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.distinctive-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 20px;
  margin-top: 18px;
}

.distinctive-stat-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(74,43,23,0.35);
}

.recent-opponent-grid,
.match-history-list {
  display: grid;
  gap: 10px;
}

.match-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 2px solid rgba(74,43,23,0.24);
  background: rgba(255,255,255,0.13);
}

.match-history-row.result-win { border-left: 8px solid #4f7a3f; }
.match-history-row.result-loss { border-left: 8px solid #9b4935; }
.match-history-row.result-draw { border-left: 8px solid #7b6b4e; }

.history-avatar {
  width: 48px;
  height: 48px;
}

.history-main a,
.history-main span {
  color: #4a2b17;
  font-weight: 900;
}

.history-main small {
  display: block;
  margin-top: 4px;
  color: #6b4c32;
}

.history-numbers {
  text-align: center;
}

.history-numbers strong,
.history-numbers span {
  display: block;
}

.history-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 240px));
  gap: 12px;
  margin-bottom: 14px;
}

.history-filters label {
  color: #4a2b17;
  font-weight: 900;
}

.history-filters select {
  margin-top: 6px;
  background: rgba(255,255,255,0.36);
  border-color: rgba(74,43,23,0.38);
  color: #2c2117;
}

.history-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: #4a2b17;
  font-weight: 800;
}

.wanted-poster .ghost-button {
  color: #3d2515;
  border-color: rgba(74,43,23,0.38);
  background: rgba(255,255,255,0.22);
}

.wanted-empty {
  text-align: center;
  color: #6b4c32;
  font-style: italic;
}

.profile-settings {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.settings-block {
  padding: 16px;
  border: 2px solid rgba(74,43,23,0.25);
  background: rgba(255,255,255,0.12);
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(56px, 1fr));
  gap: 10px;
}

.avatar-option {
  padding: 3px;
  border: 3px solid transparent;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.avatar-option-portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #e1c58b;
}

.avatar-option-portrait img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 109%;
  max-width: none;
  height: 109%;
  object-fit: cover;
  transform: translate(-50%, -50%);
}

.avatar-option.selected {
  border-color: #4f7a3f;
  background: rgba(79,122,63,0.18);
}

.wanted-auth-poster {
  max-width: 760px;
}

.wanted-auth-panel {
  color: #2c2117;
  background: rgba(255,255,255,0.16);
  border: 2px solid rgba(74,43,23,0.3);
  padding: 20px;
  border-radius: 8px;
}

.wanted-auth-panel .text-input {
  background: rgba(255,255,255,0.42);
  color: #2c2117;
  border-color: rgba(74,43,23,0.35);
}

.wanted-auth-panel .small-note {
  color: #6b4c32;
}

.poster-back-button {
  display: block;
  margin: 28px auto 0;
}

.player-identity-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.player-avatar {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
}

.ready-avatar,
.summary-avatar {
  width: 92px;
  height: 92px;
  margin: 0 auto 10px;
}

.lobby-player-identity {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.lobby-avatar {
  width: 40px;
  height: 40px;
}

.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.chat-message-row.you {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.speech-bubble {
  position: relative;
  max-width: calc(100% - 58px);
  padding: 11px 13px;
  border-radius: 17px 17px 17px 5px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(246,229,188,0.17);
}

.chat-message-row.you .speech-bubble {
  border-radius: 17px 17px 5px 17px;
  background: rgba(214,166,66,0.14);
  border-color: rgba(240,198,102,0.36);
}

.speech-bubble strong,
.speech-bubble span {
  display: block;
}

.speech-bubble strong {
  color: var(--gold-bright);
  margin-bottom: 4px;
}

.chat-message-row.warden .speech-bubble {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

@media (max-width: 760px) {
  .home-profile-card,
  .wanted-identity,
  .profile-settings {
    grid-template-columns: 1fr;
  }

  .home-profile-card {
    text-align: center;
  }

  .home-profile-avatar {
    margin: 0 auto;
  }

  .wanted-identity {
    display: grid;
    text-align: center;
  }

  .wanted-id {
    text-align: center;
  }

  .wanted-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .distinctive-stat-grid,
  .history-filters {
    grid-template-columns: 1fr;
  }

  .avatar-picker {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
  }

  .match-history-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .history-numbers {
    grid-column: 2;
    text-align: left;
    display: flex;
    gap: 6px;
  }

  .history-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* v0.4.3: themed navigation, home-page polish and play guide */
.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 18px;
  outline: none;
}

.brand-home:hover .brand-mark {
  transform: rotate(-4deg) scale(1.04);
  box-shadow: 0 18px 38px var(--shadow), inset 0 -8px 16px rgba(0, 0, 0, 0.3);
}

.brand-home:focus-visible {
  box-shadow: 0 0 0 3px rgba(240, 198, 102, 0.28);
}

.brand-home .brand-mark {
  flex: 0 0 auto;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.brand-copy {
  display: block;
  min-width: 0;
}

.brand-copy .eyebrow {
  display: block;
}

.brand-title {
  display: block;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--gold-bright);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.36);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.header-matchmaking-button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.88rem;
  white-space: nowrap;
}

button {
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease, filter 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(240, 198, 102, 0.42);
  outline-offset: 3px;
}

.primary-button,
.secondary-button,
.ghost-button,
.small-button,
.danger-button {
  position: relative;
  border-radius: 10px 14px 10px 14px;
  border: 1px solid rgba(255, 239, 197, 0.42);
  padding: 12px 19px;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-decoration: none;
  overflow: hidden;
}

.primary-button {
  color: #151006;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28), transparent 42%),
    linear-gradient(135deg, #f4cf74, #c98e28 72%, #9b631b);
  border-color: #f2d285;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(84, 48, 9, 0.2),
    inset 0 -4px 0 rgba(82, 44, 8, 0.34);
}

.secondary-button {
  color: #101820;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), transparent 44%),
    linear-gradient(135deg, #d9e7ef, #8ba9bd 72%, #5f7d91);
  border-color: rgba(223, 240, 249, 0.8);
  box-shadow:
    0 9px 22px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(33, 61, 78, 0.16),
    inset 0 -4px 0 rgba(35, 57, 73, 0.25);
}

.ghost-button {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035)),
    rgba(5, 10, 14, 0.38);
  border-color: rgba(240, 198, 102, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.22);
}

.danger-button {
  color: #fff3e9;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent 48%),
    linear-gradient(135deg, #a94337, #6f2825);
  border-color: rgba(244, 137, 117, 0.68);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3), inset 0 -3px 0 rgba(61, 14, 14, 0.38);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.small-button:hover:not(:disabled),
.danger-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255,255,255,0.14);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.ghost-button:active:not(:disabled),
.small-button:active:not(:disabled),
.danger-button:active:not(:disabled) {
  transform: translateY(1px);
}

.action-button,
.choice-chip,
.trail-chip,
.auth-tab,
.profile-mode-tab {
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.action-button:hover:not(:disabled),
.choice-chip:hover:not(:disabled),
.trail-chip:hover:not(:disabled),
.auth-tab:hover:not(:disabled),
.profile-mode-tab:hover:not(:disabled) {
  transform: translateY(-1px);
}

.hero-card {
  display: flex;
  align-items: center;
  min-height: 360px;
  padding: clamp(28px, 5vw, 58px);
  background-image:
    linear-gradient(90deg, rgba(5, 12, 19, 0.97) 0%, rgba(6, 14, 22, 0.9) 35%, rgba(6, 14, 22, 0.56) 50%, rgba(6, 14, 22, 0.08) 70%),
    url('/assets/avatars/Parley-pit-header-background.webp');
  background-size: cover;
  background-position: center center;
  border-color: rgba(240, 198, 102, 0.31);
}

.hero-card::after {
  display: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(44%, 520px);
  min-width: 360px;
}

.hero-copy h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
}

.hero-copy p:last-of-type {
  max-width: 620px;
  color: #e6d8b7;
  font-size: 1.06rem;
  line-height: 1.65;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.hero-actions {
  margin-top: 22px;
}

.rules-button,
.tutorial-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease, filter 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.rules-button:focus-visible,
.tutorial-button:focus-visible {
  outline: 3px solid rgba(240, 198, 102, 0.42);
  outline-offset: 3px;
}

.menu-panel {
  display: grid;
  gap: 22px;
}

.home-profile-area[hidden],
.home-profile-area:empty {
  display: none;
}

.home-play-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.play-mode-card {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  padding: 24px;
  border: 1px solid rgba(240, 198, 102, 0.42);
  border-radius: 18px 24px 18px 24px;
  background:
    linear-gradient(145deg, rgba(214, 166, 66, 0.15), rgba(7, 13, 18, 0.4) 42%),
    linear-gradient(180deg, rgba(30, 42, 51, 0.98), rgba(11, 17, 23, 0.98));
  box-shadow: 0 18px 42px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(255,255,255,0.025);
}

.play-mode-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -48px;
  bottom: -52px;
  border-radius: 50%;
  border: 18px solid rgba(214, 166, 66, 0.07);
  pointer-events: none;
}

.home-play-grid .matchmaking-box,
.home-play-grid .online-match-box {
  margin-top: 0;
}

.private-mode-card {
  border-color: rgba(93, 145, 185, 0.48);
  background:
    linear-gradient(145deg, rgba(93, 145, 185, 0.16), rgba(7, 13, 18, 0.42) 46%),
    linear-gradient(180deg, rgba(27, 40, 50, 0.98), rgba(10, 17, 23, 0.98));
}

.play-mode-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.play-mode-heading .field-label {
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
}

.play-mode-heading h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.mode-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #151006;
  font-size: 1.8rem;
  background: radial-gradient(circle at 35% 30%, #f7df9a, #c18a2e 66%, #6d4616);
  border: 2px solid rgba(255, 234, 174, 0.5);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 -5px 8px rgba(73,38,8,0.28);
}

.mode-icon.private-icon {
  color: #07131c;
  background: radial-gradient(circle at 35% 30%, #dbeaf3, #7197ae 66%, #365466);
  border-color: rgba(221, 240, 249, 0.55);
}

.matchmaking-lead,
.play-mode-card > .small-note {
  line-height: 1.55;
}

.private-room-join {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(246, 229, 188, 0.14);
}

.private-tip {
  position: relative;
  z-index: 1;
  margin-top: 12px;
}

.ai-box {
  margin-top: 0;
  padding: 24px;
  border: 1px solid rgba(246, 229, 188, 0.16);
  border-radius: 18px;
  background: rgba(0,0,0,0.16);
}

.ai-section-heading .small-note {
  margin-top: 4px;
}

.ai-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.ai-card {
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 16px 12px 14px;
  overflow: hidden;
  border: 3px solid #6d4724;
  border-radius: 7px 12px 8px 14px;
  color: #2c2117;
  text-align: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,0.34), transparent 24%),
    repeating-linear-gradient(0deg, rgba(89,55,22,0.025) 0 2px, transparent 2px 6px),
    linear-gradient(145deg, #f1dda6, #d3b271 65%, #c29351);
  box-shadow: 0 12px 25px rgba(0,0,0,0.33), inset 0 0 0 2px rgba(80,45,18,0.18);
}

.ai-card::before {
  content: "";
  position: absolute;
  width: 78px;
  height: 78px;
  right: -36px;
  bottom: -34px;
  border: 11px solid rgba(86,48,19,0.08);
  border-radius: 50%;
}

.ai-card:hover,
.ai-card.selected {
  transform: translateY(-3px) rotate(-0.25deg);
  border-color: #e2b75d;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,0.4), transparent 24%),
    repeating-linear-gradient(0deg, rgba(89,55,22,0.025) 0 2px, transparent 2px 6px),
    linear-gradient(145deg, #f5e6bd, #d9ba79 65%, #c89b58);
  box-shadow: 0 18px 34px rgba(0,0,0,0.42), 0 0 0 3px rgba(214,166,66,0.18), inset 0 0 0 2px rgba(80,45,18,0.18);
}

.ai-card.selected::after {
  content: "Selected";
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #f7eac8;
  background: #4d2d18;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-wanted-kicker {
  color: #5b341a !important;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ai-wanted-avatar {
  display: grid;
  overflow: hidden;
  width: 112px;
  height: 112px;
  margin: 2px auto 5px;
  place-items: center;
  border-radius: 50%;
  border: 4px solid #956127;
  background: #f6e6bd;
  box-shadow: 0 8px 18px rgba(72,39,13,0.28);
}

.ai-wanted-avatar img {
  display: block;
  width: 109%;
  max-width: none;
  height: 109%;
  object-fit: cover;
}

.ai-card strong {
  color: #432615;
  font-size: 1.05rem;
  line-height: 1.15;
}

.ai-card span:not(.ai-wanted-kicker) {
  color: #5e381e;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ai-card small {
  position: relative;
  z-index: 1;
  color: #6b4a2d;
  line-height: 1.35;
}

.ai-play-row {
  justify-content: center;
  margin-top: 18px;
}

.rules-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-color: rgba(240, 198, 102, 0.65);
  background:
    radial-gradient(circle at top right, rgba(214,166,66,0.1), transparent 24rem),
    linear-gradient(180deg, rgba(29, 39, 48, 0.995), rgba(10, 16, 22, 0.995));
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(240, 198, 102, 0.42);
  color: var(--ink);
  background: rgba(0,0,0,0.28);
  font-size: 1.5rem;
  line-height: 1;
}

.dialog-close:hover {
  transform: rotate(4deg) scale(1.05);
  border-color: var(--gold-bright);
}

.rules-intro {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.rules-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.rules-guide-section {
  padding: 17px;
  border: 1px solid rgba(246,229,188,0.16);
  border-radius: 14px;
  background: rgba(0,0,0,0.23);
}

.rules-guide-section h3 {
  margin-bottom: 10px;
}

.rules-guide-section ul,
.rules-guide-section ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.62;
}

.rules-action-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.rules-action-item {
  padding: 14px 12px;
  border: 1px solid rgba(240,198,102,0.25);
  border-radius: 13px;
  background: rgba(214,166,66,0.08);
}

.rules-action-item strong,
.rules-action-item span {
  display: block;
}

.rules-action-item strong {
  color: var(--gold-bright);
  font-family: Cinzel, Georgia, serif;
  margin-bottom: 6px;
}

.rules-action-item span,
.rules-tip-section p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.48;
}

.rules-tip-section {
  text-align: center;
}

.rules-tip-section p {
  max-width: 740px;
  margin: 0 auto;
}

.rules-dialog-actions {
  justify-content: center;
  margin-top: 18px;
}

.profile-top-actions {
  width: min(980px, 100%);
  margin: 0 auto 12px;
  display: flex;
  justify-content: flex-start;
}

.profile-back-button {
  padding: 10px 15px;
}

.wanted-auth-panel .generated-name,
.profile-email {
  color: #3d2515;
}

.wanted-auth-panel .generated-name-row {
  border-color: rgba(74,43,23,0.3);
  background: rgba(255,255,255,0.22);
}

.wanted-poster .ghost-button:hover:not(:disabled) {
  color: #2e1b10;
  border-color: rgba(74,43,23,0.62);
  background: rgba(255,255,255,0.34);
}

@media (max-width: 1100px) {
  .ai-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rules-action-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
  }

  .account-bar {
    width: 100%;
    margin-left: 0;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .hero-card {
    min-height: 390px;
    background-position: 64% center;
    background-image:
      linear-gradient(90deg, rgba(5, 12, 19, 0.98) 0%, rgba(6, 14, 22, 0.9) 46%, rgba(6, 14, 22, 0.35) 68%, rgba(6, 14, 22, 0.08) 100%),
      url('/assets/avatars/Parley-pit-header-background.webp');
  }

  .hero-copy {
    width: 56%;
    min-width: 0;
  }

  .home-play-grid {
    grid-template-columns: 1fr;
  }

  .play-mode-card {
    min-height: 0;
  }

  .rules-guide-grid,
  .rules-action-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .brand-home {
    gap: 12px;
  }

  .brand-title {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .brand-copy .eyebrow {
    font-size: 0.64rem;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .header-matchmaking-button,
  .account-profile-button {
    width: 100%;
    justify-content: center;
  }

  .hero-card {
    min-height: 420px;
    padding: 26px 22px;
    background-position: 72% center;
    background-image:
      linear-gradient(90deg, rgba(5, 12, 19, 0.99) 0%, rgba(6, 14, 22, 0.92) 52%, rgba(6, 14, 22, 0.45) 73%, rgba(6, 14, 22, 0.1) 100%),
      url('/assets/avatars/Parley-pit-header-background.webp');
  }

  .hero-copy {
    width: 67%;
  }

  .hero-copy h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .hero-copy p:last-of-type {
    font-size: 0.95rem;
  }

  .ai-card-grid,
  .rules-guide-grid,
  .rules-action-list {
    grid-template-columns: 1fr;
  }

  .ai-card {
    min-height: 0;
  }

  .ai-wanted-avatar {
    width: 126px;
    height: 126px;
  }

  .rules-dialog {
    padding: 24px 18px;
  }
}

/* v0.4.4: branded header, illustrated play cards and room-code dialog */
.brand-home {
  width: clamp(250px, 34vw, 420px);
  max-width: 48vw;
  gap: 0;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 98px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42));
  transition: transform 160ms ease, filter 160ms ease;
}

.brand-home:hover .brand-logo {
  transform: translateY(-1px) scale(1.015);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5));
}

.image-mode-card {
  isolation: isolate;
  min-height: 340px;
  background-color: #081018;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.image-mode-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(4, 10, 16, 0.99) 0%,
    rgba(5, 12, 19, 0.94) 31%,
    rgba(5, 12, 19, 0.78) 47%,
    rgba(5, 12, 19, 0.25) 67%,
    rgba(5, 12, 19, 0.06) 100%);
}

.image-mode-card::after {
  display: none;
}

.matchmaking-feature-card {
  background-image: url('/assets/avatars/Online-matchmaking.webp');
  border-color: rgba(240, 198, 102, 0.52);
}

.private-feature-card {
  background-image: url('/assets/avatars/Private-online-room.webp');
  border-color: rgba(93, 145, 185, 0.58);
}

.play-mode-content {
  position: relative;
  z-index: 1;
  width: min(50%, 305px);
  min-width: 250px;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.play-mode-content .play-mode-heading {
  margin-bottom: 10px;
}

.play-mode-content .matchmaking-lead {
  margin: 0;
  color: #e9dcc1;
  font-size: 1rem;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.86);
}

.play-mode-actions {
  margin-top: auto;
  align-items: stretch;
}

.play-mode-actions button {
  min-width: 172px;
}

.ai-section-heading h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.ai-card {
  padding-bottom: 50px;
}

.ai-card.selected::after {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 10px;
  z-index: 3;
  min-width: 82px;
  text-align: center;
  transform: translateX(-50%);
}

.join-room-dialog {
  position: relative;
  width: min(500px, 100%);
  border-color: rgba(93, 145, 185, 0.62);
  background:
    radial-gradient(circle at top right, rgba(93, 145, 185, 0.14), transparent 19rem),
    linear-gradient(180deg, rgba(27, 40, 50, 0.995), rgba(8, 14, 20, 0.995));
}

.join-room-dialog h2 {
  padding-right: 38px;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}

.join-room-dialog .muted {
  line-height: 1.55;
}

.room-code-input {
  margin-top: 8px;
  text-align: center;
  text-transform: uppercase;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.join-room-dialog-actions {
  margin-top: 20px;
  justify-content: flex-end;
}

.join-room-error {
  margin: 14px 0;
}

@media (max-width: 900px) {
  .brand-home {
    width: clamp(240px, 52vw, 390px);
    max-width: 70vw;
  }

  .image-mode-card {
    min-height: 360px;
    background-position: 58% center;
  }
}

@media (max-width: 680px) {
  .brand-home {
    width: min(310px, 88vw);
    max-width: 100%;
  }

  .brand-logo {
    max-height: 82px;
  }

  .image-mode-card {
    min-height: 420px;
    padding: 22px;
    background-position: 64% center;
  }

  .image-mode-card::before {
    background: linear-gradient(90deg,
      rgba(4, 10, 16, 0.995) 0%,
      rgba(5, 12, 19, 0.96) 40%,
      rgba(5, 12, 19, 0.78) 58%,
      rgba(5, 12, 19, 0.28) 82%,
      rgba(5, 12, 19, 0.12) 100%);
  }

  .play-mode-content {
    width: 62%;
    min-width: 0;
    min-height: 370px;
  }

  .play-mode-actions {
    width: 100%;
  }

  .play-mode-actions button {
    width: 100%;
    min-width: 0;
  }

  .join-room-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* v0.4.4 logo alignment correction
   Keep this block at the end of the stylesheet so it overrides older brand rules. */
.app-shell {
  padding-top: 10px;
}

.site-header {
  align-items: flex-start;
  min-height: 0;
  gap: 14px;
  margin-bottom: 16px;
}

.brand-home {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: flex-start;
  align-self: flex-start;
  width: auto;
  max-width: none;
  height: 120px;
  min-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  line-height: 0;
  box-shadow: none;
  outline: none;
  background: transparent;
}

.brand-logo {
  display: block;
  width: auto;
  height: 100px;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: left top;
  filter: none;
  transform: none;
  transition: none;
}

.brand-home:hover,
.brand-home:active {
  box-shadow: none;
  background: transparent;
}

.brand-home:hover .brand-logo,
.brand-home:active .brand-logo {
  filter: none;
  transform: none;
}

.brand-home:focus-visible {
  outline: 2px solid rgba(240, 198, 102, 0.72);
  outline-offset: 2px;
  box-shadow: none;
}

.account-bar {
  align-self: flex-start;
}

@media (max-width: 680px) {
  .app-shell {
    padding-top: 8px;
  }

  .site-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .brand-home {
    width: auto;
    max-width: calc(100vw - 48px);
    height: 60px;
  }

  .brand-logo {
    width: auto;
    height: 60px;
    max-width: 100%;
    max-height: none;
  }
}

/* v0.4.5 gameplay and room interface
   Keep match-specific presentation in this final block so older global styles do not override it. */
.match-shell {
  --match-gold-dark: #7d5018;
  --match-gold-mid: #c9902f;
  --match-gold-light: #ffd77a;
  --parchment: #dbc28d;
  --parchment-light: #f2dfad;
  --parchment-ink: #25170d;
}

.match-shell .match-topbar,
.match-shell .fury-wrap {
  border: 1px solid rgba(240, 198, 102, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 52%),
    linear-gradient(135deg, rgba(35, 23, 14, 0.96), rgba(8, 16, 23, 0.98));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.32), 0 12px 28px rgba(0, 0, 0, 0.3);
}

.match-shell .match-topbar {
  border-radius: 14px 14px 5px 5px;
}

.match-shell .fury-wrap {
  position: relative;
  border-radius: 5px 5px 14px 14px;
}

.fury-wrap.fury-changing {
  animation: fury-meter-impact 760ms cubic-bezier(.2, .8, .2, 1);
}

.fury-value {
  min-width: 58px;
  text-align: right;
}

/* Compact Wanted posters for active contestants */
.match-wanted-card {
  position: relative;
  isolation: isolate;
  min-height: 230px;
  padding: 17px 15px 15px;
  overflow: visible;
  color: var(--parchment-ink);
  border: 3px double #684416;
  border-radius: 8px 12px 7px 11px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.48), transparent 22%),
    radial-gradient(circle at 87% 78%, rgba(91, 45, 12, 0.2), transparent 28%),
    linear-gradient(135deg, var(--parchment-light), #c9a96b 78%, #a98245);
  box-shadow:
    inset 0 0 0 2px rgba(255, 239, 190, 0.4),
    inset 0 0 34px rgba(72, 39, 10, 0.28),
    0 15px 34px rgba(0, 0, 0, 0.42);
  transform: rotate(-0.25deg);
}

.match-wanted-card.opponent {
  transform: rotate(0.25deg);
}

.match-wanted-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(74, 38, 10, 0.38);
  border-radius: 4px 8px 5px 7px;
  background-image:
    repeating-linear-gradient(0deg, rgba(72, 40, 13, 0.025) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
}

.match-wanted-card.you {
  border-color: #9a6d21;
  box-shadow:
    inset 0 0 0 2px rgba(255, 239, 190, 0.45),
    inset 0 0 34px rgba(72, 39, 10, 0.28),
    0 0 0 2px rgba(240, 198, 102, 0.16),
    0 15px 34px rgba(0, 0, 0, 0.42);
}

.match-poster-pin {
  position: absolute;
  z-index: 2;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b8, #8b5717 55%, #352009 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.45);
}

.match-poster-pin.pin-left {
  left: 9px;
}

.match-poster-pin.pin-right {
  right: 9px;
}

.match-wanted-kicker {
  margin: 0 18px 12px;
  padding-bottom: 7px;
  color: #6d1d18;
  border-bottom: 2px solid rgba(82, 42, 10, 0.45);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

.match-wanted-identity {
  align-items: center;
  gap: 10px;
}

.match-wanted-avatar {
  width: 62px;
  height: 62px;
  border: 3px solid #6f4313;
  box-shadow: 0 0 0 2px rgba(255, 235, 180, 0.55), 0 5px 11px rgba(57, 28, 5, 0.35);
}

.match-wanted-label {
  display: block;
  color: rgba(50, 28, 11, 0.7);
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-wanted-card .player-name {
  margin-top: 2px;
  color: #2b190b;
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  line-height: 1.05;
  text-shadow: 0 1px rgba(255, 240, 194, 0.75);
}

.match-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.match-stat {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 7px 8px;
  color: var(--parchment-ink);
  border: 1px solid rgba(82, 42, 10, 0.32);
  border-radius: 5px;
  background: rgba(255, 244, 205, 0.28);
  box-shadow: inset 0 0 8px rgba(86, 44, 8, 0.08);
  text-align: center;
}

.match-stat > span:first-child {
  color: rgba(49, 26, 10, 0.68);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-stat > strong {
  color: #341d0b;
  font-family: Cinzel, Georgia, serif;
  font-size: 1rem;
  line-height: 1.1;
}

/* Dramatic Pit Event card */
.pit-event-card {
  --event-accent: #d99a2b;
  position: relative;
  isolation: isolate;
  justify-content: flex-start;
  min-height: 230px;
  padding: 20px 22px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--event-accent) 68%, #2a1708);
  border-radius: 18px 6px 18px 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 36%),
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--event-accent) 22%, transparent), transparent 36%),
    linear-gradient(155deg, #25170f, #0b141d 55%, #050a0f);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.5),
    inset 0 0 32px rgba(0, 0, 0, 0.58),
    0 16px 38px rgba(0, 0, 0, 0.45);
}

.pit-event-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 7px;
  width: auto;
  height: auto;
  border: 1px solid color-mix(in srgb, var(--event-accent) 42%, transparent);
  border-radius: 12px 3px 12px 3px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 7px);
}

.pit-event-card::after {
  content: "☠";
  position: absolute;
  z-index: -1;
  right: 14px;
  bottom: -31px;
  color: color-mix(in srgb, var(--event-accent) 17%, transparent);
  font-family: Georgia, serif;
  font-size: 8rem;
  line-height: 1;
  transform: rotate(-9deg);
}

.pit-event-card.event-blood { --event-accent: #d04b32; }
.pit-event-card.event-mercy { --event-accent: #4cb9c9; }
.pit-event-card.event-oath { --event-accent: #4ecfe7; }
.pit-event-card.event-greed { --event-accent: #e4b33e; }
.pit-event-card.event-hazard { --event-accent: #e3782d; }

.pit-event-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pit-event-card .eyebrow {
  color: var(--event-accent);
}

.pit-event-category {
  padding: 4px 7px;
  color: color-mix(in srgb, var(--event-accent) 76%, white);
  border: 1px solid color-mix(in srgb, var(--event-accent) 48%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--event-accent) 10%, rgba(0, 0, 0, 0.2));
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pit-event-card h3 {
  margin: 3px 0 6px;
  color: #ffe0a0;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.78);
}

.pit-event-card .pit-event-flavour {
  position: relative;
  margin: 0 0 12px;
  color: #d9c8a5;
  font-family: Georgia, serif;
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.45;
}

.pit-event-card .rule-text {
  position: relative;
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 11px 12px;
  color: #fff1c8;
  border: 1px solid color-mix(in srgb, var(--event-accent) 40%, rgba(255, 255, 255, 0.12));
  border-radius: 5px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--event-accent) 12%, transparent), rgba(0, 0, 0, 0.28));
}

.rule-kicker {
  color: var(--event-accent);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.pit-event-trigger-banner {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: 90%;
  padding: 8px 14px;
  color: #1d0f05;
  border: 2px solid #ffe29a;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffd76b, #b96b1e);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.6);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-2deg);
}

.pit-event-triggered {
  border-color: color-mix(in srgb, var(--event-accent) 90%, white);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.5),
    inset 0 0 36px color-mix(in srgb, var(--event-accent) 18%, transparent),
    0 0 0 2px color-mix(in srgb, var(--event-accent) 22%, transparent),
    0 18px 42px rgba(0, 0, 0, 0.5);
}

.pit-event-animating {
  animation: pit-event-impact 940ms cubic-bezier(.18, .84, .28, 1);
}

.pit-event-animating .pit-event-trigger-banner {
  animation: pit-event-stamp 1350ms cubic-bezier(.17, .89, .32, 1.25) both;
}

/* Fast intention + action phrase builder */
.quick-talk-card {
  border-color: rgba(240, 198, 102, 0.28);
  background:
    linear-gradient(180deg, rgba(37, 28, 17, 0.92), rgba(10, 17, 23, 0.98));
}

.quick-phrase-builder {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.phrase-step-block,
.phrase-preview-stage {
  display: grid;
  gap: 10px;
}

.quick-phrase-builder .workflow-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-phrase-builder .workflow-heading > span {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #1c1207;
  border-radius: 50%;
  background: linear-gradient(180deg, #f4cd6f, #b2761c);
  font-family: Inter, sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  box-shadow: inset 0 -2px rgba(74, 39, 8, 0.38);
}

.quick-intention-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.match-shell .intention-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  min-width: 0;
  min-height: 82px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid rgba(240, 198, 102, 0.24);
  border-radius: 9px 4px 9px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 46%),
    linear-gradient(135deg, rgba(43, 36, 27, 0.9), rgba(12, 20, 27, 0.96));
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.28), 0 5px 12px rgba(0, 0, 0, 0.2);
  text-align: left;
}

.intention-card-icon {
  width: 60px;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.48));
}

.intention-card-copy {
  display: grid;
  min-width: 0;
}

.match-shell .intention-card strong {
  color: #f2c968;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.94rem;
  line-height: 1.18;
}

.match-shell .intention-card:hover:not(:disabled),
.match-shell .intention-card.selected {
  border-color: rgba(255, 213, 112, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 231, 169, 0.15), transparent 48%),
    linear-gradient(135deg, rgba(90, 61, 25, 0.92), rgba(18, 25, 30, 0.98));
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(214, 166, 66, 0.1), 0 8px 18px rgba(0, 0, 0, 0.3);
}

.match-shell .featured-calm-intent {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(242, 126, 61, 0.58);
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 190, 90, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(106, 42, 20, 0.98), rgba(38, 20, 17, 0.98) 56%, rgba(10, 17, 21, 0.98));
  box-shadow:
    inset 0 -3px rgba(0, 0, 0, 0.34),
    inset 0 0 24px rgba(255, 86, 29, 0.1),
    0 5px 12px rgba(0, 0, 0, 0.24);
}

.match-shell .featured-calm-intent::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 205, 111, 0.12) 48%, transparent 72%);
  transform: translateX(-110%);
  animation: calm-intent-sweep 3.2s ease-in-out infinite;
}

.match-shell .featured-calm-intent strong {
  color: #ffd27a;
  letter-spacing: 0.025em;
}

.match-shell .featured-calm-intent:hover:not(:disabled),
.match-shell .featured-calm-intent.selected {
  border-color: rgba(255, 188, 76, 0.9);
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 213, 119, 0.3), transparent 36%),
    linear-gradient(135deg, rgba(139, 52, 20, 0.99), rgba(57, 24, 17, 0.99) 56%, rgba(13, 20, 23, 0.99));
  box-shadow:
    inset 0 -3px rgba(0, 0, 0, 0.34),
    inset 0 0 28px rgba(255, 98, 32, 0.15),
    0 0 0 2px rgba(255, 174, 62, 0.13),
    0 8px 18px rgba(0, 0, 0, 0.32);
}

@keyframes calm-intent-sweep {
  0%, 58% { transform: translateX(-110%); }
  82%, 100% { transform: translateX(110%); }
}


.quick-talk-footer {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(246, 229, 188, 0.12);
}

.quick-talk-controls {
  display: flex;
  gap: 9px;
  align-items: stretch;
  flex-wrap: wrap;
}

.talk-utility-button {
  display: inline-grid;
  grid-template-columns: 46px auto;
  min-height: 58px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 6px 12px 7px 7px;
  color: #f5ddb0;
  border: 1px solid rgba(240, 198, 102, 0.34);
  border-radius: 9px 4px 9px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 48%),
    linear-gradient(135deg, rgba(52, 34, 23, 0.94), rgba(10, 17, 22, 0.98));
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.32), 0 6px 14px rgba(0, 0, 0, 0.24);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.talk-utility-button img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.48));
}

.talk-utility-button:hover:not(:disabled) {
  border-color: rgba(255, 213, 112, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 229, 160, 0.14), transparent 50%),
    linear-gradient(135deg, rgba(84, 53, 27, 0.96), rgba(13, 21, 27, 0.99));
  transform: translateY(-1px);
}

.talk-utility-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.quick-response-button {
  min-width: 100px;
}

.remain-silent-button {
  min-width: 172px;
  margin-left: auto;
  border-color: rgba(182, 192, 201, 0.3);
}

.message-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.message-action-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 180px));
}

.message-action-choice {
  display: grid;
  min-width: 0;
  gap: 5px;
  justify-items: center;
  padding: 8px 6px 9px;
  color: var(--ink);
  border: 1px solid rgba(246, 229, 188, 0.22);
  border-radius: 8px;
  background: rgba(4, 9, 13, 0.52);
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.28);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.74rem;
  font-weight: 900;
}

.message-action-choice img {
  width: 52px;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.45));
}

.message-action-choice:hover,
.message-action-choice.selected {
  border-color: rgba(240, 198, 102, 0.78);
  background: rgba(214, 166, 66, 0.15);
  transform: translateY(-1px);
}

.message-action-choice.selected {
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(240, 198, 102, 0.12);
}

.phrase-preview {
  display: grid;
  gap: 5px;
  color: #2c190b;
  border: 2px solid #805219;
  border-radius: 6px 12px 6px 12px;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.5), transparent 25%),
    linear-gradient(135deg, #efda9f, #c39b58);
  box-shadow: inset 0 0 22px rgba(92, 48, 9, 0.2), 0 8px 18px rgba(0, 0, 0, 0.28);
  font-family: Georgia, serif;
  font-size: 1rem;
}

.preview-label {
  color: #76241b;
  font-family: Inter, sans-serif;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.phrase-builder-actions {
  margin-top: 0;
}

/* Illustrated action selection */
.room-action-card {
  border: 1px solid rgba(240, 198, 102, 0.34);
  background:
    linear-gradient(180deg, rgba(47, 32, 18, 0.93), rgba(7, 13, 18, 0.98));
}

.standard-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.match-shell .action-button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 230px;
  grid-template-rows: auto 1fr;
  gap: 8px;
  align-content: start;
  justify-items: stretch;
  padding: 8px 8px 12px;
  overflow: hidden;
  color: var(--ink);
  border: 2px solid rgba(190, 133, 43, 0.56);
  border-radius: 11px 4px 11px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(150deg, #2d251d, #0a1117 64%, #05090c);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.52),
    inset 0 -5px rgba(0, 0, 0, 0.38),
    0 8px 19px rgba(0, 0, 0, 0.32);
  text-align: center;
}

.match-shell .action-button::before {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  border: 1px solid rgba(255, 214, 120, 0.12);
  border-radius: 7px 2px 7px 2px;
}

.action-art-frame {
  display: grid;
  width: 100%;
  place-items: center;
  overflow: hidden;
  border-radius: 8px 2px 8px 2px;
  background: rgba(0, 0, 0, 0.2);
}

.action-art {
  display: block;
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.54));
  transition: transform 180ms ease, filter 180ms ease;
}

.action-copy {
  display: grid;
  gap: 4px;
  align-content: start;
}

.match-shell .action-title {
  color: #ffd77c;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.05rem;
  line-height: 1;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.74);
}

.match-shell .action-hint {
  color: #cdbf9f;
  font-size: 0.67rem;
  line-height: 1.3;
}

.match-shell .action-button:hover:not(:disabled),
.match-shell .action-button.selected {
  border-color: rgba(255, 216, 123, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 230, 166, 0.16), transparent 34%),
    linear-gradient(150deg, #543a1f, #101820 64%, #070b0e);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.52),
    inset 0 -5px rgba(0, 0, 0, 0.38),
    0 0 0 2px rgba(214, 166, 66, 0.12),
    0 13px 27px rgba(0, 0, 0, 0.46);
  transform: translateY(-2px);
}

.match-shell .action-button:hover:not(:disabled) .action-art,
.match-shell .action-button.selected .action-art {
  filter: drop-shadow(0 10px 13px rgba(0, 0, 0, 0.62)) brightness(1.08);
  transform: scale(1.025);
}

.match-shell .action-button.selected {
  outline: 2px solid rgba(255, 222, 143, 0.25);
  outline-offset: 2px;
}

.action-selected-mark {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  color: #201303;
  border: 1px solid #ffe4a2;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe192, #bd7c20);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.parley-choice-wrap {
  margin-top: 12px;
}

.parley-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 9px;
  color: #7cd7e8;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.parley-divider::before,
.parley-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(77, 198, 220, 0.55), transparent);
}

.match-shell .parley-action-button {
  min-height: 190px;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px 18px 12px 12px;
  border-color: rgba(72, 200, 225, 0.62);
  border-radius: 18px 5px 18px 5px;
  background:
    linear-gradient(90deg, rgba(50, 218, 239, 0.13), transparent 48%),
    radial-gradient(circle at 80% 50%, rgba(41, 155, 197, 0.15), transparent 42%),
    linear-gradient(145deg, #142d38, #07141d 58%, #03080d);
  text-align: left;
}

.parley-action-button .action-art {
  max-width: 176px;
}

.parley-action-button .action-copy {
  justify-items: start;
}

.parley-action-button .action-title {
  color: #a9edfa;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.parley-action-button .action-hint {
  max-width: 440px;
  color: #c7e7ed;
  font-size: 0.86rem;
  line-height: 1.4;
}

.parley-commitment {
  display: inline-block;
  width: fit-content;
  margin-bottom: 4px;
  padding: 5px 9px;
  color: #051116;
  border-radius: 999px;
  background: linear-gradient(180deg, #b9f4ff, #49afc6);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-shell .parley-action-button:hover:not(:disabled),
.match-shell .parley-action-button.selected {
  border-color: #a8edfa;
  background:
    linear-gradient(90deg, rgba(88, 226, 245, 0.23), transparent 52%),
    radial-gradient(circle at 80% 50%, rgba(64, 190, 225, 0.22), transparent 42%),
    linear-gradient(145deg, #1c4351, #081925 58%, #03080d);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.52),
    0 0 0 2px rgba(83, 213, 235, 0.13),
    0 0 26px rgba(41, 183, 213, 0.18),
    0 14px 30px rgba(0, 0, 0, 0.5);
}

.action-lock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.lock-action-button {
  min-width: 180px;
}

.selected-action-summary {
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-action-summary strong {
  color: var(--gold-bright);
}

/* Reveal stage, outcome feedback and Ready acceleration */
.reveal-card {
  overflow: hidden;
  border-color: rgba(240, 198, 102, 0.34);
  background:
    radial-gradient(circle at 50% 12%, rgba(214, 166, 66, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(35, 24, 15, 0.97), rgba(6, 13, 18, 0.99));
}

.reveal-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 15px;
}

.reveal-action {
  display: grid;
  min-width: 0;
  gap: 5px;
  justify-items: center;
  padding: 11px;
  overflow: hidden;
  border: 2px solid rgba(240, 198, 102, 0.38);
  border-radius: 12px 4px 12px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 40%),
    rgba(4, 10, 15, 0.62);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.45), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.reveal-action img {
  display: block;
  width: min(100%, 178px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.56));
}

.reveal-action strong {
  color: #ffd473;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.2rem;
}

.reveal-player-name {
  max-width: 100%;
  color: #d0c2a3;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.reveal-parley {
  border-color: rgba(82, 212, 234, 0.62);
  box-shadow: inset 0 0 25px rgba(39, 174, 202, 0.13), 0 8px 18px rgba(0, 0, 0, 0.3);
}

.reveal-parley strong {
  color: #a8edfa;
}

.reveal-versus {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #251405;
  border: 2px solid #ffe3a0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffe6a6, #c48323 60%, #67400f);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5), inset 0 -4px rgba(76, 38, 5, 0.34);
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
}

.reveal-enter-p1 {
  animation: reveal-action-left 760ms cubic-bezier(.16, .88, .28, 1.1) both;
}

.reveal-enter-p2 {
  animation: reveal-action-right 760ms cubic-bezier(.16, .88, .28, 1.1) both;
}

.reveal-card-animating .reveal-versus {
  animation: reveal-versus-impact 680ms 210ms cubic-bezier(.18, .9, .35, 1.2) both;
}

.reveal-narration {
  margin-top: 12px;
  padding: 12px 14px;
  color: #f3e0b5;
  border-left: 4px solid #d4a33b;
  background: rgba(0, 0, 0, 0.27);
  line-height: 1.46;
}

.reveal-outcome-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.reveal-outcome-tile {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(246, 229, 188, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

.reveal-outcome-tile span {
  color: #bbaa88;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reveal-outcome-tile strong {
  color: #f2dfb7;
  font-size: 0.78rem;
  line-height: 1.3;
}

.reveal-outcome-tile.benefit strong { color: #9ad58f; }
.reveal-outcome-tile.harm strong { color: #ff967e; }

.reveal-event-impact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  color: #1d1105;
  border: 1px solid #f4cf76;
  border-radius: 6px;
  background: linear-gradient(90deg, #d18c2d, #f2cf78 56%, #a75c1d);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.reveal-event-impact span {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reveal-event-impact.quiet {
  color: #c7b895;
  border-color: rgba(246, 229, 188, 0.13);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: none;
}

.reveal-details {
  margin-top: 10px;
  color: var(--muted);
}

.reveal-details summary {
  cursor: pointer;
  color: #d8c99f;
  font-size: 0.72rem;
  font-weight: 900;
}

.reveal-ready-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(240, 198, 102, 0.26);
  border-radius: 10px 4px 10px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 50%),
    rgba(7, 14, 20, 0.74);
}

.reveal-ready-status {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.reveal-ready-panel > .small-note {
  grid-column: 1 / -1;
}

.reveal-ready-button {
  min-width: 180px;
  justify-self: start;
}

/* Floating state changes */
.stat-float {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 58%;
  width: max-content;
  max-width: 150px;
  padding: 5px 8px;
  pointer-events: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(4, 8, 10, 0.94);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, 0);
  animation: stat-float-up 1450ms cubic-bezier(.18, .82, .3, 1) both;
}

.stat-float.benefit {
  color: #b9f09c;
  box-shadow: 0 0 14px rgba(122, 207, 103, 0.28);
}

.stat-float.harm {
  color: #ff9a80;
  box-shadow: 0 0 14px rgba(224, 74, 48, 0.3);
}

.fury-stat-float {
  left: auto;
  right: 42px;
  bottom: 62%;
  transform: none;
}

/* Pit Chat now begins at the top and grows downward. */
.persistent-chat-card {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.chat-log.persistent {
  align-content: start;
  grid-auto-rows: max-content;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.chat-new-message {
  justify-self: center;
  padding: 7px 11px;
  color: #1c1207;
  border: 1px solid #ffe29b;
  border-radius: 999px;
  background: linear-gradient(180deg, #f4ce72, #b87920);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35);
  font-size: 0.69rem;
  font-weight: 900;
}

@keyframes stat-float-up {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -4px) scale(1.08); }
  72% { opacity: 1; transform: translate(-50%, -34px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(0.94); }
}

@keyframes fury-meter-impact {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-5px); }
  36% { transform: translateX(5px); }
  54% { transform: translateX(-3px); }
  72% { transform: translateX(2px); }
}

@keyframes pit-event-impact {
  0% { transform: scale(1); filter: brightness(1); }
  28% { transform: scale(1.018) rotate(-0.3deg); filter: brightness(1.3); }
  58% { transform: scale(0.995) rotate(0.2deg); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes pit-event-stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg) scale(2); }
  26% { opacity: 1; transform: translate(-50%, -50%) rotate(-2deg) scale(0.92); }
  42% { transform: translate(-50%, -50%) rotate(-2deg) scale(1.04); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -75%) rotate(-2deg) scale(1); }
}

@keyframes reveal-action-left {
  0% { opacity: 0; transform: translateX(-44px) rotate(-4deg) scale(0.9); }
  66% { opacity: 1; transform: translateX(4px) rotate(0.5deg) scale(1.02); }
  100% { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

@keyframes reveal-action-right {
  0% { opacity: 0; transform: translateX(44px) rotate(4deg) scale(0.9); }
  66% { opacity: 1; transform: translateX(-4px) rotate(-0.5deg) scale(1.02); }
  100% { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

@keyframes reveal-versus-impact {
  0% { opacity: 0; transform: scale(2.1) rotate(-12deg); }
  55% { opacity: 1; transform: scale(0.88) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@media (max-width: 1020px) {
  .contestant-event-row {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1.2fr) minmax(0, 1fr);
  }

  .standard-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-shell .action-button {
    min-height: 210px;
  }

}

@media (max-width: 900px) {
  .contestant-event-row {
    grid-template-columns: 1fr 1fr;
  }

  .pit-event-card {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .match-wanted-card {
    grid-row: 2;
  }

  .message-action-grid {
    grid-template-columns: repeat(5, minmax(62px, 1fr));
  }
}

@media (max-width: 680px) {
  .contestant-event-row {
    grid-template-columns: 1fr;
  }

  .pit-event-card,
  .match-wanted-card {
    grid-column: 1;
    grid-row: auto;
  }

  .match-wanted-card,
  .match-wanted-card.opponent {
    transform: none;
  }

  .quick-intention-grid,
  .standard-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .message-action-grid,
  .message-action-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-shell .action-button {
    min-height: 195px;
  }

  .match-shell .parley-action-button {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px 12px 15px;
    text-align: center;
  }

  .parley-action-button .action-art {
    max-width: 190px;
  }

  .parley-action-button .action-copy {
    justify-items: center;
  }

  .reveal-stage {
    grid-template-columns: 1fr 44px 1fr;
    gap: 7px;
  }

  .reveal-action {
    padding: 7px;
  }

  .reveal-versus {
    width: 42px;
    height: 42px;
    font-size: 0.76rem;
  }

  .reveal-outcome-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reveal-outcome-grid .fury-outcome {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .reveal-ready-panel {
    grid-template-columns: 1fr;
  }

  .reveal-ready-button {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .quick-intention-grid,
  .standard-action-grid {
    grid-template-columns: 1fr;
  }

  .match-shell .action-button {
    min-height: 0;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
    text-align: left;
  }

  .match-shell .action-button .action-art {
    max-width: 112px;
  }

  .match-shell .action-button .action-copy {
    text-align: left;
  }

  .match-shell .parley-action-button {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .match-shell .parley-action-button .action-copy {
    text-align: center;
  }

  .reveal-stage {
    grid-template-columns: 1fr;
  }

  .reveal-versus {
    margin: -2px auto;
  }

  .reveal-action img {
    width: min(100%, 150px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .match-shell *,
  .match-shell *::before,
  .match-shell *::after {
    scroll-behavior: auto !important;
  }

  .reveal-enter-p1,
  .reveal-enter-p2,
  .reveal-card-animating .reveal-versus,
  .pit-event-animating,
  .pit-event-animating .pit-event-trigger-banner,
  .fury-wrap.fury-changing,
  .stat-float {
    animation: none !important;
  }

  .stat-float {
    position: static;
    display: inline-block;
    margin-top: 4px;
    transform: none;
    opacity: 1;
  }

  .pit-event-trigger-banner {
    position: static;
    width: fit-content;
    margin: 10px auto 0;
    transform: none;
  }
}

/* v0.4.6 room-flow and layout polish */
.pre-match-shell {
  width: min(940px, 100%);
  margin: 18px auto 0;
}

.pre-match-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 4vw, 38px);
  color: var(--ink);
  border: 2px solid rgba(224, 169, 65, 0.62);
  border-radius: 20px 7px 20px 7px;
  background:
    radial-gradient(circle at 50% 0%, rgba(222, 163, 59, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(57, 36, 20, 0.98), rgba(13, 16, 19, 0.99));
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.5),
    inset 0 0 48px rgba(0, 0, 0, 0.38),
    0 24px 60px rgba(0, 0, 0, 0.48);
}

.pre-match-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid rgba(255, 214, 119, 0.2);
  border-radius: 13px 3px 13px 3px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 8px);
  pointer-events: none;
}

.pre-match-panel h2 {
  font-size: clamp(2rem, 5vw, 3.45rem);
}

.pre-match-lead {
  max-width: 650px;
  margin: 10px auto 0;
  color: #d2c29f;
  line-height: 1.55;
}

.pre-match-emblem {
  display: grid;
  width: 144px;
  height: 144px;
  place-items: center;
  margin: -4px auto 12px;
}

.pre-match-emblem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.58));
}

.matchmaking-emblem img {
  animation: parley-coin-search 2.35s ease-in-out infinite;
}

.matchmaking-search-panel,
.matchmaking-ready-panel {
  max-width: none;
  margin: 0;
  text-align: center;
}

.matchmaking-feedback {
  grid-template-columns: repeat(2, minmax(160px, 210px));
  gap: 12px;
  margin: 24px 0 20px;
}

.matchmaking-feedback > div {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(234, 188, 91, 0.36);
  border-radius: 10px 4px 10px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 52%),
    rgba(11, 13, 15, 0.48);
  box-shadow: inset 0 -4px rgba(0, 0, 0, 0.25);
}

.matchmaking-feedback span {
  order: 1;
  color: #bdae8d;
}

.matchmaking-feedback strong {
  order: 2;
  color: #ffd67c;
  font-size: 1.8rem;
}

.matchmaking-notice {
  color: #f5ddb0;
  border-color: rgba(224, 169, 65, 0.42);
  background: rgba(147, 91, 24, 0.22);
}

.pre-match-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  text-align: left;
}

.pre-match-heading-coin {
  width: 96px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 9px 13px rgba(0, 0, 0, 0.55));
}

.pre-match-heading .pre-match-lead {
  margin-left: 0;
}

.ready-countdown {
  display: grid;
  width: 94px;
  min-height: 72px;
  place-items: center;
  margin: 0;
  padding: 10px;
  color: #221303;
  border: 2px solid #ffe39c;
  border-radius: 12px 4px 12px 4px;
  background: linear-gradient(180deg, #f4d27c, #a96519);
  box-shadow: inset 0 -4px rgba(83, 43, 7, 0.3), 0 9px 18px rgba(0, 0, 0, 0.38);
  text-align: center;
}

.matchmaking-versus {
  gap: 20px;
  margin: 26px 0 24px;
}

.pre-match-pirate {
  position: relative;
  min-height: 246px;
  align-content: center;
  padding: 24px 18px 20px;
  color: #2c190b;
  border: 3px double #684416;
  border-radius: 8px 12px 7px 11px;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.5), transparent 24%),
    linear-gradient(135deg, #f1dda7, #caa76a 78%, #9e773c);
  box-shadow: inset 0 0 26px rgba(73, 39, 9, 0.24), 0 14px 28px rgba(0, 0, 0, 0.38);
}

.pre-match-pirate.is-you {
  border-color: #9a6d21;
  box-shadow: inset 0 0 26px rgba(73, 39, 9, 0.24), 0 0 0 3px rgba(240, 198, 102, 0.14), 0 14px 28px rgba(0, 0, 0, 0.38);
}

.pre-match-pirate.is-ready {
  border-color: #7a7f31;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.5), transparent 24%),
    linear-gradient(135deg, #efe2ae, #b9b56a 78%, #7e7339);
}

.pre-match-pirate .pre-match-role {
  position: absolute;
  top: 12px;
  left: 50%;
  width: max-content;
  color: #f6e4ba;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 4px #000;
  transform: translateX(-50%);
}

.pre-match-pirate strong {
  color: #2b190b;
  font-size: 1.22rem;
}

.pre-match-pirate small,
.pre-match-pirate span {
  color: #684818;
}

.pre-match-pirate.is-ready small {
  color: #315a27;
  font-weight: 900;
}

.pre-match-pirate .ready-avatar {
  width: 104px;
  height: 104px;
  margin: 14px auto 5px;
  border-color: #714512;
  box-shadow: 0 0 0 2px rgba(255, 236, 184, 0.58), 0 7px 13px rgba(57, 28, 5, 0.32);
}

.versus-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #251405;
  border: 2px solid #ffe3a0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffe6a6, #c48323 60%, #67400f);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5), inset 0 -4px rgba(76, 38, 5, 0.34);
}

.private-lobby-panel {
  text-align: left;
}

.private-lobby-heading {
  grid-template-columns: auto minmax(0, 1fr);
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(237, 195, 105, 0.22);
}

.private-lobby-heading .room-code {
  display: inline;
  margin: 0;
  color: #ffd77c;
  font-size: inherit;
  letter-spacing: 0.09em;
}

.private-lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 16px;
  margin-top: 20px;
}

.private-invite-card,
.private-roster-card {
  padding: 18px;
  border: 1px solid rgba(234, 188, 91, 0.28);
  border-radius: 12px 4px 12px 4px;
  background: rgba(4, 7, 9, 0.36);
  box-shadow: inset 0 -4px rgba(0, 0, 0, 0.2);
}

.pre-match-section-label {
  display: block;
  color: #e4bd62;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.private-lobby-panel .copy-line {
  margin-top: 12px;
}

.private-lobby-panel .lobby-actions {
  margin-top: 14px;
}

.private-lobby-panel .player-list {
  margin-top: 12px;
}

.private-lobby-panel .player-slot {
  min-height: 66px;
  border-color: rgba(234, 188, 91, 0.22);
  border-radius: 9px 3px 9px 3px;
  background: rgba(255, 255, 255, 0.045);
}

.private-lobby-panel .player-slot.is-you {
  border-color: rgba(240, 198, 102, 0.55);
  background: rgba(214, 166, 66, 0.1);
}

.lobby-player-identity > span {
  display: grid;
  gap: 2px;
  color: #f4e3bb;
  font-weight: 800;
}

.lobby-player-identity small {
  color: #bda978;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* Put turn status and Pit Fury beside the compact arena overview on wide screens. */
.match-overview {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) 146px;
  gap: 10px;
  align-items: stretch;
}

.match-shell .match-topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: center;
  padding: 11px;
  border-radius: 14px 4px 14px 4px;
}

.match-status-item {
  display: grid;
  gap: 2px;
  padding: 8px 7px;
  border: 1px solid rgba(240, 198, 102, 0.17);
  border-radius: 7px 3px 7px 3px;
  background: rgba(0, 0, 0, 0.2);
  text-align: left;
}

.match-status-item > span {
  color: #a9997b;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.match-status-item strong {
  line-height: 1.1;
}

.match-shell .turn-label,
.match-shell .phase-label,
.match-shell .timer {
  text-align: left;
}

.match-shell .turn-label {
  color: #ffd77c;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.02rem;
}

.match-shell .phase-label {
  color: #f3ddb0;
  font-size: 0.82rem;
}

.match-shell .timer {
  color: #ffd77c;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.45rem;
}

.match-shell .fury-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  justify-items: center;
  align-items: center;
  padding: 12px 10px;
  border-radius: 4px 14px 4px 14px;
  text-align: center;
}

.fury-heading {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.fury-heading > span {
  color: #d7b25b;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-shell .fury-value {
  min-width: 0;
  color: #ffe19a;
  font-size: 1.05rem;
  text-align: center;
}

.match-shell .fury-track {
  display: flex;
  width: 28px;
  height: 116px;
  align-items: flex-end;
  border-radius: 8px 8px 4px 4px;
}

.match-shell .fury-fill {
  width: 100%;
  height: var(--fury-percent);
  background: linear-gradient(0deg, var(--gold), var(--red));
  transition: height 260ms ease;
}

.fury-caption {
  color: #9f9278;
  font-size: 0.58rem;
  line-height: 1.3;
}

.match-overview .fury-stat-float {
  left: 50%;
  right: auto;
  bottom: 42%;
  transform: translate(-50%, 0);
}

/* Make the overview and action area materially shorter without sacrificing readability. */
.match-wanted-card,
.pit-event-card {
  min-height: 196px;
}

.match-wanted-card {
  padding: 12px 11px 10px;
}

.match-wanted-kicker {
  margin: 0 15px 7px;
  padding-bottom: 5px;
  font-size: 0.62rem;
}

.match-wanted-identity {
  gap: 8px;
}

.match-wanted-avatar {
  width: 50px;
  height: 50px;
}

.match-wanted-label {
  font-size: 0.54rem;
}

.match-wanted-card .player-name {
  font-size: clamp(0.9rem, 1.45vw, 1.12rem);
}

.match-stat-grid {
  gap: 5px;
  margin-top: 8px;
}

.match-stat {
  gap: 1px;
  padding: 5px 6px;
}

.match-stat > span:first-child {
  font-size: 0.52rem;
}

.match-stat > strong {
  font-size: 0.86rem;
}

.pit-event-card {
  padding: 14px 16px;
}

.pit-event-card h3 {
  margin: 1px 0 4px;
  font-size: clamp(1.08rem, 1.8vw, 1.4rem);
}

.pit-event-card .pit-event-flavour {
  margin-bottom: 8px;
  font-size: 0.8rem;
  line-height: 1.34;
}

.pit-event-card .rule-text {
  gap: 2px;
  padding: 8px 9px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.pit-event-category {
  font-size: 0.5rem;
}

.match-shell .chat-card,
.match-shell .action-card {
  padding: 15px;
}

.match-shell .persistent-chat-card,
.match-shell .talk-builder-card {
  border: 1px solid rgba(240, 198, 102, 0.32);
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 166, 66, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(46, 30, 18, 0.96), rgba(7, 13, 18, 0.99));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.34), 0 16px 36px rgba(0, 0, 0, 0.34);
}

.match-shell .persistent-chat-card {
  min-height: 500px;
  max-height: calc(100vh - 82px);
  padding: 15px;
  border-radius: 14px 5px 14px 5px;
}

.match-shell .chat-log.persistent {
  min-height: 330px;
}

.match-shell .talk-builder-card:not(.quick-talk-card) {
  min-height: 210px;
}

.standard-action-grid {
  gap: 8px;
  margin-top: 12px;
}

.match-shell .action-button {
  min-height: 178px;
  padding: 7px 7px 10px;
}

.action-art {
  max-width: 128px;
}

.match-shell .action-title {
  font-size: 0.94rem;
}

.match-shell .action-hint {
  font-size: 0.61rem;
}

.parley-choice-wrap {
  margin-top: 9px;
}

.match-shell .parley-action-button {
  min-height: 144px;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 14px;
  padding: 9px 15px 9px 9px;
}

.parley-action-button .action-art {
  max-width: 132px;
}

.parley-action-button .action-title {
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
}

.parley-action-button .action-hint {
  font-size: 0.76rem;
}

/* The local pirate is always the left-hand result throughout reveal and summary. */
.reveal-enter-left {
  animation: reveal-action-left 760ms cubic-bezier(.16, .88, .28, 1.1) both;
}

.reveal-enter-right {
  animation: reveal-action-right 760ms cubic-bezier(.16, .88, .28, 1.1) both;
}

.reveal-outcome-tile.is-you {
  border-color: rgba(240, 198, 102, 0.38);
  background: rgba(214, 166, 66, 0.09);
}

/* Match-end decree and stable winner badge positioning. */
.match-end-card {
  position: relative;
  isolation: isolate;
  max-width: 920px;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  border: 2px solid rgba(224, 169, 65, 0.62);
  border-radius: 20px 7px 20px 7px;
  background:
    radial-gradient(circle at 50% 0%, rgba(222, 163, 59, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(57, 36, 20, 0.98), rgba(10, 14, 17, 0.99));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.48), 0 24px 60px rgba(0, 0, 0, 0.5);
}

.match-end-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid rgba(255, 214, 119, 0.18);
  border-radius: 13px 3px 13px 3px;
  pointer-events: none;
}

.match-end-emblem img {
  width: 96px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 9px 14px rgba(0, 0, 0, 0.58));
}

.match-end-card h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.match-end-ruling {
  max-width: 680px;
  margin: 10px auto 0;
  color: #d5c39e;
  line-height: 1.55;
}

.match-end-card .scoreboard {
  gap: 16px;
  margin: 22px 0;
}

.match-score-poster {
  position: relative;
  min-height: 330px;
  padding: 28px 22px 18px;
  color: #2b190b;
  border: 3px double #684416;
  border-radius: 8px 12px 7px 11px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.48), transparent 22%),
    radial-gradient(circle at 87% 78%, rgba(91, 45, 12, 0.2), transparent 28%),
    linear-gradient(135deg, #f1dda7, #c9a96b 78%, #a98245);
  box-shadow: inset 0 0 32px rgba(72, 39, 10, 0.26), 0 14px 30px rgba(0, 0, 0, 0.38);
}

.match-score-poster.is-you {
  border-color: #9a6d21;
  box-shadow: inset 0 0 32px rgba(72, 39, 10, 0.26), 0 0 0 3px rgba(240, 198, 102, 0.14), 0 14px 30px rgba(0, 0, 0, 0.38);
}

.match-score-poster.winner {
  border-color: #a66a16;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.52), transparent 22%),
    radial-gradient(circle at 50% 0%, rgba(255, 213, 96, 0.28), transparent 40%),
    linear-gradient(135deg, #f5e2a8, #d2ae64 78%, #aa7b32);
  box-shadow: inset 0 0 34px rgba(72, 39, 10, 0.24), 0 0 0 3px rgba(240, 198, 102, 0.22), 0 16px 34px rgba(0, 0, 0, 0.42);
}

.score-role {
  position: absolute;
  top: 13px;
  left: 50%;
  width: max-content;
  color: #f6e4ba;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 4px #000;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.match-score-poster .winner-badge {
  position: absolute;
  z-index: 2;
  top: 11px;
  right: 13px;
  margin: 0;
  color: #251405;
  border: 1px solid #ffe19a;
  background: linear-gradient(180deg, #f6d47e, #b66b18);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.match-score-poster .summary-avatar {
  width: 96px;
  height: 96px;
  margin: 18px auto 8px;
  border-color: #704412;
  box-shadow: 0 0 0 2px rgba(255, 235, 180, 0.55), 0 6px 12px rgba(57, 28, 5, 0.34);
}

.match-score-poster h4 {
  color: #2b190b;
  font-size: 1.2rem;
}

.match-score-poster .stat-line {
  color: #5d421f;
  border-bottom-color: rgba(78, 40, 9, 0.25);
}

.match-score-poster .stat-line strong {
  color: #2f1a09;
}

.match-end-card .result-actions {
  justify-content: center;
}

@keyframes parley-coin-search {
  0%, 100% { transform: translateY(0) rotate(-1deg) scale(0.98); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.58)) brightness(0.96); }
  50% { transform: translateY(-5px) rotate(1deg) scale(1.025); filter: drop-shadow(0 15px 24px rgba(214, 166, 66, 0.28)) brightness(1.08); }
}

@media (max-width: 1080px) {
  .match-overview {
    grid-template-columns: 1fr;
  }

  .match-shell .match-topbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .match-shell .fury-wrap {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    justify-items: stretch;
    padding: 10px 12px;
  }

  .fury-heading {
    display: contents;
  }

  .fury-heading > span {
    grid-column: 1;
    align-self: center;
  }

  .match-shell .fury-value {
    grid-column: 3;
    align-self: center;
    text-align: right;
  }

  .match-shell .fury-track {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    height: 14px;
    align-items: stretch;
  }

  .match-shell .fury-fill {
    width: var(--fury-percent);
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--red));
    transition: width 260ms ease;
  }

  .fury-caption {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
  }

  .match-overview .fury-stat-float {
    bottom: 55%;
  }
}

@media (max-width: 760px) {
  .pre-match-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pre-match-heading .ready-countdown {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 54px;
  }

  .private-lobby-grid {
    grid-template-columns: 1fr;
  }

  .matchmaking-versus {
    grid-template-columns: 1fr;
  }

  .versus-mark {
    margin: -2px auto;
  }

  .match-end-card .scoreboard {
    grid-template-columns: 1fr;
  }

  .match-score-poster {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .match-shell .match-topbar {
    grid-template-columns: 1fr 1fr;
  }

  .timer-status-item {
    grid-column: 1 / -1;
  }

  .match-shell .persistent-chat-card {
    min-height: 390px;
    max-height: none;
  }

  .match-shell .chat-log.persistent {
    min-height: 250px;
  }

  .match-shell .action-button {
    min-height: 160px;
  }
}

@media (max-width: 520px) {
  .pre-match-panel,
  .match-end-card {
    padding: 22px 16px;
  }

  .pre-match-emblem {
    width: 112px;
    height: 112px;
  }

  .pre-match-heading,
  .private-lobby-heading {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .pre-match-heading-coin {
    width: 82px;
    height: 86px;
    margin: 0 auto;
  }

  .pre-match-heading .pre-match-lead {
    margin-left: auto;
  }

  .matchmaking-feedback {
    grid-template-columns: 1fr 1fr;
  }

  .private-lobby-panel .copy-line {
    grid-template-columns: 1fr;
  }

  .match-shell .match-topbar {
    grid-template-columns: 1fr;
  }

  .timer-status-item {
    grid-column: auto;
  }

  .match-shell .fury-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .fury-heading {
    display: flex;
    grid-column: 1;
    justify-content: space-between;
  }

  .fury-heading > span,
  .match-shell .fury-value {
    grid-column: auto;
  }

  .match-shell .fury-track {
    grid-column: 1;
    grid-row: 2;
  }

  .fury-caption {
    grid-column: 1;
    grid-row: 3;
  }

  .matchmaking-actions,
  .private-lobby-panel .lobby-actions,
  .match-end-card .result-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .matchmaking-actions button,
  .private-lobby-panel .lobby-actions button,
  .match-end-card .result-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .matchmaking-emblem img,
  .reveal-enter-left,
  .reveal-enter-right {
    animation: none !important;
  }
}

/* Explicit grid placement: older global status rules span the full page. */
@media (min-width: 1081px) {
  .match-overview > .match-topbar {
    grid-column: 1;
  }

  .match-overview > .contestant-event-row {
    grid-column: 2;
  }

  .match-overview > .fury-wrap {
    grid-column: 3;
  }
}

@media (max-width: 1080px) {
  .match-overview > .match-topbar,
  .match-overview > .contestant-event-row,
  .match-overview > .fury-wrap {
    grid-column: 1;
  }
}

/* Room-code dialog: match the v0.4.6 pre-match room styling. */
.join-room-dialog {
  isolation: isolate;
  overflow: hidden;
  width: min(560px, 100%);
  padding: clamp(24px, 4vw, 38px);
  color: var(--ink);
  border: 2px solid rgba(224, 169, 65, 0.62);
  border-radius: 20px 7px 20px 7px;
  background:
    radial-gradient(circle at 50% 0%, rgba(222, 163, 59, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(57, 36, 20, 0.99), rgba(13, 16, 19, 0.995));
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.5),
    inset 0 0 48px rgba(0, 0, 0, 0.38),
    0 28px 80px rgba(0, 0, 0, 0.62);
}

.join-room-dialog::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid rgba(255, 214, 119, 0.2);
  border-radius: 13px 3px 13px 3px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 8px);
  pointer-events: none;
}

.join-room-dialog .eyebrow,
.join-room-dialog .field-label {
  color: #e4bd62;
}

.join-room-dialog h2 {
  color: #f7e4b4;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.58);
}

.join-room-dialog .muted {
  color: #d2c29f;
}

.join-room-dialog .room-code-input {
  border: 1px solid rgba(234, 188, 91, 0.46);
  border-radius: 10px 4px 10px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 48%),
    rgba(5, 8, 10, 0.58);
  color: #ffd77c;
  box-shadow: inset 0 -4px rgba(0, 0, 0, 0.24);
}

.join-room-dialog .room-code-input::placeholder {
  color: rgba(210, 194, 159, 0.5);
}

.join-room-dialog .room-code-input:focus {
  border-color: #f0c666;
  box-shadow:
    0 0 0 3px rgba(214, 166, 66, 0.14),
    inset 0 -4px rgba(0, 0, 0, 0.24);
}

.join-room-dialog .dialog-close {
  color: #f7e4b4;
  border-color: rgba(234, 188, 91, 0.42);
  background: rgba(44, 25, 11, 0.78);
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.24);
}

.join-room-dialog .dialog-close:hover {
  border-color: #f0c666;
  background: rgba(91, 52, 18, 0.9);
}

.join-room-dialog-actions {
  padding-top: 18px;
  border-top: 1px solid rgba(237, 195, 105, 0.22);
}

@media (max-width: 520px) {
  .join-room-dialog {
    padding: 24px 16px;
  }

  .join-room-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .join-room-dialog-actions button {
    width: 100%;
  }
}

/* Talk Phase icon controls and emergency cooperation responsiveness. */
@media (max-width: 680px) {
  .quick-talk-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-response-button,
  .remain-silent-button {
    width: 100%;
    min-width: 0;
  }

  .remain-silent-button {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .reveal-ready-status {
    justify-content: flex-start;
  }
}

@media (max-width: 440px) {
  .match-shell .intention-card,
  .match-shell .featured-calm-intent {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 72px;
    gap: 9px;
    padding: 8px 9px;
  }

  .intention-card-icon,
  .featured-calm-intent .intention-card-icon {
    width: 52px;
  }

  .match-shell .intention-card strong {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .match-shell .featured-calm-intent::after {
    animation: none !important;
  }
}

/* v0.4.6: dedicated rules page, safer room exit, and room-aligned home/profile polish. */
.home-page-shell,
.profile-page-shell,
.how-to-page {
  display: grid;
  gap: 18px;
}

.home-page-shell,
.profile-page-shell {
  position: relative;
  padding: clamp(10px, 1.8vw, 18px);
  border: 1px solid rgba(231, 183, 83, 0.38);
  border-radius: 22px 8px 22px 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(218, 161, 55, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(54, 34, 20, 0.9), rgba(11, 15, 18, 0.96));
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.38),
    inset 0 0 44px rgba(0, 0, 0, 0.28),
    0 24px 64px rgba(0, 0, 0, 0.42);
}

.home-page-shell::before,
.profile-page-shell::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px solid rgba(255, 220, 141, 0.13);
  border-radius: 15px 3px 15px 3px;
  pointer-events: none;
}

.home-page-shell > *,
.profile-page-shell > * {
  position: relative;
  z-index: 1;
}

.home-hero-card {
  border-radius: 15px 5px 15px 5px;
  border-color: rgba(224, 169, 65, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 163, 0.06),
    0 16px 36px rgba(0, 0, 0, 0.36);
}

.home-page-shell .menu-panel {
  padding: clamp(12px, 1.5vw, 18px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-page-shell .play-mode-card,
.home-page-shell .ai-box {
  border-radius: 14px 5px 14px 5px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 151, 0.055),
    0 14px 30px rgba(0, 0, 0, 0.34);
}

.home-page-shell .play-mode-card {
  border-color: rgba(224, 169, 65, 0.54);
}

.home-page-shell .private-mode-card {
  border-color: rgba(174, 147, 97, 0.48);
}

.home-page-shell .ai-box {
  border-color: rgba(224, 169, 65, 0.34);
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 166, 66, 0.09), transparent 42%),
    rgba(9, 12, 14, 0.46);
}

.profile-page-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.profile-page-shell .profile-top-actions {
  width: 100%;
  margin: 0;
  padding: 2px 2px 0;
}

.profile-page-shell .wanted-poster,
.profile-page-shell .profile-loading-panel {
  width: min(980px, calc(100% - 4px));
  margin: 0 auto 2px;
  border-radius: 10px 4px 10px 4px;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.44),
    0 0 0 2px rgba(225, 175, 75, 0.18);
}

.profile-page-shell .profile-mode-tabs {
  padding: 6px;
  border: 1px solid rgba(85, 48, 18, 0.26);
  border-radius: 9px 3px 9px 3px;
  background: rgba(67, 37, 14, 0.1);
}

.profile-page-shell .profile-mode-tab {
  border-radius: 7px 2px 7px 2px;
}

.profile-page-shell .wanted-stat,
.profile-page-shell .distinctive-stat-grid > div,
.profile-page-shell .profile-settings,
.profile-page-shell .history-list,
.profile-page-shell .recent-opponents-list {
  border-radius: 8px 3px 8px 3px;
}

.match-room-surface {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(224, 169, 65, 0.5);
  border-radius: 18px 6px 18px 6px;
  background:
    radial-gradient(circle at 50% 0%, rgba(219, 164, 59, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(62, 39, 23, 0.96), rgba(11, 15, 18, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.36),
    inset 0 0 40px rgba(0, 0, 0, 0.24),
    0 20px 50px rgba(0, 0, 0, 0.42);
}

.match-room-surface::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 221, 142, 0.12);
  border-radius: 11px 2px 11px 2px;
  pointer-events: none;
}

.how-to-page {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.how-to-top-actions {
  display: flex;
  justify-content: flex-start;
}

.how-to-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: clamp(20px, 4vw, 46px);
  align-items: center;
  min-height: 300px;
  padding: clamp(28px, 5vw, 54px);
  background:
    linear-gradient(90deg, rgba(14, 16, 17, 0.3), rgba(14, 16, 17, 0.78)),
    radial-gradient(circle at 78% 42%, rgba(214, 166, 66, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(69, 43, 24, 0.98), rgba(11, 15, 18, 0.99));
}

.how-to-hero-copy,
.how-to-hero-coin,
.how-to-section > *,
.how-to-final-callout > * {
  position: relative;
  z-index: 1;
}

.how-to-hero-copy > p:not(.eyebrow) {
  max-width: 700px;
  color: #dbc9a5;
  font-size: 1.05rem;
  line-height: 1.66;
}

.how-to-hero-coin {
  width: min(100%, 205px);
  justify-self: center;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.55));
}

.how-to-goal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
}

.how-to-goal-strip span {
  display: grid;
  place-items: center;
  min-height: 68px;
  padding: 10px;
  color: #d9c59a;
  text-align: center;
  border: 1px solid rgba(235, 188, 89, 0.28);
  border-radius: 10px 3px 10px 3px;
  background: rgba(5, 8, 10, 0.42);
}

.how-to-goal-strip strong {
  display: block;
  color: #ffd77a;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.35rem;
}

.how-to-section {
  padding: clamp(24px, 4vw, 40px);
}

.how-to-section-heading {
  margin-bottom: 20px;
}

.how-to-section-heading h3 {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.phase-walkthrough {
  display: grid;
  gap: 14px;
}

.phase-example {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 50px minmax(220px, 0.9fr) minmax(280px, 1.25fr);
  gap: 16px;
  align-items: center;
  min-height: 160px;
  padding: 18px;
  border: 1px solid rgba(235, 189, 93, 0.24);
  border-radius: 13px 4px 13px 4px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 52%),
    rgba(5, 8, 10, 0.42);
}

.phase-step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #211405;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 900;
  border: 1px solid #ffe0a0;
  border-radius: 50%;
  background: linear-gradient(180deg, #f6d77f, #aa671a);
  box-shadow: 0 7px 16px rgba(0,0,0,0.38);
}

.phase-example-copy h4 {
  color: #f3d88f;
  font-size: 1.05rem;
}

.phase-example-copy p {
  margin: 7px 0 0;
  color: #cdbd9c;
  line-height: 1.52;
}

.guide-pit-event {
  min-height: 122px;
  display: grid;
  gap: 5px;
  padding: 17px 18px;
}

.guide-pit-event .pit-event-kicker {
  color: #e7b654;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.guide-pit-event > strong {
  color: #f6de9d;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.16rem;
}

.guide-pit-event em,
.guide-pit-event > span:last-child {
  color: #d0c09f;
  font-size: 0.82rem;
  line-height: 1.4;
}

.guide-pit-event > span:last-child {
  padding-top: 7px;
  border-top: 1px solid rgba(255, 207, 112, 0.18);
  color: #f0d69c;
  font-weight: 700;
}

.guide-chat-example {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.guide-chat-example img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 3px solid #b27b31;
  border-radius: 50%;
  background: #ead49c;
}

.guide-speech-bubble {
  position: relative;
  padding: 16px;
  color: #352414;
  font-weight: 700;
  line-height: 1.45;
  border: 2px solid #8c5a25;
  border-radius: 13px 13px 13px 4px;
  background: linear-gradient(180deg, #f1dfb1, #caa766);
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

.guide-action-choice {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.guide-action-choice > span {
  color: #bfae8e;
  font-family: Cinzel, Georgia, serif;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-action-mini {
  min-height: 122px;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(101, 190, 210, 0.34);
  border-radius: 12px 4px 12px 4px;
  background: rgba(8, 22, 27, 0.62);
}

.guide-action-mini img {
  width: 92px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 9px 3px 9px 3px;
}

.guide-action-mini strong {
  color: #d7eff0;
  font-family: Cinzel, Georgia, serif;
}

.guide-parley-mini {
  border-color: rgba(231, 181, 74, 0.5);
  background: rgba(65, 39, 14, 0.64);
}

.guide-parley-mini strong {
  color: #f4d47e;
}

.guide-reveal-example {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.guide-reveal-example > div {
  display: grid;
  gap: 5px;
  justify-items: center;
}

.guide-reveal-example img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border: 2px solid rgba(235, 191, 93, 0.5);
  border-radius: 50%;
}

.guide-reveal-example strong {
  color: #f3d88f;
  font-size: 0.85rem;
}

.guide-reveal-example b {
  color: #d6a642;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.2rem;
}

.guide-reveal-example > p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #d0c09e;
}

.guide-reveal-example > p strong {
  color: #78d1c4;
  font-size: 1rem;
}

.guide-delta {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
}

.guide-delta.positive {
  color: #dff6d9;
  background: rgba(67, 122, 58, 0.64);
}

.how-to-action-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.how-to-action-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 152px;
  padding: 12px;
  border: 1px solid rgba(232, 187, 92, 0.26);
  border-radius: 13px 4px 13px 4px;
  background: rgba(6, 9, 11, 0.5);
}

.how-to-action-card img {
  width: 128px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px 3px 10px 3px;
}

.how-to-action-card span {
  color: #d3a850;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.how-to-action-card h4 {
  margin-top: 3px;
  color: #f2d88f;
  font-size: 1.15rem;
}

.how-to-action-card p {
  margin: 6px 0 0;
  color: #cbb998;
  font-size: 0.88rem;
  line-height: 1.5;
}

.how-to-action-card.featured {
  grid-column: 1 / -1;
  border-color: rgba(246, 197, 94, 0.6);
  background:
    radial-gradient(circle at 12% 50%, rgba(226, 164, 45, 0.19), transparent 24%),
    rgba(57, 35, 13, 0.66);
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.win-priority-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 1.35rem;
  color: #cdbc9a;
  line-height: 1.52;
}

.win-priority-list strong {
  color: #f1d58a;
}

.decision-example {
  position: relative;
  z-index: 1;
  margin-top: 18px;
}

.decision-example > p {
  color: #dbc9a5;
  line-height: 1.55;
}

.decision-example > div {
  display: grid;
  gap: 8px;
}

.decision-example span {
  padding: 11px 12px;
  color: #cdbd9d;
  line-height: 1.45;
  border: 1px solid rgba(232, 187, 92, 0.2);
  border-radius: 9px 3px 9px 3px;
  background: rgba(5, 8, 10, 0.42);
}

.decision-example span strong {
  color: #f0d386;
}

.how-to-final-callout {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.how-to-final-callout > img {
  width: 110px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid rgba(238, 185, 69, 0.48);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.how-to-final-callout p:last-child {
  margin-bottom: 0;
  color: #cdbb99;
  line-height: 1.55;
}

.abandon-dialog {
  width: min(560px, 100%);
  padding: clamp(26px, 5vw, 42px);
  text-align: center;
  border: 2px solid rgba(224, 169, 65, 0.62);
  border-radius: 18px 6px 18px 6px;
  background:
    radial-gradient(circle at 50% 0%, rgba(205, 70, 50, 0.15), transparent 32%),
    linear-gradient(180deg, rgba(65, 39, 22, 0.99), rgba(12, 15, 17, 0.995));
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.42),
    0 28px 80px rgba(0,0,0,0.65);
}

.abandon-dialog-emblem {
  width: 96px;
  height: 96px;
  margin: -5px auto 14px;
}

.abandon-dialog-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.55));
}

.abandon-dialog h2 {
  font-size: clamp(1.85rem, 5vw, 2.7rem);
}

.abandon-dialog > p:not(.eyebrow) {
  max-width: 450px;
  margin: 14px auto 0;
  color: #d5c39f;
  line-height: 1.6;
}

.abandon-dialog-actions {
  justify-content: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(235, 187, 90, 0.2);
}

@media (max-width: 900px) {
  .how-to-hero {
    grid-template-columns: 1fr 150px;
  }

  .how-to-hero-coin {
    width: 150px;
  }

  .phase-example {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .phase-example > :last-child {
    grid-column: 2;
  }

  .how-to-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .home-page-shell,
  .profile-page-shell {
    padding: 8px;
  }

  .how-to-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .how-to-hero-coin {
    grid-row: 1;
    width: 132px;
  }

  .how-to-goal-strip,
  .how-to-action-grid {
    grid-template-columns: 1fr;
  }

  .how-to-action-card,
  .how-to-action-card.featured {
    grid-column: auto;
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .how-to-action-card img {
    width: 92px;
  }

  .how-to-final-callout {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .how-to-final-callout > img {
    width: 80px;
  }

  .how-to-final-callout .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .phase-example {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .phase-step {
    width: 38px;
    height: 38px;
  }

  .phase-example > :last-child {
    grid-column: 1;
  }

  .guide-action-choice,
  .guide-reveal-example {
    grid-template-columns: 1fr;
  }

  .guide-action-choice > span,
  .guide-reveal-example b {
    transform: rotate(90deg);
  }

  .guide-reveal-example > p {
    grid-column: 1;
  }

  .how-to-action-card,
  .how-to-action-card.featured {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .how-to-action-card img {
    width: 78px;
  }

  .abandon-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .abandon-dialog-actions button {
    width: 100%;
  }
}

/* v0.5.1 interface refinements: stable ledger controls and quicker profile actions. */
@media (min-width: 901px) {
  .account-bar {
    margin-top: 26px;
  }
}

.leaderboard-row.is-current-player {
  box-shadow:
    inset 6px 0 0 #8d2e1c,
    inset 0 0 0 2px rgba(141, 46, 28, 0.32);
}

.leaderboard-pirate-details {
  min-width: 0;
}

.leaderboard-pirate-name {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.leaderboard-pirate-name > strong {
  min-width: 0;
}

.leaderboard-you-marker {
  position: static;
  flex: 0 0 auto;
  border: 2px solid #602012;
  border-radius: 999px;
  padding: 4px 9px;
  background: linear-gradient(180deg, #ad3e24, #762414);
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 171, 0.3),
    0 2px 5px rgba(74, 25, 13, 0.3);
  color: #fff0b4;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.profile-top-actions {
  align-items: center;
  justify-content: space-between;
}

.profile-account-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.profile-top-sign-out {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(232, 108, 82, 0.62);
  border-radius: 10px 14px 10px 14px;
  padding: 9px 13px;
  background: linear-gradient(145deg, rgba(112, 39, 27, 0.94), rgba(48, 21, 17, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 226, 194, 0.16), 0 4px 10px rgba(0, 0, 0, 0.28);
  color: #ffe2c2;
  font-size: 0.8rem;
  font-weight: 900;
}

.profile-top-sign-out:hover {
  border-color: #ef8e72;
  background: linear-gradient(145deg, #8c3323, #472019);
  transform: translateY(-1px);
}

.profile-top-sign-out svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-identity-actions {
  align-items: stretch;
}

.profile-name-reroll {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(74, 43, 23, 0.28);
  border-radius: 10px 4px 10px 4px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.16);
}

.profile-current-name {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding-left: 5px;
}

.profile-current-name small {
  color: #775037;
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-current-name strong {
  color: #3d2013;
  font-family: Cinzel, Georgia, serif;
  line-height: 1.2;
}

@media (max-width: 620px) {
  .profile-name-reroll {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .profile-current-name {
    padding: 4px 6px;
  }

  .profile-name-reroll .ghost-button {
    width: 100%;
  }
}

/* v0.5.2: fixed action-sized Pit Chat, internal history scrolling and Parley nullification. */
.phase-panel-slot {
  min-width: 0;
}

.action-panel-height-measurement {
  position: fixed;
  top: 0;
  left: -100000px;
  visibility: hidden;
  pointer-events: none;
}

.match-shell .persistent-chat-card {
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.match-shell .chat-log.persistent {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.pit-event-nullified {
  border-color: rgba(91, 213, 226, 0.84);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.46),
    inset 0 0 36px rgba(54, 178, 196, 0.16),
    0 0 0 2px rgba(91, 213, 226, 0.14),
    0 18px 42px rgba(0, 0, 0, 0.5);
}

.pit-event-nullified-banner {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: 92%;
  padding: 8px 14px;
  color: #092129;
  border: 2px solid #c4f6ff;
  border-radius: 4px;
  background: linear-gradient(180deg, #a9eef6, #45a7b8);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.6);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(1deg);
}

.reveal-event-impact.nullified {
  color: #092129;
  border-color: #bdeff7;
  background: linear-gradient(90deg, #3e9bac, #a9e8ef 56%, #2f7f91);
}

/* v0.5.3: guided tutorial, action map and exact example outcomes. */
.tutorial-prompt {
  width: min(640px, 100%);
  padding: clamp(26px, 5vw, 44px);
  text-align: center;
  border: 2px solid rgba(224, 169, 65, 0.68);
  border-radius: 20px 7px 20px 7px;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 166, 66, 0.2), transparent 35%),
    linear-gradient(180deg, rgba(67, 42, 23, 0.99), rgba(10, 14, 17, 0.995));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.46), 0 28px 80px rgba(0, 0, 0, 0.68);
}

.tutorial-prompt-emblem img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.58));
}

.tutorial-prompt h2 {
  font-size: clamp(1.9rem, 5vw, 3rem);
}

.tutorial-prompt > p:not(.eyebrow) {
  max-width: 510px;
  margin: 14px auto 0;
  color: #d7c5a2;
  line-height: 1.62;
}

.tutorial-prompt-actions {
  justify-content: center;
  margin-top: 24px;
}

.tutorial-intro-page {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.tutorial-intro-card {
  width: min(760px, 100%);
  margin: 0 auto;
}

.tutorial-intro-opponent {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: min(500px, 100%);
  margin: 20px auto 4px;
  padding: 12px;
  color: #d9c8a5;
  border: 1px solid rgba(235, 189, 93, 0.28);
  border-radius: 13px 4px 13px 4px;
  background: rgba(4, 8, 11, 0.4);
  text-align: left;
}

.tutorial-intro-opponent img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 3px double #d2a64c;
  border-radius: 50%;
  background: #e6d29f;
}

.tutorial-intro-opponent span,
.tutorial-intro-opponent small,
.tutorial-intro-opponent strong,
.tutorial-intro-opponent em {
  display: block;
}

.tutorial-intro-opponent small {
  color: #bda97f;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tutorial-intro-opponent strong {
  margin-top: 2px;
  color: #f3d687;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.25rem;
}

.tutorial-intro-opponent em {
  margin-top: 4px;
  color: #c8b792;
  font-size: 0.78rem;
  line-height: 1.4;
}

.tutorial-intro-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.tutorial-intro-highlights span {
  display: grid;
  gap: 4px;
  min-height: 84px;
  place-content: center;
  padding: 10px;
  color: #cdbb97;
  border: 1px solid rgba(235, 189, 93, 0.2);
  border-radius: 10px 3px 10px 3px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.75rem;
}

.tutorial-intro-highlights strong {
  color: #f0d184;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.9rem;
}

.tutorial-feature-section {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: clamp(18px, 3vw, 30px);
  align-items: center;
  border-color: rgba(111, 203, 230, 0.58);
  background:
    radial-gradient(circle at 12% 50%, rgba(116, 215, 239, 0.22), transparent 28%),
    linear-gradient(145deg, rgba(24, 83, 108, 0.98), rgba(8, 37, 55, 0.99) 58%, rgba(6, 17, 27, 0.99));
  box-shadow:
    inset 0 0 0 2px rgba(5, 26, 40, 0.52),
    inset 0 0 44px rgba(50, 158, 196, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.42);
}

.tutorial-feature-section::before {
  border-color: rgba(159, 226, 244, 0.2);
}

.tutorial-feature-portrait {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  object-fit: cover;
  border: 4px double #d2a64c;
  border-radius: 50%;
  background: #e6d29f;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

.tutorial-feature-copy {
  position: relative;
  z-index: 1;
}

.tutorial-feature-copy > p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #cce3e9;
  line-height: 1.55;
}

.tutorial-feature-copy ul {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tutorial-feature-copy li {
  padding: 6px 9px;
  color: #d7f3f7;
  border: 1px solid rgba(134, 214, 234, 0.3);
  border-radius: 999px;
  background: rgba(2, 24, 37, 0.42);
  font-size: 0.72rem;
  font-weight: 800;
}

.tutorial-feature-section > .primary-button {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.action-map-section .how-to-section-heading > p:last-child,
.example-outcomes-section .how-to-section-heading > p:last-child {
  max-width: 780px;
  margin: 8px 0 0;
  color: #cdbc9b;
  line-height: 1.55;
}

.action-advantage-map {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.advantage-chain {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto minmax(100px, 1fr) auto minmax(100px, 1fr) auto minmax(100px, 1fr);
  gap: 10px;
  align-items: center;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid rgba(235, 189, 93, 0.24);
  border-radius: 15px 5px 15px 5px;
  background: rgba(4, 8, 11, 0.48);
}

.action-map-node {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(240, 198, 102, 0.3);
  border-radius: 12px 4px 12px 4px;
  background: linear-gradient(145deg, rgba(54, 40, 28, 0.94), rgba(8, 14, 18, 0.98));
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.28);
}

.action-map-node img {
  width: min(86px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.55));
}

.action-map-node strong {
  color: #f2d486;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.9rem;
}

.action-map-node.compact {
  grid-template-columns: 52px auto;
  gap: 8px;
  align-items: center;
  justify-content: start;
  padding: 7px 10px 7px 7px;
}

.action-map-node.compact img {
  width: 52px;
}

.action-map-parley {
  border-color: rgba(85, 206, 229, 0.52);
  background: linear-gradient(145deg, rgba(20, 64, 77, 0.92), rgba(5, 18, 25, 0.99));
}

.action-map-parley strong {
  color: #a9eefa;
}

.advantage-arrow {
  display: grid;
  gap: 2px;
  justify-items: center;
  color: #e5b95d;
  text-align: center;
}

.advantage-arrow b {
  color: #cbb98f;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.advantage-arrow i {
  font-family: Georgia, serif;
  font-size: 2rem;
  font-style: normal;
  line-height: 0.8;
}

.advantage-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.advantage-branches > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(235, 189, 93, 0.2);
  border-radius: 12px 4px 12px 4px;
  background: rgba(4, 8, 11, 0.38);
}

.cooperation-ladder {
  display: grid;
  grid-template-columns: auto repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.cooperation-ladder > strong,
.cooperation-ladder > span {
  display: grid;
  place-items: center;
  padding: 11px 10px;
  border: 1px solid rgba(76, 190, 207, 0.27);
  border-radius: 9px 3px 9px 3px;
  background: rgba(8, 35, 42, 0.52);
  text-align: center;
}

.cooperation-ladder > strong {
  color: #a9eafa;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.78rem;
}

.cooperation-ladder > span {
  gap: 3px;
  color: #c6dadd;
  font-size: 0.74rem;
}

.cooperation-ladder b {
  color: #81d7c9;
}

.example-outcome-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.example-outcome-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(235, 189, 93, 0.24);
  border-radius: 13px 4px 13px 4px;
  background: rgba(4, 8, 11, 0.46);
}

.example-outcome-matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.example-versus {
  color: #d49b36;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.72rem;
  font-weight: 900;
}

.example-outcome-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.example-outcome-stats span {
  display: grid;
  gap: 3px;
  padding: 8px;
  color: #d7c7a6;
  border: 1px solid rgba(235, 189, 93, 0.16);
  border-radius: 8px 3px 8px 3px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}

.example-outcome-stats b {
  color: #f0d384;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.example-outcome-stats .example-fury {
  border-color: rgba(195, 78, 54, 0.26);
  background: rgba(122, 41, 29, 0.14);
}

.example-outcome-card > p {
  margin: 0;
  color: #bfae8d;
  font-size: 0.8rem;
  line-height: 1.5;
}

body.tutorial-route .app-shell {
  width: min(1460px, calc(100vw - 24px));
}

.tutorial-page {
  position: relative;
  display: grid;
  gap: 14px;
  width: 100%;
}

.tutorial-page::before {
  display: none;
}

.tutorial-page > * {
  position: relative;
  z-index: 1;
}

.tutorial-top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  padding: 0;
}

.tutorial-progress-label {
  margin: 0;
  color: #f4d486;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: left;
}

.tutorial-progress-label span {
  margin-left: 8px;
  color: #b9a887;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.52em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-match-shell {
  position: relative;
  isolation: isolate;
  width: min(1180px, calc(100% - 210px));
  margin-left: auto;
  padding: clamp(14px, 1.8vw, 20px);
  border: 1px solid rgba(231, 183, 83, 0.38);
  border-radius: 22px 8px 22px 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(218, 161, 55, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(54, 34, 20, 0.9), rgba(11, 15, 18, 0.96));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.38), inset 0 0 44px rgba(0, 0, 0, 0.28), 0 24px 64px rgba(0, 0, 0, 0.42);
}

.tutorial-match-shell::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px solid rgba(255, 220, 141, 0.13);
  border-radius: 15px 3px 15px 3px;
  pointer-events: none;
}

.tutorial-match-shell > * {
  position: relative;
  z-index: 1;
}

.tutorial-match-columns {
  align-items: stretch;
}

.tutorial-play-space {
  position: relative;
  align-content: start;
}

.tutorial-chat-card {
  position: sticky;
  top: 12px;
  height: 620px;
  min-height: 620px !important;
  max-height: 620px !important;
}

.tutorial-chat-log {
  min-height: 0 !important;
  scroll-behavior: auto !important;
}

.tutorial-chat-log .chat-message-row.warden {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: end;
}

.tutorial-warden-avatar {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-color: #d3a541;
  background: rgba(20, 13, 7, 0.82);
}

.tutorial-chat-log .chat-message-row.warden .speech-bubble {
  margin: 0;
  color: #2c1b0c;
  border: 2px solid #8a5c20;
  background: linear-gradient(180deg, #f0dca7, #c29b58);
  text-align: left;
}

.tutorial-chat-log .chat-message-row.warden .speech-bubble strong {
  color: #6e1e16;
}

.tutorial-untimed {
  font-size: 0.95rem !important;
}

.tutorial-guidance-tooltip {
  position: fixed !important;
  z-index: 80 !important;
  display: grid;
  width: 184px;
  gap: 3px;
  padding: 12px 15px;
  pointer-events: none;
  color: #2d1908;
  border: 2px solid #6d4216;
  border-radius: 12px 4px 12px 4px;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.55), transparent 30%),
    linear-gradient(145deg, #f2d991, #bc8c3e);
  box-shadow: inset 0 0 0 2px rgba(255, 239, 183, 0.3), 0 12px 28px rgba(0, 0, 0, 0.48);
  animation: tutorial-pointer-bob 1.35s ease-in-out infinite;
}

.tutorial-guidance-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 2px);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #d3a955;
  filter: drop-shadow(3px 2px 0 #6d4216);
  transform: translateY(-50%);
}

.tutorial-guidance-tooltip > span {
  color: #7b2818;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tutorial-guidance-tooltip > strong {
  font-family: Cinzel, Georgia, serif;
  font-size: 0.84rem;
  line-height: 1.25;
}

.tutorial-guidance-tooltip.compact::after {
  top: calc(100% + 2px);
  left: 50%;
  border-top: 18px solid #d3a955;
  border-right: 12px solid transparent;
  border-bottom: 0;
  border-left: 12px solid transparent;
  filter: drop-shadow(2px 3px 0 #6d4216);
  transform: translateX(-50%);
}

.tutorial-required {
  animation: tutorial-target-pulse 1.4s ease-in-out infinite !important;
}

.tutorial-action-card .action-button.tutorial-required,
.tutorial-talk-card .intention-card.tutorial-required {
  border-color: #ffe08f;
}

.tutorial-reveal-card .reveal-details[open] {
  border-color: rgba(240, 198, 102, 0.34);
}

.tutorial-results-page .tutorial-end-card {
  width: min(920px, 100%);
  margin: 0 auto;
}

.tutorial-completion-panel {
  color: #2c180f;
}

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

.tutorial-completion-grid span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(78, 43, 18, 0.26);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
}

.tutorial-completion-grid strong {
  color: #6d2117;
  font-family: Cinzel, Georgia, serif;
}

@keyframes tutorial-pointer-bob {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(7px); }
}

@keyframes tutorial-target-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 218, 122, 0.2), 0 0 14px rgba(238, 181, 62, 0.26); filter: brightness(1); }
  50% { box-shadow: 0 0 0 5px rgba(255, 218, 122, 0.34), 0 0 30px rgba(242, 186, 66, 0.62); filter: brightness(1.13); }
}

@media (max-width: 1120px) {
  .tutorial-match-shell {
    width: 100%;
  }

  .cooperation-ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cooperation-ladder > strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .tutorial-feature-section {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .tutorial-feature-portrait {
    width: 105px;
    height: 105px;
  }

  .tutorial-feature-section > .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .advantage-chain {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .advantage-chain > :nth-child(4) {
    grid-column: 1 / -1;
    transform: rotate(90deg);
  }

  .advantage-chain > :nth-child(5) {
    grid-column: 1;
  }

  .advantage-chain > :nth-child(6) {
    grid-column: 2;
    grid-row: 3;
  }

  .advantage-chain > :nth-child(7) {
    grid-column: 3;
    grid-row: 3;
  }

  .example-outcome-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-match-columns {
    grid-template-columns: 1fr;
  }

  .tutorial-chat-card {
    position: static;
    grid-row: 1;
    height: 420px;
    min-height: 420px !important;
    max-height: 420px !important;
  }
}

@media (max-width: 680px) {
  .tutorial-page {
    gap: 12px;
  }

  .tutorial-top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tutorial-progress-label {
    padding: 0 4px;
  }

  .tutorial-progress-label span {
    display: block;
    margin: 6px 0 0;
  }

  .tutorial-feature-section {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .tutorial-feature-portrait {
    justify-self: center;
  }

  .tutorial-feature-copy ul {
    justify-content: center;
  }

  .advantage-branches,
  .cooperation-ladder,
  .tutorial-completion-grid,
  .tutorial-intro-highlights {
    grid-template-columns: 1fr;
  }

  .cooperation-ladder > strong {
    grid-column: auto;
  }

  .advantage-branches > div {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .example-outcome-stats {
    grid-template-columns: 1fr;
  }

  .tutorial-guidance-tooltip {
    width: 164px;
    padding: 9px 11px;
  }
}

@media (max-width: 460px) {
  .tutorial-intro-opponent {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .advantage-chain {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 10px;
  }

  .action-map-node img {
    width: 64px;
  }

  .action-map-node.compact {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 6px;
  }

  .action-map-node.compact img {
    width: 42px;
  }

  .action-map-node strong {
    font-size: 0.72rem;
  }

  .advantage-arrow b {
    display: none;
  }

  .tutorial-prompt-actions,
  .tutorial-end-card .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tutorial-prompt-actions button,
  .tutorial-end-card .result-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-guidance-tooltip,
  .tutorial-required {
    animation: none !important;
  }
}

/* v0.5.4: Captain's Locker, Pit Personas and layered cosmetic loadouts. */
.appearance-portrait {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  isolation: isolate;
}

.appearance-portrait > .appearance-portrait-image,
.appearance-portrait > .appearance-frame-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.appearance-portrait > .appearance-portrait-image {
  z-index: 0;
  padding: 9%;
  border-radius: 50%;
  clip-path: circle(37.2% at 50% 50%);
  object-fit: cover;
}

.appearance-portrait.portrait-needs-zoom > .appearance-portrait-image {
  padding: 5%;
  clip-path: circle(40.9% at 50% 50%);
}

.appearance-portrait > .appearance-frame-image {
  z-index: 1;
  pointer-events: none;
}

.appearance-banner {
  position: relative;
  display: block;
  overflow: hidden;
  background: #101923;
}

.appearance-banner > img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
}

.home-profile-avatar {
  width: 78px;
  height: 78px;
}

.account-chip-avatar {
  width: 38px;
  height: 38px;
}

.account-profile-button .account-chip-avatar img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.leaderboard-pirate .leaderboard-avatar {
  width: 52px;
  height: 52px;
}

.leaderboard-pirate .leaderboard-avatar img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.history-avatar {
  width: 52px;
  height: 52px;
}

.chat-avatar {
  width: 48px;
  height: 48px;
}

.lobby-avatar {
  width: 52px;
  height: 52px;
}

.match-persona-name {
  display: block;
  margin-top: 3px;
  color: #6b3e1e;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
}

/* Public Wanted Poster */
.wanted-identity-hero {
  position: relative;
  width: min(820px, 100%);
  min-height: 340px;
  margin: 22px auto 26px;
  overflow: hidden;
  isolation: isolate;
  border: 3px double #603b1d;
  border-radius: 8px 3px 8px 3px;
  background: #3a200f;
  box-shadow: 0 13px 25px rgba(60, 29, 11, 0.28);
}

.wanted-profile-banner {
  position: absolute;
  inset: 0;
}

.wanted-profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(11, 7, 3, 0.88), rgba(11, 7, 3, 0.08) 72%),
    linear-gradient(90deg, rgba(11, 7, 3, 0.28), transparent 30% 70%, rgba(11, 7, 3, 0.28));
}

.wanted-identity-hero .wanted-identity {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 340px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 28px 24px 24px;
  border: 0;
  background: transparent;
  text-align: center;
}

.wanted-identity-hero .wanted-avatar {
  width: clamp(126px, 20vw, 182px);
  height: clamp(126px, 20vw, 182px);
  filter: drop-shadow(0 9px 10px rgba(0, 0, 0, 0.52));
}

.wanted-identity-hero .wanted-identity h3 {
  max-width: min(680px, 100%);
  margin: 0;
  color: #f6e4ba;
  text-align: center;
  text-shadow: 0 2px 4px #000;
}

.wanted-identity-hero .wanted-identity h3 {
  overflow-wrap: anywhere;
  line-height: 1.02;
  text-wrap: balance;
}

/* Captain's Locker */
.locker-page-shell {
  width: min(1240px, 100%);
}

.locker-page-shell .panel {
  border-color: rgba(224, 169, 65, 0.34);
  border-radius: 13px 5px 13px 5px;
  background:
    radial-gradient(circle at 50% 0%, rgba(213, 158, 55, 0.08), transparent 40%),
    rgba(11, 17, 22, 0.82);
}

.locker-top-actions {
  display: flex;
  gap: 10px;
}

.locker-top-actions .profile-back-button {
  margin-right: auto;
}

.locker-header {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 32px);
}

.locker-header h2 {
  margin: 2px 0 8px;
  color: var(--gold-bright);
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.locker-header p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.locker-progress-summary {
  display: grid;
  flex: 0 0 auto;
  min-width: 175px;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid rgba(240, 198, 102, 0.38);
  border-radius: 9px 3px 9px 3px;
  background: rgba(214, 166, 66, 0.09);
  text-align: right;
}

.locker-progress-summary strong {
  color: var(--gold-bright);
  font-family: Cinzel, Georgia, serif;
  font-size: 1.25rem;
}

.locker-progress-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.locker-haul-callout {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid #d7a446;
  border-radius: 12px 4px 12px 4px;
  background:
    radial-gradient(circle at 8% 50%, rgba(255, 220, 116, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(89, 46, 16, 0.94), rgba(23, 22, 19, 0.96));
  box-shadow: inset 0 0 0 2px rgba(255, 222, 143, 0.08);
}

.locker-haul-callout h3,
.locker-haul-callout p {
  margin: 2px 0;
}

.locker-haul-callout h3 {
  color: #ffe09a;
}

.locker-haul-callout p:last-child {
  color: #d9c596;
}

.locker-loadout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
  gap: 18px;
}

.locker-composite-card {
  overflow: hidden;
  border: 1px solid rgba(224, 169, 65, 0.44);
  border-radius: 14px 5px 14px 5px;
  background: #0b1116;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.locker-composite-preview {
  position: relative;
  min-height: 320px;
  overflow: hidden;
}

.locker-preview-banner {
  position: absolute;
  inset: 0;
}

.locker-composite-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 8, 12, 0.88), rgba(4, 8, 12, 0.18) 58%, rgba(3, 7, 10, 0.44)),
    linear-gradient(0deg, rgba(2, 6, 9, 0.92), transparent 55%);
}

.locker-composite-preview.is-previewing {
  box-shadow: inset 0 0 0 3px #e0ac4e;
}

.locker-preview-identity {
  position: absolute;
  z-index: 2;
  left: clamp(18px, 4vw, 42px);
  bottom: 24px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.locker-preview-portrait {
  width: clamp(132px, 18vw, 190px);
  height: clamp(132px, 18vw, 190px);
  filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.65));
}

.locker-preview-identity span,
.locker-preview-identity strong {
  display: block;
  color: #e5c984;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.locker-preview-identity h3 {
  margin: 5px 0;
  color: #fff0c3;
  font-size: clamp(1.7rem, 4vw, 3rem);
  text-shadow: 0 3px 6px #000;
}

.locker-slot-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(224, 169, 65, 0.25);
}

.locker-slot-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid rgba(224, 169, 65, 0.16);
}

.locker-slot-summary > div:last-child {
  border-right: 0;
}

.locker-slot-summary span {
  color: #a9956b;
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.locker-slot-summary strong {
  overflow: hidden;
  color: #f2d99e;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locker-clear-preview {
  margin: 0 14px 14px;
}

.locker-next-rewards {
  padding: 20px;
}

.locker-next-rewards h3 {
  margin: 3px 0 15px;
}

.locker-next-reward-list {
  display: grid;
  gap: 10px;
}

.locker-next-reward-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  padding: 11px;
  border-left: 3px solid #d6a642;
  background: rgba(214, 166, 66, 0.07);
}

.locker-next-reward-list span {
  grid-row: span 2;
  align-self: center;
  color: #f2c962;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
}

.locker-next-reward-list small {
  color: var(--muted);
}

.locker-collection-section,
.locker-reward-track,
.locker-account-settings {
  padding: clamp(18px, 2.5vw, 28px);
}

.locker-section-heading {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.locker-section-heading h3 {
  margin: 3px 0 0;
}

.locker-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.locker-filter-tabs button {
  border: 1px solid rgba(232, 190, 95, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #c9b686;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
}

.locker-filter-tabs button.selected {
  border-color: #e0ae50;
  background: #9a4e1e;
  color: #fff0c4;
}

.locker-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.locker-item-card {
  position: relative;
  display: grid;
  grid-template-rows: 180px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(227, 183, 83, 0.24);
  border-radius: 11px 4px 11px 4px;
  background: rgba(4, 8, 11, 0.48);
  transition: border-color 150ms ease, transform 150ms ease;
}

.locker-item-card:hover {
  border-color: rgba(234, 191, 93, 0.58);
  transform: translateY(-2px);
}

.locker-item-card.is-locked {
  background: rgba(5, 8, 10, 0.7);
}

.locker-item-card.is-equipped {
  border-color: #dda748;
  box-shadow: inset 0 0 0 2px rgba(221, 167, 72, 0.21);
}

.locker-item-card.is-new::after {
  content: "NEW";
  position: absolute;
  z-index: 4;
  top: 9px;
  right: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #9e321f;
  color: #fff2c5;
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.locker-item-visual {
  display: grid;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(205, 163, 75, 0.18), transparent 52%),
    #10171c;
}

.locker-item-card.is-locked .locker-item-visual {
  filter: saturate(0.42) brightness(0.66);
}

.locker-persona-art,
.locker-banner-art {
  width: 100%;
  height: 100%;
}

.locker-persona-art {
  width: 180px;
  height: 180px;
  max-width: 100%;
  padding: 12px;
  object-fit: contain;
}

.locker-banner-art {
  object-fit: cover;
  object-position: center;
}

.locker-item-portrait {
  width: 170px;
  height: 170px;
}

.locker-item-copy {
  padding: 14px 14px 8px;
}

.locker-item-copy h4 {
  margin: 7px 0 6px;
  color: #f2d796;
  font-family: Cinzel, Georgia, serif;
  font-size: 1rem;
}

.locker-item-copy p {
  margin: 0;
  color: #bfae89;
  font-size: 0.79rem;
  line-height: 1.45;
}

.locker-item-copy blockquote {
  margin: 11px 0 0;
  padding-left: 9px;
  color: #d4c4a0;
  border-left: 2px solid #9c642c;
  font-size: 0.75rem;
  font-style: italic;
}

.locker-item-state {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.locker-item-state span,
.locker-item-state b {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(214, 166, 66, 0.12);
  color: #d8bd7a;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.locker-item-state b {
  background: rgba(143, 57, 33, 0.66);
  color: #ffe3a0;
}

.locker-item-actions {
  display: flex;
  gap: 7px;
  padding: 10px 14px 14px;
}

.locker-item-actions button {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.72rem;
}

.locker-reward-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 9px;
}

.locker-reward {
  display: grid;
  grid-template-columns: auto 48px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(222, 176, 76, 0.19);
  border-radius: 8px 3px 8px 3px;
  background: rgba(255, 255, 255, 0.025);
}

.locker-reward.is-locked {
  opacity: 0.58;
  filter: saturate(0.55);
}

.locker-reward.is-owned {
  border-color: rgba(107, 163, 94, 0.48);
  background: rgba(107, 163, 94, 0.08);
}

.locker-reward > .locker-reward-art {
  width: 48px;
  height: 48px;
  border-radius: 7px;
  object-fit: cover;
}

.locker-reward > .locker-reward-art.is-portrait {
  border-radius: 0;
  background: transparent;
  clip-path: circle(45.4% at 50% 50%);
}

.locker-reward > span:not(.locker-reward-level) {
  display: grid;
  min-width: 0;
}

.locker-reward strong,
.locker-reward small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locker-reward strong {
  color: #e8cf92;
  font-size: 0.76rem;
}

.locker-reward small,
.locker-reward b {
  color: #ae9c76;
  font-size: 0.62rem;
}

.locker-reward-level {
  color: #e4b75b;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.69rem;
  font-weight: 900;
}

.locker-account-settings {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.profile-name-reroll {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-current-name {
  display: grid;
}

.profile-current-name small {
  color: var(--muted);
  font-size: 0.67rem;
  text-transform: uppercase;
}

.profile-current-name strong {
  color: var(--gold-bright);
  font-family: Cinzel, Georgia, serif;
}

.locker-auth-poster {
  min-height: 540px;
}

/* Banners and frames throughout a live match. */
.ready-pirate {
  position: relative;
  min-height: 290px;
  padding: 0;
  overflow: hidden;
}

.ready-pirate-banner {
  position: absolute;
  inset: 0;
}

.ready-pirate-banner::after,
.summary-player-banner::after,
.lobby-player-banner::after,
.match-card-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(11, 7, 3, 0.94), rgba(11, 7, 3, 0.1) 75%);
}

.ready-pirate-content {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 290px;
  gap: 5px;
  align-content: end;
  padding: 20px;
  text-align: center;
}

.pre-match-pirate .ready-avatar {
  width: 112px;
  height: 112px;
  margin: 10px auto 1px;
}

.ready-pirate-content > strong {
  color: #fff0c5;
  text-shadow: 0 2px 5px #000;
}

.lobby-appearance-slot {
  position: relative;
  min-height: 82px;
  overflow: hidden;
  isolation: isolate;
}

.lobby-player-banner {
  position: absolute;
  z-index: -1;
  inset: 0;
}

.lobby-player-banner::after {
  background: linear-gradient(90deg, rgba(5, 9, 12, 0.95), rgba(5, 9, 12, 0.58));
}

.lobby-player-identity {
  display: flex;
  gap: 10px;
  align-items: center;
}

.match-card-identity-header {
  position: relative;
  min-height: 111px;
  margin: -13px -11px 0;
  padding: 13px 11px 10px;
  overflow: hidden;
  border-radius: 4px 8px 0 0;
  isolation: isolate;
}

.match-card-banner {
  position: absolute;
  z-index: -1;
  inset: 0;
}

.match-card-banner::after {
  background:
    linear-gradient(90deg, rgba(17, 10, 4, 0.68), rgba(17, 10, 4, 0.2)),
    linear-gradient(0deg, rgba(25, 12, 4, 0.76), transparent 78%);
}

.match-card-identity-header .match-wanted-kicker {
  color: #f3d792;
  border-bottom-color: rgba(255, 224, 155, 0.38);
  text-shadow: 0 2px 4px #000;
}

.match-card-identity-header .match-wanted-label,
.match-card-identity-header .match-card-progression {
  color: #d7c397;
  text-shadow: 0 2px 4px #000;
}

.match-card-identity-header .player-name {
  color: #fff0c5;
  text-shadow: 0 2px 4px #000;
}

.match-card-identity-header .match-persona-name {
  color: #e4bd66;
  text-shadow: 0 2px 4px #000;
}

.match-wanted-avatar {
  width: 68px;
  height: 68px;
}

.summary-player-banner {
  position: absolute;
  inset: 0 0 auto;
  height: 138px;
  border-radius: 5px 9px 0 0;
}

.summary-player-banner::after {
  background: linear-gradient(0deg, rgba(45, 24, 8, 0.9), rgba(5, 9, 12, 0.15));
}

.match-score-poster > *:not(.summary-player-banner):not(.score-role):not(.winner-badge) {
  position: relative;
  z-index: 1;
}

.match-score-poster .score-role,
.match-score-poster .winner-badge {
  position: absolute;
  z-index: 2;
}

.match-score-poster .summary-avatar {
  display: block;
  width: 108px;
  height: 108px;
}

.match-score-identity {
  display: grid;
  min-width: 0;
  justify-items: center;
}

.match-score-identity h4 {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.persona-result-line {
  min-height: 42px;
  margin: 8px 0 12px;
  padding: 7px 9px;
  color: #553315;
  border-left: 3px solid #8d4b1d;
  background: rgba(255, 242, 195, 0.34);
  font-family: Georgia, serif;
  font-size: 0.76rem;
  font-style: italic;
  line-height: 1.35;
}

.phrase-persona-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 11px;
  border: 1px solid rgba(230, 184, 88, 0.25);
  border-radius: 8px 3px 8px 3px;
  background: rgba(214, 166, 66, 0.07);
}

.phrase-persona-strip span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phrase-persona-strip strong {
  color: var(--gold-bright);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.83rem;
}

/* Post-match collection rewards. */
.post-match-locker-haul {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(228, 179, 71, 0.5);
  border-radius: 10px 3px 10px 3px;
  background:
    radial-gradient(circle at 8% 15%, rgba(247, 207, 111, 0.14), transparent 35%),
    rgba(62, 34, 13, 0.32);
}

.post-match-haul-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.post-match-haul-heading h3,
.post-match-haul-heading p {
  margin: 0;
}

.post-match-unlock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
}

.post-match-unlock-grid article {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(99, 53, 20, 0.34);
  border-radius: 7px;
  background: rgba(255, 245, 207, 0.24);
}

.post-match-unlock-grid img {
  grid-row: span 2;
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.post-match-unlock-grid span {
  display: grid;
}

.post-match-unlock-grid small {
  color: #79512e;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.post-match-unlock-grid strong {
  color: #3a2110;
}

.post-match-unlock-grid button {
  grid-column: 2;
  justify-self: start;
  padding: 6px 9px;
  font-size: 0.68rem;
}

@media (max-width: 900px) {
  .locker-loadout-grid,
  .locker-account-settings {
    grid-template-columns: 1fr;
  }

  .locker-account-actions {
    justify-content: flex-start;
  }

  .locker-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .locker-slot-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .locker-slot-summary > div:nth-child(2) {
    border-right: 0;
  }

  .locker-slot-summary > div:nth-child(-n+2) {
    border-bottom: 1px solid rgba(224, 169, 65, 0.16);
  }
}

@media (max-width: 640px) {
  .locker-top-actions,
  .locker-header,
  .locker-haul-callout,
  .post-match-haul-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .locker-progress-summary {
    text-align: left;
  }

  .locker-composite-preview {
    min-height: 300px;
  }

  .locker-preview-identity {
    right: 16px;
    left: 16px;
    bottom: 18px;
    gap: 10px;
  }

  .locker-preview-portrait {
    width: 120px;
    height: 120px;
  }

  .locker-collection-grid,
  .locker-reward-list {
    grid-template-columns: 1fr;
  }

  .wanted-identity-hero,
  .wanted-identity-hero .wanted-identity {
    min-height: 300px;
  }

  .wanted-identity-hero .wanted-identity {
    align-items: center;
    padding: 22px 14px 18px;
  }

  .profile-page-shell .profile-top-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .profile-account-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .wanted-identity-hero .wanted-avatar {
    width: 112px;
    height: 112px;
  }

  .wanted-identity-hero .wanted-identity h3 {
    font-size: 1.45rem;
  }

  .post-match-unlock-grid {
    grid-template-columns: 1fr;
  }
}

/* v0.5.5: creator story and project support. */
.header-about-button {
  position: relative;
  min-height: 44px;
  padding: 9px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #d9c9a3;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-about-button::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 6px;
  left: 4px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 150ms ease, transform 150ms ease;
}

.header-about-button:hover:not(:disabled),
.header-about-button.selected {
  background: transparent;
  box-shadow: none;
  color: #f0c666;
  transform: translateY(-1px);
}

.header-about-button:hover:not(:disabled)::after,
.header-about-button.selected::after {
  opacity: 0.9;
  transform: scaleX(1);
}

.header-about-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.about-page {
  display: grid;
  gap: 20px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.about-top-actions {
  display: flex;
  justify-content: flex-start;
}

.about-hero,
.about-story-card,
.about-pledge,
.about-support {
  color: #e9dfc8;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(230px, 0.65fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: 430px;
  padding: clamp(30px, 6vw, 70px);
  background:
    linear-gradient(90deg, rgba(4, 10, 15, 0.98), rgba(7, 15, 21, 0.82) 56%, rgba(5, 10, 14, 0.56)),
    url('/assets/avatars/Parley-pit-header-background.webp') center / cover;
}

.about-hero-copy {
  max-width: 700px;
}

.about-page .eyebrow {
  color: #d6a642;
}

.about-hero h2 {
  max-width: 720px;
  margin: 7px 0 18px;
  color: #fff0c3;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  line-height: 0.98;
  text-wrap: balance;
  text-shadow: 0 4px 8px #000;
}

.about-hero-copy > p:not(.eyebrow) {
  max-width: 660px;
  margin: 12px 0 0;
  color: #e6dcc4;
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.72;
}

.about-hero-copy .about-pirate-welcome {
  color: #f2d99f;
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
}

.about-creator-card {
  display: grid;
  justify-items: center;
  padding: 22px 18px;
  border: 1px solid rgba(224, 169, 65, 0.42);
  border-radius: 18px 6px 18px 6px;
  background: rgba(5, 10, 14, 0.83);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  text-align: center;
}

.about-avatar-frame {
  width: 154px;
  height: 154px;
  margin-bottom: 15px;
  overflow: hidden;
  border: 5px solid #a16b25;
  border-radius: 26px 8px 26px 8px;
  background: #5df04e;
  box-shadow:
    0 0 0 2px #211307,
    0 11px 22px rgba(0, 0, 0, 0.48);
}

.about-avatar-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.about-creator-card > span,
.about-creator-card > small {
  color: #bdad89;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.about-creator-card h3 {
  margin: 3px 0 0;
  color: #fff0c3;
  font-size: 2rem;
}

.about-creator-card p {
  margin: 1px 0 11px;
  color: #e0ac4e;
  font-weight: 800;
}

.about-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.about-story-card {
  padding: clamp(24px, 4vw, 38px);
}

.about-story-card h3,
.about-pledge h3,
.about-support h3 {
  margin: 6px 0 14px;
  color: #fff0c3;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.12;
  text-wrap: balance;
}

.about-story-card > p:not(.eyebrow),
.about-pledge p,
.about-support-copy > p,
.about-support blockquote {
  color: #d8cfbb;
  line-height: 1.72;
}

.about-story-card > p + p {
  margin-top: 15px;
}

.about-story-card .about-fine-print {
  padding-top: 14px;
  border-top: 1px solid rgba(224, 169, 65, 0.18);
  color: #a99c83;
  font-size: 0.76rem;
}

.about-pledge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  padding: clamp(26px, 5vw, 46px);
  border-color: rgba(224, 169, 65, 0.68);
  background:
    radial-gradient(circle at 8% 50%, rgba(224, 169, 65, 0.14), transparent 26%),
    linear-gradient(135deg, rgba(67, 37, 14, 0.72), rgba(10, 15, 18, 0.96));
}

.about-pledge-mark {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 2px solid #d7a642;
  border-radius: 50%;
  color: #f6d47f;
  font-size: 2.2rem;
  box-shadow: inset 0 0 24px rgba(224, 169, 65, 0.16);
}

.about-pledge p {
  margin: 8px 0 0;
}

.about-pledge strong {
  color: #ffe6a5;
}

.about-support {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(26px, 5vw, 56px);
  align-items: center;
  padding: clamp(28px, 5vw, 50px);
}

.about-support-copy > p {
  margin: 9px 0 0;
}

.support-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.buy-coffee-button,
.feedback-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid #f1cf78;
  border-radius: 9px 15px 9px 15px;
  color: #fff3d2;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
  text-decoration: none;
  box-shadow:
    inset 0 0 0 2px rgba(53, 25, 8, 0.42),
    0 10px 22px rgba(0, 0, 0, 0.32);
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.buy-coffee-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 42%),
    linear-gradient(135deg, #9f6227, #643415);
}

.feedback-button {
  border-color: #81bad0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 42%),
    linear-gradient(135deg, #28687f, #12394a);
}

.buy-coffee-button:hover,
.buy-coffee-button:focus-visible,
.feedback-button:hover,
.feedback-button:focus-visible {
  color: #fff;
  filter: brightness(1.13);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 2px rgba(53, 25, 8, 0.42),
    0 14px 26px rgba(0, 0, 0, 0.4);
}

.home-support {
  margin: 0 clamp(12px, 1.5vw, 18px) clamp(12px, 1.5vw, 18px);
}

.about-support-copy > small {
  display: block;
  margin-top: 8px;
  color: #9f947d;
  font-size: 0.7rem;
}

.about-support blockquote {
  margin: 0;
  padding: 25px;
  border: 1px solid rgba(224, 169, 65, 0.3);
  border-radius: 14px 4px 14px 4px;
  background: rgba(214, 166, 66, 0.07);
  font-family: Georgia, serif;
  font-size: 1.08rem;
  font-style: italic;
}

.about-support blockquote p {
  margin: 0;
}

.about-support blockquote footer {
  margin-top: 14px;
  color: #e0ac4e;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.about-version-mark {
  padding: 4px 12px 14px;
  color: #8f8778;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-align: center;
}

@media (max-width: 900px) {
  .about-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
    padding: 34px;
  }

  .about-avatar-frame {
    width: 132px;
    height: 132px;
  }

  .about-support {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .header-about-button {
    width: 100%;
  }

  .about-page {
    gap: 14px;
  }

  .about-hero,
  .about-story-grid {
    grid-template-columns: 1fr;
  }

  .about-hero {
    min-height: 0;
    padding: 28px 20px;
    background:
      linear-gradient(180deg, rgba(4, 10, 15, 0.96), rgba(7, 15, 21, 0.84)),
      url('/assets/avatars/Parley-pit-header-background.webp') center / cover;
  }

  .about-creator-card {
    width: min(300px, 100%);
    margin: 0 auto;
  }

  .about-pledge {
    grid-template-columns: 1fr;
  }

  .about-pledge-mark {
    width: 64px;
    height: 64px;
  }

  .about-support,
  .about-story-card {
    padding: 24px 20px;
  }

  .buy-coffee-button,
  .feedback-button {
    width: 100%;
  }
}
