/* ---- Bomb Avoider --------------------------------------------------------------------------- */

.av-root {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: #0c0414;
  color: var(--text);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.av-root[hidden] { display: none; }
.av-canvas { position: absolute; inset: 0; display: block; }

.av-x {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: rgba(33, 13, 34, .8);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}

/* score bar */
.av-hud {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}
.av-hud[hidden] { display: none; }
.av-hud > div {
  display: grid;
  justify-items: center;
  padding: 6px 14px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(180deg, #5c2a5e, #3c1a3e);
  box-shadow: 0 4px 0 var(--ink);
}
.av-hud small { color: var(--muted); font-weight: 900; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.av-hud b { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; line-height: 1.05; }
.av-score { min-width: 96px; background: linear-gradient(180deg, #ffe680, #ffb02e) !important; color: var(--ink); }
.av-score small { color: rgba(33, 13, 34, .7); }
.av-score b { font-size: 2rem; }
.av-score.bump { animation: avBump .3s ease-out; }
.av-earn { display: flex !important; gap: 12px; }
.av-earn span { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; }
.av-earn b { font-size: 1.15rem; }
.av-earn .xp { color: #8fd0ff; }

/* intro / results cards */
.av-screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(12, 4, 20, .25), rgba(12, 4, 20, .7));
}
.av-screen[hidden] { display: none; }
.av-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(520px, 100%);
  padding: 26px 24px 22px;
  border: 3px solid var(--ink);
  border-radius: 28px;
  background:
    radial-gradient(110% 70% at 50% 0%, rgba(255, 138, 30, .28), transparent 62%),
    linear-gradient(180deg, var(--panel-hi), var(--panel));
  box-shadow: var(--hard), 0 24px 70px rgba(0, 0, 0, .55);
  text-align: center;
  animation: avPop .45s cubic-bezier(.2, 1.4, .4, 1);
}
.av-card p { margin: 0; line-height: 1.45; }
.av-logo { display: flex; align-items: center; gap: 12px; }
.av-logo h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 0 var(--ink);
}
.av-logo h1 span { color: var(--yellow); }
.av-logo-bomb {
  position: relative;
  width: 56px;
  height: 56px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a90d8, #3a3c80 55%, #1d1d45);
  animation: avFall 1.6s ease-in infinite;
}
.av-logo-bomb::after {
  content: "";
  position: absolute;
  top: -12px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffd23f;
  box-shadow: 0 0 12px #ff8a1e;
  animation: avSpark .2s steps(2) infinite;
}
.av-how { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.av-how li { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-weight: 800; font-size: .85rem; }
.av-how kbd {
  min-width: 26px;
  padding: 2px 6px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: .8rem;
  box-shadow: 0 2px 0 var(--ink);
}
.av-dot.heavy {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #9a9aab, #2e2e3a);
  box-shadow: 0 0 0 2px #ff3b4f;
}
.av-pb { color: var(--muted); font-weight: 800; font-size: .9rem; }
.av-pb b { color: var(--yellow); }
.av-play,
.av-again {
  display: grid;
  justify-items: center;
  margin-top: 6px;
  padding: 10px 46px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(180deg, #ff7a6b, #e8283f);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
}
.av-play b,
.av-again b { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; text-shadow: 0 2px 0 var(--ink); }
.av-play small,
.av-again small { font-weight: 900; font-size: .7rem; opacity: .85; }
.av-play:active,
.av-again:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }

.av-card.results h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; color: var(--yellow); text-shadow: 0 3px 0 var(--ink); }
.av-big { display: grid; justify-items: center; }
.av-big b { font-family: var(--font-display); font-weight: 400; font-size: 4.4rem; line-height: 1; text-shadow: 0 5px 0 var(--ink); }
.av-big small { color: var(--muted); font-weight: 900; }
.av-earned { display: flex; gap: 12px; }
.av-earned span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: rgba(0, 0, 0, .3);
  font-weight: 900;
  font-size: 1.1rem;
}
.av-earned .xp { color: #8fd0ff; }
.av-btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.av-leave {
  padding: 12px 18px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--ink-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}
.av-ribbon {
  position: absolute;
  top: -14px;
  padding: 4px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd23f, #ff8a1e);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  box-shadow: 0 3px 0 var(--ink);
  animation: avBump .6s .2s ease-out both;
}
.av-card.best { box-shadow: var(--hard), 0 0 0 4px rgba(255, 210, 63, .5), 0 24px 70px rgba(0, 0, 0, .55); }

/* touch controls */
.av-pad { display: none; }
@media (pointer: coarse) {
  .av-pad {
    position: absolute;
    left: 0;
    right: 0;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 2;
    display: flex;
    gap: 12px;
    padding: 0 max(16px, env(safe-area-inset-left));
    pointer-events: none;
  }
  .av-pad button {
    width: 76px;
    height: 76px;
    border: 3px solid var(--ink);
    border-radius: 22px;
    background: rgba(74, 30, 78, .75);
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 5px 0 var(--ink);
    pointer-events: auto;
    touch-action: none;
  }
  .av-pad button.jump { margin-left: auto; border-radius: 50%; background: rgba(232, 40, 63, .8); }
  .av-pad button.on { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); filter: brightness(1.2); }
}

@keyframes avPop { from { opacity: 0; transform: scale(.85) translateY(20px); } }
@keyframes avBump { 40% { transform: scale(1.18); } }
@keyframes avFall { 0% { transform: translateY(-14px) rotate(-10deg); } 70% { transform: translateY(4px) rotate(8deg); } 85% { transform: translateY(0) scaleY(.9); } 100% { transform: translateY(-14px) rotate(-10deg); } }
@keyframes avSpark { 50% { transform: scale(.6); } }

.reduced-motion .av-card,
.reduced-motion .av-logo-bomb,
.reduced-motion .av-ribbon { animation: none; }

@media (max-width: 560px) {
  .av-logo h1 { font-size: 2rem; }
  .av-hud { gap: 6px; }
  .av-hud > div { padding: 4px 9px; }
  .av-best { display: none !important; }
}

/* the Play menu card for this mode */
.play-card.avoider .mode-rail { --rail-accent: #ff7a6b; --rail-accent-2: #e8283f; }
.play-card.avoider {
  background:
    radial-gradient(circle at 78% 30%, rgba(255, 90, 60, .32), transparent 46%),
    radial-gradient(circle at 10% 110%, rgba(255, 210, 63, .18), transparent 50%),
    linear-gradient(180deg, #5e2a63, #4f2255 50%, #3f1a45);
}
.play-card.avoider .mode-tag { background: linear-gradient(90deg, #ff7a6b, #ffd23f); }
.play-card.avoider .mode-opt[data-size],
.play-card.avoider.av-solo .practice-btn,
.play-card.avoider .bot-diff,
.play-card.avoider .race-opt,
.play-card.avoider .mini-arena,
.play-card.avoider .gem-art,
.play-card.avoider .siege-art,
.play-card.avoider .raceway-art { display: none !important; }
.mode-opt.av-opt { display: none; }
.play-card.avoider .mode-opt.av-opt { display: flex; }
.play-card.avoider .mode-switch { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* the Hollow's Play popup */
.hub-av-sizes { display: none !important; }
.hub-play-pop.avoider .hub-sizes:not(.hub-av-sizes),
.hub-play-pop.avoider .bot-diff,
.hub-play-pop.avoider.av-solo [data-hub-go="bot"] { display: none !important; }
.hub-play-pop.avoider .hub-av-sizes { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.avoider-art { display: none; position: relative; width: 250px; height: 140px; }
.play-card.avoider .avoider-art { display: block; }
.ava-ground {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(180deg, #5fae4f 0 30%, #5a3a2a 30%);
}
.ava-plat {
  display: none;
  position: absolute;
  left: 140px;
  bottom: 70px;
  width: 80px;
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: linear-gradient(180deg, #5fae4f 0 30%, #8c7a96 30%);
}
.ava-bomb {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a90d8, #3a3c80 55%, #1d1d45);
  animation: avaDrop 1.8s ease-in infinite;
}
.ava-bomb.b1 { left: 40px; }
.ava-bomb.b2 { left: 110px; animation-delay: .6s; }
.ava-bomb.b3 { left: 190px; animation-delay: 1.2s; background: radial-gradient(circle at 40% 35%, #9a9aab, #2e2e3a); box-shadow: 0 0 0 3px #ff3b4f; }
.ava-boom {
  position: absolute;
  left: 30px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8d0, #ffb02e 45%, rgba(255, 90, 30, 0) 70%);
  animation: avaBoom 1.8s ease-out infinite;
}
.ava-runner {
  position: absolute;
  left: 160px;
  bottom: 32px;
  width: 18px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 9px 9px 6px 6px;
  background: linear-gradient(180deg, #ffd9a8 0 40%, #3f8cff 40%);
  animation: avaRun 1.8s ease-in-out infinite;
}
@keyframes avaDrop { 0% { top: -20px; opacity: 0; } 15% { opacity: 1; } 70% { top: 84px; } 100% { top: 84px; opacity: 0; } }
@keyframes avaBoom { 0%, 65% { transform: scale(0); opacity: 0; } 72% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes avaRun { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(46px) translateY(-14px); } }

/* ---- versus: mode picker, queue, scoreboard, banners ---- */
.av-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
.av-modes button {
  display: grid;
  justify-items: center;
  padding: 7px 4px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: var(--ink-2);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}
.av-modes button b { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; color: var(--text); }
.av-modes button small { font-weight: 900; font-size: .64rem; }
.av-modes button.on { background: linear-gradient(180deg, #ffe680, var(--yellow)); color: rgba(33, 13, 34, .75); }
.av-modes button.on b { color: var(--ink); }

.av-card.queue h2,
.av-card.results h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 2rem; color: var(--yellow); text-shadow: 0 3px 0 var(--ink); }
.av-spin {
  width: 46px;
  height: 46px;
  border: 5px solid rgba(255, 255, 255, .18);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: avSpin .8s linear infinite;
}
.av-seats { display: flex; gap: 10px; }
.av-seats i {
  width: 34px;
  height: 34px;
  border: 3px dashed rgba(255, 255, 255, .25);
  border-radius: 50%;
}
.av-seats i.in { border: 3px solid var(--ink); background: var(--c); box-shadow: 0 0 14px var(--c); animation: avBump .4s ease-out; }

.av-round { min-width: 74px; }
.av-players { display: flex !important; gap: 6px; padding: 6px 8px !important; background: rgba(33, 13, 34, .8) !important; }
.av-pl {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  border: 2px solid var(--c);
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
  font-weight: 900;
  font-size: .78rem;
  white-space: nowrap;
}
.av-pl i { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--c); }
.av-pl em { color: var(--yellow); font-style: normal; letter-spacing: -1px; }
.av-pl.me { box-shadow: 0 0 0 2px rgba(61, 220, 114, .35); }
.av-pl.out { opacity: .4; text-decoration: line-through; }
.av-score.small { min-width: 70px; }
.av-score.small b { font-size: 1.5rem; }

.av-banner {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 28px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  box-shadow: var(--hard), 0 18px 50px rgba(0, 0, 0, .5);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  animation: avPop .45s cubic-bezier(.2, 1.4, .4, 1);
}
.av-banner[hidden] { display: none; }
.av-banner b { font-family: var(--font-display); font-weight: 400; font-size: 2rem; color: #fff; text-shadow: 0 3px 0 var(--ink); }
.av-banner small { color: var(--muted); font-weight: 900; }
.av-banner.mine { background: linear-gradient(180deg, #4ce884, #24b158); }
.av-banner.mine b { color: var(--ink); text-shadow: none; }
.av-banner.mine small { color: rgba(33, 13, 34, .7); }

.av-table { display: grid; gap: 5px; width: 100%; margin: 0; padding: 0; list-style: none; }
.av-table li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 2px solid rgba(0, 0, 0, .35);
  border-left: 5px solid var(--c);
  border-radius: 12px;
  background: rgba(0, 0, 0, .25);
  font-weight: 900;
  text-align: left;
}
.av-table li i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.av-table li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-table li em { color: var(--yellow); font-style: normal; }
.av-table li b { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; text-align: right; }
.av-table li.top { background: rgba(255, 210, 63, .14); }
.av-table li.me span::after { content: " (you)"; color: var(--muted); font-size: .8em; }
.av-big.small b { font-size: 2.6rem; }

@keyframes avSpin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .av-hud { flex-wrap: wrap; justify-content: center; width: calc(100vw - 80px); }
  .av-players { order: 3; flex-wrap: wrap; justify-content: center; }
  .av-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.hub-av-sizes button { font-size: .82rem; }
.play-card.avoider .av-opt .mode-dots { display: none; }
.play-card.avoider .av-opt { justify-content: center; padding-left: 4px; padding-right: 4px; }

.av-chat {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: rgba(33, 13, 34, .8);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}
.av-root .chat-dock { position: relative; z-index: 4; }
