/* ===== The look of the game pages, raised: a living sky, a picture at the top of each page,
   cards that answer the mouse, a gold cursor, a curtain between pages (js/motion.js builds them).
   Everything here is decoration: with reduced motion, or without GSAP, the pages work as before. */

/* ---------- the sky behind every page (not the home page: its globe is the sky) ---------- */
.mo-sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.mo-sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mo-sky i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; }
.mo-sky .a1 { width: 52vmax; height: 52vmax; left: -16vmax; top: -22vmax; background: radial-gradient(circle, rgba(47, 107, 255, .55), transparent 65%); animation: moDrift1 26s ease-in-out infinite alternate; }
.mo-sky .a2 { width: 44vmax; height: 44vmax; right: -14vmax; top: 10vh; background: radial-gradient(circle, rgba(255, 186, 74, .38), transparent 65%); animation: moDrift2 32s ease-in-out infinite alternate; }
.mo-sky .a3 { width: 40vmax; height: 40vmax; left: 30vw; bottom: -26vmax; background: radial-gradient(circle, rgba(140, 90, 255, .35), transparent 65%); animation: moDrift3 38s ease-in-out infinite alternate; }
.mo-sky .grid { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(140, 170, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 170, 255, .06) 1px, transparent 1px);
  background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); }
@keyframes moDrift1 { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes moDrift2 { to { transform: translate(-12vw, 18vh) scale(.9); } }
@keyframes moDrift3 { to { transform: translate(-16vw, -12vh) scale(1.2); } }
[data-theme="light"] .mo-sky i { opacity: .22; }
[data-theme="light"] .mo-sky canvas { display: none; }
[data-theme="light"] .mo-sky .grid { opacity: .7; background-image: linear-gradient(rgba(30, 60, 140, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(30, 60, 140, .07) 1px, transparent 1px); }

/* ---------- the picture at the top of a page ---------- */
.motion-on main { position: relative; isolation: isolate; }
.mo-scene { position: absolute; z-index: -1; right: 0; top: 64px; width: clamp(170px, 21vw, 300px); aspect-ratio: 1; pointer-events: none; }
.mo-scene::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 201, 74, .28), transparent 66%); filter: blur(12px); }
.mo-scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 30px 36px rgba(0, 0, 0, .55)); }
.mo-scene img + img { inset: auto; width: 34%; height: auto; }
.mo-scene img:nth-child(2) { left: -6%; bottom: 4%; }
.mo-scene img:nth-child(3) { right: -4%; top: 2%; }
.pg-head { position: relative; }
@media (max-width: 900px) { .mo-scene { width: 130px; right: 0; top: 70px; opacity: .5; } .mo-scene img:nth-child(3) { right: 0; } }

/* ---------- page titles: room for the letters to rise ---------- */
.pg-head h1 { padding-bottom: .06em; }

/* ---------- cards answer the mouse: a light under the cursor, a lift, a gold edge ---------- */
.motion-on :is(.panel-card, .job, .co-card, .ct-stat, .camp-card, .battle-card, .unit-card, .party-card, .art-card, .region-card, .type-card, .inv-item, .pf-tile) {
  transition: transform .35s cubic-bezier(.2, .9, .2, 1), box-shadow .35s, border-color .35s; }
.motion-on .panel-card { position: relative; }
.motion-on .panel-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 201, 74, .09), transparent 60%); }
.motion-on .panel-card:hover::before { opacity: 1; }
@media (hover: hover) {
  .motion-on :is(.job, .co-card, .ct-stat, .camp-card, .battle-card, .unit-card, .party-card, .art-card, .region-card, .type-card, .pf-tile):hover {
    transform: translateY(-4px); border-color: rgba(255, 201, 74, .45); box-shadow: 0 18px 40px rgba(var(--shadow), .45), 0 0 0 1px rgba(255, 201, 74, .12), 0 0 30px rgba(255, 201, 74, .08); }
  .motion-on .inv-item:hover { transform: translateY(-3px) scale(1.03); border-color: rgba(255, 201, 74, .4); }
  .motion-on .panel-card:hover { border-color: rgba(255, 201, 74, .22); }
}

/* ---------- the main buttons: a sweep of light ---------- */
.motion-on .btn.primary { position: relative; overflow: hidden; }
.motion-on .btn.primary::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); animation: moSweep 4.5s ease-in-out infinite; }
@keyframes moSweep { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* ---------- empty lists: a soft breathing frame ---------- */
.motion-on .empty-state { border: 1px dashed rgba(255, 201, 74, .25); animation: moBreathe 3.6s ease-in-out infinite; }
@keyframes moBreathe { 50% { border-color: rgba(255, 201, 74, .5); box-shadow: 0 0 34px rgba(255, 201, 74, .08) inset; } }

/* ---------- the top bar: a light that follows the mouse between the links ---------- */
.motion-on .nav-links { position: relative; }
.mo-nav-pill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 12px; pointer-events: none; z-index: 0; opacity: 0;
  background: linear-gradient(180deg, rgba(255, 201, 74, .16), rgba(255, 201, 74, .05)); box-shadow: inset 0 0 0 1px rgba(255, 201, 74, .28), 0 0 18px rgba(255, 201, 74, .15); }
.motion-on .nav-links a { position: relative; z-index: 1; }

/* ---------- the gold cursor (a mouse only) ---------- */
.mo-cursor, .mo-dot { position: fixed; left: 0; top: 0; z-index: 10000; pointer-events: none; border-radius: 50%; }
.mo-cursor { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid rgba(255, 201, 74, .75); box-shadow: 0 0 18px rgba(255, 201, 74, .25);
  transition: width .25s, height .25s, margin .25s, background .25s, border-color .25s, opacity .25s; }
.mo-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #ffc94a; }
.mo-cursor.big { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: rgba(255, 201, 74, .1); border-color: #ffc94a; }
.mo-cursor.down { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
body.mg-open .mo-cursor, body.mg-open .mo-dot, .mo-cursor.away, .mo-dot.away { opacity: 0; }

/* ---------- the curtain between pages ---------- */
.mo-curtain { position: fixed; inset: 0; z-index: 9999; pointer-events: none; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #0d1838 0%, #04060c 70%); }
.mo-curtain::before { content: ''; position: absolute; left: 0; right: 0; height: 3px; top: 0; background: linear-gradient(90deg, transparent, #ffc94a, #fff1c9, #ffc94a, transparent); box-shadow: 0 0 24px #ffc94a; }
.mo-curtain .orb { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; font-size: 40px; color: #1f1400;
  background: var(--grad); box-shadow: 0 0 60px rgba(255, 201, 74, .45); }
.mo-curtain .ring { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid transparent; border-top-color: #ffc94a; border-right-color: rgba(255, 201, 74, .35); animation: moSpin .8s linear infinite; }
@keyframes moSpin { to { transform: rotate(360deg); } }
/* until motion.js takes the curtain away: the page arriving behind it is not seen (and never longer than 2.5 s) */
html.mo-enter::after { content: ''; position: fixed; inset: 0; z-index: 9998; background: #04060c; animation: moGone 0s 2.5s forwards; }
@keyframes moGone { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .mo-sky i, .motion-on .btn.primary::after, .motion-on .empty-state { animation: none; }
  html.mo-enter::after { display: none; }
}

/* the labels at the right of a page's head stay readable over its picture */
.motion-on .pg-head .where-chip { position: relative; z-index: 1; background: rgba(6, 22, 20, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
[data-theme="light"].motion-on .pg-head .where-chip { background: rgba(236, 255, 248, .9); }


/* ===== Home ===== */
/* the daily tasks: a picture in the corner of each, lifting under the mouse; a stamp when done */
.motion-on .task { min-height: 118px; overflow: hidden; isolation: isolate; }
.task-art { position: absolute; right: -4px; top: -2px; width: 50%; max-width: 92px; z-index: -1; pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); transition: transform .5s cubic-bezier(.2, .9, .2, 1), filter .4s; }
.task:hover .task-art { transform: translate(-4px, -8px) rotate(-6deg) scale(1.08); }
.task.done .task-art { filter: grayscale(.85) brightness(.55); transform: none; }
.task .task-name, .task small, .task .task-icon { position: relative; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.task.done .mo-stamp { position: absolute; right: 10px; top: 22px; padding: 3px 9px; border-radius: 7px; font-family: var(--font-display); font-weight: 900; font-size: 11px; letter-spacing: 1.5px;
  color: var(--mint); border: 2px solid var(--mint); transform: rotate(-8deg); background: rgba(6, 30, 22, .7); }
/* the level ring glows and turns; the XP line shimmers */
.motion-on .ring { box-shadow: 0 0 0 4px rgba(56, 189, 248, .08), 0 0 26px rgba(56, 189, 248, .35); }
.motion-on .ring::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1px dashed rgba(255, 201, 74, .4); animation: moSpin 18s linear infinite; pointer-events: none; }
.motion-on .health-bar > div { background-size: 200% 100%; animation: moShimmer 3s linear infinite; }
@keyframes moShimmer { to { background-position: -200% 0; } }
/* the title over the globe: a gold halo */
.motion-on .hero-title h1 { text-shadow: 0 0 40px rgba(255, 201, 74, .18), 0 6px 30px rgba(0, 0, 0, .6); }
/* goals: they lift, and the ones ready to collect glow */
.motion-on .goal { transition: transform .3s cubic-bezier(.2, .9, .2, 1), border-color .3s, box-shadow .3s; }
@media (hover: hover) { .motion-on .goal:hover { transform: translateX(4px); border-color: rgba(255, 201, 74, .35); } }
.motion-on .goal.ready { animation: moReady 2s ease-in-out infinite; }
@keyframes moReady { 50% { box-shadow: 0 0 0 1px rgba(255, 201, 74, .45), 0 0 26px rgba(255, 201, 74, .25); } }
/* the stats on the player card */
.motion-on .stat { transition: transform .3s, border-color .3s; }
@media (hover: hover) { .motion-on .stat:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, .4); } }


/* ===== My nation ===== */
/* the banner: the nation's colour, its island floating on the right, a big glossy flag */
.motion-on .ct-hero { position: relative; overflow: hidden; isolation: isolate; min-height: 170px; padding: 26px 28px;
  background: radial-gradient(ellipse at 85% 50%, color-mix(in srgb, var(--nc, #ffc94a) 38%, transparent), transparent 60%),
    linear-gradient(120deg, rgba(var(--card), .95), rgba(var(--card-2), .92)); }
.ct-island { position: absolute; z-index: -1; right: 4%; top: 50%; width: clamp(150px, 20vw, 250px); translate: 0 -50%; pointer-events: none;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .55)); animation: ctFloat 5s ease-in-out infinite; }
@keyframes ctFloat { 50% { transform: translateY(-10px) rotate(1.5deg); } }
.motion-on .ct-actions { position: relative; z-index: 1; margin-right: clamp(150px, 21vw, 260px); }
.ct-flag-wrap { position: relative; flex-shrink: 0; border-radius: 50%; overflow: hidden; display: block;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .12), 0 0 0 7px color-mix(in srgb, var(--nc, #ffc94a) 45%, transparent), 0 14px 34px rgba(0, 0, 0, .5); }
.motion-on .ct-flag { width: 96px; height: 96px; display: block; box-shadow: none; }
.ct-flag-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 45%, transparent 60%);
  transform: translateX(-120%); animation: ctShine 4.5s ease-in-out infinite 1s; }
@keyframes ctShine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.motion-on .ct-id h1 { font-size: clamp(30px, 3.6vw, 46px); background: linear-gradient(100deg, #fff, #fff 40%, color-mix(in srgb, var(--nc, #ffc94a) 60%, #ffc94a)); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="light"].motion-on .ct-id h1 { background: linear-gradient(100deg, #10162a, #10162a 40%, color-mix(in srgb, var(--nc, #ffc94a) 70%, #b07a12)); -webkit-background-clip: text; background-clip: text; }
@media (max-width: 760px) {
  .motion-on .ct-hero { flex-wrap: wrap; }
  .ct-island { width: 120px; right: -10px; top: 26%; opacity: .55; }
  .motion-on .ct-actions { margin-right: 0; }
  .motion-on .ct-flag { width: 72px; height: 72px; }
}

/* the road of eras: the islands themselves, the road lit up to where the nation is */
.motion-on .dev-eras { position: relative; gap: 10px; }
.motion-on .dev-eras li { padding: 10px 6px 8px; transition: transform .3s; }
.motion-on .dev-eras li span img { width: 100%; max-width: 76px; height: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
.motion-on .dev-eras li:not(.done):not(.now) span img { filter: grayscale(1) brightness(.5); }
.motion-on .dev-eras li.now { transform: translateY(-6px) scale(1.04); animation: moReady 2.4s ease-in-out infinite; }
.motion-on .dev-eras li.now span img { animation: ctFloat 3s ease-in-out infinite; }

/* the projects: big art, a progress bar that shines */
.motion-on .dev-project { position: relative; overflow: hidden; padding: 16px; transition: transform .35s cubic-bezier(.2, .9, .2, 1), border-color .35s, box-shadow .35s; }
@media (hover: hover) { .motion-on .dev-project:hover { transform: translateY(-4px); border-color: rgba(255, 201, 74, .4); box-shadow: 0 18px 40px rgba(var(--shadow), .45); } }
.motion-on .dev-project .proj-art { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .5)); transition: transform .4s; }
.motion-on .dev-project:hover .proj-art { transform: rotate(-6deg) scale(1.1); }
.motion-on .dev-project header b { font-family: var(--font-display); font-size: 17px; }
.motion-on .dev-track { height: 12px; position: relative; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); }
.motion-on .dev-track div { position: relative; overflow: hidden; box-shadow: 0 0 14px rgba(255, 201, 74, .45); }
.motion-on .dev-track div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-100%); animation: ctBar 2.2s ease-in-out infinite; }
@keyframes ctBar { to { transform: translateX(100%); } }
.motion-on .dev-project.complete { background: linear-gradient(160deg, rgba(61, 255, 181, .08), rgba(var(--tint), .03)); }
.motion-on .btn.primary:disabled::after, .motion-on .btn.primary[disabled]::after { display: none; }


/* ===== Shared pieces ===== */
/* tabs: the chosen one glows gold */
.motion-on .seg-glider { background: linear-gradient(180deg, rgba(255, 201, 74, .22), rgba(255, 201, 74, .08)) !important; box-shadow: inset 0 0 0 1px rgba(255, 201, 74, .4), 0 0 22px rgba(255, 201, 74, .18); }
.motion-on .seg button.active { color: var(--gold); }
/* empty lists: the picture floats */
.motion-on .empty-state > span:first-child { display: inline-block; font-size: 34px; animation: moBob 2.6s ease-in-out infinite; }
@keyframes moBob { 50% { transform: translateY(-6px) rotate(-6deg); } }
/* rows of a table light up under the mouse */
@media (hover: hover) { .motion-on tbody tr { transition: background .25s, box-shadow .25s; } .motion-on tbody tr:hover { background: rgba(255, 201, 74, .05); box-shadow: inset 3px 0 0 var(--gold); } }

/* ===== Market ===== */
.motion-on .inv-item { position: relative; transition: transform .3s cubic-bezier(.2, .9, .2, 1), border-color .3s, background .3s; }
.motion-on .inv-item .res-art, .motion-on .inv-item span img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); transition: transform .35s; }
.motion-on .inv-item:hover span img { transform: translateY(-4px) rotate(-8deg) scale(1.12); }
.motion-on .inv-item:not(.zero) { background: linear-gradient(160deg, rgba(255, 201, 74, .09), rgba(var(--tint), .03)); border-color: rgba(255, 201, 74, .25); }
.motion-on .inv-item:not(.zero) b { color: var(--gold); }
.motion-on .inv-item.zero { opacity: .45; }
.motion-on .inv-item.zero span img { filter: grayscale(1); }
/* nobody sells yet: the closed chest */
.motion-on .market-empty::before { content: ''; display: block; width: 110px; height: 110px; margin: 0 auto 10px; background: url(../img/box/closed.webp) center / contain no-repeat;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .5)); animation: moBob 3s ease-in-out infinite; }

/* ===== Military ===== */
/* the campaign over a battlefield, the training over the range */
.motion-on .camp-card { position: relative; overflow: hidden; isolation: isolate; padding: 22px; border-color: rgba(255, 159, 67, .35);
  background: linear-gradient(90deg, rgba(8, 10, 20, .94) 0%, rgba(8, 10, 20, .78) 45%, rgba(8, 10, 20, .35) 100%), url(../img/battle/field-day.webp) center 60% / cover; }
.motion-on .camp-card::after { content: ''; position: absolute; right: 2%; bottom: -6%; width: min(44%, 420px); aspect-ratio: 700 / 155; z-index: -1; opacity: .9;
  background: url(../img/battle/vehicles.webp) left top / 100% auto no-repeat; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .6)); animation: moRoll 9s ease-in-out infinite alternate; }
@keyframes moRoll { to { transform: translateX(-26px); } }
.motion-on .camp-head > span { font-size: 32px; }
.motion-on .camp-head b { font-family: var(--font-display); font-size: 20px; }
.motion-on .training-link { position: relative; overflow: hidden; isolation: isolate; border-color: rgba(255, 201, 74, .35) !important;
  background: linear-gradient(90deg, rgba(8, 10, 20, .92), rgba(8, 10, 20, .55)), url(../img/games/range-bg.webp) center 70% / cover !important; transition: transform .3s, box-shadow .3s; }
@media (hover: hover) { .motion-on .training-link:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(var(--shadow), .5), 0 0 24px rgba(255, 201, 74, .12); } }
.motion-on .battle-card { position: relative; overflow: hidden; isolation: isolate; }
.motion-on .battle-card::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .22; background: url(../img/battle/arena.webp) center / cover; }
.motion-on .battle-card.mine { animation: moWar 2.4s ease-in-out infinite; }
@keyframes moWar { 50% { box-shadow: 0 0 0 1px rgba(255, 77, 109, .5), 0 0 34px rgba(255, 77, 109, .25); } }
[data-theme="light"].motion-on .camp-card, [data-theme="light"].motion-on .training-link { color: #eef2ff; }

/* ===== Jobs ===== */
.motion-on .job { position: relative; overflow: hidden; padding-top: 18px; padding-bottom: 18px; }
.motion-on .job .cc-icon { width: 72px; height: 72px; transition: transform .4s; }
.motion-on .job:hover .cc-icon { transform: rotate(-6deg) scale(1.1); }
.motion-on .job-name { font-family: var(--font-display); font-size: 17px; }
.motion-on .job-pay b { font-size: 26px; color: var(--gold); text-shadow: 0 0 22px rgba(255, 201, 74, .35); }
.motion-on .job .btn.primary[data-apply] { min-width: 130px; height: 46px; font-size: 15px; animation: moReady 2.2s ease-in-out infinite; }
.motion-on .job.current { border-color: rgba(61, 255, 181, .45); background: linear-gradient(120deg, rgba(61, 255, 181, .09), rgba(var(--card), .9)); }

/* how a job works */
.jb-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.jb-how article { position: relative; padding: 22px 20px 20px; border-radius: 22px; text-align: center; border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(var(--card), .8), rgba(var(--card-2), .9)); transition: transform .35s cubic-bezier(.2, .9, .2, 1), border-color .35s; }
.jb-how article:hover { transform: translateY(-5px); border-color: rgba(255, 201, 74, .4); }
.jb-how img { width: 96px; height: 96px; object-fit: contain; margin: 0 auto 10px; display: block; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .5)); }
.jb-how b { display: block; font-family: var(--font-display); font-size: 16px; }
.jb-how small { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 760px) { .jb-how { grid-template-columns: 1fr; } .jb-how article { display: grid; grid-template-columns: 70px 1fr; text-align: left; gap: 0 14px; align-items: center; } .jb-how img { width: 64px; height: 64px; margin: 0; grid-row: span 2; } }

/* ===== Profile ===== */
.motion-on .pf-hero { position: relative; overflow: hidden; isolation: isolate; padding: 26px 28px;
  background: radial-gradient(ellipse at 80% 40%, rgba(255, 201, 74, .16), transparent 55%), linear-gradient(120deg, rgba(var(--card), .95), rgba(var(--card-2), .92)); }
.motion-on .pf-hero::after { content: ''; position: absolute; z-index: -1; right: 3%; top: 50%; width: clamp(80px, 9vw, 120px); aspect-ratio: 300 / 450; translate: 0 -50%;
  background: url(../img/medals/roundHero.webp) center / contain no-repeat; opacity: .9; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); animation: ctFloat 5s ease-in-out infinite; }
.motion-on .pf-hero .pf-actions, .motion-on .pf-hero > :last-child { position: relative; z-index: 1; margin-right: clamp(90px, 10vw, 140px); }
.motion-on .pf-avatar { box-shadow: 0 0 0 4px rgba(255, 201, 74, .35), 0 0 40px rgba(255, 201, 74, .35), 0 20px 50px rgba(var(--shadow), .5); }
.motion-on .pf-id h1 { font-size: clamp(32px, 4vw, 52px); }
.motion-on .pf-xp { height: 12px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); }
.motion-on .pf-xp div { position: relative; overflow: hidden; box-shadow: 0 0 16px rgba(61, 255, 181, .45); }
.motion-on .pf-xp div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); transform: translateX(-100%); animation: ctBar 2.4s ease-in-out infinite; }
/* the four numbers, each with its picture */
.motion-on .pf-tile { position: relative; overflow: hidden; isolation: isolate; }
.motion-on .pf-tile::after { content: ''; position: absolute; z-index: -1; right: -8px; bottom: -10px; width: 74px; height: 74px; background: center / contain no-repeat; opacity: .85;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); transition: transform .4s; }
.motion-on .pf-tile:nth-child(1)::after { background-image: url(../img/achievements/strong.webp); }
.motion-on .pf-tile:nth-child(2)::after { background-image: url(../img/achievements/fighter.webp); }
.motion-on .pf-tile:nth-child(3)::after { background-image: url(../img/achievements/veteran.webp); }
.motion-on .pf-tile:nth-child(4)::after { background-image: url(../img/achievements/collector.webp); }
.motion-on .pf-tile:hover::after { transform: rotate(-10deg) scale(1.12); }
/* the soldier stands in a pool of light */
.motion-on .doll::before { content: ''; position: absolute; left: 50%; bottom: 4%; width: 60%; height: 90px; translate: -50% 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(255, 201, 74, .32), rgba(56, 189, 248, .12) 45%, transparent 70%); filter: blur(6px); animation: moPool 4s ease-in-out infinite; }
@keyframes moPool { 50% { opacity: .65; transform: scaleX(.92); } }
@media (max-width: 760px) { .motion-on .pf-hero::after { width: 80px; right: -6px; top: 22%; opacity: .5; } .motion-on .pf-hero > :last-child { margin-right: 0; } }

/* ===== Politics ===== */
.motion-on .pm-card { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 90% 60%, rgba(255, 201, 74, .14), transparent 55%), linear-gradient(160deg, rgba(var(--card), .92), rgba(var(--card-2), .96)); }
.motion-on .pm-card::after { content: ''; position: absolute; z-index: -1; right: 6px; bottom: -14px; width: 96px; aspect-ratio: 1; background: url(../img/achievements/founder.webp) center / contain no-repeat; opacity: .5; transform: rotate(8deg); }
.motion-on .pm-name { background: linear-gradient(100deg, #fff, #ffe7a8 60%, #ffc94a); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="light"].motion-on .pm-name { background: linear-gradient(100deg, #10162a, #8a5a12); -webkit-background-clip: text; background-clip: text; }
.motion-on .gov-top > .panel-card:nth-child(2) { position: relative; overflow: hidden; isolation: isolate; }
.motion-on .gov-top > .panel-card:nth-child(2)::after { content: ''; position: absolute; z-index: -1; right: 14px; bottom: -30px; width: 70px; aspect-ratio: 300 / 450; background: url(../img/medals/mp.webp) center / contain no-repeat; opacity: .28; transform: rotate(-6deg); }
.motion-on .treasury { color: var(--gold); text-shadow: 0 0 28px rgba(255, 201, 74, .3); }

/* ===== Travel: the boarding pass ===== */
.motion-on .pass { position: relative; isolation: isolate; box-shadow: 0 30px 70px rgba(var(--shadow), .55), 0 0 0 1px rgba(255, 201, 74, .25); }
.motion-on .pass::before { content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--pa, 0deg), transparent 0 70%, #ffc94a 80%, #38bdf8 90%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: moPass 6s linear infinite; }
@property --pa { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes moPass { to { --pa: 360deg; } }

/* ===== News ===== */
.motion-on .art-card { position: relative; }
@media (hover: hover) { .motion-on .art-card:hover { transform: translateY(-4px); border-color: rgba(255, 201, 74, .35); box-shadow: 0 18px 40px rgba(var(--shadow), .45); } }
@media (max-width: 760px) { .motion-on .pf-hero { padding: 20px; } .motion-on .pf-id { min-width: 0; } .motion-on .pf-id h1 { font-size: 28px; overflow-wrap: anywhere; } }


/* ===== Company, firm, player, tournament ===== */
.motion-on .cp-hero { position: relative; overflow: hidden; isolation: isolate; padding: 24px 26px; border-radius: 24px;
  background: radial-gradient(ellipse at 85% 50%, rgba(255, 201, 74, .16), transparent 58%), linear-gradient(120deg, rgba(var(--card), .95), rgba(var(--card-2), .92)); border: 1px solid var(--line); }
.motion-on .cp-hero > :last-child:not(.ct-island):not(.cp-title) { position: relative; z-index: 1; margin-right: clamp(140px, 19vw, 240px); }
.motion-on .cp-title h1 { font-size: clamp(30px, 3.6vw, 46px); }
.motion-on .pl-hero::after { content: ''; position: absolute; z-index: -1; right: 3%; top: 50%; width: clamp(110px, 12vw, 150px); aspect-ratio: 1; translate: 0 -50%;
  background: url(../img/achievements/veteran.webp) center / contain no-repeat; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .55)); animation: ctFloat 5s ease-in-out infinite; }
.motion-on .pl-hero > :last-child { margin-right: clamp(130px, 14vw, 180px) !important; }
@media (max-width: 760px) {
  .motion-on .cp-hero > :last-child:not(.ct-island):not(.cp-title), .motion-on .pl-hero > :last-child { margin-right: 0 !important; }
  .motion-on .pl-hero::after { width: 70px; right: 8px; top: 24%; opacity: .5; }
  .motion-on .cp-title { min-width: 0; } .motion-on .cp-title h1 { font-size: 26px; overflow-wrap: anywhere; }
}
/* the tournament: a trophy on the empty bracket */
.motion-on #bracket { position: relative; overflow: hidden; isolation: isolate; min-height: 190px; }
.motion-on #bracket::after { content: ''; position: absolute; z-index: -1; right: 24px; top: 50%; width: 100px; aspect-ratio: 300 / 450; translate: 0 -50%;
  background: url(../img/medals/roundHero.webp) center / contain no-repeat; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55)); animation: ctFloat 4.5s ease-in-out infinite; opacity: .9; }
.motion-on #bracket > * { position: relative; max-width: calc(100% - 150px); }
@media (max-width: 760px) { .motion-on #bracket::after { width: 70px; opacity: .45; } .motion-on #bracket > * { max-width: none; } }

/* a player's page: the card is the banner (no frame inside a frame) */
.motion-on #card:has(.pl-hero) { padding: 0; background: none; border: 0; box-shadow: none; }
.motion-on #card:has(.pl-hero)::before { display: none; }

/* ===== Battle (js/battle-fx.js) ===== */
.bfx-ring { position: fixed; left: 0; top: 0; width: 60px; height: 60px; border-radius: 50%; z-index: 300; pointer-events: none; border: 3px solid #ffd36b; box-shadow: 0 0 24px #ffb300, inset 0 0 16px #ffb300; }
.bfx-spark { position: fixed; left: 0; top: 0; width: 6px; height: 6px; border-radius: 50%; z-index: 300; pointer-events: none; background: #fff3c4; box-shadow: 0 0 10px #ffb300, 0 0 4px #fff; }
.bfx-coin { position: fixed; left: 0; top: 0; width: 32px; height: 32px; z-index: 59; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); }
.bfx-rays { position: fixed; left: 0; top: 0; width: 900px; height: 900px; z-index: 59; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 201, 74, .22) 0deg 8deg, transparent 8deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 65%); mask-image: radial-gradient(circle, #000 0%, transparent 65%); }
.camp-win { box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 201, 74, .45), 0 0 60px rgba(255, 201, 74, .25); }
.camp-win > b { display: block; font-family: var(--font-display); font-size: 24px; background: linear-gradient(100deg, #fff1c9, #ffc94a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#fightBtn:not(:disabled) { animation: bfxIdle 2.4s ease-in-out infinite; }
@keyframes bfxIdle { 50% { box-shadow: 0 0 0 1px rgba(255, 140, 80, .5), 0 0 34px rgba(255, 110, 80, .45); } }

/* ===== The daily raid ===== */
.raid-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: var(--text); overflow: hidden; isolation: isolate;
  border: 1px solid rgba(255, 77, 109, .5); background: linear-gradient(110deg, rgba(60, 10, 20, .9), rgba(20, 10, 25, .75)), url(../img/battle/field-night.webp) center / cover;
  box-shadow: 0 10px 30px rgba(255, 77, 109, .15); animation: moWar 2.4s ease-in-out infinite; transition: transform .3s; }
.raid-card:hover { transform: translateY(-3px); }
.raid-card.won { animation: none; border-color: rgba(61, 255, 181, .45); background: linear-gradient(110deg, rgba(8, 40, 30, .92), rgba(10, 20, 25, .8)), url(../img/battle/field-day.webp) center / cover; }
.raid-icon { font-size: 30px; flex: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.raid-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.raid-body b { font-family: var(--font-display); font-size: 14px; line-height: 1.2; color: #fff; }
.raid-body small { color: #d7c9d2; font-size: 11.5px; }
.raid-bar { display: block; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 3px; }
.raid-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff4d6d, #ff9f43); border-radius: 6px; }
.raid-card.won .raid-bar i { background: var(--mint); }
.raid-go { grid-column: 1 / -1; text-align: center; font-weight: 800; font-size: 13px; color: #fff; padding: 8px 11px; border-radius: 10px; background: linear-gradient(135deg, #ff4d6d, #ff9f43); }
.raid-card.won .raid-go { background: rgba(61, 255, 181, .2); color: var(--mint); }
@keyframes moWar { 50% { box-shadow: 0 0 0 1px rgba(255, 77, 109, .5), 0 0 34px rgba(255, 77, 109, .25); } }
.raid-row { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; margin-bottom: 4px; border-radius: 8px; font-size: 13px; overflow: hidden; isolation: isolate; background: rgba(255, 255, 255, .03); }
.raid-row i { position: absolute; left: 0; top: 0; bottom: 0; z-index: -1; background: linear-gradient(90deg, rgba(61, 255, 181, .22), rgba(61, 255, 181, .05)); }
