/* BALKANOPOLY — the game-over screen: a newspaper front page, "The Balkan Times, special awards edition" (v9.11.0).
   The show plays once (#results gets the class "run"): the paper spins in, the title thumps down, the awards stamp in
   one by one and their numbers roll like an old counter. Without "run" everything simply stands in its final place,
   which is also what a tap on the paper jumps to. Delays come from each element's --at (set in ui-results.js). */
.news-ov {
  background: rgba(30, 22, 14, 0.62);
}
.news {
  --np: #f4ebd2;
  --nk: #2b2118;
  --nline: #6b5a44;
  --slab: 'Alfa Slab One', Georgia, 'Times New Roman', serif;
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  /* the double frame is drawn on this box; the paper scrolls inside it, so nothing slides over the frame */
  padding: 12px;
  color: var(--nk);
  font-family: var(--body);
  border: 2px solid var(--nk);
  background:
    radial-gradient(circle at 23% 31%, rgba(110, 80, 40, 0.1) 0 1px, transparent 2px) 0 0 / 37px 41px,
    radial-gradient(circle at 70% 60%, rgba(110, 80, 40, 0.08) 0 1.5px, transparent 2.5px) 0 0 / 53px 47px,
    radial-gradient(ellipse at 50% 40%, #f4ebd2 0%, #ede0bf 60%, #ddcba2 100%);
  box-shadow:
    inset 0 0 0 8px #f1e6c8,
    inset 0 0 0 10px var(--nk),
    0 24px 60px rgba(0, 0, 0, 0.5);
}
.news.run {
  cursor: pointer;
}
.nw-paper {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 14px 0;
  /* sideways never: an award popping in grows past the edge for a moment */
  overflow: hidden auto;
  overscroll-behavior: contain;
}
.nw-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 700 14px/1.1 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nw-hatch {
  flex: 1;
  height: 14px;
  background: repeating-linear-gradient(90deg, var(--nk) 0 2px, transparent 2px 5px);
}
/* the masthead: a slab title with an outline and a solid shadow, like old wood type */
.nw-mast {
  font: 400 clamp(28px, 7vw, 64px) / 1.05 var(--slab);
  color: var(--np);
  -webkit-text-stroke: 4px var(--nk);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--nk);
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
}
.nw-date {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 10px;
  border-top: 2px solid var(--nk);
  border-bottom: 2px solid var(--nk);
  padding: 5px 0;
  font: 700 14px/1.2 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* the winner: the victory-train painting printed in newspaper ink, the headline and the final standings */
.nw-top {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}
.nw-pic {
  position: relative;
  height: 150px;
  box-sizing: border-box;
  border: 2px solid var(--nk);
  padding: 4px;
  background: var(--np);
}
.nw-img {
  height: 100%;
  background: url(../img/landing/winner.webp) 92% 30% / cover;
  filter: grayscale(1) sepia(0.35) contrast(1.3) brightness(1.04);
}
.nw-burst,
.nw-burst i {
  clip-path: polygon(
    50% 0%,
    57.1% 9.6%,
    67.1% 3%,
    70.5% 14.5%,
    82.1% 11.7%,
    81.4% 23.6%,
    93.3% 25%,
    88.5% 36%,
    99.2% 41.3%,
    91% 50%,
    99.2% 58.7%,
    88.5% 64%,
    93.3% 75%,
    81.4% 76.4%,
    82.1% 88.3%,
    70.5% 85.5%,
    67.1% 97%,
    57.1% 90.4%,
    50% 100%,
    42.9% 90.4%,
    32.9% 97%,
    29.5% 85.5%,
    17.9% 88.3%,
    18.6% 76.4%,
    6.7% 75%,
    11.5% 64%,
    0.8% 58.7%,
    9% 50%,
    0.8% 41.3%,
    11.5% 36%,
    6.7% 25%,
    18.6% 23.6%,
    17.9% 11.7%,
    29.5% 14.5%,
    32.9% 3%,
    42.9% 9.6%
  );
}
.nw-burst {
  position: absolute;
  left: -22px;
  bottom: -20px;
  width: 92px;
  height: 92px;
  background: var(--nk);
  display: grid;
  place-items: center;
}
.nw-burst i {
  position: absolute;
  inset: 5px;
  background: var(--np);
}
.nw-burst span {
  position: relative;
  font: 400 16px/1 var(--slab);
  text-transform: uppercase;
}
.nw-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.nw-head h1 {
  margin: 0;
  font: 400 clamp(24px, 4.2vw, 36px) / 1.05 var(--slab);
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.nw-sub {
  margin: 0;
  font: italic 400 17px/1.3 var(--body);
}
.nw-stand {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.nw-st {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 2px solid var(--nk);
  padding-left: 9px;
  min-width: 0;
}
.nw-st b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.nw-st > span {
  font: 700 16px var(--mono);
}
.nw-tok {
  flex: none;
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--nk);
  box-sizing: border-box;
}
/* the awards: a ribbon, then one stamped box per award */
.nw-rib {
  align-self: center;
  background: var(--nk);
  color: var(--np);
  padding: 9px 44px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%);
  font: 700 19px/1 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nw-awards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.nw-aw {
  flex: 1 1 230px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: 54px auto auto;
  column-gap: 12px;
  row-gap: 5px;
  align-items: center;
  padding: 12px 14px;
  border: 2px solid var(--nk);
  box-shadow:
    inset 0 0 0 3px #f1e6c8,
    inset 0 0 0 4px var(--nk);
}
.nw-th {
  width: 54px;
  height: 54px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--nk);
  box-shadow:
    0 0 0 3px var(--np),
    0 0 0 4.5px var(--nk);
  overflow: hidden;
  background: var(--np);
}
.nw-th img,
.nw-th svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nw-th img {
  filter: grayscale(1) sepia(0.35) contrast(1.3);
}
.nw-at {
  font: 400 18px/1.05 var(--slab);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nw-av {
  grid-column: 1 / 3;
  font: 400 28px/1 var(--slab);
  overflow-wrap: anywhere;
}
.nw-al {
  grid-column: 1 / 3;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 16px;
  line-height: 1.25;
  min-width: 0;
}
.nw-al > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* a number that rolls into place: each digit is a column 0–9 0–9 that stops on the right one */
.nw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.nw-odo {
  display: inline-flex;
  align-items: flex-start;
}
.nw-d {
  --h: 1em;
  --h: round(1em, 1px); /* whole pixels, so the resting digit is sharp and level with its neighbours */
  position: relative;
  display: inline-block;
  height: var(--h);
  overflow: hidden;
  line-height: 1;
}
.nw-w {
  visibility: hidden;
}
.nw-roll {
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: -0.5em;
  width: 1em;
  text-align: center;
  display: flex;
  flex-direction: column;
  transform: translateY(calc((10 + var(--d)) * -1 * var(--h)));
}
.nw-roll > span {
  height: var(--h);
  line-height: var(--h);
}
/* Biggest empire: a little engraved map, the owner's countries striped in their colour */
.nw-emp {
  flex: 2 1 470px;
  grid-template-columns: 150px minmax(0, 1fr);
  grid-template-rows: auto;
  padding: 8px 14px 8px 8px;
  box-shadow:
    inset 0 0 0 3px #f1e6c8,
    inset 0 0 0 4px var(--nk),
    4px 4px 0 var(--nk);
}
.nw-map {
  width: 100%;
  border: 2px solid var(--nk);
  background: var(--np);
  overflow: hidden;
}
.nw-map svg {
  display: block;
  width: 100%;
  height: 100%;
}
.nw-et {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.nw-emp .nw-at {
  font-size: 21px;
}
.nw-emp .nw-av {
  font-size: 26px;
}
/* the buttons, as an advertisement: a footer under the paper, always in view. Its classes must never look like
   an ad (no "ad" in the name): ad blockers hid the old .nw-ad box, buttons and all (v9.12.3) */
.nw-call {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 10px 0 0;
  padding: 10px 14px;
  background: #f1e6c8;
  border: 2px solid var(--nk);
  box-shadow:
    inset 0 0 0 3px #f1e6c8,
    inset 0 0 0 4px var(--nk);
}
.nw-calltext {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nw-calltext b {
  font: 700 24px/1 var(--body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nw-calltext i {
  font-size: 16px;
  line-height: 1.2;
}
.nw-bm,
.nw-bs {
  min-height: 50px;
  cursor: pointer;
}
.nw-bm {
  padding: 0 28px;
  background: var(--nk);
  color: var(--np);
  border: none;
  font: 400 21px var(--slab);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nw-bm:hover {
  background: #4a3828;
}
.nw-bs {
  padding: 0 16px;
  background: transparent;
  color: var(--nk);
  border: 2px solid var(--nk);
  font: 700 16px var(--body);
}
.nw-bs:hover {
  background: rgba(43, 33, 24, 0.08);
}
.nw-bm:focus-visible,
.nw-bs:focus-visible,
.nw-chart summary:focus-visible {
  outline: 3px solid #c9a24a;
  outline-offset: 2px;
}
.nw-chart {
  margin: 4px 0 16px;
}
.nw-chart summary {
  cursor: pointer;
  font: 700 16px var(--body);
  padding: 4px 0;
}

/* ---- the show ---- */
.news .a {
  animation-duration: var(--t, 0.5s);
  animation-delay: var(--at, 0s);
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.25, 1);
}
.news.run {
  animation: nwSpin 1s cubic-bezier(0.15, 0.7, 0.2, 1) both;
}
.run .up {
  animation-name: nwUp;
}
.run .thump {
  animation-name: nwThump;
}
.run .pop {
  animation-name: nwPop;
}
.run .unf {
  animation-name: nwUnf;
}
.run .slide {
  animation-name: nwSlide;
}
.run .nw-roll {
  animation: nwRoll 1s cubic-bezier(0.2, 0.8, 0.25, 1) calc(var(--at, 0s) + 0.2s) both;
}
.run .nw-draw {
  animation: nwDraw 0.9s ease-out var(--draw, 0s) both;
}
.run .nw-fill {
  animation: nwFill 0.6s ease var(--fill, 0s) both;
}
.run .nw-bm {
  animation: nwRing 0.6s ease var(--at, 0s) 1;
}
@keyframes nwSpin {
  from {
    transform: scale(0.06) rotate(-540deg);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes nwThump {
  0% {
    transform: scale(1.7);
    opacity: 0;
  }
  60% {
    transform: scale(0.97);
    opacity: 1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes nwUp {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes nwPop {
  0% {
    transform: scale(1.55) rotate(-5deg);
    opacity: 0;
  }
  55% {
    transform: scale(0.96) rotate(1deg);
    opacity: 1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes nwUnf {
  from {
    transform: scaleX(0);
  }
  to {
    transform: none;
  }
}
@keyframes nwSlide {
  from {
    transform: translateY(60px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes nwRoll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc((10 + var(--d)) * -1 * var(--h)));
  }
}
@keyframes nwDraw {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes nwFill {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes nwRing {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: rotate(-4deg) scale(1.06);
  }
  40% {
    transform: rotate(4deg) scale(1.06);
  }
  60% {
    transform: rotate(-3deg);
  }
  80% {
    transform: rotate(2deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .news.run {
    animation-name: nwUp;
  }
  .run .nw-roll {
    animation: none;
  }
}

/* ---- phones: one column, the awards one under another ---- */
@media (max-width: 640px) {
  .news-ov {
    padding: 8px;
  }
  .news {
    padding: 8px;
  }
  .nw-paper {
    padding: 6px 8px 0;
  }
  .nw-strip {
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.08em;
  }
  .nw-date {
    font-size: 12px;
  }
  .nw-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .nw-pic {
    height: 130px;
    margin-left: 10px;
  }
  .nw-burst {
    width: 78px;
    height: 78px;
    left: -14px;
    bottom: -14px;
  }
  .nw-burst span {
    font-size: 14px;
  }
  .nw-rib {
    padding: 8px 28px;
    font-size: 16px;
  }
  .nw-emp {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }
  .nw-map {
    width: min(100%, 280px);
    justify-self: center;
  }
  .nw-call {
    margin-top: 8px;
    padding: 10px;
  }
  .nw-calltext b {
    font-size: 18px;
  }
  .nw-calltext i {
    font-size: 14px;
  }
  .nw-bm,
  .nw-bs {
    min-height: 44px;
  }
  .nw-bm {
    flex: 1 1 100%;
    font-size: 19px;
  }
  .nw-bs {
    flex: 1 1 0;
    padding: 0 10px;
    font-size: 15px;
  }
}
/* the game's phone layout starts pop-ups below the money bar (mobile.css): the paper fits under it */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  #game:not(.hidden) ~ #modalRoot .news {
    max-height: calc(100dvh - 110px);
  }
}
