/* ============================================================
   ARTY GAMES: brings the site's newer look into every game.
   Loaded after each game's own style.css, so it only restyles the
   pieces the games share (titles, buttons, boxes, cards, results).
   - titles: the bold word gets the yellow marker, drawn in on load
   - buttons: rounded, navy edge, a pressed-in navy base, a little bounce;
     the main call to action is yellow with a shine sweeping across
   - boxes and panels: white with a coloured "sticker" shadow
   - cards on the game home screens: pop in one after another, tilt on hover
   Without this file every game still works exactly as before.
   ============================================================ */
:root {
  --ag-navy: var(--color-navy, #1E3A5F);
  --ag-yellow: var(--color-yellow, #FDE358);
  --ag-sky: #cfe3f2;
  --ag-pink: #f3d2cf;
  --ag-mint: #d5ecd4;
  --ag-bounce: cubic-bezier(.34, 1.56, .5, 1);
}

/* ---- Titles: the yellow marker draws itself under the bold word ---- */
.hero h1 b, .lvhead h1 b, .usg-head h1 b, .ls-name b, .hub h1 b {
  background: linear-gradient(var(--ag-yellow), var(--ag-yellow)) no-repeat 0 88% / 0% .42em;
  animation: ag-mark .9s cubic-bezier(.6, 0, .2, 1) .35s forwards;
  padding: 0 .06em;
}
@keyframes ag-mark { to { background-size: 100% .42em; } }

/* ---- Buttons ---- */
/* everyday buttons: white pill with a navy base you press into */
.text-btn, .ghost, button.ctl, :root .lb-tab, .bd-tab, .replay {
  background: #fff;
  border: 1.5px solid var(--ag-navy);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ag-navy);
  transition: background-color .2s, color .2s, box-shadow .15s, transform .3s var(--ag-bounce);
}
button.ctl { border-radius: 12px; }
/* buttons whose words wrap onto two lines stay neat rounded boxes, not capsules */
.text-btn { border-radius: 16px; }
.text-btn.big { border-radius: 999px; }
@media (hover: hover) {
.text-btn:hover:not(:disabled), .ghost:hover, button.ctl:hover, :root .lb-tab:hover, .bd-tab:hover, .replay:hover,
.text-btn:focus-visible, .ghost:focus-visible, button.ctl:focus-visible {
  background: var(--ag-yellow); color: var(--ag-navy);
  transform: translateY(-2px) rotate(-1.5deg);
  box-shadow: 0 5px 0 var(--ag-navy);
  outline: none;
}
}
.text-btn:active:not(:disabled), .ghost:active, button.ctl:active, :root .lb-tab:active, .bd-tab:active, .replay:active {
  transform: translateY(3px); box-shadow: 0 0 0 var(--ag-navy);
}
:root .lb-tab.on, .bd-tab.on { background: var(--ag-navy); color: var(--color-off-white, #F8F9F0); }
.text-btn:disabled { box-shadow: none; }

/* the main call to action: yellow, with a shine that sweeps across */
.text-btn.big, .primary, .intro .pill {
  font-weight: 700;
  color: var(--ag-navy);
  background-color: var(--ag-yellow);
  background-image: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .65) 50%, transparent 62%);
  background-size: 260% 100%; background-repeat: no-repeat; background-position: 160% 0;
  border: 1.5px solid var(--ag-navy);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ag-navy);
  animation: ag-shine 5s ease-in-out infinite;
  transition: background-color .2s, color .2s, box-shadow .15s, transform .35s var(--ag-bounce);
}
@media (hover: hover) {
.text-btn.big:hover, .primary:hover:not(:disabled), .intro .pill:hover,
.text-btn.big:focus-visible, .primary:focus-visible {
  background-color: var(--ag-navy); color: var(--color-off-white, #F8F9F0);
  transform: translateY(-3px) rotate(-2deg) scale(1.04);
  box-shadow: 0 6px 0 var(--ag-navy), 0 0 0 5px rgba(253, 227, 88, .55);
  outline: none;
}
}
.text-btn.big:active, .primary:active, .intro .pill:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ag-navy); }
@keyframes ag-shine { 0%, 62% { background-position: 160% 0; } 100% { background-position: -60% 0; } }

/* toggle pills (Solar System): keep their on/off colours, add the pressed-in base */
.pill:where(:not(.intro .pill)) { box-shadow: 0 3px 0 var(--ag-navy); transition: background-color .2s, color .2s, box-shadow .15s, transform .3s var(--ag-bounce); }
@media (hover: hover) {
.pill:where(:not(.intro .pill)):hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ag-navy); }
}
.pill:where(:not(.intro .pill)):active { transform: translateY(3px); box-shadow: 0 0 0 var(--ag-navy); }

/* answer choices and mode options: white cards that lift and turn yellow */
.mode-opt, .round-opt, .choice, .opt, .lv {
  background: #fff;
  border: 1.5px solid var(--ag-navy);
  box-shadow: 4px 4px 0 var(--ag-navy);
  transition: background-color .2s, box-shadow .2s, transform .3s var(--ag-bounce);
}
@media (hover: hover) {
.mode-opt:hover, .round-opt:hover, .choice:hover:not(:disabled), .opt:hover:not(:disabled), .lv:hover:not(:disabled) {
  background: var(--ag-yellow);
  transform: translate(-2px, -2px) rotate(-.6deg);
  box-shadow: 6px 6px 0 var(--ag-navy);
}
}
.mode-opt:active, .round-opt:active, .choice:active:not(:disabled), .opt:active:not(:disabled), .lv:active:not(:disabled) {
  transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ag-navy);
}
.mode-opt.last { box-shadow: 4px 4px 0 var(--ag-navy), inset 0 0 0 3px var(--ag-yellow); }

/* ---- Boxes and panels: white with a coloured sticker shadow ---- */
.widget, .lb-panel, .prompt, .learned-box, .again-box, .info, .usg-badge-box, .modalbox, .pcard, .bd-said, .scroll {
  background: #fff;
  border: 1.5px solid var(--ag-navy);
  box-shadow: 7px 7px 0 -1.5px var(--ag-pop, var(--ag-yellow)), 7px 7px 0 0 var(--ag-navy);
}
.widget, .lb-panel { border-radius: 16px; }
.lb-panel, .info { --ag-pop: var(--ag-sky); }
.learned-box, .again-box, .pcard { --ag-pop: var(--ag-pink); }
.prompt { border-radius: 999px; --ag-pop: var(--ag-yellow); }
.w-head { border-bottom-color: var(--ag-navy); }
.w-search, :root .lb-input, :root .lb-row input { border-radius: 999px; padding-inline: 14px; }

/* the "zoom out" fact box and the finished banner get a yellow tab look */
.persp, .bd-done {
  background: #fff;
  border: 1.5px solid var(--ag-navy);
  border-radius: 16px;
  box-shadow: 7px 7px 0 -1.5px var(--ag-yellow), 7px 7px 0 0 var(--ag-navy);
  rotate: -.6deg;
}
.persp h3 { display: inline-block; background: var(--ag-yellow); border: 1.5px solid var(--ag-navy); border-radius: 999px; padding: 3px 12px; rotate: -2deg; }

/* results and choose-a-mode screens: the card becomes a sticker that pops in */
.overlay > .card {
  background: var(--color-off-white, #F8F9F0);
  border: 1.5px solid var(--ag-navy);
  border-radius: 24px;
  padding: 28px clamp(18px, 5vw, 32px) 30px;
  box-shadow: 11px 11px 0 -1.5px var(--ag-yellow), 11px 11px 0 0 var(--ag-navy), 0 30px 60px -28px rgba(0, 0, 0, .35);
  width: calc(100% - 12px);
  animation: ag-pop .55s var(--ag-bounce) both;
}
.overlay { background: rgba(30, 58, 95, .55); }
@keyframes ag-pop { from { opacity: 0; transform: translateY(22px) scale(.92) rotate(-1.5deg); } }

/* ---- Home-screen cards (Ready, Sportz Rulez, Solar System, US Government) ---- */
li > button.card, .feat > .fcard, .usg-card {
  background: #fff;
  border: 1.5px solid var(--ag-navy);
  box-shadow: 7px 7px 0 -1.5px var(--ag-pop, var(--ag-yellow)), 7px 7px 0 0 var(--ag-navy);
  rotate: var(--ag-tilt, 0deg);
  transition: transform .35s var(--ag-bounce), box-shadow .25s, rotate .35s var(--ag-bounce);
  animation: ag-rise .6s var(--ag-bounce) both;
}
li:nth-child(4n+1) > button.card, .usg-card:nth-child(3n+1) { --ag-pop: var(--ag-yellow); --ag-tilt: -.8deg; }
li:nth-child(4n+2) > button.card, .usg-card:nth-child(3n+2) { --ag-pop: var(--ag-sky); --ag-tilt: .7deg; }
li:nth-child(4n+3) > button.card, .usg-card:nth-child(3n+3) { --ag-pop: var(--ag-pink); --ag-tilt: -.5deg; }
li:nth-child(4n+4) > button.card { --ag-pop: var(--ag-mint); --ag-tilt: .9deg; }
.feat > .fcard { --ag-pop: var(--ag-sky); }
.feat > .fcard.main { --ag-pop: var(--ag-yellow); }
@media (hover: hover) {
li > button.card:hover, .feat > .fcard:hover, .usg-card:hover,
li > button.card:focus-visible, .feat > .fcard:focus-visible {
  rotate: 0deg;
  transform: translate(-3px, -4px);
  box-shadow: 11px 11px 0 -1.5px var(--ag-pop, var(--ag-yellow)), 11px 11px 0 0 var(--ag-navy);
  outline: none;
}
}
li > button.card:active, .feat > .fcard:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 -1.5px var(--ag-pop), 3px 3px 0 0 var(--ag-navy); }
/* one after another as the screen arrives */
li:nth-child(1) > button.card, .usg-card:nth-child(1) { animation-delay: .05s; }
li:nth-child(2) > button.card, .usg-card:nth-child(2) { animation-delay: .12s; }
li:nth-child(3) > button.card, .usg-card:nth-child(3) { animation-delay: .19s; }
li:nth-child(4) > button.card { animation-delay: .26s; }
li:nth-child(5) > button.card { animation-delay: .33s; }
li:nth-child(6) > button.card { animation-delay: .4s; }
li:nth-child(n+7) > button.card { animation-delay: .47s; }
@keyframes ag-rise { from { opacity: 0; transform: translateY(26px) scale(.96); } }

/* ---- Level maps ---- */
/* on the scrolling level lists the header gets a solid backing so rows slide under it cleanly */
.stage:has(> .bd-map, > .ladder-wrap) > .hud.ls { background: linear-gradient(var(--bg, #F8F9F0) 82%, rgba(248, 249, 240, 0)); padding-bottom: 22px; }

/* "Practise weak spots" is just "Weak spots" on phones, so it fits on one line */
.wk-short { display: none; }
@media (max-width: 560px) {
  .wk-long { display: none; }
  .wk-short { display: inline; }
  /* the title and buttons share the top row; the level line gets the whole width below,
     so nothing is squeezed onto two lines */
  .hud.ls { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 14px; align-items: start; }
  .hud.ls > .ls-title { display: contents; }
  .hud.ls .ls-name { grid-column: 1; grid-row: 1; }
  .hud.ls > .hud-right { grid-column: 2; grid-row: 1; flex-direction: column; align-items: stretch; gap: 10px; }
  .hud.ls > .hud-right > .text-btn { text-align: center; }
  .hud.ls > .hud-right:has(.sfx-btn) { flex-direction: row; align-items: center; }
  .hud.ls .ls-next { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin-top: 0; }
  .hud.ls .text-btn { white-space: nowrap; }
}
/* "Level one: Oceania" sits on a white sticker so the map lines never run through it */
.ls-next { display: inline-block; background: #fff; border: 1.5px solid var(--ag-navy); border-radius: 16px; padding: 4px 16px 5px; box-shadow: 4px 4px 0 -1.5px var(--ag-yellow), 4px 4px 0 0 var(--ag-navy); rotate: -1deg; }
.ld-ring { transition: transform .35s var(--ag-bounce); }
@media (hover: hover) {
.ld-node:not(.locked):hover .ld-ring { transform: translateY(-3px) rotate(-6deg) scale(1.06); }
}

/* the leaderboard picker: navy words (iPhone otherwise paints them blue), cut off neatly */
.lb-select { font-family: inherit; color: var(--ag-navy); text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
@media (max-width: 639px) { .lb-panel { width: min(270px, calc(100% - 32px)); } }
/* (leaderboard.css loads later and sets its own shadow, so this needs the extra weight) */
.stage .lb-panel { background: #fff; border-radius: 16px; box-shadow: 7px 7px 0 -1.5px var(--ag-sky), 7px 7px 0 0 var(--ag-navy); }

/* empty leaderboard message */
.lb-empty { margin: 8px 0 4px; font-size: .85rem; line-height: 1.35; color: var(--soft, rgba(30, 58, 95, .65)); }
.lb-panel:not(.open) .lb-empty { display: none; }
.lb-mini-list li[hidden] { display: none; }
/* on phones the leaderboard sits at the end of a scrolling list, in the flow */
.lb-panel.lb-inline { position: static; width: auto; max-width: 420px; margin: 28px auto 10px; }
.lb-panel.lb-inline .lb-fold { display: none; }

/* little messages slide up with a bounce */
.toast { border-radius: 999px; transition: opacity .2s, transform .45s var(--ag-bounce); }

@media (prefers-reduced-motion: reduce) {
  .hero h1 b, .lvhead h1 b, .usg-head h1 b, .ls-name b, .hub h1 b { animation: none; background-size: 100% .42em; }
  .text-btn.big, .primary, .intro .pill, li > button.card, .feat > .fcard, .usg-card, .overlay > .card { animation: none; }
}

/* Locked level labels: faded colour instead of see-through, so the dashed ladder line
   never shows through the words */
.ld-node.locked .ld-label, .ld-node.locked .ld-sub,
.ladder-wrap .ld-node.locked .ld-label, .ladder-wrap .ld-node.locked .ld-sub { opacity: 1; color: rgba(30, 58, 95, .45); }

/* Solar System: the space window becomes a sticker too */
.space { box-shadow: 8px 8px 0 -1.5px var(--ag-yellow), 8px 8px 0 0 var(--ag-navy); }
/* cards with sticker shadows need a little more air between them */
ul:has(> li > button.card), .feat:has(> .fcard), .usg-cards { row-gap: 24px; column-gap: 22px; }

/* Life Through the Ages: on the dark sky the pressed-in base is a deeper yellow (navy would vanish) */
.intro .pill { border-color: #c9a92a; box-shadow: 0 5px 0 #c9a92a; }
@media (hover: hover) { .intro .pill:hover { box-shadow: 0 7px 0 #c9a92a, 0 0 0 5px rgba(253, 227, 88, .35); } }
.intro .pill:active { box-shadow: 0 1px 0 #c9a92a; }
