:root {
  --vh: 1vh;
  --flag-offset: 100vw;
}

.gaming-page body {
  background-color: rgb(34, 133, 142);
}

.gaming-page #footer {
  display: none;
}

#game {
  position: relative;
  padding: 36px 27px 135px 27px;
  height: 100%;
  box-sizing: border-box;
  background: rgb(33,152,120);
  background: linear-gradient(180deg, rgba(33,152,120,0.8) 35%, rgba(33,124,152,0.8) 100%);
  background-attachment: fixed;
  overflow: hidden;
  min-height: 100vh; /* Fallback for browsers that do not support Custom Properties */
  min-height: calc((var(--vh, 1vh) * 100) - var(--header-height));
}

.no-header #game {
  min-height: calc((var(--vh, 1vh) * 100));
}

#game .flag-scores .flag-score:focus,
#game button:focus {
  outline: none !important;
}

#game .flag-scores .flag-score,
#game button {
  -webkit-tap-highlight-color: transparent !important;
}

.game-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  left: 0;
  padding: 27px 27px 27px 27px;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  gap: 9px;
}

.game-nav #game-level-name {
  display: block;
  transform: scale(1.2);
  transform-origin: right bottom;
  font-family: var(--secondary-font);
  font-size: 14px;
  color: rgba(223, 242, 237, 0.65);
  font-weight: 500;
  margin: auto 0 auto auto;
}

.game-nav #game-level-name:empty {
  display: none;
}

#game-level-name-template {
  display: none;
}

.nav-button {
  color: rgba(223, 242, 237, 0.65);
  z-index: 10;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--secondary-font);
  border: 2px solid rgba(223, 242, 237, 0.65);
  border-radius: 18px;
  padding: 5px 14px;
  user-select: none;
  -webkit-user-drag: none;
  cursor: pointer;
  transition: all 250ms;
  background: linear-gradient(180deg, rgb(33 131 144) 35%, rgb(33 131 143) 100%);
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-button:hover {
  opacity: 1;
  color: #dff2ed;
  border-color: #dff2ed;
}

#game-signup-btn {
  margin-left: auto;
}

#game[data-page="title_screen"] #game-menu-btn {
  transition: none;
  pointer-events: none;
  opacity: 0;
}

#game-level-name .challenge-details {
  font-size: 18px;
  text-transform: uppercase;
}

#game-level-name .challenge-title {
  max-width: 35vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8em;
  text-transform: uppercase;
  font-weight: 600;
}

#game-level-name .challenge-category {
  margin-bottom: -1px;
}

.flag-slide-ctn {
  position: relative;
  margin-top: 18px;
  text-align: center;
  height: 36px;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.flag-slide-ctn .flag-slide {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes slide-carousel {
  0% {
      opacity: 0;
  }
  10%, 30% {
      transform: translateX(0) translateY(0);
      opacity: 1;
  }
  40% {
      opacity: 0;
  }
  100% {
      opacity: 0;
      transform: translateX(100px) translateY(-100px);
  }
}

.flag-slide .flag-icon {
  width: 36px;
  height: auto;
  margin: 0 4px;
  display: inline-block;
  animation: wave 1.6s ease-in-out infinite;
}

.flag-slide .flag-icon .bi {
  font-size: 2.5em;
  color: #ffed22;
}

.flag-slide .flag-icon .empty-star {
  color: rgba(255, 255, 255, 0.31);
}

.flag-slide .flag-icon svg {
  border-radius: 2px;
  max-height: 24px;
}

.flag-slide .flag-icon svg.noborder {
  border-radius: 0;
}

.flag-slide .flag-icon:nth-child(1) {
    animation-delay: 0s;
}
.flag-slide .flag-icon:nth-child(2) {
    animation-delay: 0.2s;
}
.flag-slide .flag-icon:nth-child(3) {
    animation-delay: 0.4s;
}
.flag-slide .flag-icon:nth-child(4) {
    animation-delay: 0.6s;
}
.flag-slide .flag-icon:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes wave {
    0%, 100% {
        filter: brightness(1);
        transform: translateY(0);
    }
    50% {
        filter: brightness(1.1);
        transform: translateY(-5px);
    }
}

#flags {
  font-family: var(--secondary-font);
  text-align: center;
}

.flag {
  max-width: 420px;
  margin: 0 auto;
}

.flag.player-selected .loading-bar,
.flag.player-selected .flag-object {
  animation-play-state: paused !important;
}

#flags h1 {
  color: #FFF;
  font-size: 3.6em;
  font-weight: 600;
  margin: 36px 0 0 0;
  text-wrap: balance;
}

html[lang="fr"] #title-screen h1 {
  font-size: 3.15em;
}

#flags h1 strong {
  font-weight: 800;
}

#flags h2 {
  color: #FFF;
  font-size: 1.4em;
  margin: 0;
  font-family: var(--primary-font);
  text-wrap: balance;
}

html[lang="es"] #title-screen h2 {
  font-size: 1.28em;
}

h2.game-score {
  font-weight: 300;
}

h2.game-score .game-score-title {
  font-weight: 400;
}

h2.game-score .game-score-int {
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2.game-score i {
  font-style: normal;
  font-size: 0.8em;
  font-weight: 300;
}

.flag-credit {
  color: rgba(255, 255, 255, 0.88);
  margin-top: 27px;
  font-size: 0.75em;
  text-wrap: balance;
}

.flag-credit a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: underline;
}

h1.game-over {
  text-transform: uppercase;
  letter-spacing: -3px;
  transform: rotate(-0.5deg);
}

.leaderboard-wrapper {
  position: relative;
  z-index: 5;
}

#flags .leaderboard-wrapper h2 {
  font-size: 1.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.leaderboard-wrapper .view-all {
  color: #FFFFFF;
  text-transform: uppercase;
  text-align: right;
  width: 100%;
  display: block;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 25px;
}

.leaderboard-wrapper .leaderboard {
  overflow-y: auto;
  max-height: calc(100vh - 412px);
  min-height: 200px;
  margin-top: 14px;
  padding-right: 4px;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  scrollbar-width: thin;

  /* fade at the bottom */
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 4px), transparent 100%);
  mask-image: linear-gradient(to bottom, black calc(100% - 4px), transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.leaderboard-wrapper .leaderboard.scroll-end {
  -webkit-mask-image: none;
  mask-image: none;
  -webkit-mask-size: auto;
  mask-size: auto;
}

.leaderboard-wrapper .leaderboard-header,
.leaderboard-wrapper .leaderboard-player,
.leaderboard .item {
  border: 2px solid transparent;
  margin: 0 0 4px 0;
  color: #FFFFFF;
  font-family: var(--secondary-font);
  font-weight: 600;
  font-size: 1em;
  align-items: center;
  border-radius: 18px;
  text-align: left;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 24px;

  display: grid;
  grid-template-columns: 50px 1fr 80px;
  gap: 10px;
  padding: 8px;
}

.leaderboard-wrapper .leaderboard-header {
  margin: 0;
  color: #ffffff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 5px 4px rgba(0, 0, 0, 0.2);
}

.leaderboard-wrapper .leaderboard-player {
  margin: 10px 0 0 0;
  border: 2px solid #ffffff;
}

.leaderboard-wrapper .leaderboard::-webkit-scrollbar {
  background: transparent;
  width: 8px;
}

.leaderboard-wrapper .leaderboard::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.leaderboard-wrapper .leaderboard::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

.leaderboard .item:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.2);
}

.leaderboard .item:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.1);
}

.leaderboard .item-header {
  text-transform: uppercase;
  background-color: rgba(21, 98, 77, 0.3);
}

.leaderboard .item .rank {
  border-radius: 100%;
}

.leaderboard-player .rank i,
.leaderboard .item .rank i {
  font-style: normal;
}

.leaderboard-player.top-rank,
.leaderboard .item.top-rank {
  padding: 6px 8px;
}

.leaderboard-player.top-rank i,
.leaderboard .item.top-rank i {
  display: inline-block;
  border-radius: 100%;
  width: 20px;
  border: 4px solid transparent;
  height: 20px;
  line-height: 20px;
}

.leaderboard-player.rank-1 .rank i,
.leaderboard .item.rank-1 .rank i {
  box-shadow: inset 0 0 0 #b67d05, 2px 2px 0 rgba(0, 0, 0, 0.08);
  border-color: #fadd40;
  text-shadow: 0 0 4px #9d6c04;
  background: linear-gradient(to bottom right, #f9ad0e 50%, #e89f06 50%);
}

.leaderboard-player.rank-2 .rank i,
.leaderboard .item.rank-2 .rank i {
  box-shadow: inset 0 0 0 #a7b2b8, 2px 2px 0 rgba(0, 0, 0, 0.08);
  border-color: #edeff1;
  text-shadow: 0px 0px 4px #98a6ad;
  background: linear-gradient(to bottom right, #d1d7da 50%, #c3cbcf 50%);
}

.leaderboard-player.rank-3 .rank i,
.leaderboard .item.rank-3 .rank i {
  box-shadow: inset 0 0 0 #955405, 2px 2px 0 rgba(0, 0, 0, 0.08);
  border-color: #f7bb23;
  text-shadow: 0 0 4px #7d4604;
  background: linear-gradient(to bottom right, #df7e08 50%, #c67007 50%);
}

.leaderboard .item.is-player {
  background-color: rgba(1,22,16,0.58);
}

@keyframes rankTease {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

.leaderboard-player .rank,
.leaderboard .rank {
  text-align: center;
}

.leaderboard-player .player,
.leaderboard .player {
  flex-grow: 1;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.leaderboard-player .username,
.leaderboard .username {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard .item .player .bi {
  color: #FFF;
}

.leaderboard-player .player-country img,
.leaderboard .player-country img {
  width: 18px;
  height: 12px;
  display: inline-block;
  vertical-align: baseline;
  border-radius: 2px;
  object-fit: cover;
}

.leaderboard-player [data-country="np"] img,
.leaderboard [data-country="np"] img {
  object-fit: none;
}

.leaderboard-player .score,
.leaderboard .score {
  text-align: center;
}

.leaderboard .item .score .bi {
  color: #FFFFFF;
  vertical-align: baseline;
}

.leaderboard-player .player-country:empty,
.leaderboard .player-country:empty {
  display: none;
}

/* Level 10+ (default) */
.fx-1 .flag-object { animation: flagBlur 2s ease forwards; }
.fx-2 .flag-object { animation: flagSlideL 5s ease forwards, flagRotate 4s ease forwards; }
.fx-3 .flag-object { animation: flagSlideR 5s ease forwards, flagRotate 4s ease forwards; }
.fx-4 .flag-object { animation: flagSpin 1s linear infinite }
.fx-5 .flag-object { animation: flagSpin 1s linear reverse infinite }
.fx-6 .flag-object { animation: flagSlideY 1s linear forwards; }
.fx-7 .flag-object { animation: flagZoomIn 5s ease-in-out forwards; }
.fx-8 .flag-object { animation: flagClipX 2.2s ease-in-out infinite; }
.fx-9 .flag-object { animation: flagClipY 3s ease-in-out infinite; }
.fx-10 .flag-object { animation: flagClipXY 5.25s ease-in-out infinite; }
.fx-11 .flag-object { animation: flagRocketTB 5.5s ease forwards, flagRotate 4s ease forwards; }
.fx-12 .flag-object { animation: flagSpin 0.8s linear infinite, flagClipXY 5.25s ease-in-out infinite; }

/* Level 20 */
.fx-2 .difficulty-2 .flag-object { animation: flagSlideL 4s ease forwards, flagRotate 3s ease forwards; }
.fx-3 .difficulty-2 .flag-object { animation: flagSlideR 4s ease forwards, flagRotate 3s ease forwards; }
.fx-4 .difficulty-2 .flag-object { animation: flagSpin 0.8s linear infinite; }
.fx-5 .difficulty-2 .flag-object { animation: flagSpin 0.8s linear reverse infinite; }
.fx-10 .difficulty-2 .flag-object { animation: flagClipXY 4.15s ease-in-out infinite; }
.fx-11 .difficulty-2 .flag-object { animation: flagRocketTB 4.5s ease forwards, flagRotate 3s ease forwards; }

/* Level 30 */
.fx-2 .difficulty-3 .flag-object { animation: flagSlideL 3s ease forwards, flagRotate 2s ease forwards; }
.fx-3 .difficulty-3 .flag-object { animation: flagSlideR 3s ease forwards, flagRotate 2s ease forwards; }
.fx-4 .difficulty-3 .flag-object { animation: flagSpin 0.6s linear infinite }
.fx-5 .difficulty-3 .flag-object { animation: flagSpin 0.6s linear reverse infinite }
.fx-8 .difficulty-3 .flag-object { animation: flagClipX 2s ease-in-out infinite; }
.fx-9 .difficulty-3 .flag-object { animation: flagClipY 2.2s ease-in-out infinite; }
.fx-10 .difficulty-3 .flag-object { animation: flagClipXY 3.4s ease-in-out infinite; }
.fx-11 .difficulty-3 .flag-object { animation: flagRocketTB 3.5s ease forwards, flagRotate 2s ease forwards; }

/* Level 40 */
.fx-2 .difficulty-4 .flag-object { animation: flagSlideL 2s ease forwards, flagRotate 1s ease forwards; }
.fx-3 .difficulty-4 .flag-object { animation: flagSlideR 2s ease forwards, flagRotate 1s ease forwards; }
.fx-4 .difficulty-4 .flag-object { animation: flagSpin 0.4s linear infinite }
.fx-5 .difficulty-4 .flag-object { animation: flagSpin 0.4s linear reverse infinite }
.fx-8 .difficulty-4 .flag-object { animation: flagClipX 2s ease-in-out infinite; }
.fx-9 .difficulty-4 .flag-object { animation: flagClipY 2s ease-in-out infinite; }
.fx-10 .difficulty-4 .flag-object { animation: flagClipXY 2.5s ease-in-out infinite; }
.fx-11 .difficulty-4 .flag-object { animation: flagRocketTB 2.5s ease forwards, flagRotate 1s ease forwards; }

/* Level 50 */
.fx-2 .difficulty-5 .flag-object { animation: flagSlideL 1s ease forwards, flagRotate 1s ease forwards; }
.fx-3 .difficulty-5 .flag-object { animation: flagSlideR 1s ease forwards, flagRotate 1s ease forwards; }
.fx-4 .difficulty-5 .flag-object { animation: flagSpin 0.32s linear infinite }
.fx-5 .difficulty-5 .flag-object { animation: flagSpin 0.32s linear reverse infinite }
.fx-7 .difficulty-5 .flag-object { animation: flagZoomIn 4s ease-in-out forwards; }
.fx-8 .difficulty-5 .flag-object { animation: flagClipX 1.8s ease-in-out infinite; }
.fx-9 .difficulty-5 .flag-object { animation: flagClipY 1.8s ease-in-out infinite; }
.fx-10 .difficulty-5 .flag-object { animation: flagClipXY 1.6s ease-in-out infinite; }
.fx-11 .difficulty-5 .flag-object { animation: flagRocketTB 1.8s ease forwards, flagRotate 1s ease forwards; }

/* Loading bar by levels */
.flag.level-1 .loading-bar { animation-duration: 10s; }
.flag.level-10 .loading-bar { animation-duration: 8s; }
.flag.level-20 .loading-bar { animation-duration: 6s; }
.flag.level-30 .loading-bar { animation-duration: 4s; }
.flag.level-40 .loading-bar { animation-duration: 3s; }
.flag.level-50 .loading-bar { animation-duration: 2.7s; }
.flag.level-60 .loading-bar { animation-duration: 2.4s; }
.flag.level-70 .loading-bar { animation-duration: 2.2s; }
.flag.level-80 .loading-bar { animation-duration: 2.0s; }
.flag.level-90 .loading-bar { animation-duration: 1.9s; }
.flag.level-100 .loading-bar { animation-duration: 1.8s; }
.flag.level-110 .loading-bar { animation-duration: 1.72s; }
.flag.level-120 .loading-bar { animation-duration: 1.64s; }
.flag.level-130 .loading-bar { animation-duration: 1.56s; }
.flag.level-140 .loading-bar { animation-duration: 1.48s; }
.flag.level-150 .loading-bar { animation-duration: 1.4s; }
.flag.level-160 .loading-bar { animation-duration: 1.32s; }
.flag.level-170 .loading-bar { animation-duration: 1.24s; }
.flag.level-180 .loading-bar { animation-duration: 1.16s; }
.flag.level-190 .loading-bar { animation-duration: 1.08s; }
.flag.level-200 .loading-bar { animation-duration: 1s; }

/* Level 0 (Practice) */
.flag.level-0 .loading-bar-container { display: none; }
.flag.level-0 .loading-bar { animation: none }

/* C101 */
.fx-101 .flag-object { animation: flagBlink 0.1s linear forwards; }

/* C102 */
.fx-102 .flag-object {
  filter: grayscale(1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fx-102 .flag-object svg {
  margin: 8px;
}

.fx-102 .flag-object:before {
  --d: 100px;
  --angle: 120deg;

  content: "";
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  z-index: 20;
  opacity: 0.3;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  margin: auto;

  background: repeating-linear-gradient(var(--angle), red, green, blue, green, red var(--d));
  background-size: calc(var(--d)/sin(var(--angle))) 100%;
  animation: TVWave 2s linear infinite reverse;
}

@keyframes TVWave {
  0% {
    background-position: calc(var(--d)/sin(var(--angle))) 0;
  }
}

/* C103 */
.fx-103 .flag {
  transform: scale(-1, -1);
}

.fx-103 .flag-scores {
  transform: scale(-1, -1);
}

.fx-103 #game-over .flag,
.fx-103 #game-over .flag-scores {
  transform: none;
}

/* C104 */
#game.fx-104 {
  background: linear-gradient(180deg, rgba(201, 141, 98, 0.9) 35%, rgba(33, 124, 152, 0.8) 100%);
}

.fx-104 .flag-object {
  animation: wavyHeat 3s ease-in-out infinite, heatWave 2s infinite linear;
}

.fx-104 .flag-object.flag-illusion {
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 1;
  zoom: 3;
  animation: wavyHeat 3s ease-in-out infinite, heatWave 2s infinite linear, illusionFadeOut 2s 1s forwards;
  scale: 1.05;
}

@keyframes illusionFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes heatWave {
  0% { transform: translateY(0) skewX(0deg); filter: blur(0px); }
  25% { transform: translateY(-1px) skewX(2deg); filter: blur(1.2px); }
  50% { transform: translateY(1px) skewX(-2deg); filter: blur(0.8px); }
  75% { transform: translateY(-0.6px) skewX(1.6deg); filter: blur(1.2px); }
  100% { transform: translateY(0) skewX(0deg); filter: blur(0px); }
}

@keyframes wavyHeat {
  0% { transform: perspective(400px) rotateY(0deg) skewY(0deg); }
  25% { transform: perspective(400px) rotateY(4deg) skewY(2deg); }
  50% { transform: perspective(400px) rotateY(-4deg) skewY(-2deg); }
  75% { transform: perspective(400px) rotateY(2deg) skewY(1deg); }
  100% { transform: perspective(400px) rotateY(0deg) skewY(0deg); }
}

/* C105 */
.fx-105 {
  animation: hueRotation 10s infinite;
}

@keyframes hueRotation {
  0% { filter: hue-rotate(30deg); }
  25% { filter: hue-rotate(165deg); }
  50% { filter: hue-rotate(330deg); }
  75% { filter: hue-rotate(165deg); }
  100% { filter: hue-rotate(30deg); }
}

/* C110 */
.fx-110 .flag .loading-bar { animation-duration: 1.2s; }

/* C117 */
.fx-117 .flag-object { animation: flagBlink 0.05s linear forwards; }

/* C118 */
.fx-118 .flag .loading-bar { animation-duration: 1.6s; }

/* Animations */
@keyframes back {
  from {
    background-size: 100% 100%;
  }
  to {
    background-size: 200% 200%;
  }
}

@keyframes flagBlur {
  0% {
    filter: blur(50px);
  }
  100% {
    filter: blur(0);
  }
}

@keyframes flagSlideL {
  0% {
    left: calc(-1 * var(--flag-offset));
  }
  60% {
    left: var(--flag-offset);
  }
  100% {
    left: calc(-1 * var(--flag-offset));
  }
}

@keyframes flagSlideR {
  0% {
    right: calc(-1 * var(--flag-offset));
  }
  60% {
    right: var(--flag-offset);
  }
  100% {
    right: calc(-1 * var(--flag-offset));
  }
}

@keyframes flagRocketTB {
  0% {
    position: relative;
    top: -100vh;
  }
  35% {
    position: relative;
    top: 250px;
  }
  90% {
    position: relative;
    top: 0;
  }
  100% {
    position: relative;
    top: -100vh;
  }
}

@keyframes flagRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(90deg);
  }
}

@keyframes flagSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes flagBlink {
  0% {
    visibility: visible;
  }
  100% {
    visibility: hidden;
  }
}

@keyframes flagSlideY {
  0% {
    position: relative;
    opacity: 0;
    top: -100vh;
  }
  60% {
    position: relative;
    top: 5vh;
    opacity: 0.1;
  }
  100% {
    position: relative;
    top: 0;
    opacity: 1;
  }
}

@keyframes flagZoomIn {
  0% {
    opacity: 0;
    position: relative;
    top: -90px;
    scale: 0.01;
  }
  15% {
    opacity: 1;
  }
  100% {
    position: relative;
    top: 0;
    left: 0;
    scale: 1;
  }
}

@keyframes flagClipX {
  0% {
    clip-path: inset(0 0 0 80%);
  }
  50% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0 0 80%);
  }
}

@keyframes flagClipY {
  0% {
    clip-path: inset(80% 0 0 0);
  }
  50% {
    clip-path: inset(0 0 80% 0);
  }
  100% {
    clip-path: inset(80% 0 0 0);
  }
}

@keyframes flagClipXY {
  0% {
    clip-path: inset(40% 0 0 70%);
  }
  25% {
    clip-path: inset(0 70% 40% 0);
  }
  50% {
    clip-path: inset(70% 40% 0 0);
  }
  75% {
    clip-path: inset(0 0 70% 40%);
  }
  100% {
    clip-path: inset(40% 0 0 70%);
  }
}

.flag .flag-object-wrapper {
  position: relative;
}

.flag .flag-object {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.flag .flag-object svg {
  max-height: 280px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.flag .flag-object svg.noborder {
  box-shadow: none;
  border-radius: initial;
}

.flag .choice {
  position: relative;
  background-color: #FFF;
  border: 2px solid transparent;

  color: #219878;
  width: 100%;
  padding: 10px 48px;
  margin-top: 18px;
  border-radius: 18px;
  font-family: var(--secondary-font);
  font-weight: 600;
  font-size: 1.3em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 75ms;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.3s ease forwards;
  z-index: 10;
}

.flag .choice[disabled] {
  cursor: default;
  color: #becfcb;
}

.flag .choice:not(.selected)[disabled] .bi-arrow-right {
  display: none;
}

.flag .flag-button {
  text-transform: uppercase;
  animation: none;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.flag .button-group {
  display: flex;
  gap: 9px;
}

.flag .button-group .flag-button {
  font-size: 1em;
  padding: 12px 4px;
}

.flag .button-help {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 9px;
  padding: 0 8px;
  font-size: 0.87em;
  letter-spacing: -0.25px;
  text-wrap: balance;
}

.flag .button-help strong {
  font-weight: 500;
}

.flag-button .help-text {
  display: block;
  text-transform: none;
  font-size: 0.7em;
  font-weight: 400;
  font-family: var(--primary-font);
  letter-spacing: -0.25px;
  margin-top: 4px;
  white-space: normal;
  text-wrap: balance;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.flag-choices button:nth-child(1) { animation-delay: 0.6s; }
.flag-choices button:nth-child(2) { animation-delay: 0.7s; }
.flag-choices button:nth-child(3) { animation-delay: 0.8s; }

.flag-choices.choices-count-4 button:nth-child(1) { animation-delay: 0.5s; }
.flag-choices.choices-count-4 button:nth-child(2) { animation-delay: 0.6s; }
.flag-choices.choices-count-4 button:nth-child(3) { animation-delay: 0.7s; }
.flag-choices.choices-count-4 button:nth-child(4) { animation-delay: 0.8s; }

.flag .choice.success,
.flag .choice.selected,
.flag .choice:not([disabled]):hover {
  background-color: #15624d;
  color: #fdfffe;
}

.flag .flag-choices .choice.success {
  background-color: #e53935;
  color: #fffcfc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  scale: 1.03;
}

.flag .choice .bi-arrow-right {
  opacity: 0;
  position: absolute;
  right: 32px;
  top: 12px;
  color: #FFF;
  transition: 150ms;
  z-index: 20;
}

.flag .flag-choices .choice.success .bi-arrow-right,
.flag .flag-choices .choice.error .bi-arrow-right {
  display: none;
}

.flag .choice[disabled] .bi-arrow-right,
.flag .choice.selected .bi-arrow-right,
.flag .choice:hover .bi-arrow-right {
  opacity: 1;
  right: 14px;
}

.flag .choice:not(.challenge) .bi-lock-fill {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.flag .choice:not([data-choice]) {
  cursor: default;
}

.flag .loading-bar-container {
  margin-top: 18px;
  width: 100%;
  height: 24px;
  background-color: #FFF;
  border-radius: 12px;
  border: 2px solid #FFF;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.flag .loading-bar {
  width: 100%;
  height: 100%;
  background: #219878;
  border-radius: 10px;
  animation: loading 5s linear forwards;
  animation-delay: 0.8s;
}

.flag .loading-text {
  position: absolute;
  top: 0;
  left: 0;
  text-align: center;
  width: 100%;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.87em;
  letter-spacing: -0.25px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  padding: 0 8px;
  box-sizing: border-box;
  text-shadow: 0 2px 4px rgb(6 26 20);
}

.flag .flag-scores {
  display: flex;
  justify-content: space-between;
  font-family: var(--secondary-font);
  font-weight: 600;
  font-size: 0;
  color: #FFF;
  margin-top: 10%;
  opacity: 0.92;
  white-space: nowrap;
  align-items: center;
}

.flag .flag-scores .flag-score {
  position: relative;
  display: inline-block;
  font-size: 17px;
  border: 2px solid #FFF;
  border-radius: 18px;
  padding: 5px 14px;
  user-select: none;
  -webkit-user-drag: none;
}

#title-screen .flag .flag-scores .flag-highscore {
  font-size: 15px;
  line-height: 20px;
}

.flag .flag-scores .flag-player .bi-dot {
  /* quick fix so the button is the same height as others */
  display: inline-block;
  width: 0;
  margin: 0;
  visibility: hidden;
}

.flag .flag-scores .flag-player,
.flag .flag-scores .flag-music,
.flag .flag-scores .flag-volume {
  margin-right: 7px;
}

.flag .flag-scores .flag-music,
.flag .flag-scores .flag-volume {
  cursor: pointer;
}

.flag .flag-scores .bi {
  margin-right: 2px;
}

.flag .flag-scores .flag-music .bi,
.flag .flag-scores .flag-volume .bi {
  margin-right: 0;
}

.flag .score-bubble {
  display: none;
  position: absolute;
  font-size: 2em;
  white-space: nowrap;
  text-shadow: 1px 1px 2px #15624d;
}

.flag .score-bubble.success {
  top: -10px;
  left: 60%;
  color: #FFF;
  animation: floatUpRight 1s forwards;
}

.flag .score-bubble.error {
  top: 8px;
  left: 50%;
  color: #e53935;
  animation: floatDownRight 1s forwards;
}

.game-options {
  margin-top: 27px;
  display: flex;
  justify-content: space-between;
}

.game-options .option-container {
  width: 48%;
}

.game-options .option-label {
  color: #FFF;
  font-weight: 500;
}

.game-options .option {
  color: #FFF;
  font-weight: 500;
  border: 2px solid #FFF;
  background-color: transparent;
  padding: 6px 18px;
  border-radius: 18px;
  margin-top: 5px;
}

.slick-slider .slick-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0;
  border: none;
  background: none;
  padding: 14px 8px;
  cursor: pointer;
  z-index: 10;
}

.slick-slider .slick-arrow::before {
  font-family: "bootstrap-icons", sans-serif;
  color: #FFF;
  font-size: 18px;
}

.slick-slider .slick-prev::before {
  content: "\F22D";
}

.slick-slider .slick-next::before {
  content: "\F231";
}

.slick-slider .slick-prev {
  left: 0;
  padding-right: calc(50% - 28px);
}

.slick-slider .slick-next {
  right: 0;
  padding-left: calc(50% - 28px);
}

@keyframes floatUpRight {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        transform: translateX(30px) translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateX(60px) translateY(-40px) scale(0);
    }
}

@keyframes floatDownRight {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        transform: translateX(30px) translateY(20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateX(60px) translateY(40px) scale(0);
    }
}

#game-mode-word h1 {
  max-width: 770px;
  margin: 0 auto;
}

#game-mode-word h1 > i {
  margin: 0 4px;
  font-style: normal;
}

#game-mode-word .flag .flag-button-object svg {
  pointer-events: none;
  max-height: 80px;
  border-radius: 8px;
}

#game-mode-word .flag .choices-count-4 .flag-button-object svg {
  max-height: 48px;
}

#game-mode-word .flag .flag-button-object svg.noborder {
  border-radius: initial;
}

#game-mode-word .flag .choice:not(.success) {
  background-color: rgba(108, 184, 164, 0.3);
  border: 2px solid transparent;
}

#game-mode-word .flag .choice:not([disabled]):hover {
  background-color: #15624d;
}

@media only screen and (max-width: 800px) {
  #game-mode-word h1 {
    font-size: 7vw;
  }

  .game-nav {
    background: linear-gradient(180deg, rgb(34 133 142 / 0%) 0, rgb(34 133 142) 33%);
    z-index: 100;
  }
}

#game-over .leaderboard-wrapper {
  opacity: 0;
  animation: 0.85s leaderboardSlide forwards;
  animation-delay: 0.2s;
}

#game-over .leaderboard-wrapper.prevent-animation {
  animation: none;
}

#game-over .leaderboard-wrapper .leaderboard {
  border-top: 0;
  overflow: visible;
  padding-right: 0;
  -webkit-mask-image: none;
  mask-image: none;
  -webkit-mask-size: auto;
  mask-size: auto;
}

#game-over .leaderboard .item.is-player {
  transform: scale(1.03);
  animation: rankTease 1.5s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.92);
}

#leaderboard .flag .choice.selected {
  border-color: #FFF;
}

.flag .challenge {
  margin-top: 9px;
  padding: 9px 38px;
  background: transparent;
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  display: grid;
  align-items: center;
  grid-template-columns: auto 72px;
}

.flag .challenge[disabled] {
  color: rgba(255, 255, 255, 0.56);
  border-color: rgba(255, 255, 255, 0.56);
}

.challenge .challenge-stars {
  display: block;
  letter-spacing: 1px;
}

.challenge .challenge-stars .bi {
  letter-spacing: -6px;
  line-height: 26px;
  display: inline-block;
}

.challenge .challenge-stars .bi:nth-child(1) { font-size: 0.8em; }
.challenge .challenge-stars .bi:nth-child(2) { font-size: 0.9em; }

.challenge .challenge-stars .bi-star-fill {
  color: #ffed22;
}

.challenge .challenge-stars .empty-star {
  color: rgba(255, 255, 255, 0.31);
}

.challenge .challenge-name {
  display: block;
  text-align: left;
}

.challenge .challenge-title {
  display: block;
  text-align: left;
}

.challenge .challenge-score {
  display: block;
  font-size: 0.7em;
}

.challenge .challenge-category {
  display: inline-block;
  font-size: 0.53em;
  transform: rotate(1deg);
  background: rgba(255, 255, 255, 0.92);
  color: #219878;
  width: max-content;
  border-radius: 18px;
  padding: 1px 6px;
  font-weight: 800;
  margin-right: 4px;
}

.challenge .challenge-category:last-child {
  margin-right: 0;
}

.flag .challenge[disabled] .challenge-category {
  background: transparent;
  color: rgba(255, 255, 255, 0.60);
  border: 2px solid rgba(255, 255, 255, 0.60);
}

.challenge .challenge-details {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.challenge .challenge-details .bi {
  font-size: 0.6em;
}

.challenge .challenge-difficulty-wrapper {
  display: flex;
  flex-direction: column;
}

.challenge .challenge-difficulty {
  display: flex;
  gap: 2px;
}

.challenge .challenge-difficulty-name {
  display: block;
  font-size: 0.45em;
  line-height: normal;
}

.challenge .challenge-difficulty i {
  background: rgba(255, 255, 255, 0.22);
  width: 12px;
  height: 3px;
}

.challenge .challenge-difficulty i:first-child {
  border-radius: 8px 0 0 8px;
}

.challenge .challenge-difficulty i:last-child {
  border-radius: 0 8px 8px 0;
}

.challenge .challenge-difficulty .fill {
  background: #FFF;
}

.flag .challenge[disabled] .challenge-difficulty i {
  border-color:  rgba(255, 255, 255, 0.60);
}

.flag .challenge[disabled] .challenge-difficulty .fill {
  border-color: transparent;
  background-color: rgba(255, 255, 255, 0.60);
}

.challenge .challenge-locked {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.challenge .challenge-locked .unlock-at {
  color: rgba(255, 255, 255, 0.41);
  font-size: 0.9em;
}

.challenge .challenge-locked .bi {
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.31);
  letter-spacing: -2px;
}

.challenge .challenge-stats {
  text-align: right;
}

.total-stars {
  display: inline-block;
}

.total-stars .flag-slide {
  letter-spacing: -4px;
  margin-bottom: -4px;
}

.total-stars .flag-slide .flag-icon {
  margin: 0;
  text-shadow: 1px 2px 0 #219778;
}

.total-stars .flag-slide .flag-icon:nth-child(2) {
  scale: 1.2;
}

.total-stars .stars .stars-count {
  color: #219878;
  background-color: #FFF;
  display: inline-block;
  text-align: center;
  width: 89px;
  font-size: 1.5em;
  font-weight: 600;
  border-radius: 27px;
  padding: 5px 0;
}

.total-stars .stars .stars-label {
  text-transform: uppercase;
  font-weight: 600;
  color: #FFF;
  font-size: 0.53em;
  margin-top: 5px;
}

#game-over .game-stars {
  margin-top: 5px;
}

#game-over .flag-slide .flag-icon {
  margin: 0 1px;
}

@keyframes leaderboardSlide {
  0% {
    position: relative;
    opacity: 0;
    top: -100vh;
  }
  60% {
    position: relative;
    top: 5vh;
  }
  100% {
    position: relative;
    top: 0;
    opacity: 1;
  }
}

@keyframes loading {
  0% {
    width: 100%;
    background: #219878;
  }
  25% {
    background: #1e9c71;
  }
  50% {
    background: #a2b342;
  }
  70% {
    background: #f1c232;
  }
  100% {
    width: 0;
    background: #e53935;
  }
}

@media only screen and (max-width: 540px) {
  #flags h1.challenge-unlocked {
    font-size: 10vw;
  }

  #flags h1 {
    font-size: 12vw;
  }

  #flags h2 {
    font-size: 4.7vw;
  }

  html[lang="fr"] #title-screen h1 {
    font-size: 9.8vw;
  }

  html[lang="fr"] #title-screen h2 {
    font-size: 4.3vw;
  }

  html[lang="es"] #title-screen h1 {
    font-size: 10.5vw;
  }

  html[lang="es"] #title-screen h2 {
    font-size: 3.8vw;
  }
}

@media only screen and (max-width: 480px) {
  .gaming-page.modal-open body {
    background-color: var(--background-color);
  }

  .flag .choice {
    font-size: 4.3vw;
  }

  .flag-button .help-text {
    font-size: 13px;
  }

  .flag .flag-object svg {
    max-height: 200px;
  }

  #game-mode-word h1 {
    font-size: 8vw;
  }

  #game-mode-word .flag .flag-button-object svg {
    max-height: 60px;
  }

  .game-options .option {
    font-size: 14px;
  }

  .flag .button-group .flag-button {
    font-size: 0.82em;
  }

  .leaderboard-wrapper .leaderboard-header,
  .leaderboard-wrapper .leaderboard-player,
  .leaderboard .item {
    font-size: 0.9em;
    grid-template-columns: 40px 1fr 70px;
    padding: 6px;
  }

  .leaderboard .item.top-rank {
    padding: 5px 6px;
  }

  .leaderboard .item.top-rank i {
    width: 18px;
    height: 18px;
    line-height: 18px;
  }
}

@media only screen and (max-width: 390px) {
  .game-nav #game-level-name,
  .nav-button {
    font-size: 3.6vw;
  }
}

@media only screen and (max-width: 360px) {
  .flag .flag-scores .flag-score {
    font-size: 3.9vw;
  }

  #title-screen .flag .flag-scores .flag-highscore {
    font-size: 3.9vw;
    line-height: 4.6vw;
  }
}

/* Clouds */

#cloud-wrap {
  background: rgb(33,152,120);
  bottom: 0;
  left: 0;
  padding-top: var(--header-height);
  position: fixed;
  right: 0;
  top: 0;
  z-index: -1;
  height: 100vh;
}

@keyframes animateCloud {
    0% {
        margin-left: -1000px;
    }
    100% {
        margin-left: 100%;
    }
}

.cloud-1 {
	animation: animateCloud 35s linear infinite;
	transform: scale(0.65);
}

.cloud-2 {
	animation: animateCloud 20s linear infinite;
	transform: scale(0.3);
}

.cloud-3 {
	animation: animateCloud 30s linear infinite;
	transform: scale(0.5);
}

.cloud-4 {
	animation: animateCloud 18s linear infinite;
	transform: scale(0.4);
}

.cloud-5 {
	animation: animateCloud 25s linear infinite;
	transform: scale(0.55);
}

.cloud {
	background: #fff;
	background: linear-gradient(to bottom, #fff 5%, #f1f1f1 100%);

	border-radius: 100px;
	box-shadow: 0 8px 5px rgba(0, 0, 0, 0.1);

	height: 120px;
	position: relative;
	width: 350px;
}

.cloud:after, .cloud:before {
  background: #fff;
  content: '';
  position: absolute;
  z-indeX: -1;
}

.cloud:after {
	border-radius: 100px;
	height: 100px;
	left: 50px;
	top: -50px;
	width: 100px;
}

.cloud:before {
	border-radius: 200px;
	width: 180px;
	height: 180px;
	right: 50px;
	top: -90px;
}

@media only screen and (max-width: 480px) {
  .cloud-1,
  .cloud-3 {
    visibility: hidden;
  }

  @keyframes animateCloud {
    0% {
      margin-left: -480px;
    }
    100% {
      margin-left: 100%;
    }
  }
}

/*#id_username {*/
/*  max-width: 300px;*/
/*  text-align: center;*/
/*  outline-color: var(--accent-color);*/
/*  font-weight: 600;*/
/*  color: var(--accent-color);*/
/*  font-size: 1.1em;*/
/*  border-radius: 18px;*/
/*  padding-right: 34px;*/
/*  padding-left: 34px;*/
/*}*/