/* Rivals: title page, full-screen 3D view, HUD and touch controls. Builds on game.css. */
.rv-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; }
@media (max-width: 760px) { .rv-hero { grid-template-columns: 1fr; } .rv-hero__art { max-width: 320px; } }
.rv-hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); color: var(--indigo); letter-spacing: -.02em; margin: 6px 0; }
.rv-hero__art { position: relative; aspect-ratio: 4 / 3; width: 100%; margin: auto; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #8fd3ff 0 62%, #5fb33b 62% 70%, #8a5a35 70% 100%); }
.rv-hero__hero { position: absolute; width: 22%; left: 39%; top: 26%; animation: td-bob 2s ease-in-out infinite; }
.rv-cube { position: absolute; width: 16%; aspect-ratio: 1; border-radius: 6px; box-shadow: inset -6px -6px 0 rgba(0,0,0,.18); animation: td-bob 2.6s ease-in-out infinite; }
.rv-cube--a { left: 8%; top: 40%; background: #3a78e8; }
.rv-cube--b { right: 9%; top: 40%; background: #f5902a; animation-delay: .4s; }
.rv-cube--c { right: 24%; top: 8%; width: 11%; background: #f6c945; animation-delay: .8s; }
.rv-h2 { margin: 30px 0 14px; color: var(--indigo); }
.rv-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.rv-mode { display: grid; grid-template-rows: 110px 1fr; border-radius: 24px; overflow: hidden; background: var(--bg); border: 2px solid var(--line); box-shadow: var(--shadow); }
.rv-mode__art { background-size: cover; position: relative; }
.rv-mode--fort .rv-mode__art { background: linear-gradient(180deg, #8fd3ff 0 55%, #5fb33b 55% 64%, #8a5a35 64%); }
.rv-mode--fort .rv-mode__art::after { content: ""; position: absolute; left: 38%; bottom: 36%; width: 24%; height: 18%; border-radius: 4px; background: linear-gradient(90deg, #fff 0 30%, #2f6fe0 30%); box-shadow: 0 0 0 6px #3a78e8; }
.rv-mode--sky .rv-mode__art { background: radial-gradient(circle at 20% 60%, #5fb33b 0 12%, transparent 13%), radial-gradient(circle at 80% 40%, #5fb33b 0 12%, transparent 13%), linear-gradient(180deg, #8fd3ff, #c9ecff); }
.rv-mode--sky .rv-mode__art::after { content: ""; position: absolute; left: 47%; top: 26%; width: 20px; height: 20px; background: #ffd23f; transform: rotate(45deg); box-shadow: 0 0 18px #ffd23f; }
.rv-mode--raid .rv-mode__art { background: linear-gradient(180deg, #8fd3ff 0 50%, #a9a39a 50% 70%, #5fb33b 70%); }
.rv-mode--duel .rv-mode__art { background: linear-gradient(180deg, #8fd3ff 0 55%, #5fb33b 55% 64%, #8a5a35 64%); }
.rv-mode--duel .rv-mode__art::before { content: ""; position: absolute; left: 30%; top: 30%; width: 18px; height: 18px; border-radius: 50%; background: #7fb0ff; box-shadow: 70px 6px 0 #ffb15c, 34px -14px 0 -4px #fff; }
.rv-mode--duel .rv-mode__art::after { content: ""; position: absolute; left: 46%; bottom: 36%; width: 8%; height: 26%; background: #a9a39a; box-shadow: inset -4px 0 0 rgba(0,0,0,.15); }
.rv-mode--raid .rv-mode__art::after { content: ""; position: absolute; left: 46%; top: 22%; width: 22px; height: 30px; background: #f28a1d; clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%); }
.rv-mode__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.rv-mode__body h3 { margin: 0; font-size: 1.4rem; }
.rv-mode__body p { margin: 0 0 6px; }
.rv-mode__body .btn { margin-top: auto; align-self: flex-start; }
.rv-mode__body canvas { width: 20px; height: 20px; vertical-align: -4px; }
.rv-ctrl { margin-top: 18px; }

.rv-huddle h2 { margin: 4px 0 6px; }
.rv-huddle__q { margin: 16px 0 8px; font-size: 1.1rem; }
.rv-plans { display: grid; gap: 10px; }
.rv-plans--row { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .rv-plans--row { grid-template-columns: 1fr; } }
.rv-plan { padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.rv-plan:hover, .rv-plan:focus-visible { border-color: var(--blue); background: rgba(47,111,224,.08); }
.rv-huddle__ctrl { margin-top: 14px; }
.rv-end__score { font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rv-dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.rv-dot--blue { background: #2f6fe0; } .rv-dot--orange { background: #f28a1d; }
.rv-stats { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rv-stats li { background: var(--tint); border-radius: 14px; padding: 8px 4px; font-size: .8rem; display: flex; flex-direction: column; }
.rv-stats b { font-size: 1.4rem; }
.rv-skill { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: rgba(138,92,245,.1); border-radius: 16px; padding: 12px; }
.rv-skill img { flex: none; }
.rv-reflect { margin-top: 12px; }

/* Full-screen game */
html.rv-playing, html.rv-playing body { overflow: hidden; }
.rv-game { position: fixed; inset: 0; z-index: 40; background: #8fd3ff; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rv-hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; color: #fff; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.rv-hud button { pointer-events: auto; }
.rv-score { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; }
.rv-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 1rem; }
.rv-pill--blue { background: rgba(47,111,224,.9); } .rv-pill--orange { background: rgba(242,138,29,.92); }
.rv-pill.is-down { opacity: .55; }
.rv-clock { padding: 6px 12px; border-radius: 12px; background: rgba(20,28,60,.7); font-variant-numeric: tabular-nums; }
.rv-tools { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); display: flex; gap: 8px; }
.rv-round { width: 46px; height: 46px; border-radius: 14px; border: 0; background: rgba(20,28,60,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.rv-calls { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 6px; }
.rv-call { border: 0; border-radius: 12px; padding: 7px 10px; background: rgba(47,111,224,.85); color: #fff; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; text-align: left; }
.rv-call::before { content: attr(data-call); display: none; }
html:not(.rv-touch) .rv-call { counter-increment: call; }
html:not(.rv-touch) .rv-call::before { content: counter(call) " "; display: inline; opacity: .8; }
.rv-calls { counter-reset: call; }
.rv-banner { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 14px; background: rgba(20,28,60,.75); max-width: min(90vw, 560px); text-align: center; font-size: 1.05rem; }
.rv-banner--blue { background: rgba(47,111,224,.92); } .rv-banner--orange { background: rgba(214,112,10,.95); }
.rv-cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.rv-cross::before, .rv-cross::after { content: ""; position: absolute; background: rgba(255,255,255,.9); box-shadow: 0 0 2px rgba(0,0,0,.6); }
.rv-cross::before { left: 10px; top: 0; width: 2px; height: 22px; } .rv-cross::after { top: 10px; left: 0; height: 2px; width: 22px; }
.rv-bottom { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rv-hearts { display: flex; gap: 4px; }
.rv-hearts i { width: 20px; height: 18px; background: rgba(0,0,0,.35); clip-path: path("M10 18 L1.5 9.5 A4.5 4.5 0 0 1 10 3.5 A4.5 4.5 0 0 1 18.5 9.5 Z"); }
.rv-hearts i.on { background: #ff4d6d; }
.rv-hearts i.half { background: linear-gradient(90deg, #ff4d6d 50%, rgba(0,0,0,.35) 50%); }
.rv-hotbar { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(20,28,60,.55); }
.rv-slot { width: 48px; height: 48px; border-radius: 8px; border: 2px solid rgba(255,255,255,.4); position: relative; display: grid; place-items: end; padding: 2px 5px; }
.rv-slot--stick { background: linear-gradient(90deg, transparent 44%, #9a6236 44% 56%, transparent 56%) 0 14px / 100% 28px no-repeat, linear-gradient(#8fe3ff, #8fe3ff) 20px 7px / 8px 9px no-repeat; }
.rv-slot--mallet { background: linear-gradient(90deg, transparent 44%, #6b4a2b 44% 56%, transparent 56%) 0 14px / 100% 28px no-repeat, linear-gradient(#b388ff, #b388ff) 8px 6px / 32px 16px no-repeat; box-shadow: 0 0 0 3px #b388ff; }
.rv-slot--armor { background: linear-gradient(var(--armor, #9a6236), var(--armor, #9a6236)) 12px 10px / 24px 26px no-repeat; }
.rv-slot--ball { background: radial-gradient(circle at 40% 38%, #ffffff 0 18%, #dfe8f2 19% 42%, transparent 43%) center / 100% 100% no-repeat; }
.rv-slot--block { background: linear-gradient(135deg, #5b93ff, #2f6fe0); box-shadow: inset 0 0 0 6px rgba(0,0,0,.12); }

.rv-pad { position: absolute; inset: 0; z-index: 1; touch-action: none; } /* under the HUD so its buttons stay tappable */
.rv-stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.5); pointer-events: none; }
.rv-stick span { position: absolute; left: 34px; top: 34px; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.75); }
.rv-btns { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 260px; height: 252px; }
.rv-btn { position: absolute; border: 0; border-radius: 50%; color: #fff; font: inherit; font-weight: 900; font-size: .85rem; text-shadow: 0 1px 0 rgba(0,0,0,.4); touch-action: none; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.rv-btn.is-on { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.rv-btn--hit { width: 92px; height: 92px; right: 0; bottom: 70px; background: rgba(255,93,143,.9); }
.rv-btn--build { width: 78px; height: 78px; right: 104px; bottom: 96px; background: rgba(47,111,224,.9); }
.rv-btn--jump { width: 86px; height: 86px; right: 70px; bottom: 0; background: rgba(95,179,59,.92); }
.rv-btn--throw { width: 66px; height: 66px; right: 2px; bottom: 176px; background: rgba(150,170,200,.92); font-size: .74rem; }
.rv-btn--balloon { width: 66px; height: 66px; right: 74px; bottom: 184px; background: rgba(79,184,255,.92); font-size: .74rem; }
.rv-btn--shield { width: 70px; height: 70px; right: 188px; bottom: 96px; background: rgba(120,132,150,.92); font-size: .74rem; }
.rv-btn--mazazo { width: 74px; height: 74px; right: 162px; bottom: 0; background: rgba(110,80,160,.55); font-size: .74rem; opacity: .7; }
.rv-btn--mazazo.is-ready { background: rgba(140,90,230,.95); opacity: 1; box-shadow: 0 0 0 3px #e3d4ff, 0 4px 0 rgba(0,0,0,.25); }
.rv-slot--balloon { background: radial-gradient(circle at 42% 40%, #bfe6ff 0 16%, #4fb8ff 17% 44%, transparent 45%) center / 100% 100% no-repeat; }
html.rv-touch .rv-cross { display: block; }
html.rv-touch .rv-bottom { left: 40%; }
@media (max-height: 420px) { .rv-call { padding: 5px 8px; font-size: .72rem; } .rv-slot { width: 40px; height: 40px; } }

.rv-pause { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(13,21,48,.5); }
.rv-pause__card { background: var(--bg); color: var(--ink); border-radius: 24px; padding: 24px; display: grid; gap: 12px; text-align: center; min-width: min(320px, 90vw); }
.rv-pause__card h2 { margin: 0; color: var(--indigo); }

/* Phones held upright: score on its own row, team calls and tools under it, hotbar bottom-left clear of the buttons. */
@media (orientation: portrait) and (max-width: 600px) {
  .rv-score { gap: 5px; }
  .rv-pill { font-size: .75rem; padding: 5px 8px; gap: 4px; }
  .rv-pill svg { width: 15px; height: 15px; }
  .rv-clock { padding: 5px 8px; font-size: .9rem; }
  .rv-tools { top: calc(max(10px, env(safe-area-inset-top)) + 44px); }
  .rv-round { width: 42px; height: 42px; }
  .rv-calls { top: calc(max(10px, env(safe-area-inset-top)) + 44px); }
  .rv-call { padding: 6px 9px; font-size: .74rem; }
  .rv-banner { top: calc(max(10px, env(safe-area-inset-top)) + 236px); font-size: .95rem; }
  /* Hearts and hotbar go under the team calls, so the bottom is free for the action buttons. */
  html.rv-touch .rv-bottom { left: max(10px, env(safe-area-inset-left)); top: calc(max(10px, env(safe-area-inset-top)) + 156px); bottom: auto; transform: none; align-items: flex-start; }
  html.rv-touch .rv-slot { width: 40px; height: 40px; }
  .rv-btns { transform: scale(.85); transform-origin: right bottom; }
}
@media (orientation: portrait) and (max-width: 360px) {
  .rv-btns { transform: scale(.78); }
  html.rv-touch .rv-slot { width: 38px; height: 38px; }
}

/* Shop (opens at your base) */
.rv-shop h2 { margin: 0 0 4px; color: var(--indigo); }
.rv-shop h3 { margin: 14px 0 6px; font-size: 1rem; }
.rv-shop__have { margin: 0; font-weight: 800; }
.rv-shop__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rv-shop__item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--tint); }
.rv-shop__item.is-on { outline: 3px solid var(--indigo); }
.rv-shop__item small { display: block; opacity: .8; }
.rv-shop__swatch { width: 36px; height: 36px; border-radius: 8px; background: var(--armor, #b388ff); box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); }
.rv-shop__swatch--mallet { background: linear-gradient(90deg, transparent 42%, #6b4a2b 42% 58%, transparent 58%) 0 14px / 100% 22px no-repeat, linear-gradient(#b388ff, #b388ff) 4px 4px / 28px 14px no-repeat; box-shadow: none; }
.rv-shop__tag { font-size: .8rem; font-weight: 800; opacity: .75; }
