/*
 * Round 4 OVR Breakdown Modal styles
 * Extracted from round4Eval.css for maintainability
 */
/* ========== OVR BREAKDOWN MODAL ========== */
.ovr-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: max(0.5rem, env(safe-area-inset-top)) var(--spacing) max(0.6rem, env(safe-area-inset-bottom));
}

.ovr-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.ovr-modal-content {
  --ovr-tier-rgb: 77, 163, 255;
  --ovr-tier-soft-rgb: 208, 231, 255;
  --ovr-tier-ink: #1e4576;
  position: relative;
  background: linear-gradient(160deg, #ffffff, #f5f8ff);
  border-radius: 14px;
  max-width: 500px;
  width: 100%;
  max-height: min(86vh, 660px);
  padding: 0.18rem;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.45);
  animation: modalSlideIn 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ovr-modal-content::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 12px;
  border: 1px solid rgba(var(--ovr-tier-rgb), 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.ovr-modal-content::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.62), transparent 36%),
    radial-gradient(circle at 86% 16%, rgba(var(--ovr-tier-rgb), 0.14), transparent 40%),
    radial-gradient(circle at 84% 82%, rgba(var(--ovr-tier-rgb), 0.1), transparent 44%);
}

.ovr-modal-content[data-tier="icon"] {
  --ovr-tier-rgb: 243, 156, 18;
  --ovr-tier-soft-rgb: 255, 237, 194;
  --ovr-tier-ink: #8a4e00;
  background: linear-gradient(158deg, #fff8ec, #fdf4df 42%, #fffaf0);
}

.ovr-modal-content[data-tier="legendary"] {
  --ovr-tier-rgb: 231, 76, 60;
  --ovr-tier-soft-rgb: 255, 222, 218;
  --ovr-tier-ink: #8d2f26;
  background: linear-gradient(158deg, #fff3f3, #ffe6e3 46%, #fff7f5);
}

.ovr-modal-content[data-tier="epic"] {
  --ovr-tier-rgb: 155, 89, 182;
  --ovr-tier-soft-rgb: 239, 225, 255;
  --ovr-tier-ink: #5f3381;
  background: linear-gradient(158deg, #f8f1ff, #eee0ff 46%, #faf5ff);
}

.ovr-modal-content[data-tier="rare"] {
  --ovr-tier-rgb: 255, 107, 53;
  --ovr-tier-soft-rgb: 255, 227, 213;
  --ovr-tier-ink: #8f431f;
  background: linear-gradient(158deg, #fff5ee, #ffe8d8 46%, #fff8f2);
}

.ovr-modal-content[data-tier="gold"] {
  --ovr-tier-rgb: 255, 201, 54;
  --ovr-tier-soft-rgb: 255, 242, 199;
  --ovr-tier-ink: #8b6700;
  background: linear-gradient(158deg, #fff9eb, #fff0c9 46%, #fffaf0);
}

.ovr-modal-content[data-tier="silver"] {
  --ovr-tier-rgb: 155, 169, 191;
  --ovr-tier-soft-rgb: 233, 239, 247;
  --ovr-tier-ink: #415064;
  background: linear-gradient(158deg, #f7faff, #edf2f9 46%, #f9fbff);
}

.ovr-modal-content[data-tier="bronze"] {
  --ovr-tier-rgb: 186, 128, 82;
  --ovr-tier-soft-rgb: 242, 224, 209;
  --ovr-tier-ink: #6f4a2d;
  background: linear-gradient(158deg, #fff6ef, #f7e8dc 46%, #fff9f4);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-36px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ovr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.65rem;
  margin: -0.18rem -0.18rem 0;
  border-bottom: 1px solid rgba(var(--ovr-tier-rgb), 0.36);
  background:
    linear-gradient(135deg, rgba(var(--ovr-tier-rgb), 0.92), rgba(var(--ovr-tier-rgb), 0.68)),
    linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px 10px 0 0;
  position: sticky;
  top: -0.18rem;
  z-index: 100;
  box-shadow: 0 10px 16px rgba(var(--ovr-tier-rgb), 0.14);
}

.ovr-modal-title {
  font-size: 1.05rem;
  color: white;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1.15;
}

.ovr-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-weight: bold;
  line-height: 1;
}

.ovr-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg) scale(1.05);
}

.ovr-modal-body {
  position: relative;
  margin: 0.24rem 0.12rem 0.12rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--ovr-tier-rgb), 0.18);
  padding: 0.45rem 0.55rem 0.6rem;
  background:
    radial-gradient(460px 220px at 8% -6%, rgba(var(--ovr-tier-rgb), 0.18), transparent 60%),
    radial-gradient(500px 240px at 102% 6%, rgba(var(--ovr-tier-rgb), 0.12), transparent 62%),
    linear-gradient(180deg, rgba(var(--ovr-tier-soft-rgb), 0.36), rgba(255,255,255,0.06));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.ovr-modal-body::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(var(--ovr-tier-rgb), 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--ovr-tier-rgb), 0.05) 1px, transparent 1px);
  background-size: 14px 14px;
}

.ovr-modal-body::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,0.24), transparent 34%),
    radial-gradient(circle at 88% 90%, rgba(var(--ovr-tier-rgb), 0.08), transparent 44%);
  opacity: 0.8;
}

.ovr-modal-body > * {
  position: relative;
  z-index: 1;
}

.ovr-breakdown-section {
  margin-bottom: 0.45rem;
  padding: 0.34rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--ovr-tier-rgb), 0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(var(--ovr-tier-soft-rgb), 0.32)),
    linear-gradient(135deg, rgba(var(--ovr-tier-rgb), 0.03), rgba(var(--ovr-tier-rgb), 0));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 4px 14px rgba(16, 26, 42, 0.04);
}

.ovr-breakdown-section-character .ovr-dropdown {
  display: block;
}

.ovr-character-layout {
  display: grid;
  grid-template-columns: minmax(118px, 160px) minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  margin-top: 0.25rem;
}

.ovr-character-text-pane {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}

.ovr-breakdown-section:last-child {
  margin-bottom: 0;
}

.ovr-section-title {
  font-size: 0.8rem;
  color: #1e4576;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ovr-section-text {
  font-size: 0.78rem;
  line-height: 1.25;
  color: #444;
  margin: 0.3rem 0 0;
}

.ovr-character-tools {
  margin-top: 0.35rem;
  display: flex;
  justify-content: flex-start;
}

.ovr-audio-preview-btn {
  border: 1px solid rgba(30, 69, 118, 0.18);
  background: linear-gradient(135deg, rgba(30, 69, 118, 0.06), rgba(70, 129, 255, 0.1));
  color: #203a64;
  border-radius: 999px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.ovr-audio-preview-btn:hover {
  background: linear-gradient(135deg, rgba(30, 69, 118, 0.1), rgba(70, 129, 255, 0.14));
}

.ovr-audio-preview-status {
  min-height: 1.1rem;
  margin: 0.25rem 0 0;
  font-size: 0.66rem;
  line-height: 1.2;
  color: #54718f;
  letter-spacing: 0.01em;
}

.ovr-audio-preview-status.is-warning {
  color: #8a5b00;
}

.ovr-audio-preview-status.is-ready {
  color: #2b6d50;
}

.ovr-char-summary-rich {
  margin-top: 0;
  display: grid;
  gap: 0.28rem;
  background: linear-gradient(180deg, rgba(248,251,255,0.96), rgba(243,247,254,0.9));
  border: 1px solid rgba(25, 44, 74, 0.08);
  border-radius: 10px;
  padding: 0.38rem 0.42rem;
}

.ovr-summary-resolver,
.ovr-summary-trace,
.ovr-summary-blurb {
  display: block;
}

.ovr-summary-resolver {
  font-size: 0.72rem;
  line-height: 1.2;
  color: #2c3f5b;
  font-weight: 700;
}

.ovr-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
}

.ovr-summary-chip {
  font-size: 0.62rem;
  line-height: 1.05;
  color: #203046;
  background: rgba(32, 48, 70, 0.06);
  border: 1px solid rgba(32, 48, 70, 0.08);
  border-radius: 999px;
  padding: 0.12rem 0.36rem;
}

.ovr-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.16rem;
}

.ovr-summary-badge {
  font-size: 0.61rem;
  line-height: 1.05;
  border-radius: 999px;
  padding: 0.12rem 0.34rem;
  border: 1px solid transparent;
}

.ovr-summary-badge.trait {
  background: rgba(70, 129, 255, 0.12);
  border-color: rgba(70, 129, 255, 0.2);
  color: #21469c;
}

.ovr-summary-badge.flag {
  background: rgba(154, 89, 48, 0.1);
  border-color: rgba(154, 89, 48, 0.18);
  color: #7b4a28;
}

.ovr-summary-badge.variant {
  background: rgba(114, 77, 214, 0.12);
  border-color: rgba(114, 77, 214, 0.22);
  color: #4e33a9;
  font-weight: 700;
}

.ovr-summary-trace {
  font-size: 0.66rem;
  line-height: 1.16;
  color: #6a7688;
}

.ovr-summary-blurb {
  font-size: 0.73rem;
  line-height: 1.22;
  color: #3f4752;
}

.ovr-character-image-wrap {
  width: 100%;
  max-width: 180px;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,0.08);
  background: #f4f7ff;
}

.ovr-character-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.ovr-character-image-wrap.missing {
  border-style: dashed;
  opacity: 0.92;
}

.ovr-dropdown {
  border-radius: 10px;
  border: 1px solid rgba(var(--ovr-tier-rgb), 0.14);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--ovr-tier-rgb), 0.08), transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(var(--ovr-tier-soft-rgb), 0.28));
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(18, 34, 62, 0.05);
}

.ovr-dropdown-score {
  border-color: rgba(var(--ovr-tier-rgb), 0.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--ovr-tier-rgb), 0.08), transparent 54%),
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(var(--ovr-tier-soft-rgb), 0.28));
}

.ovr-dropdown-score summary {
  background:
    linear-gradient(180deg, rgba(var(--ovr-tier-rgb), 0.11), rgba(var(--ovr-tier-rgb), 0.04));
  border-color: rgba(var(--ovr-tier-rgb), 0.14);
  color: var(--ovr-tier-ink);
}

.ovr-dropdown-score summary:hover {
  background:
    linear-gradient(180deg, rgba(var(--ovr-tier-rgb), 0.15), rgba(var(--ovr-tier-rgb), 0.05));
  border-color: rgba(var(--ovr-tier-rgb), 0.22);
}

.ovr-dropdown-score summary::after {
  border-right-color: rgba(var(--ovr-tier-rgb), 0.88);
  border-bottom-color: rgba(var(--ovr-tier-rgb), 0.88);
}

.ovr-dropdown-score[open] summary::after {
  border-color: rgb(var(--ovr-tier-rgb));
}

.ovr-dropdown summary {
  list-style: none;
  min-height: 40px;
  padding: 0 0.5rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(var(--ovr-tier-rgb), 0.08), rgba(var(--ovr-tier-rgb), 0.02));
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.ovr-dropdown summary:hover {
  background: linear-gradient(180deg, rgba(var(--ovr-tier-rgb), 0.12), rgba(var(--ovr-tier-rgb), 0.03));
  border-color: rgba(var(--ovr-tier-rgb), 0.12);
}

.ovr-dropdown summary::-webkit-details-marker {
  display: none;
}

.ovr-dropdown summary::after {
  content: '';
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(var(--ovr-tier-rgb), 0.72);
  border-bottom: 2px solid rgba(var(--ovr-tier-rgb), 0.72);
  transform: rotate(45deg);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.ovr-dropdown[open] summary::after {
  transform: rotate(225deg);
  border-color: rgba(var(--ovr-tier-rgb), 0.95);
}

.ovr-dropdown > :not(summary) {
  margin: 0;
  padding: 0.18rem 0.5rem 0.38rem;
}

.ovr-dropdown .score-breakdown-list,
.ovr-dropdown .ovr-section-text,
.ovr-dropdown .ovr-keywords {
  margin-top: 0.28rem;
}
.ovr-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.ovr-keywords-label,
.ovr-keywords-empty {
  font-size: 0.72rem;
  color: #666;
}

.ovr-keyword-chip {
  font-size: 0.68rem;
  color: #234;
  background: #eaf3ff;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
}

#ovrBreakdownModal.ovr-context-mode .ovr-breakdown-content {
  background:
    radial-gradient(1200px 340px at 8% -6%, rgba(38, 122, 255, 0.08), transparent 55%),
    radial-gradient(1000px 340px at 100% 0%, rgba(35, 196, 140, 0.06), transparent 60%),
    #fff;
}

#ovrBreakdownModal.ovr-context-mode .ovr-breakdown-section-character {
  border-color: rgba(31, 52, 88, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

#ovrBreakdownModal.ovr-context-mode .ovr-character-layout {
  grid-template-columns: minmax(90px, 116px) minmax(0, 1fr);
  gap: 0.42rem;
}

#ovrBreakdownModal.ovr-context-mode .ovr-character-image-wrap {
  max-width: 116px;
  border-radius: 10px;
}

#ovrBreakdownModal.ovr-context-mode .ovr-character-image {
  aspect-ratio: 1 / 1;
}

#ovrBreakdownModal.ovr-context-mode .ovr-char-summary-rich {
  gap: 0.24rem;
  padding: 0.34rem 0.38rem;
}

.ovr-context-quick-view {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
}

.ovr-context-quick-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(246,249,255,0.95));
  border: 1px solid rgba(31, 52, 88, 0.1);
  border-radius: 8px;
  padding: 0.32rem 0.38rem;
  display: grid;
  gap: 0.18rem;
}

.ovr-context-quick-card.boost {
  border-color: rgba(46, 148, 84, 0.35);
  background: linear-gradient(180deg, rgba(236, 252, 242, 0.9), rgba(246, 255, 249, 0.98));
}

.ovr-context-quick-card.drag {
  border-color: rgba(194, 83, 83, 0.28);
  background: linear-gradient(180deg, rgba(255, 241, 241, 0.9), rgba(255, 248, 248, 0.98));
}

.ovr-context-quick-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent-primary);
  font-size: 0.7rem;
}

.ovr-context-quick-head strong {
  font-size: 0.7rem;
  line-height: 1.1;
}

.ovr-context-quick-copy {
  margin: 0;
  color: #2f3743;
  font-size: 0.69rem;
  line-height: 1.18;
}

.ovr-context-quick-headline {
  font-weight: 700;
  color: #203046;
}

.ovr-context-quick-detail {
  color: #455262;
}

.ovr-context-quick-flavor {
  margin: 0.04rem 0 0;
  padding: 0.2rem 0.28rem;
  border-radius: 7px;
  background: rgba(255,255,255,0.75);
  border: 1px dashed rgba(32, 48, 70, 0.12);
  color: #263244;
  font-size: 0.66rem;
  line-height: 1.16;
  font-weight: 600;
  display: block;
}

.ovr-context-quick-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
}

.ovr-context-quick-prompt {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.2rem;
  align-items: start;
  margin-top: 0.02rem;
  font-size: 0.62rem;
  color: #334256;
}

#ovrBreakdownModal.ovr-context-mode .ovr-context-quick-prompt {
  display: none !important;
}

.ovr-context-quick-prompt-label {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #415267;
}

.ovr-context-quick-prompt-arrow {
  color: #7a8797;
}

.ovr-context-quick-prompt-text {
  font-weight: 700;
  line-height: 1.15;
  color: #273243;
}

.ovr-context-secondary {
  opacity: 0.92;
}

.ovr-context-secondary .ovr-dropdown:not([open]) {
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  padding-top: 0.28rem;
}

.ovr-context-secondary .ovr-section-title {
  font-size: 0.74rem;
  color: #6a7688;
}

.ovr-summary-rule {
  height: 1px;
  background: linear-gradient(90deg, rgba(31,52,88,0.18), rgba(31,52,88,0.04));
  margin: 0.12rem 0 0.14rem;
}

/* Score Breakdown Mini Diagram */
.score-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.score-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: #445;
  font-weight: 700;
}

.score-mini-title {
  letter-spacing: 0.01em;
}

.score-mini-total {
  color: rgb(var(--ovr-tier-rgb));
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.score-mini-track {
  display: flex;
  gap: 0.12rem;
  background: #f5f7fb;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 0.14rem;
  min-height: 0.66rem;
  overflow: hidden;
}

.score-mini-track.penalties {
  background: #fff4f4;
  border-color: rgba(190, 50, 50, 0.22);
}

.score-mini-segment {
  height: 0.4rem;
  border-radius: 999px;
  display: inline-block;
}

.score-mini-segment.pos {
  background: hsl(var(--segment-hue), 65%, 48%);
}

.score-mini-segment.neg {
  background: hsl(calc(var(--segment-hue) + 350), 80%, 58%);
}

.score-mini-empty {
  font-size: 0.64rem;
  color: #7a8593;
  padding: 0.02rem 0.28rem;
}

.score-mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
}

.score-mini-chip {
  font-size: 0.62rem;
  border-radius: 999px;
  padding: 0.06rem 0.3rem;
  border: 1px solid transparent;
  color: #2f3a4a;
  background: #edf1f8;
  white-space: nowrap;
}

.score-mini-chip.positive {
  background: #ebf8ef;
  border-color: rgba(61, 155, 92, 0.45);
}

.score-mini-chip.negative {
  background: #fff0f0;
  border-color: rgba(211, 83, 83, 0.45);
}

.score-mini-chip.neutral {
  background: #eff3f7;
  border-color: rgba(120, 140, 160, 0.4);
}

/* OVR Breakdown Details */
.ovr-breakdown-details {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ovr-visual-shell {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --glint-x: 50%;
  --glint-y: 35%;
  --focus-hue: 38;
  position: relative;
  width: min(420px, 94%);
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(145deg, #f8fbff, #f3f6ff);
  padding: 0.55rem;
  display: grid;
  gap: 0.5rem;
  transform: perspective(920px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 280ms ease, box-shadow 260ms ease;
  box-shadow: 0 8px 24px rgba(13, 23, 42, 0.14);
  overflow: hidden;
}

.ovr-visual-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--glint-x) var(--glint-y), rgba(255, 255, 255, 0.42), transparent 38%);
  pointer-events: none;
  animation: ovrAmbientGlow 5.8s ease-in-out infinite;
}

.ovr-visual-shell::after {
  content: '';
  position: absolute;
  inset: 8px;
  clip-path: polygon(10% 0%, 90% 0%, 100% 18%, 100% 82%, 90% 100%, 10% 100%, 0% 82%, 0% 18%);
  border: 1px solid rgba(255, 255, 255, 0.58);
  pointer-events: none;
  animation: ovrOutlinePulse 2.7s ease-in-out infinite;
}

.ovr-visual-shell:hover {
  box-shadow: 0 14px 30px rgba(13, 23, 42, 0.2), 0 0 0 1px hsla(var(--focus-hue), 78%, 62%, 0.34);
}

.ovr-visual-ring-wrap {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0.45rem;
  align-items: center;
}

.ovr-visual-ring {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  margin: 0 auto 0 0;
  position: relative;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.97) 47%, transparent 48%),
    conic-gradient(var(--accent-primary) calc(var(--ovr-fill, 0) * 1%), rgba(0, 0, 0, 0.08) 0);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 0 0 7px rgba(255, 255, 255, 0.55);
  animation: ovrRingPulse 2.4s ease-in-out infinite;
}

.ovr-visual-ring::before,
.ovr-visual-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  animation: ovrRingOrbit 7.8s linear infinite;
}

.ovr-visual-ring::after {
  inset: -10px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.75);
  opacity: 0.5;
  animation-duration: 9.8s;
  animation-direction: reverse;
}

.ovr-visual-ring-fill {
  display: none;
}

.ovr-visual-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1;
  transform: translateY(7px);
}

.ovr-visual-center b {
  display: block;
  font-size: 1.95rem;
  color: #1f2f44;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8), 0 7px 12px rgba(23, 44, 76, 0.24);
  animation: ovrCountPop 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ovr-visual-chipset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.22rem;
}

.ovr-visual-mood {
  margin-top: 0.12rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  border-radius: 10px;
  border: 1px solid rgba(var(--ovr-tier-rgb), 0.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--ovr-tier-rgb), 0.08), transparent 56%),
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.55));
  padding: 0.28rem 0.34rem;
}

.ovr-visual-mood img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.14));
}

.ovr-visual-mood-copy {
  min-width: 0;
  display: grid;
  gap: 0.04rem;
  line-height: 1.05;
}

.ovr-visual-mood-copy small {
  font-size: 0.55rem;
  color: #4a5970;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ovr-visual-mood-copy strong {
  font-size: 0.72rem;
  color: #213148;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ovr-visual-mood-copy span {
  font-size: 0.6rem;
  color: #516178;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ovr-visual-mood em {
  font-style: normal;
  font-weight: 900;
  font-size: 0.78rem;
  color: rgb(var(--ovr-tier-rgb));
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.ovr-visual-mood.fallback {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ovr-visual-mood.fallback img {
  display: none;
}

.ovr-chip {
  font-size: 0.63rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: #2b3b53;
  padding: 0.12rem 0.36rem;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ovr-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 10px rgba(24, 43, 74, 0.18);
}

.ovr-visual-bars {
  display: grid;
  gap: 0.34rem;
}

.ovr-visual-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.66rem;
  color: #3a4657;
  border-radius: 10px;
  padding: 0.15rem 0.22rem;
  transition: background 160ms ease, transform 170ms ease, box-shadow 170ms ease;
  outline: none;
}

.ovr-visual-bar-row:focus-visible,
.ovr-visual-bar-row:hover,
.ovr-visual-bar-row.is-emphasis {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(24, 43, 74, 0.13);
}

.ovr-visual-bar-row b {
  font-size: 0.62rem;
  color: #334155;
}

.ovr-visual-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(22, 31, 42, 0.08);
  overflow: hidden;
}

.ovr-visual-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  width: 0;
  animation: ovrBarFill 620ms ease forwards;
  animation-delay: var(--delay, 0s);
  position: relative;
}

.ovr-visual-bar i::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 0;
  width: 12px;
  height: 100%;
  filter: blur(3px);
  background: rgba(255, 255, 255, 0.72);
}

.ovr-visual-bar .bar-base { background: linear-gradient(90deg, #53a7ff, #3c89df); }
.ovr-visual-bar .bar-rarity { background: linear-gradient(90deg, #f39c12, #ffbf5f); }
.ovr-visual-bar .bar-attr { background: linear-gradient(90deg, #8e6cff, #6755e7); }
.ovr-visual-bar .bar-scenario { background: linear-gradient(90deg, #49c27f, #2f9e63); }
.ovr-visual-bar-row.is-negative .bar-scenario { background: linear-gradient(90deg, #ff7a8a, #ea4b68); }

.ovr-scenario-narrative {
  margin: 0.25rem 0 0;
  padding: 0.36rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.64);
  color: #334155;
  font-size: 0.68rem;
  line-height: 1.35;
  position: relative;
  overflow: hidden;
}

.ovr-scenario-narrative::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #53a7ff, #8e6cff);
}

.ovr-visual-shell.tier-icon,
.ovr-breakdown-total.tier-icon {
  border-color: rgba(243, 156, 18, 0.56);
  box-shadow: 0 0 24px rgba(243, 156, 18, 0.25);
  background: linear-gradient(150deg, rgba(255, 245, 225, 0.98), rgba(255, 235, 195, 0.84));
}

.ovr-visual-shell.tier-legendary,
.ovr-breakdown-total.tier-legendary {
  border-color: rgba(231, 76, 60, 0.45);
  box-shadow: 0 0 19px rgba(231, 76, 60, 0.22);
  background: linear-gradient(150deg, rgba(255, 239, 237, 0.96), rgba(255, 220, 216, 0.84));
}

.ovr-visual-shell.tier-epic,
.ovr-breakdown-total.tier-epic {
  border-color: rgba(155, 89, 182, 0.42);
  box-shadow: 0 0 18px rgba(155, 89, 182, 0.24);
  background: linear-gradient(150deg, rgba(245, 237, 255, 0.96), rgba(231, 215, 255, 0.84));
}

.ovr-visual-shell.tier-rare,
.ovr-breakdown-total.tier-rare {
  border-color: rgba(255, 107, 53, 0.45);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.2);
  background: linear-gradient(150deg, rgba(255, 242, 234, 0.96), rgba(255, 225, 205, 0.86));
}

.ovr-visual-shell.tier-gold,
.ovr-breakdown-total.tier-gold {
  border-color: rgba(255, 201, 54, 0.45);
  box-shadow: 0 0 16px rgba(255, 201, 54, 0.2);
  background: linear-gradient(150deg, rgba(255, 249, 232, 0.96), rgba(255, 239, 194, 0.84));
}

.ovr-visual-shell.tier-silver,
.ovr-breakdown-total.tier-silver {
  border-color: rgba(155, 169, 191, 0.42);
  box-shadow: 0 0 14px rgba(155, 169, 191, 0.2);
  background: linear-gradient(150deg, rgba(246, 249, 255, 0.98), rgba(231, 237, 247, 0.9));
}

.ovr-visual-shell.tier-bronze,
.ovr-breakdown-total.tier-bronze {
  border-color: rgba(186, 128, 82, 0.45);
  box-shadow: 0 0 14px rgba(186, 128, 82, 0.2);
  background: linear-gradient(150deg, rgba(255, 245, 238, 0.96), rgba(241, 223, 207, 0.86));
}

@keyframes ovrBarFill {
  from { transform: translateX(-14%); opacity: 0.3; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes ovrAmbientGlow {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@keyframes ovrOutlinePulse {
  0%, 100% { opacity: 0.36; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.01); }
}

@keyframes ovrRingPulse {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 0 0 7px rgba(255, 255, 255, 0.55); }
  50% { transform: scale(1.02); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 0 0 9px rgba(255, 255, 255, 0.66); }
}

@keyframes ovrRingOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ovrCountPop {
  0% { transform: scale(0.76); opacity: 0.3; }
  72% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.ovr-breakdown-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ovr-breakdown-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.35rem;
  align-items: center;
  background: #fafafa;
  padding: 0.25rem 0.35rem;
  border-radius: 5px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.ovr-breakdown-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(26, 46, 77, 0.11);
}

.ovr-breakdown-label {
  font-weight: 600;
  color: #333;
  font-size: 0.74rem;
}

.ovr-breakdown-value {
  font-weight: bold;
  color: #666;
  font-size: 0.74rem;
  text-align: right;
}

.ovr-breakdown-total {
  background: linear-gradient(135deg, rgba(var(--ovr-tier-soft-rgb), 0.72), rgba(var(--ovr-tier-rgb), 0.08));
  padding: 0.35rem;
  border-radius: 8px;
  border: 2px solid rgba(var(--ovr-tier-rgb), 0.42);
  margin-top: 0.2rem;
}

.ovr-breakdown-total .ovr-breakdown-label,
.ovr-breakdown-total .ovr-breakdown-value {
  font-size: 0.92rem;
  color: rgb(var(--ovr-tier-rgb));
}

/* Clickable OVR indicator */
.eval-ovr-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.eval-ovr-clickable::after {
  content: '🔍';
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.eval-ovr-clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.eval-ovr-clickable:hover::after {
  opacity: 1;
}

.eval-ovr-clickable:focus {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .ovr-modal {
    align-items: flex-start;
    justify-content: center;
    padding-top: max(0.75rem, calc(env(safe-area-inset-top) + 0.4rem));
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
  }

  .ovr-modal-content {
    max-height: calc(100vh - max(1.3rem, env(safe-area-inset-top)) - max(1.1rem, env(safe-area-inset-bottom)));
    border-radius: 10px;
    padding: 0.14rem;
  }

  .ovr-modal-title {
    font-size: 0.95rem;
  }

  .ovr-modal-body {
    padding: 0.45rem 0.55rem 0.6rem;
    margin: 0.18rem 0.08rem 0.08rem;
  }

  .ovr-character-layout {
    grid-template-columns: 1fr;
  }

  .ovr-character-image-wrap {
    max-width: 100%;
  }

  #ovrBreakdownModal.ovr-context-mode .ovr-character-layout {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 0.35rem;
  }

  #ovrBreakdownModal.ovr-context-mode .ovr-character-image-wrap {
    max-width: 92px;
  }

  #ovrBreakdownModal.ovr-context-mode .ovr-character-image {
    aspect-ratio: 1 / 1;
  }

  #ovrBreakdownModal.ovr-context-mode .ovr-context-quick-view {
    grid-template-columns: 1fr;
    gap: 0.22rem;
  }

  #ovrBreakdownModal.ovr-context-mode .ovr-summary-blurb {
    font-size: 0.68rem;
    line-height: 1.18;
  }

  #ovrBreakdownModal.ovr-context-mode .ovr-context-quick-flavor {
    font-size: 0.62rem;
    line-height: 1.14;
  }

  .ovr-summary-meta,
  .ovr-summary-badges {
    gap: 0.14rem;
  }

  .ovr-context-quick-view {
    grid-template-columns: 1fr;
  }

  .ovr-visual-shell {
    width: 100%;
  }

  .ovr-visual-ring-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .ovr-visual-ring {
    margin: 0 auto;
  }

  .ovr-visual-mood {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.28rem;
  }

  .ovr-visual-mood em {
    display: none;
  }
}

