/* The children's maps (public/images-enfants.js, src/carte/enfants.ts): the same maps and borders as a picture book, in
   the drawer of the children's tab only, loaded after carte.css. Brighter colours, a sea of waves, a rounder and larger
   letter, the emblems of the powers, the pictures of the places, a pin on the place chosen, a compass rose. */

.carte-enfants {
  --carte-land: #fbeac2;
  --carte-sea: #84cdea;
  --carte-wave: #e9f7fd;
  --carte-beyond: #efe3c4;
  --carte-coast: #2a78a8;
  --carte-river: #3a92d8;
  --carte-water-ink: #135890;
  --carte-desert-ink: #9a5a14;
  --carte-region-ink: #47301f;
  --carte-halo: #fffaf0;
  --carte-border: #7a4f2e;
  --carte-red: #f0603f;
  --carte-gold: #f4b628;
  --carte-green: #5cbf3f;
  --carte-blue: #5b5bd6;
  --carte-purple: #b45fd8;
  --carte-teal: #1fb7a6;
  --carte-brown: #c98a4b;
  --carte-rose: #f0679f;
  --carte-fill: 1;
  /* How strong the colour of who rules is. */
  --k-tint: 0.42;
  --carte-scale: 1.2;
  /* A letter of children's books, the same on every device; the device's round one while it loads. */
  --carte-font: 'Fredoka', var(--rounded);
}

/* The map at night: a deep sea, the same bright pictures. */
:root[data-theme='dark'] .carte-enfants {
  --carte-land: #3d3326;
  --carte-sea: #1b4a78;
  --carte-wave: #5f9fd8;
  --carte-beyond: #141826;
  --carte-coast: #6fb4ea;
  --carte-river: #5fa8e0;
  --carte-water-ink: #b4dcff;
  --carte-desert-ink: #f2c27a;
  --carte-region-ink: #f6e6cb;
  --carte-halo: #2a231a;
  --carte-border: #e6c79c;
  --carte-red: #ff7a5c;
  --carte-gold: #ffc847;
  --carte-green: #7ed65f;
  --carte-blue: #8f8cff;
  --carte-purple: #d08af0;
  --carte-teal: #3fd1bf;
  --carte-brown: #dca46a;
  --carte-rose: #ff8ab8;
  --carte-fill: 1;
  --k-tint: 0.6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .carte-enfants {
    --carte-land: #3d3326;
    --carte-sea: #1b4a78;
    --carte-wave: #5f9fd8;
    --carte-beyond: #141826;
    --carte-coast: #6fb4ea;
    --carte-river: #5fa8e0;
    --carte-water-ink: #b4dcff;
    --carte-desert-ink: #f2c27a;
    --carte-region-ink: #f6e6cb;
    --carte-halo: #2a231a;
    --carte-border: #e6c79c;
    --carte-red: #ff7a5c;
    --carte-gold: #ffc847;
    --carte-green: #7ed65f;
    --carte-blue: #8f8cff;
    --carte-purple: #d08af0;
    --carte-teal: #3fd1bf;
    --carte-brown: #dca46a;
    --carte-rose: #ff8ab8;
    --carte-fill: 1;
    --k-tint: 0.6;
  }
}

/* A frame of two lines around the map, as on a treasure map. */
.carte-enfants .carte-frame::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  box-shadow:
    inset 0 0 0 3px var(--carte-brown),
    inset 0 0 0 5px var(--carte-halo),
    inset 0 0 0 6.5px var(--carte-brown);
  pointer-events: none;
}

/* Who rules: bolder colours, borders like stitches (dashes of some length: a dash of almost nothing, round, stalls the
   drawing of a wide view). */
.carte-enfants .carte-regions path {
  fill-opacity: var(--k-tint);
}

.carte-enfants .carte-outer {
  stroke-width: 2.2px;
  stroke-opacity: 0.9;
}

.carte-enfants .carte-inner {
  stroke-width: 1.8px;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
  stroke-opacity: 0.8;
}

/* The coast, drawn as with a felt pen; waves on the open sea (k-wave). */
.carte-enfants :is(.carte-sea, .carte-lakes) {
  stroke-width: 1.8px;
}

.carte-enfants .carte-rivers {
  stroke-width: 2.2px;
  stroke-linecap: round;
}

/* The journey of a scene: footsteps. */
.carte-enfants .carte-route {
  stroke-width: 6px;
  stroke-dasharray: 1.5 9;
}

.carte-enfants .carte-route-halo {
  stroke-width: 10px;
  stroke-dasharray: 1.5 9;
  stroke-linecap: round;
}

/* The names, in the letter of the children, all half bold, as public/carte.js measures them, with a thick halo. */
.carte-enfants .carte-labels text,
.carte-enfants .carte-labels text:is(.is-marked, .is-chosen) {
  font-family: var(--carte-font);
  font-weight: 600;
  stroke-width: 4px;
}

.carte-enfants .carte-labels :is(.l-eau, .l-fleuve, .l-desert, .l-sub, .l-district, .l-ile) {
  font-style: normal;
}

/* The emblems of the powers, in their round badge: on the map, in the legend. */
.carte-enfants :is(.k-badge, .k-emblem) circle {
  fill: var(--carte-halo);
  stroke-width: 2.5px;
}

.carte-enfants .k-badge {
  cursor: pointer;
}

.carte-enfants .k-emblem {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}

/* The note's places glow under their picture; the one chosen has a pin, which hops. */
.carte-enfants .k-glow {
  fill: #f1e5d0;
  fill-opacity: 0.45;
  stroke: var(--carte-marked);
  stroke-width: 2px;
}

.carte-enfants .k-glow.is-chosen {
  fill: #ffe066;
  fill-opacity: 0.75;
  stroke: var(--frise-scene);
  stroke-width: 2.5px;
}

.carte-enfants .k-pin {
  --kid-pin-fill: var(--frise-scene);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: k-hop 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .carte-enfants .k-pin {
    animation: none;
  }
}

/* The period, with its picture, and the legend: in the letter of the names. */
.carte-enfants :is(.carte-period, .carte-legend, .carte-info) {
  font-family: var(--carte-font);
  font-size: 0.85rem;
}

/* The picture of the period at the left of its name and dates, as high as both, the three centred together. */
.carte-enfants .carte-period-option {
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
}

.carte-enfants .k-period {
  grid-row: span 2;
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.3rem;
}

.carte-enfants .carte-legend li {
  gap: 0.35rem;
}

/* The compass rose, at the bottom right, over the source. */
.carte-enfants .k-rose {
  position: absolute;
  z-index: 1;
  right: 0.5rem;
  bottom: 1.6rem;
  width: 3.4rem;
  height: 3.8rem;
  pointer-events: none;
  font-family: var(--carte-font);
}

@media (max-width: 40rem) {
  .carte-enfants .k-rose {
    width: 2.6rem;
    height: 2.9rem;
  }

  .carte-enfants :is(.carte-period, .carte-legend) {
    font-size: 0.75rem;
  }
}

/* The pin of the buttons of the drawer, red as the timeline's (frise-enfants.css). */
.carte-enfants .frise-mark-pin path {
  fill: #e8453c;
}

.carte-enfants .frise-mark-pin circle {
  fill: #fff;
}
