/* World Tour compact mode
   A narrow, glanceable match-side HUD with the existing logger in a drawer. */

.wt-full-view-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wt-view-toggle {
  min-width: 72px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(123, 139, 255, 0.34);
  border-radius: 3px;
  background: rgba(17, 23, 52, 0.78);
  color: #aeb8ff;
  font: 700 10px/1 'Chakra Petch', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.wt-view-toggle:hover {
  border-color: rgba(76, 214, 255, 0.7);
  background: rgba(23, 35, 70, 0.92);
  color: #d8f8ff;
}

.wt-compact-view,
.wt-compact-drawer-head,
.wt-drawer-backdrop,
.wt-mobile-view-switch {
  display: none;
}

@media (max-width: 960px) {
  .wt-mobile-view-switch {
    display: flex;
    margin-bottom: 18px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .wt-mobile-view-switch > span {
    color: #7784a4;
    font: 700 9px/1 'Chakra Petch', monospace;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
}

body.wt-view-compact {
  min-width: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(47, 89, 195, 0.18), transparent 34%),
    #070a13;
}

body.wt-view-compact #navbar-mount,
body.wt-view-compact .site-footer,
body.wt-view-compact .last-updated,
body.wt-view-compact .v2-quick-dock,
body.wt-view-compact #scotty-widget {
  display: none !important;
}

body.wt-view-compact .v2-shell {
  position: relative;
  display: block;
  width: min(100%, 430px);
  min-width: 0;
  min-height: 100dvh;
  margin: 0 auto;
  border: 0;
  background:
    linear-gradient(rgba(111, 128, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 128, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #0b1020 0%, #080b14 100%);
  background-size: 32px 32px, 32px 32px, auto;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.48);
  contain: none !important;
}

body.wt-view-compact .v2-main {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
  overflow: visible;
}

body.wt-view-compact .v2-main::before,
body.wt-view-compact .v2-main::after {
  display: none;
}

body.wt-view-compact .v2-main > *:not(.wt-compact-view) {
  display: none !important;
}

body.wt-view-compact .wt-compact-view {
  position: relative;
  display: flex;
  min-height: 100dvh;
  padding: 0 16px calc(112px + env(safe-area-inset-bottom));
  flex-direction: column;
  gap: 12px;
  animation: wtCompactEnter 240ms ease-out both;
}

.wt-compact-topbar {
  display: flex;
  min-height: 64px;
  margin: 0 -16px;
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 65, 84, 0.28);
  background: rgba(5, 7, 13, 0.92);
}

.wt-compact-brand {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: #f8f9ff;
  font: italic 800 13px/1 'Barlow Condensed', sans-serif;
  letter-spacing: 0.055em;
  text-decoration: none;
  white-space: nowrap;
}

.wt-compact-brand-mark {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid #ff3853;
  background: #e91938;
  clip-path: polygon(50% 0, 100% 24%, 84% 82%, 50% 100%, 14% 82%, 0 24%);
  transform: rotate(-10deg);
  box-shadow: 0 0 8px rgba(255, 40, 70, 0.2);
}

.wt-compact-brand-mark::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  transform: rotate(45deg);
}

.wt-compact-topbar .wt-view-toggle {
  min-width: 58px;
  border-color: rgba(255, 255, 255, 0.16);
  color: #dce2ff;
}

.wt-compact-season-row {
  display: flex;
  padding: 11px 0 2px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.wt-compact-season-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.wt-compact-kicker,
.wt-compact-label {
  color: #7f8bad;
  font: 700 9px/1.2 'Chakra Petch', monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wt-compact-kicker {
  color: #f1f4ff;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.wt-compact-live {
  display: inline-flex;
  align-items: center;
  color: #7e8aa9;
  font: 600 9px/1 'Chakra Petch', monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.wt-compact-days {
  padding: 8px 10px;
  border: 1px solid rgba(255, 198, 84, 0.5);
  border-radius: 3px;
  background: #f3bd4c;
  color: #17100a;
  font: 700 10px/1 'Chakra Petch', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wt-compact-rank-card,
.wt-compact-primary-card,
.wt-compact-metric,
.wt-compact-milestone {
  border: 1px solid rgba(121, 139, 210, 0.18);
  border-radius: 4px;
  background: rgba(17, 23, 43, 0.96);
  box-shadow: none;
}

.wt-compact-rank-card {
  position: relative;
  min-height: 176px;
  padding: 20px;
  overflow: hidden;
}

.wt-compact-rank-card::before {
  display: none;
}

.wt-compact-rank-glyph {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 3px 10px rgba(77, 123, 217, 0.24));
}

.wt-compact-rank-glyph svg {
  display: block;
  width: 52px;
  height: 52px;
}

.wt-compact-rank-card h1 {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 66px);
  margin: 7px 0 3px;
  color: #eef2ff;
  font: 800 clamp(34px, 12vw, 46px)/0.92 'Barlow Condensed', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.wt-compact-points-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #7e8ba8;
  font: 600 11px/1 'Chakra Petch', monospace;
}

.wt-compact-points-line strong {
  color: #dce4ff;
  font-size: 13px;
}

.wt-compact-progress {
  position: relative;
  height: 7px;
  margin-top: 25px;
  overflow: hidden;
  border: 1px solid rgba(132, 151, 216, 0.13);
  border-radius: 999px;
  background: rgba(4, 8, 20, 0.82);
}

.wt-compact-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #725cff, #30d3f4);
  box-shadow: none;
  transition: width 280ms ease-out;
}

.wt-compact-progress-meta {
  display: flex;
  margin-top: 8px;
  justify-content: space-between;
  gap: 10px;
  color: #6f7d9e;
  font: 600 9px/1.2 'Chakra Petch', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wt-compact-progress-meta strong {
  color: #9aaaff;
}

.wt-compact-primary-card {
  padding: 17px 18px 15px;
  border-left: 2px solid #4bc6ff;
}

.wt-compact-primary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wt-compact-status {
  display: inline-flex;
  min-height: 24px;
  padding: 0 8px;
  align-items: center;
  border: 1px solid rgba(65, 221, 151, 0.38);
  border-radius: 3px;
  background: rgba(43, 174, 117, 0.1);
  color: #55df9d;
  font: 700 9px/1 'Chakra Petch', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wt-compact-status.is-behind {
  border-color: rgba(255, 83, 101, 0.42);
  background: rgba(205, 47, 68, 0.1);
  color: #ff7788;
}

.wt-compact-status.is-done {
  border-color: rgba(255, 196, 77, 0.42);
  background: rgba(207, 145, 27, 0.1);
  color: #ffd06e;
}

.wt-compact-daily {
  display: flex;
  margin-top: 8px;
  align-items: baseline;
  gap: 7px;
}

.wt-compact-daily strong {
  color: #4bc6ff;
  font: 800 46px/0.92 'Barlow Condensed', sans-serif;
  letter-spacing: 0.01em;
}

.wt-compact-daily span {
  color: #e9edff;
  font: 700 15px/1 'Barlow Condensed', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wt-compact-primary-card p {
  margin: 8px 0 0;
  color: #8390ad;
  font: 500 11px/1.45 'Chakra Petch', monospace;
}

.wt-compact-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wt-compact-metric {
  display: flex;
  min-width: 0;
  min-height: 90px;
  padding: 13px 14px;
  flex-direction: column;
  justify-content: space-between;
}

.wt-compact-metric > span {
  color: #697797;
  font: 700 8px/1 'Chakra Petch', monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.wt-compact-metric > strong {
  overflow: hidden;
  color: #edf1ff;
  font: 700 clamp(20px, 7vw, 27px)/1 'Barlow Condensed', sans-serif;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.wt-compact-metric > small {
  overflow: hidden;
  color: #72809f;
  font: 600 8px/1.15 'Chakra Petch', monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wt-compact-milestone {
  display: grid;
  min-height: 74px;
  padding: 12px 14px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.wt-compact-milestone-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(61, 220, 210, 0.42);
  border-radius: 50%;
}

.wt-compact-milestone-icon span {
  width: 8px;
  height: 8px;
  border: 2px solid #3edbd0;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(62, 219, 208, 0.55);
}

.wt-compact-milestone > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.wt-compact-milestone > div:nth-child(2) span,
.wt-compact-milestone-distance span {
  color: #697797;
  font: 700 8px/1 'Chakra Petch', monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.wt-compact-milestone > div:nth-child(2) strong {
  overflow: hidden;
  color: #e9edff;
  font: 700 18px/1 'Barlow Condensed', sans-serif;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.wt-compact-milestone-distance {
  display: flex;
  align-items: baseline;
  gap: 4px;
  text-align: right;
}

.wt-compact-milestone-distance strong {
  color: #46d7d0;
  font: 700 25px/1 'Barlow Condensed', sans-serif;
}

.wt-compact-actions {
  position: fixed;
  z-index: 20;
  width: min(calc(100% - 32px), 398px);
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  padding: 8px;
  border: 1px solid rgba(107, 128, 205, 0.18);
  border-radius: 5px;
  background: rgba(8, 12, 24, 0.94);
  box-shadow: 0 -18px 38px rgba(4, 6, 12, 0.54);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.wt-add-points {
  display: grid;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(77, 208, 255, 0.56);
  border-radius: 3px;
  background: linear-gradient(110deg, #6453ea, #3e8be8 55%, #32bad9);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(47, 105, 224, 0.26);
}

.wt-add-points > span {
  font: 500 25px/1 'Chakra Petch', monospace;
}

.wt-add-points > strong {
  font: 800 16px/1 'Barlow Condensed', sans-serif;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
}

.wt-add-points > small {
  color: rgba(255, 255, 255, 0.78);
  font: 700 9px/1 'Chakra Petch', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.wt-view-compact .v2-sidebar {
  position: fixed !important;
  z-index: 2101;
  width: min(390px, 100vw) !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 0 !important;
  inset: 0 0 0 auto !important;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 0 !important;
  border-left: 1px solid rgba(99, 126, 222, 0.3) !important;
  background: #0a0f1e !important;
  box-shadow: -30px 0 70px rgba(0, 0, 0, 0.62) !important;
  transform: translateX(calc(100% + 8px));
  visibility: hidden;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 220ms;
}

body.wt-view-compact.wt-points-open .v2-sidebar {
  transform: translateX(0);
  visibility: visible;
}

body.wt-view-compact .v2-sidebar::before,
body.wt-view-compact .v2-sidebar::after,
body.wt-view-compact .v2-sidebar > *:not(.wt-compact-drawer-head):not(.v2-match-section) {
  display: none !important;
}

body.wt-view-compact .wt-compact-drawer-head {
  display: flex;
  margin-bottom: 18px;
  padding-bottom: 15px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(104, 126, 204, 0.2);
}

.wt-compact-drawer-head > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wt-compact-drawer-head span {
  color: #6f7c9d;
  font: 700 8px/1 'Chakra Petch', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wt-compact-drawer-head strong {
  color: #f3f5ff;
  font: 800 27px/1 'Barlow Condensed', sans-serif;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.wt-drawer-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(134, 151, 209, 0.28);
  border-radius: 3px;
  background: rgba(28, 36, 67, 0.62);
  color: #dce3ff;
  font: 400 27px/1 sans-serif;
  cursor: pointer;
}

body.wt-view-compact .v2-sidebar .v2-match-section {
  display: flex !important;
}

body.wt-view-compact .v2-sidebar .v2-mode-tab,
body.wt-view-compact .v2-sidebar .v2-undo {
  min-height: 44px;
}

body.wt-view-compact .v2-sidebar .v2-undo {
  width: 100%;
  justify-content: center;
}

body.wt-view-compact[data-match-mode="cashout"] #cashoutButtons,
body.wt-view-compact:not([data-match-mode]) #cashoutButtons,
body.wt-view-compact[data-match-mode="quickplay"] #quickplayButtons,
body.wt-view-compact[data-match-mode="quickcash"] #quickCashButtons,
body.wt-view-compact[data-match-mode="bots"] #botsButtons {
  display: grid !important;
}

body.wt-view-compact[data-match-mode="manual"] #manualButtons,
body.wt-view-compact .v2-match-section > .v2-undo {
  display: flex !important;
}

body.wt-view-compact[data-match-mode="cashout"] #quickplayButtons,
body.wt-view-compact[data-match-mode="cashout"] #quickCashButtons,
body.wt-view-compact[data-match-mode="cashout"] #botsButtons,
body.wt-view-compact[data-match-mode="cashout"] #manualButtons,
body.wt-view-compact[data-match-mode="quickplay"] #cashoutButtons,
body.wt-view-compact[data-match-mode="quickplay"] #quickCashButtons,
body.wt-view-compact[data-match-mode="quickplay"] #botsButtons,
body.wt-view-compact[data-match-mode="quickplay"] #manualButtons,
body.wt-view-compact[data-match-mode="quickcash"] #cashoutButtons,
body.wt-view-compact[data-match-mode="quickcash"] #quickplayButtons,
body.wt-view-compact[data-match-mode="quickcash"] #botsButtons,
body.wt-view-compact[data-match-mode="quickcash"] #manualButtons,
body.wt-view-compact[data-match-mode="bots"] #cashoutButtons,
body.wt-view-compact[data-match-mode="bots"] #quickplayButtons,
body.wt-view-compact[data-match-mode="bots"] #quickCashButtons,
body.wt-view-compact[data-match-mode="bots"] #manualButtons,
body.wt-view-compact[data-match-mode="manual"] #cashoutButtons,
body.wt-view-compact[data-match-mode="manual"] #quickplayButtons,
body.wt-view-compact[data-match-mode="manual"] #quickCashButtons,
body.wt-view-compact[data-match-mode="manual"] #botsButtons {
  display: none !important;
}

body.wt-view-compact .wt-drawer-backdrop {
  position: fixed;
  z-index: 2100;
  display: block;
  inset: 0;
  border: 0;
  background: rgba(3, 5, 11, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(3px);
}

body.wt-view-compact.wt-points-open .wt-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.wt-view-compact.wt-points-open {
  overflow: hidden;
}

@keyframes wtCompactEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 330px) {
  body.wt-view-compact .wt-compact-view {
    padding-inline: 10px;
  }

  .wt-compact-topbar {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  .wt-compact-brand {
    font-size: 11px;
  }

  .wt-compact-rank-card,
  .wt-compact-primary-card {
    padding-inline: 14px;
  }

  .wt-compact-metric {
    padding-inline: 10px;
  }

  .wt-compact-actions {
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.wt-view-compact .wt-compact-view {
    animation: none;
  }

  body.wt-view-compact .v2-sidebar,
  body.wt-view-compact .wt-drawer-backdrop,
  .wt-compact-progress > span,
  .wt-view-toggle {
    transition: none;
  }
}

@media (forced-colors: active) {
  .wt-compact-rank-card,
  .wt-compact-primary-card,
  .wt-compact-metric,
  .wt-compact-milestone,
  .wt-add-points,
  .wt-view-toggle {
    border: 1px solid ButtonText;
  }

  .wt-compact-progress > span {
    background: Highlight;
  }
}

/* Shared by Full and Compact: a quiet cumulative target below progress. */
.wt-pace-total {
  margin: 14px 0 0;
  color: #b4b8cd;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
}

.wt-pace-total strong {
  color: #e7e9f3;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wt-pace-total[hidden] { display: none; }
