.pvp-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.pvp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pvp-statline,
.pvp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.pvp-stat,
.pvp-hud-cell {
  min-width: 74px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.pvp-stat span,
.pvp-hud-cell span {
  display: block;
  color: var(--cg-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.pvp-stat strong,
.pvp-hud-cell strong {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink);
  font-size: 19px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pvp-btn,
.pvp-route,
.pvp-seg-btn,
.pvp-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.pvp-btn {
  padding: 0 14px;
}

.pvp-btn:hover,
.pvp-route:hover,
.pvp-seg-btn:hover,
.pvp-close:hover {
  transform: translateY(-1px);
  border-color: var(--cg-teal);
}

.pvp-btn:focus-visible,
.pvp-route:focus-visible,
.pvp-seg-btn:focus-visible,
.pvp-close:focus-visible,
.pvp-canvas:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.35);
  outline-offset: 3px;
}

.pvp-icon {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.pvp-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pvp-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

.pvp-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #c9d8d7;
  border-radius: 8px;
  background: #e9f4f1;
  box-shadow: var(--cg-shadow);
  touch-action: none;
}

.pvp-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.72;
  max-height: min(70vh, 520px);
  min-height: 360px;
  cursor: pointer;
}

.pvp-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  pointer-events: none;
}

.pvp-hud-cell {
  min-width: 0;
  padding: 7px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
}

.pvp-hud-cell strong {
  font-size: 17px;
}

.pvp-start,
.pvp-result {
  position: absolute;
  left: 50%;
  display: grid;
  gap: 7px;
  width: min(86%, 330px);
  padding: 16px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--cg-ink);
  text-align: center;
  box-shadow: var(--cg-shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.pvp-start {
  bottom: 18px;
  pointer-events: none;
}

.pvp-start strong,
.pvp-result strong {
  font-size: 23px;
  line-height: 1.1;
}

.pvp-start span,
.pvp-result span,
.pvp-result p {
  margin: 0;
  color: var(--cg-muted);
  font-size: 14px;
}

.pvp-result {
  top: 50%;
  transform: translate(-50%, -50%);
  animation: pvp-pop 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pvp-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.pvp-final-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.pvp-final-cell {
  min-width: 0;
  padding: 6px 2px;
  border: 1px solid var(--cg-line);
  border-radius: 7px;
  background: rgba(246, 247, 242, 0.92);
}

.pvp-final-cell span {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.pvp-final-cell strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvp-result-actions {
  display: flex;
  gap: 8px;
}

.pvp-result-actions .pvp-btn {
  flex: 1 1 0;
}

.pvp-target {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #c9d8d7;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #eef7f5 54%, #f8f2e6);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.pvp-target span,
.pvp-target em {
  color: var(--cg-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.pvp-target strong {
  overflow: hidden;
  color: var(--cg-ink);
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pvp-routes {
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pvp-route {
  padding: 0 8px;
  color: var(--cg-muted);
  font-size: 14px;
}

.pvp-route-on {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

.pvp-route-lock {
  background: #edf6f1;
  color: var(--cg-green);
}

.pvp-drop {
  background: var(--cg-ink);
  color: #fff;
}

.pvp-below {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pvp-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.pvp-seg-btn {
  border: 0;
  box-shadow: none;
  padding: 0 15px;
  color: var(--cg-muted);
}

.pvp-seg-btn[aria-pressed="true"] {
  background: var(--cg-blue);
  color: #fff;
}

.pvp-note {
  flex: 1 1 220px;
  margin: 0;
  color: var(--cg-muted);
  font-size: 13px;
  line-height: 1.35;
}

.pvp-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 37, 40, 0.34);
}

.pvp-modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  box-shadow: 0 24px 70px rgba(30, 37, 40, 0.22);
}

.pvp-modal-card h2 {
  margin: 0 48px 12px 0;
  font-size: 24px;
  line-height: 1.1;
}

.pvp-modal-card p {
  margin: 10px 0 0;
  color: var(--cg-muted);
  line-height: 1.45;
}

.pvp-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.pvp-hide {
  display: none !important;
}

@media (max-width: 620px) {
  .pvp-shell {
    padding: 0 10px 18px;
  }

  .pvp-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pvp-statline,
  .pvp-actions {
    justify-content: center;
  }

  .pvp-stat {
    flex: 1 1 72px;
    text-align: center;
  }

  .pvp-canvas {
    aspect-ratio: 1 / 1.08;
    min-height: 420px;
    max-height: none;
  }

  .pvp-hud {
    gap: 5px;
  }

  .pvp-hud-cell {
    padding: 6px 3px;
  }

  .pvp-hud-cell span {
    font-size: 9px;
  }

  .pvp-hud-cell strong {
    font-size: 14px;
  }

  .pvp-target {
    grid-template-columns: 1fr;
    gap: 5px;
    text-align: center;
  }

  .pvp-target strong {
    font-size: 30px;
  }

  .pvp-routes {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }

  .pvp-route {
    padding: 0 4px;
    font-size: 12px;
  }

  .pvp-drop {
    grid-column: span 2;
  }

  .pvp-below {
    align-items: stretch;
    flex-direction: column;
  }

  .pvp-seg {
    justify-content: center;
  }

  .pvp-seg-btn {
    flex: 1 1 0;
  }

  .pvp-note {
    text-align: center;
  }
}
