/* 🥊 라이벌 재벌 화면 · 제안 팝업 (어두운 고급 톤 · 라이벌별 강조색 --rc) */
.rv-modal { max-width: 980px !important; background: radial-gradient(120% 80% at 0% 0%, #1b1530, #0d0b14 55%, #08070c) !important; color: #ece6f6; color-scheme: dark; border: 1px solid #3a2d55 !important; box-shadow: 0 0 0 1px #f0b90b22, 0 24px 80px #000c !important; }
html[data-theme] .ar-modal-in.rv-modal p, html[data-theme] .ar-modal-in.rv-modal small, html[data-theme] .ar-modal-in.rv-modal b, html[data-theme] .ar-modal-in.rv-modal h3, html[data-theme] .ar-modal-in.rv-modal h4, html[data-theme] .ar-modal-in.rv-modal h5, html[data-theme] .ar-modal-in.rv-modal em, html[data-theme] .ar-modal-in.rv-modal span, html[data-theme] .ar-modal-in.rv-modal li { color: #ece6f6; }
html[data-theme] .ar-modal-in.rv-modal .dim { color: #a79fbb; }
.rv-hero { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 16px 18px 10px; border-bottom: 1px solid #2a2140; background: linear-gradient(90deg, #f0b90b14, transparent 60%); }
.rv-hero small { letter-spacing: .22em; font-size: 10px; color: #f0b90b !important; }
.rv-hero h3 { margin: 2px 0 4px; font-size: 22px; }
.rv-hero p { margin: 0; font-size: 13px; color: #b9b0cc !important; }
.rv-tabs, .rv-panes { flex-shrink: 0; display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; }
html[data-theme] .rv-modal .chip { background: #1d1730 !important; border: 1px solid #3a2d55 !important; color: #d9d0ea !important; }
html[data-theme] .rv-modal .chip.on { background: #f0b90b !important; border-color: #f0b90b !important; color: #1a1300 !important; }
html[data-theme] .rv-modal .btn.ghost { color: #ece6f6; border-color: #4a3b6a; background: #1d1730; }
html[data-theme] .rv-modal .btn.ghost:hover { border-color: #f0b90b; }
.rv-h { margin: 16px 0 8px; font-size: 13px; color: #f0b90b !important; }

/* 카드 */
.rv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rv-card { position: relative; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 0 0 10px; border-radius: 14px; overflow: hidden; cursor: pointer; background: #141022; border: 1px solid color-mix(in srgb, var(--rc) 45%, #2a2140); color: inherit; transition: transform .18s ease, box-shadow .18s ease; }
.rv-card:hover, .rv-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 30px color-mix(in srgb, var(--rc) 35%, transparent); }
.rv-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.rv-card b { padding: 6px 12px 0; font-size: 16px; }
.rv-card b small { font-weight: 400; font-size: 12px; color: #a79fbb !important; }
.rv-card em { padding: 0 12px; font-style: normal; font-weight: 700; color: #f6d365 !important; font-size: 15px; }
.rv-card-sub { padding: 0 12px; font-size: 12px; color: #a79fbb !important; }
.rv-card-tag { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--rc); color: #fff !important; box-shadow: 0 2px 8px #0008; }
.rv-card-alert, .rv-card-love { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #dc2626; color: #fff !important; animation: rv-pulse 1.4s ease-in-out infinite; }
.rv-card-love { background: #db2777; animation: none; }
.rv-spark { width: calc(100% - 24px); height: 24px; margin: 2px 12px 0; }
.rv-spark polyline { fill: none; stroke: var(--rc); stroke-width: 2; vector-effect: non-scaling-stroke; }
@keyframes rv-pulse { 50% { transform: scale(1.08); } }

/* 순위 */
.rv-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rv-rank li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #151024; border: 1px solid #241c38; }
.rv-rank li.rival { cursor: pointer; border-color: color-mix(in srgb, var(--rc) 50%, #241c38); background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 18%, #151024), #151024); }
.rv-rank li.me { border-color: #f0b90b; box-shadow: 0 0 0 1px #f0b90b55; }
.rv-no { font-weight: 800; color: #f0b90b !important; text-align: center; }
.rv-rank em { font-style: normal; font-weight: 700; color: #f6d365 !important; }

/* 분석 */
.rv-trend { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-trend span { padding: 5px 10px; border-radius: 999px; background: #221a36; border: 1px solid #3a2d55; font-size: 13px; }
.rv-whys { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.rv-why { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: #151024; border-left: 3px solid var(--rc); cursor: pointer; }
.rv-why img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.rv-why small { display: block; margin-top: 2px; color: #a79fbb !important; font-size: 12px; }
.rv-me { font-style: normal; color: #f87171 !important; font-weight: 800; }
.rv-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 280px; overflow: auto; }
.rv-log li { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: #120e1d; }
.rv-log time { margin-right: 8px; font-size: 11px; color: #8d84a3; }

/* 내 관계 */
.rv-mine { display: grid; gap: 8px; }
.rv-minerow { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: #151024; border: 1px solid color-mix(in srgb, var(--rc) 45%, #241c38); color: inherit; text-align: left; cursor: pointer; }
.rv-minerow img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.rv-minerow small { display: block; color: #a79fbb !important; font-size: 12px; margin-top: 2px; }

/* 프로필 · 대화 */
.rv-profile { display: flex; flex-direction: column; gap: 10px; }
.rv-back { align-self: flex-start; }
.rv-pro-top { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.rv-portrait { margin: 0; position: relative; border-radius: 16px; overflow: hidden; border: 2px solid var(--rc); box-shadow: 0 0 30px color-mix(in srgb, var(--rc) 35%, transparent); }
.rv-portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.rv-portrait figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, #000c); font-weight: 800; text-align: center; color: #fff; }
.rv-pro-info h4 { margin: 0 0 6px; font-size: 22px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rv-pro-info h4 small { font-size: 13px; font-weight: 400; color: #a79fbb !important; }
.rv-mood, .rv-stage { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #241c38; font-weight: 600; }
.rv-stage { background: #4a1833; }
.rv-bio { margin: 0 0 8px; font-size: 13px; color: #c9c0dc !important; }
.rv-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-bottom: 8px; }
.rv-stats b { color: #f6d365 !important; }
.rv-meter { display: grid; grid-template-columns: 52px 1fr 36px; gap: 8px; align-items: center; font-size: 12px; margin: 4px 0; }
.rv-meter i { height: 8px; border-radius: 999px; background: #241c38; overflow: hidden; }
.rv-meter b { display: block; height: 100%; border-radius: inherit; transition: width .5s ease; }
.rv-meter.aff b { background: linear-gradient(90deg, #ef4444, #f59e0b 50%, #22c55e); }
.rv-meter.riv b { background: linear-gradient(90deg, #f97316, #dc2626); }
.rv-meter.love b { background: linear-gradient(90deg, #f472b6, #e11d48); }
.rv-meter em { font-style: normal; text-align: right; font-weight: 700; }
.rv-chat { min-height: 120px; max-height: 240px; overflow: auto; padding: 12px; border-radius: 14px; background: #0b0912; border: 1px solid color-mix(in srgb, var(--rc) 40%, #2a2140); display: flex; flex-direction: column; gap: 8px; }
.rv-line { margin: 0; max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.rv-line b { display: block; font-size: 11px; opacity: .8; margin-bottom: 2px; }
.rv-line.npc { align-self: flex-start; background: color-mix(in srgb, var(--rc) 20%, #17122a); border-top-left-radius: 2px; }
.rv-line.me { align-self: flex-end; background: #2a2440; border-top-right-radius: 2px; }
.rv-line.sys { align-self: center; max-width: 100%; background: transparent; font-size: 12px; color: #f6d365 !important; padding: 2px; }
.rv-line.sys b { display: none; }
.rv-typing span::after { content: '▍'; animation: rv-blink 1s steps(1) infinite; }
@keyframes rv-blink { 50% { opacity: 0; } }
.rv-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-act { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 110px; padding: 10px 12px; border-radius: 12px; background: #1a1428; border: 1px solid #3a2d55; color: #ece6f6; font-weight: 700; cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.rv-act:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--rc); }
.rv-act:disabled { opacity: .45; cursor: not-allowed; }
.rv-act { position: relative; }
.rv-act.fav { border-color: #f0b90b88; }
.rv-act.fav::before { content: '⭐'; position: absolute; top: -7px; right: -5px; font-size: 13px; filter: drop-shadow(0 1px 2px #000a); }
.rv-act small { font-weight: 400; font-size: 11px; color: #f6d365 !important; }
.rv-tip { margin: 2px 0 0; font-size: 12px; }
.rv-romance { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.rv-romance .btn small { display: block; font-size: 10px; font-weight: 400; }
.rv-ok { margin: 0; color: #f9a8d4 !important; }
.rv-deals { display: grid; gap: 8px; }
.rv-deal { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #151024; border: 1px solid #241c38; }
.rv-deal > b { min-width: 120px; }
.rv-deal > small { flex: 1 1 260px; color: #a79fbb !important; font-size: 12px; }
.rv-deal select, .rv-deal input { background: #0d0a16; color: #ece6f6; border: 1px solid #3a2d55; border-radius: 8px; padding: 6px 8px; font-size: 13px; max-width: 260px; }

/* 📨 라이벌 제안 팝업 */
.rv-pop { border: 0; padding: 0; background: transparent; max-width: min(560px, calc(100vw - 32px)); width: 100%; color: #ece6f6; }
.rv-pop::backdrop { background: #05030acc; backdrop-filter: blur(3px); }
.rv-pop-in { display: grid; grid-template-columns: 190px 1fr; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #1b1530, #0b0912); border: 1px solid color-mix(in srgb, var(--rc) 60%, #2a2140); box-shadow: 0 0 40px color-mix(in srgb, var(--rc) 35%, transparent), 0 24px 70px #000c; animation: rv-pop-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes rv-pop-in { from { transform: translateY(30px) scale(.92); opacity: 0; } }
.rv-pop-art { margin: 0; position: relative; }
.rv-pop-art img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 230px; }
.rv-pop-art figcaption { position: absolute; left: 0; right: 0; top: 0; padding: 8px; font-size: 12px; font-weight: 800; text-align: center; background: var(--rc); color: #fff; }
.rv-pop-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.rv-pop-body h3 { margin: 0; font-size: 16px; color: #f6d365; }
.rv-pop-line { margin: 0; font-size: 15px; line-height: 1.55; min-height: 3em; }
.rv-pop-choices { display: grid; gap: 6px; }
.rv-pop-choice { text-align: left; padding: 9px 12px; border-radius: 10px; background: #1d1730; border: 1px solid #3a2d55; color: #ece6f6; cursor: pointer; }
.rv-pop-choice:hover, .rv-pop-choice:focus-visible { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 18%, #1d1730); }
.rv-pop-choice small { display: block; font-size: 11px; color: #a79fbb; margin-top: 2px; }
.rv-pop-res { margin: 0; padding: 10px; border-radius: 10px; font-size: 14px; }
.rv-pop-res.good { background: #14532d66; border: 1px solid #22c55e66; }
.rv-pop-res.bad { background: #7f1d1d66; border: 1px solid #ef444466; }
.rv-pop-later { align-self: flex-end; }
.rv-pop-threat .rv-pop-in, .rv-pop-overtake .rv-pop-in { animation: rv-pop-in .45s cubic-bezier(.2, 1.4, .4, 1) both, rv-shake .4s .45s ease-in-out; }
@keyframes rv-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (max-width: 640px) {
  .rv-pro-top { grid-template-columns: 1fr; }
  .rv-portrait { max-width: 220px; margin: 0 auto; }
  .rv-pop-in { grid-template-columns: 1fr; }
  .rv-pop-art img { min-height: 0; max-height: 200px; }
  .rv-cards { grid-template-columns: repeat(2, 1fr); }
  .rv-line { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .rv-card, .rv-pop-in, .rv-card-alert { animation: none !important; transition: none !important; }
}
html[data-theme] .rv-pop .btn.ghost { color: #ece6f6; border: 1px solid #4a3b6a; background: #1d1730; }
html[data-theme] .rv-pop h3 { color: #f6d365; }
html[data-theme] .rv-pop .rv-pop-line, html[data-theme] .rv-pop .rv-pop-choice b, html[data-theme] .rv-pop .rv-pop-res { color: #ece6f6; }

.rv-enterprise, .rv-memory { list-style: none; padding: 0; margin: .65rem 0; }
.rv-enterprise { display: grid; gap: .55rem; }
.rv-modal .rv-enterprise > li { background: #151024; border: 1px solid #3a2d55; color: #ece6f6; border-radius: 9px; padding: .75rem; overflow-wrap: anywhere; }
.rv-enterprise :is(b,small) { display: block; }
.ar-modal-in.rv-modal .rv-enterprise > li > small { color: #c9c0dc; }
.rv-memory { color: var(--muted); }
.rv-enterprise p { margin: .45rem 0; line-height: 1.5; }
.rv-enterprise button { min-height: 42px; margin: .25rem .4rem .1rem 0; }
.rv-inbox-result:empty { display: none; }
.rv-inbox-result { color: var(--text); border-bottom: 1px solid var(--line2); padding-bottom: .5rem; }
.rv-life-mood, .rv-memory { font-size: .82rem; line-height: 1.4; }
.rv-memory { display: grid; gap: .15rem; }
/* 💒 부부 · 공동 사업 */
.rv-family { display: grid; gap: 10px; }
.rv-couple { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--rc, #f0b90b) 55%, transparent); background: color-mix(in srgb, var(--rc, #f0b90b) 12%, transparent); font-size: .9rem; }
.rv-couple b { font-variant-numeric: tabular-nums; }
.rv-family select { min-height: 40px; max-width: 100%; }

.rv-modal .rv-incident-entry { align-self: flex-start; min-height: 44px; }
.rv-incident { width: min(420px, calc(100% - 24px)); max-height: calc(100% - 24px); box-sizing: border-box;
  padding: 0; color: #f3e8ed; background: #18121a; border: 1px solid #775262; border-radius: 14px; }
.rv-incident::backdrop { background: #09060bd9; }
.rv-incident-frame { display: grid; gap: 12px; padding: 15px; }
.rv-incident :is(header, .rv-incident-controls > div) { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rv-incident :is(h3, h4, p) { margin: 0; }
.rv-incident h3 { color: #ffe7ee; font-size: 1.12rem; }
.rv-incident h4 { color: #fff4f6; font-size: 1.4rem; line-height: 1.3; overflow-wrap: anywhere; }
.rv-incident .btn { min-height: 44px; min-width: 44px; }
.rv-incident .btn:focus-visible, .rv-modal .rv-incident-entry:focus-visible { outline: 2px solid #ffd095; outline-offset: 3px; }
.rv-incident-scene { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); align-items: center;
  gap: 12px; min-height: 108px; overflow: hidden; border-radius: 10px; background: #2c1925; padding-right: 10px; }
.rv-incident-scene img { display: block; width: 100%; height: 100%; max-height: 148px; object-fit: cover; }
.rv-incident-state, .rv-incident-rel, .rv-incident-controls p { color: #e0c4d0; font-size: .875rem; }
.rv-incident-controls > div { margin-top: 9px; }
.rv-incident-controls .btn { flex: 1; border-radius: 8px; color: #fff0f3; background: #553344; border: 1px solid #a47487; }
.rv-incident-controls :is([data-ri-phase="start"], [data-ri-phase="strike"]) { background: #a63151; border-color: #d26d8c; }
.rv-incident-controls .btn:disabled { opacity: .55; }
.rv-incident-feedback { font-size: .875rem; color: #ffd095; }
.rv-incident-feedback:empty { display: none; }
.rv-incident-hit { animation: rv-incident-impact 170ms ease-out; }
@keyframes rv-incident-impact {
  0% { transform: translateX(4px); background: #6d314a; }
  36% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .rv-incident-hit { animation: none; }
}
html[data-theme] .rv-incident [data-ri-close] {
  color: #fff0f3; background: #2c1925; border: 1px solid #8e6476;
}
