/* AOW V11.17 — legibility and game-reference results; presentation only.
   Loaded after legacy + V11.16 card styles. Preserve modal events, result data,
   standings, participant identities, uploaded avatars and bracket geometry. */

/* Shared team identity dialogs (Bracket, Results, Participants, both chats). */
body.aow-masters-theme :is(.team-info-card,.participants-team-dialog,.chat-team-card) {
  width:min(520px,100%);
  max-height:min(86dvh,760px);
  padding:clamp(18px,3vw,26px)!important;
  color:#ecf6f4;
  border-color:#57898e!important;
  border-radius:2px!important;
}
body.aow-masters-theme :is(.team-info-card,.participants-team-dialog,.chat-team-card)::before {
  opacity:.075;
}
body.aow-masters-theme :is(.team-info-header,.chat-team-card-top) {
  gap:16px;
  margin-bottom:18px;
}
body.aow-masters-theme :is(.team-info-heading h2,#participants-modal-name,#chat-team-name) {
  margin:4px 0 10px!important;
  font-size:clamp(28px,4vw,38px)!important;
  line-height:1.08!important;
  overflow-wrap:anywhere;
}
body.aow-masters-theme :is(.team-info-heading small,.participants-modal-faction span,.chat-team-faction) {
  display:block;
  margin-bottom:7px;
  font-size:clamp(16px,2vw,18px)!important;
  font-weight:900!important;
  line-height:1.18;
}
body.aow-masters-theme :is(.team-info-label,.participants-modal-label,.chat-team-roster-title,.chat-team-moderation-title) {
  margin-bottom:10px!important;
  font-size:clamp(16px,1.6vw,18px)!important;
  font-weight:900!important;
  line-height:1.2;
  letter-spacing:.08em!important;
}
body.aow-masters-theme .team-info-section {
  margin-top:14px;
  padding-top:13px;
  border-top-color:#385e63!important;
}
body.aow-masters-theme :is(.team-info-leader,.participants-modal-leader,.chat-team-leader,.chat-team-leader strong) {
  font-size:clamp(19px,2vw,21px)!important;
  line-height:1.28!important;
  color:#eaf5f2!important;
  overflow-wrap:anywhere;
}
body.aow-masters-theme :is(.team-info-player,.participants-modal-player,.chat-team-player) {
  min-height:48px!important;
  padding:9px 12px!important;
  gap:12px!important;
  border:1px solid #385e64!important;
  border-radius:2px!important;
  background:rgba(5,22,25,.78)!important;
}
body.aow-masters-theme :is(.team-info-player strong,.participants-modal-player strong,.chat-team-player strong) {
  font-family:var(--aow-heading)!important;
  color:#edf7f4!important;
  font-size:clamp(19px,1.8vw,21px)!important;
  font-weight:700!important;
  line-height:1.2!important;
  overflow-wrap:anywhere;
}
body.aow-masters-theme :is(.team-info-player-number,.participants-player-number,.chat-team-player span) {
  width:32px!important;
  min-width:32px!important;
  height:29px;
  flex:0 0 32px;
  display:grid;
  place-items:center;
  border-radius:2px!important;
  color:#9cdbde!important;
  background:#13323a!important;
  font-size:16px!important;
  font-weight:900!important;
}
body.aow-masters-theme .participants-modal-section {
  padding:14px!important;
  border-radius:2px!important;
  border-color:#42696d!important;
  background:rgba(8,28,32,.77)!important;
}
body.aow-masters-theme .participants-modal-faction {gap:13px;margin-bottom:12px;}
body.aow-masters-theme .participants-modal-faction img,
body.aow-masters-theme .chat-team-logo {width:68px!important;height:68px!important;max-width:68px!important;max-height:68px!important;}
body.aow-masters-theme :is(.team-info-close,.participants-team-close,.chat-team-card-x) {
  width:42px!important;
  height:42px!important;
  font-size:26px!important;
}
body.aow-masters-theme :is(.chat-team-muted-banner,.chat-team-current-mute) {
  font-size:16px!important;
  line-height:1.35;
}
body.aow-masters-theme .chat-team-roster-grid {gap:14px;}
body.aow-masters-theme .chat-team-player {margin-top:2px;}
@media(max-width:580px) {
  body.aow-masters-theme :is(.team-info-card,.participants-team-dialog,.chat-team-card) {padding:18px 16px!important;max-height:85dvh;}
  body.aow-masters-theme :is(.team-info-heading h2,#participants-modal-name,#chat-team-name) {font-size:clamp(27px,7vw,34px)!important;}
  body.aow-masters-theme :is(.team-info-header,.chat-team-card-top) {gap:12px;}
  body.aow-masters-theme .chat-team-roster-grid {grid-template-columns:1fr!important;}
  body.aow-masters-theme .chat-team-roster-grid > section[hidden] {display:none!important;}
}

/* Tournament-complete dialog: align it with the game's cyan tactical panels. */
body.aow-masters-theme .tournament-results-modal {z-index:10000;padding:18px;}
body.aow-masters-theme .tournament-results-modal-backdrop {
  background:rgba(2,10,12,.82);
  backdrop-filter:blur(6px);
}
body.aow-masters-theme .tournament-results-modal-card {
  width:min(600px,100%);
  max-height:calc(100dvh - 36px);
  overflow-y:auto;
  padding:clamp(22px,4vw,38px)!important;
  border:1px solid #679fa3!important;
  border-top:4px solid #79c9cb!important;
  border-radius:2px!important;
  text-align:left;
  background:
    repeating-linear-gradient(116deg,transparent 0 4px,rgba(143,215,211,.035) 4px 6px),
    linear-gradient(155deg,#19373a 0%,#0b2429 42%,#06171b 100%)!important;
  box-shadow:0 26px 84px rgba(0,0,0,.68),inset 0 1px 0 rgba(203,251,249,.2)!important;
}
body.aow-masters-theme .tournament-results-modal-icon {
  width:62px;height:62px;margin:0 0 16px!important;
  display:grid;place-items:center;
  background:#142f34;border:1px solid #b28f3d;
  color:#f4cf59;border-radius:2px!important;
}
body.aow-masters-theme .tournament-results-modal-card .eyebrow {
  font:800 17px/1.2 var(--aow-heading)!important;
  letter-spacing:.14em;color:#93d7dc!important;
}
body.aow-masters-theme .tournament-results-modal-card h2 {
  font:900 clamp(32px,5vw,47px)/1.07 var(--aow-heading)!important;
  letter-spacing:.035em!important;margin:10px 0 17px!important;
  color:#f4ffff!important;
}
body.aow-masters-theme .tournament-results-modal-card p {
  font-size:clamp(18px,2.3vw,21px)!important;
  line-height:1.4!important;
  max-width:520px;
  margin:0 0 25px!important;
  color:#ccdddd!important;
}
body.aow-masters-theme .tournament-results-modal-actions {
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  justify-content:stretch;
}
body.aow-masters-theme .tournament-results-modal-actions .btn {
  display:flex;align-items:center;justify-content:center;
  min-width:0!important;min-height:52px;
  padding:12px!important;font-size:20px!important;
  border-radius:2px!important;
  text-decoration:none;
}
@media(max-width:460px) {
  body.aow-masters-theme .tournament-results-modal-actions {grid-template-columns:1fr;}
  body.aow-masters-theme .tournament-results-modal-card h2 {font-size:33px!important;}
}

/* Final standings — compact game-style ranking boards instead of rounded purple cards. */
body.aow-masters-theme .public-results-page {
  width:min(1600px,calc(100vw - 36px))!important;
  max-width:1600px!important;
  margin:24px auto 40px!important;
  position:relative;
  left:50%!important;
  transform:translateX(-50%)!important;
}
body.aow-masters-theme .public-results-head {
  margin:0 0 24px!important;
  padding:0 0 16px;
  text-align:left!important;
  border-bottom:1px solid #557d80;
}
body.aow-masters-theme .public-results-head h1 {
  margin:8px 0 10px;
  font-size:clamp(38px,4.2vw,60px)!important;
}
body.aow-masters-theme .public-results-head .muted {
  font-size:19px!important;
  color:#c0d5d4!important;
}
body.aow-masters-theme .public-results-grid {
  display:grid;
  width:100%;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:16px;
  align-items:stretch;
}
body.aow-masters-theme .public-result-card {
  --rank:#8ac6ca;
  position:relative;
  min-width:0;width:100%;height:100%;
  padding:14px 14px 16px!important;
  border-radius:2px!important;
  border:1px solid #527a7e!important;
  border-top:3px solid var(--rank)!important;
  background:
    repeating-linear-gradient(116deg,transparent 0 5px,rgba(119,182,183,.032) 5px 7px),
    linear-gradient(160deg,rgba(22,48,51,.98),rgba(7,21,25,.99) 70%)!important;
  box-shadow:inset 0 1px 0 rgba(164,224,224,.11),0 12px 30px rgba(0,0,0,.35)!important;
}
body.aow-masters-theme .public-result-place-1 {--rank:#f0ce5b;}
body.aow-masters-theme .public-result-place-2 {--rank:#b8d4db;}
body.aow-masters-theme .public-result-place-3 {--rank:#e6a16a;}
body.aow-masters-theme .public-result-place-4 {--rank:#d98980;}
body.aow-masters-theme .public-result-medal {
  height:170px!important;flex:0 0 170px!important;
  margin:0 0 10px!important;
  border:1px solid rgba(98,147,149,.35);
  background:linear-gradient(180deg,rgba(4,16,20,.66),rgba(17,40,43,.65));
  overflow:hidden;
}
body.aow-masters-theme .public-result-medal img {
  width:auto;max-width:100%;max-height:152px;
  height:auto;object-fit:contain;
}
body.aow-masters-theme .public-result-medal-fallback {
  width:92px;height:92px;border-radius:2px;
  border:1px solid var(--rank);
  background:#10282d;color:var(--rank);
  font:900 54px/1 var(--aow-heading);
}
body.aow-masters-theme .public-result-place-title {
  margin:0 0 14px!important;
  padding:10px 12px!important;
  background:linear-gradient(90deg,var(--rank),color-mix(in srgb,var(--rank) 72%,#0c2a30))!important;
  color:#071719!important;
  text-align:center;
  border-radius:0!important;
  font:900 21px/1.1 var(--aow-heading)!important;
  letter-spacing:.10em!important;
}
body.aow-masters-theme .public-result-team {
  width:100%;min-height:76px;
  margin:0 0 14px!important;
  padding:10px!important;gap:12px;
  border:1px solid #48787d!important;
  border-left:3px solid var(--rank)!important;
  border-radius:2px!important;
  background:linear-gradient(90deg,#14343a,#0c2328)!important;
  color:#eff9f6!important;
  box-shadow:none!important;
}
body.aow-masters-theme .public-result-team:hover,
body.aow-masters-theme .public-result-team:focus-visible {
  border-color:#b3e4e3!important;
  background:#234c52!important;
}
body.aow-masters-theme .public-result-team-emblem {
  flex:0 0 56px;width:56px;height:56px;
  border:1px solid #6eabb0;
  background:#061d23;
  border-radius:2px;
}
body.aow-masters-theme .public-result-team-emblem img {
  width:52px;height:52px;max-width:52px;max-height:52px;
  object-fit:contain;
}
body.aow-masters-theme .public-result-team-emblem img.aow-avatar-custom {object-fit:cover;}
body.aow-masters-theme .public-result-team-text strong {
  display:block;
  font:800 clamp(18px,1.55vw,23px)/1.15 var(--aow-heading)!important;
  color:#f2ffff!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere;
}
body.aow-masters-theme .public-result-team-text small {
  font:750 16px/1.2 var(--aow-heading)!important;
  color:#b9d5d5!important;
  letter-spacing:.025em;
  margin-top:5px!important;
}
body.aow-masters-theme .public-result-team-arrow {color:#e6ce80!important;font-size:28px!important;}
body.aow-masters-theme .public-result-rewards {
  flex:1 1 auto;
  min-height:145px!important;
  padding:14px!important;
  border-radius:2px!important;
  border:1px solid #3c676c!important;
  background:rgba(4,16,19,.78)!important;
  overflow:hidden;
}
body.aow-masters-theme .public-result-rewards-label {
  margin:0 0 10px;
  font:900 17px/1.2 var(--aow-heading)!important;
  color:#86d2d5!important;
  letter-spacing:.12em;
}
body.aow-masters-theme .public-result-rewards ul {margin:0;padding-left:23px;}
body.aow-masters-theme .public-result-rewards li {
  margin:6px 0;
  font:600 19px/1.32 var(--aow-body)!important;
  color:#ecf5f3!important;
  overflow-wrap:anywhere;
}
body.aow-masters-theme .public-result-rewards .muted {font-size:17px!important;}
body.aow-masters-theme .public-results-waiting {
  border:1px solid #648b91!important;
  border-top:3px solid #87cbd2!important;
  border-radius:2px!important;
  background:linear-gradient(160deg,#193538,#08191c)!important;
}
body.aow-masters-theme .public-results-waiting-icon {color:#f0cb59!important;}
body.aow-masters-theme .public-results-waiting p {font-size:20px!important;line-height:1.4!important;}
body.aow-masters-theme .public-results-waiting .btn {font-size:20px!important;}
@media(max-width:1420px) {
  body.aow-masters-theme .public-results-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:720px) {
  body.aow-masters-theme .public-results-page {width:calc(100vw - 24px)!important;margin:18px auto 32px!important;}
  body.aow-masters-theme .public-results-grid {grid-template-columns:minmax(0,1fr)!important;gap:14px;}
  body.aow-masters-theme .public-result-card {padding:12px!important;}
  body.aow-masters-theme .public-result-medal {height:148px!important;flex-basis:148px!important;}
  body.aow-masters-theme .public-result-medal img {max-height:137px;}
  body.aow-masters-theme .public-result-rewards {min-height:0!important;}
}
