/* Word Wars v20: the game picker and Word Rangers (ship screen, run, Armory, Workbench, Suit Lab).
   The ship screen is #home with the class "rangers", so the Tank Stars top bar, learning buttons,
   quests and phone layout apply to it as they are. */
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
.btn.gold { background: linear-gradient(180deg, #ffe066, #ff9f1c); color: #3b1d00; border-color: #fff0b3; box-shadow: 0 4px 0 #a35a00, 0 6px 18px rgba(255,159,28,.35); }

/* ---------- top bar switch ---------- */
.chip.switch-chip { border: 1px solid rgba(182,92,255,.55); background: rgba(40,20,70,.75); color: #f1e3ff; font-weight: 800; cursor: pointer; font-family: inherit; }
.chip.switch-chip:hover { border-color: #d6a6ff; box-shadow: 0 0 14px rgba(182,92,255,.45); }

/* ---------- pick a game ---------- */
#pick { overflow-y: auto; background: radial-gradient(circle at 30% 20%, #1b2a55, transparent 55%), radial-gradient(circle at 75% 80%, #2c1450, transparent 55%), var(--bg); }
.pick-wrap { min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 28px 18px; }
.pick-wrap .logo { font-size: 58px; }
.pick-wrap .logo small { font-size: 18px; letter-spacing: 8px; }
.pick-cards { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.pick-card { position: relative; width: 300px; padding: 16px 18px 20px; border-radius: 24px; border: 2px solid var(--line); background: var(--panel); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: transform .15s, box-shadow .2s, border-color .2s; }
.pick-card:hover { transform: translateY(-4px) scale(1.02); }
.pick-card.tanks:hover, .pick-card.tanks.last { border-color: #3dfcd8; box-shadow: 0 0 30px rgba(61,252,216,.3); }
.pick-card.rangers:hover, .pick-card.rangers.last { border-color: #b65cff; box-shadow: 0 0 30px rgba(182,92,255,.35); }
.pick-card b { font-family: var(--head); font-size: 26px; letter-spacing: 1px; }
.pick-card.tanks b { color: #3dfcd8; }
.pick-card.rangers b { color: #d6a6ff; }
.pick-card > span { color: var(--muted); font-size: 15px; line-height: 1.35; }
.pick-card em { position: absolute; top: -10px; right: 14px; font-style: normal; font-weight: 900; font-size: 12px; padding: 3px 10px; border-radius: 12px; background: #2a3a66; color: #dfe9ff; }
.pick-card em.new { background: linear-gradient(180deg, #e2b8ff, #9b4dff); color: #1c0636; box-shadow: 0 0 14px rgba(182,92,255,.7); }
.pick-art { width: 240px; height: 120px; display: block; }
.pick-rg { display: flex; align-items: flex-end; justify-content: center; position: relative; }
.pick-rg img { width: 96px; height: 96px; image-rendering: pixelated; }
/* the gun's grip (x 3-4, bottom rows) in the ranger's glove (x 10-11, y 10): images are 6x */
.pick-rg img.pg { position: absolute; width: auto; height: auto; left: 114px; bottom: 24px; }
.pick-shared { color: var(--muted); font-weight: 700; text-align: center; font-size: 15px; }

/* ---------- the ship screen ---------- */
#home.rangers { background: #0a0f24; }
#home.rangers #homeBg { image-rendering: pixelated; position: absolute; inset: 0; width: 100%; height: 100%; }
#home.rangers .rg-gun-card .tank-name { color: #fff; }
.rg-slots { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.rg-slot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(0,0,0,.35); border: 1px solid var(--line); opacity: .4; }
.rg-slot.on { opacity: 1; border-color: rgba(255,209,102,.6); }
.rg-slot img { width: 24px; height: 24px; image-rendering: pixelated; }
.mode.off { opacity: .45; cursor: not-allowed; }
.rg-side { display: flex; flex-direction: column; gap: 8px; justify-content: space-between; }
.rg-danger { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.rg-danger > div { text-align: center; min-width: 64px; }
.rg-danger small { display: block; font-size: 11px; letter-spacing: 2px; color: #ff9fae; font-weight: 800; }
.rg-danger b { font-family: var(--head); font-size: 24px; color: #ff5d73; }
.rg-danger button { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35); font-size: 14px; }
.rg-danger button:disabled { opacity: .3; cursor: default; }
.rg-res-row { display: flex; gap: 6px; flex-wrap: wrap; }
.rg-resi { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px 4px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 14px; }
.rg-resi img { width: 21px; height: 21px; image-rendering: pixelated; }
.play-btn.rg-deploy { background: linear-gradient(180deg, #e2b8ff, #8a3dff); color: #16032e; box-shadow: 0 6px 0 #4b1a99, 0 10px 30px rgba(155,77,255,.5); }
.play-btn.rg-deploy span { font-size: 38px; }
.play-btn.rg-deploy:active { box-shadow: 0 2px 0 #4b1a99; }

/* ---------- panels: Armory, Workbench, Suit Lab ---------- */
.rg-intro { color: var(--muted); max-width: 820px; margin: 0 auto 14px; line-height: 1.4; }
.rg-guns, .rg-parts, .rg-suit { display: flex; flex-direction: column; gap: 10px; max-width: 860px; margin: 0 auto; }
.rg-gun, .rg-part, .rg-suit-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.rg-gun.on, .rg-part.on { border-color: var(--gc, #ffd166); box-shadow: 0 0 16px rgba(255,209,102,.25); }
.rg-gun.locked { opacity: .55; }
.rg-gun-art { width: 120px; display: grid; place-items: center; }
.rg-gun-art img { max-width: 110px; image-rendering: pixelated; }
.rg-gun-info, .rg-part-info, .rg-suit-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rg-gun-info b, .rg-part-info b, .rg-suit-info b { font-size: 18px; }
.rg-gun-info small, .rg-part-info small, .rg-suit-info small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.rg-part-info small.next { color: #b8ffd9; }
.rg-gun-stats { display: flex; gap: 10px; flex-wrap: wrap; font-weight: 800; font-size: 13px; margin-top: 3px; }
.rg-bench-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 860px; margin: 0 auto 8px; flex-wrap: wrap; }
.rg-bench-gun { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.rg-bench-gun img { height: 48px; image-rendering: pixelated; }
.rg-slotbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 860px; margin: 0 auto 12px; }
.rg-slotbtn { width: 108px; padding: 8px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rg-slotbtn.on { border-color: #ffd166; box-shadow: 0 0 14px rgba(255,209,102,.4); }
.rg-slotbtn img { width: 36px; height: 36px; image-rendering: pixelated; }
.rg-slotbtn b { font-size: 13px; }
.rg-slotbtn small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rg-part-art img { width: 48px; height: 48px; image-rendering: pixelated; }
.rg-tier { font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 10px; background: var(--tc); color: #140f1f; margin-left: 6px; vertical-align: middle; }
.rg-tier.none { background: #36405e; color: #c9d4e8; }
.rg-cost { display: flex; gap: 10px; flex-wrap: wrap; font-weight: 800; font-size: 13px; margin-top: 4px; }
.rg-cost span { display: inline-flex; align-items: center; gap: 3px; }
.rg-cost span.short { color: #ff7b8d; }
.rg-cost img, .rg-suit-row button img { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: middle; }
.rg-part-btns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 150px; }
.rg-suit-i { font-size: 30px; width: 40px; text-align: center; }
.rg-pips { display: flex; gap: 3px; margin-top: 3px; }
.rg-pips i { width: 16px; height: 6px; border-radius: 3px; background: #2a3354; }
.rg-pips i.on { background: linear-gradient(90deg, #3dfcd8, #5ab8ff); }
.rg-suit + .rg-res-row, .panel-body > .rg-res-row { justify-content: center; margin-bottom: 12px; }

/* ---------- the run ---------- */
#rgame { background: #000; overflow: hidden; touch-action: none; }
.rg-canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; }
.rg-hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--head); }
.rg-hud button { pointer-events: auto; }
.rg-xp { position: absolute; left: 0; right: 0; top: 0; height: 12px; background: rgba(10,8,25,.75); border-bottom: 2px solid #140f1f; }
.rg-xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3dfcd8, #5ab8ff); transition: width .1s; }
.rg-lv { position: absolute; left: 50%; top: 13px; transform: translateX(-50%); font-size: 14px; color: #bff; text-shadow: 0 2px 0 #140f1f; }
.rg-top { position: absolute; left: 10px; right: 10px; top: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rg-hp { display: flex; flex-direction: column; gap: 2px; width: min(240px, 34vw); }
.rg-hpbar { height: 14px; border-radius: 4px; background: #2a0f1a; border: 2px solid #140f1f; overflow: hidden; }
.rg-hpbar i { display: block; height: 100%; background: linear-gradient(180deg, #ff8a9a, #e0314f); transition: width .12s; }
.rg-hpt { font-size: 12px; color: #ffd0d6; text-shadow: 0 2px 0 #140f1f; }
.rg-mid { text-align: center; }
.rg-time { font-size: 26px; color: #fff; text-shadow: 0 3px 0 #140f1f; }
.rg-time.boss { color: #ff5d73; animation: rg-pulse 1s infinite; }
.rg-kills { font-family: var(--body); font-weight: 800; font-size: 13px; color: #dfe9ff; text-shadow: 0 2px 0 #140f1f; }
.rg-right { display: flex; align-items: center; gap: 10px; }
.rg-ammo { font-size: 15px; color: #fff3c4; text-shadow: 0 2px 0 #140f1f; }
.rg-ammo b { font-size: 20px; }
.rg-ammo .rl { color: #ffd166; animation: rg-pulse .5s infinite; }
.rg-pause { width: 42px; height: 42px; border-radius: 12px; border: 2px solid #140f1f; background: rgba(30,40,80,.85); font-size: 18px; color: #fff; }
.rg-boss { position: absolute; left: 50%; top: 74px; transform: translateX(-50%); width: min(460px, 70vw); text-align: center; display: none; }
.rg-boss.on { display: block; }
.rg-bossn { font-size: 15px; color: #ffd0d6; text-shadow: 0 2px 0 #140f1f; }
.rg-bossbar { height: 12px; border-radius: 4px; background: #2a0f1a; border: 2px solid #140f1f; overflow: hidden; margin-top: 2px; }
.rg-bossbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff5d73, #ffb347); transition: width .15s; }
.rg-banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); text-align: center; opacity: 0; white-space: nowrap; }
.rg-banner b { display: block; font-size: 34px; text-shadow: 0 4px 0 #140f1f, 0 0 24px rgba(0,0,0,.6); }
.rg-banner small { display: block; font-family: var(--body); font-weight: 800; font-size: 16px; color: #eaf2ff; text-shadow: 0 2px 0 #140f1f; margin-top: 4px; }
.rg-banner.show { animation: rg-banner 2.4s ease-out forwards; }
@keyframes rg-banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } 10% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rg-pulse { 50% { opacity: .55; } }
.rg-joy { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); display: none; }
.rg-joy.on { display: block; }
.rg-joy i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(61,252,216,.55); border: 2px solid rgba(255,255,255,.6); }
.rg-acts { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 12px; align-items: flex-end; }
.rg-acts button { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #140f1f; background: rgba(30,40,80,.85); color: #fff; font-size: 26px; overflow: hidden; display: grid; place-items: center; }
.rg-acts.touch button { width: 84px; height: 84px; font-size: 32px; }
.rg-acts button span { position: relative; z-index: 1; }
.rg-acts button i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.6); z-index: 2; }
.rg-acts button small { position: absolute; bottom: 4px; left: 0; right: 0; font-size: 9px; font-family: var(--body); font-weight: 800; z-index: 3; color: #cfe; }
.rg-abil.ready { border-color: #ffd166; box-shadow: 0 0 18px rgba(255,209,102,.7); }

/* modals inside the run: upgrade cards, pause, revive, results */
.rg-modal { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(3,6,16,.72); backdrop-filter: blur(4px); padding: 14px; overflow-y: auto; animation: fadein .25s; }
.rg-pick { align-content: center; gap: 14px; }
.rg-pick-title { font-family: var(--head); font-size: 34px; color: #ffd166; text-shadow: 0 4px 0 #140f1f; text-align: center; }
.rg-cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.rg-card { position: relative; width: 190px; min-height: 210px; padding: 16px 12px; border-radius: 18px; border: 3px solid var(--rc); background: linear-gradient(180deg, #1d2a52, #0d1430);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: 0 0 22px color-mix(in srgb, var(--rc) 45%, transparent); animation: popin .3s; transition: transform .12s; }
.rg-card:hover { transform: translateY(-5px) scale(1.04); }
.rgc-k { position: absolute; top: 8px; left: 10px; font-weight: 900; font-size: 13px; color: var(--muted); }
.rgc-i { font-size: 44px; }
.rg-card b { font-family: var(--head); font-size: 19px; }
.rgc-r { font-weight: 900; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--rc); }
.rgc-t { font-size: 15px; color: #dfe9ff; line-height: 1.3; }
.rg-box { width: min(520px, 100%); padding: 24px 26px; border-radius: 24px; background: linear-gradient(180deg, #1a2648, #0c1328); border: 2px solid var(--line); text-align: center; animation: popin .3s; }
.rg-box-title { font-family: var(--head); font-size: 36px; margin-bottom: 8px; }
.rg-box p { color: #dfe9ff; line-height: 1.45; }
.rg-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.rg-menu-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.rg-build { color: var(--muted); font-size: 18px; line-height: 1.5; word-break: break-word; }
.rg-help { margin-top: 12px; color: var(--muted); font-size: 13px; }
.rg-end .rg-box { width: min(620px, 100%); }
.rg-end.win .rg-box { border-color: var(--gold); box-shadow: 0 0 50px rgba(255,209,102,.3); }
.rg-end-title { font-family: var(--head); font-size: 44px; }
.rg-end.win .rg-end-title { background: linear-gradient(180deg, #fff3b0, #ffb52e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rg-end.lose .rg-end-title { color: #ff7b8d; }
.rg-end-sub { color: #dfe9ff; margin: 6px 0 14px; line-height: 1.4; }
.rg-rewards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rg-rewards > div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 14px; background: rgba(0,0,0,.3); }
.rg-rewards span { font-size: 24px; }
.rg-rewards b { font-family: var(--head); font-size: 22px; }
.rg-rewards small { color: var(--muted); font-size: 12px; text-align: center; }
.rg-res { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* phones held sideways (same breakpoints as css/phone.css) */
@media (max-height: 500px) and (orientation: landscape), (max-width: 600px) {
  .pick-wrap { gap: 12px; padding: 14px; }
  .pick-wrap .logo { font-size: 36px; }
  .pick-wrap .logo small { font-size: 13px; letter-spacing: 5px; }
  .pick-card { width: 250px; padding: 10px 12px 14px; gap: 4px; }
  .pick-card b { font-size: 21px; }
  .pick-card > span { font-size: 13px; }
  .pick-art { width: 200px; height: 84px; }
  .pick-rg { zoom: .7; }
  #home.rangers #homeBg { position: absolute; inset: 0 auto auto 0; height: 100%; }
  .rg-play .play-row { flex-wrap: wrap; justify-content: flex-end; }
  .rg-time { font-size: 20px; }
  .rg-banner b { font-size: 24px; }
  .rg-banner small { font-size: 13px; }
  .rg-boss { top: 56px; }
  .rg-card { width: 150px; min-height: 160px; padding: 10px 8px; }
  .rgc-i { font-size: 34px; }
  .rg-card b { font-size: 16px; }
  .rgc-t { font-size: 13px; }
  .rg-pick-title { font-size: 24px; }
  .rg-box { padding: 14px 16px; }
  .rg-box-title, .rg-end-title { font-size: 28px; }
  .rg-rewards b { font-size: 18px; }
  .rg-gun, .rg-part, .rg-suit-row { flex-wrap: wrap; }
  .rg-gun-art { width: 80px; }
  .rg-part-btns { min-width: 0; flex-direction: row; }
}
