/* SHOP-CRATES-ALIVE 16/11 (js/views/shop-fx.js): the Shop icon's club light, one theme per banner, the Viral crate the loudest.
   Only transform and opacity are animated. html[data-fx-away] (page in the background) and [data-fx-off] (stage off screen) pause
   everything. No opacity blink faster than 3 a second. prefers-reduced-motion: a still picture (bottom of this file). */
html[data-fx-away] .fxa, html[data-fx-away] .fxa *, [data-fx-off] .fxa, [data-fx-off] .fxa *, .fxa[data-fx-off], .fxa[data-fx-off] * { animation-play-state: paused !important; }

/* ---------------- 1. the Shop icon ---------------- */
.shop-alive { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; isolation: isolate; }
.shop-alive > * { grid-area: 1 / 1; }
.shop-alive > .tab-ico { position: relative; z-index: 2; width: 26px; height: 26px; color: #ffe2f3; }
.pm-row .shop-alive, .pm-row .shop-alive > .tab-ico, .pm-row .shop-alive .sa-lit .tab-ico { width: 22px; height: 22px; }
/* the halo: a soft disc of magenta and cyan that breathes (1.8 s) */
.sa-halo { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 79, 168, .55), rgba(120, 70, 255, .28) 55%, rgba(40, 220, 255, 0) 100%);
  opacity: .45; transform: scale(.78); animation: sa-breathe 1.8s ease-in-out infinite; }
@keyframes sa-breathe { 50% { opacity: .85; transform: scale(1.06); } }
/* the ring: a conic band of club colours that turns round the icon (a still mask cuts the middle out) */
.sa-ring { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; z-index: 1; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(255, 79, 168, 0), #ff4fa8 18%, rgba(255, 79, 168, 0) 30%, rgba(46, 230, 255, 0) 50%, #2ee6ff 68%, rgba(46, 230, 255, 0) 80%, rgba(255, 210, 74, .9) 92%, rgba(255, 79, 168, 0));
  -webkit-mask: radial-gradient(closest-side, transparent 72%, #000 76%, #000 92%, transparent 100%); mask: radial-gradient(closest-side, transparent 72%, #000 76%, #000 92%, transparent 100%);
  opacity: .8; animation: sa-turn 3.2s linear infinite; }
@keyframes sa-turn { to { transform: rotate(360deg); } }
/* a spark rides the ring the other way round */
.sa-orbit { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; z-index: 3; pointer-events: none; animation: sa-turn 2.4s linear infinite reverse; }
.sa-spark { position: absolute; left: 50%; top: 0; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, .8), 0 0 12px 4px rgba(46, 230, 255, .6); opacity: 0; }
/* the icon lit: a bright copy over the line icon that glows in and out (2.4 s: never a blink) */
.sa-lit { position: relative; z-index: 2; display: grid; place-items: center; opacity: 0; animation: sa-lit 2.4s ease-in-out infinite; pointer-events: none; }
.sa-lit .tab-ico { color: #fff; filter: drop-shadow(0 0 3px #ff4fa8) drop-shadow(0 0 6px rgba(46, 230, 255, .8)); }
@keyframes sa-lit { 50% { opacity: .9; } }
#tabs button[data-tab="shop"] { overflow: hidden; }
/* hot: an offer on sale for a limited time or a free claim. Faster turn, brighter halo, the spark shows */
body[data-shop-hot] .sa-halo { animation-duration: 1.2s; background: radial-gradient(closest-side, rgba(255, 79, 168, .8), rgba(255, 210, 74, .4) 55%, rgba(40, 220, 255, 0) 100%); }
body[data-shop-hot] .sa-ring { animation-duration: 1.6s; opacity: 1; }
body[data-shop-hot] .sa-spark { opacity: 1; }
body[data-shop-hot] .sa-orbit { animation-duration: 1.4s; }
body[data-shop-hot] .sa-lit { animation-duration: 1.2s; }

/* ---------------- 2. the buy buttons wear their banner's theme: one still colour each, square (no shape, no light) ---------------- */
/* Phil 16/11 on the first captures: "too much and ugly ... simple and minimalize, not the whole page". Nothing over the stage art. */
.buyzone[data-theme] button.buy { border-radius: 0; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.buyzone[data-theme="ember"] button.buy { background: #8a3414; border-color: #c9662e; }
.buyzone[data-theme="frost"] button.buy { background: #24587a; border-color: #5f9cc4; }
.buyzone[data-theme="storm"] button.buy { background: #2f3d5c; border-color: #6479a8; }
.buyzone[data-theme="mist"] button.buy { background: #2c5a3b; border-color: #5f9a6d; }
.buyzone[data-theme="wave"] button.buy { background: #136674; border-color: #4fa6b3; }
.buyzone[data-theme="smoke"] button.buy { background: #3b3050; border-color: #7a64a6; }

/* ---------------- 2b. SALE ticket (Phil 16/11: "-50% sale (it should be colorful the sale ticket) for 24h") ----------------
   A punched ticket pinned over the top-left corner of the buy bar: the cut on a gold-to-pink body, the time left on a cyan stub
   behind a perforation. It hangs at its own angle (--tk-tilt) and swings from its pin on its own beat (--tk-beat). */
.buyzone[data-sale="1"] .buybar { position: relative; margin-top: 16px; }
.sale-tk { position: absolute; z-index: 3; left: 4px; top: -19px; display: inline-flex; align-items: stretch; height: 26px; color: #1b0d16;
  font-weight: 800; line-height: 1; white-space: nowrap; transform-origin: 8px 4px; transform: rotate(var(--tk-tilt, -4deg));
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); animation: tk-swing var(--tk-beat, 3s) ease-in-out var(--tk-late, 0s) infinite alternate;
  /* two half-holes punched in the short sides */
  -webkit-mask: radial-gradient(circle 5px at 0 50%, transparent 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 5px at 100% 50%, transparent 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 5px at 0 50%, transparent 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 5px at 100% 50%, transparent 97%, #000) right / 51% 100% no-repeat; }
.sale-cut { display: flex; align-items: center; padding: 0 8px 0 12px; font-size: 16px; letter-spacing: .2px;
  background: linear-gradient(100deg, #ffe14d 0%, #ffb02e 45%, #ff5a7a 100%); }
.sale-left { display: flex; align-items: center; gap: 3px; padding: 0 12px 0 7px; font-size: 12px; background: #3fd6ff;
  border-left: 2px dashed rgba(27, 13, 22, .55); }
.sale-left .ico { width: 13px; height: 13px; }
.sale-left .cd { font-variant-numeric: tabular-nums; }
@keyframes tk-swing { from { transform: rotate(calc(var(--tk-tilt, -4deg) - 2.5deg)); } to { transform: rotate(calc(var(--tk-tilt, -4deg) + 3deg)); } }
/* the price before the cut, struck, in front of the price paid */
.buyzone[data-sale="1"] button.buy .chest-gain { position: relative; padding-top: 11px; }
.chest-gain .was { position: absolute; left: 0; top: -5px; padding: 1px 4px; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; text-shadow: none;
  background: rgba(12, 8, 14, .72); text-decoration: line-through 1.5px #ff7a93; }
/* the same cut on the banner's thumb in the rail, so it is seen before the banner is picked */
.rail-sale { position: absolute; z-index: 2; right: 2px; top: 2px; padding: 2px 5px; font-size: 11px; font-weight: 800; line-height: 1; color: #1b0d16;
  background: linear-gradient(100deg, #ffe14d, #ff5a7a); transform: rotate(6deg); box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

/* ---------------- 3. the Viral crate: a rainbow button whose colour changes over time, that's all ---------------- */
/* a strip four buttons long, painted with the rainbow twice, slides under the words: the face goes red, gold, cyan, violet... */
.buyzone[data-theme="viral"] button.buy { position: relative; overflow: hidden; isolation: isolate; background: #b0306e; border-color: rgba(255, 255, 255, .55); }
.buyzone[data-theme="viral"] button.buy > :not(.buy-fx) { position: relative; z-index: 1; }
.buy-fx { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bfx-viral .bfx-a { position: absolute; left: 0; top: 0; bottom: 0; width: 400%; display: block;
  background: linear-gradient(90deg, #e0336f, #e8a21c, #2fb8a0, #2f8fe0, #8a4fe0, #e0336f, #e8a21c, #2fb8a0, #2f8fe0, #8a4fe0, #e0336f);
  animation: bfx-slide 9s linear infinite; }
@keyframes bfx-slide { to { transform: translateX(-50%); } }

/* ---------------- still picture (reduced motion, or the player's Animations: off) ---------------- */
@media (prefers-reduced-motion: reduce) {
  .fxa, .fxa *, .fxa::before { animation: none !important; }
  .sa-halo { opacity: .6; transform: none; }
  .sa-ring { transform: rotate(40deg); }
  .sa-lit { opacity: .55; }
  body[data-shop-hot] .sa-halo { opacity: .9; }
  .bfx-viral .bfx-a { transform: translateX(-10%); }
  .sale-tk { animation: none !important; }
}

/* ---- 4. SHOP-TAKES-SWITCH-SPOT (Phil 16/11): the Shop holds the top-right spot of the header; the City / World flip is a round
   glyph in the bottom-left corner of the scene (main.js placeSwitch moves it: city pane on the City tab, first of the map's bottom
   row elsewhere). */
.shop-btn { position: relative; }
.shop-btn .shop-alive { width: 30px; height: 30px; }
.shop-btn.on { background: #232c30; }
.shop-btn > .badge { position: absolute; right: -4px; top: -4px; left: auto; }
#switch-btn.switch-btn { flex: none; align-self: center; width: 48px; height: 48px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--self); background: rgba(27, 34, 37, .92);
  color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
#switch-btn .tab-ico { width: 24px; height: 24px; }
#city-pane > #switch-btn { position: absolute; z-index: 3; left: calc(8px + env(safe-area-inset-left)); bottom: var(--sw-lift, 10px); }

/* SWITCH-ALWAYS-1118: the City / World glyph is on every screen, on the left edge under the chat glyph, a quarter past the edge */
body > #switch-btn.switch-btn { position: fixed; z-index: 30; left: var(--sw-left, 0px); top: var(--sw-top, 58%); bottom: auto; transition: left .18s ease-out; }
body > #switch-btn.switch-btn.edge { left: calc(var(--sw-left, 0px) - 12px + env(safe-area-inset-left)); }
body > #switch-btn.switch-btn.edge:hover, body > #switch-btn.switch-btn.edge:focus-visible, body > #switch-btn.switch-btn.edge:active { left: calc(4px + env(safe-area-inset-left)); }
@media (prefers-reduced-motion: reduce) { body > #switch-btn.switch-btn { transition: none; } }
/* SWITCH-BOTTOM-RIGHT-1118: in the empty right end of the squads bar, whole, never over a face */
body > #switch-btn.switch-btn.dock-right { left: auto; right: calc(10px + env(safe-area-inset-right)); transition: none; }
body.sw-dock #dock { position: relative; padding-right: calc(110px + env(safe-area-inset-right)); }
#dock-shield[hidden] { display: none; }
/* Keep the full touch target beside the globe while drawing a smaller tab inside it. */
#dock-shield { position: fixed; z-index: 29; right: calc(34px + env(safe-area-inset-right)); width: 68px; height: 48px; margin: 0; padding: 0 16px 0 10px; border: 0; background: transparent; color: white; display: grid; place-items: center; }
#dock-shield::before { content: ""; position: absolute; inset: 8px 0 8px 17px; border: 2px solid #607ffe; border-radius: 16px 0 0 16px; background: #1b2225; }
#dock-shield > .gi { position: absolute; left: 21px; top: 12px; width: 19px; height: 19px; }
#dock-shield[data-active="true"]::before { background: #283d79; }
/* ARMY-FUSION-1118: Commander | Troops, one strip at the head of both screens */
.army-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 10px; }
.army-tab { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #151b1e; color: var(--dim); font-weight: 700; }
.army-tab.on { color: #f0c069; border-color: #f0c069; background: #2a2114; }
.army-tab svg { width: 18px; height: 18px; }
/* SWITCH-ALWAYS-1118: in the City's commander pane (phone) the strip starts at the pane's top, right where the glyph stands: it steps aside */
@media (max-width: 700px) { body[data-tab="city"]:not([data-army]) [data-testid="commander"] > .army-tabs { margin-left: 30px; } }   /* ARMY-FRAME-1118: in the Army frame the panel keeps its own 42 px gutter */
