/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */

:root {
  --font-family-system: "Twemoji Country Flags", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: #fff;
  font-family: var(--font-family-system);
}

.page__main {
  flex-grow: 1;
  margin-top: 1rem;
}

.page__container {
  width: 100%;
  max-width: 42rem;
  margin-right: auto;
  margin-left: auto;
}

/* Hide the triangle that appears next to the summary text */
details#language-switcher > summary {
  list-style: none;
}
/* Webkit browsers (Chrome, Safari, newer Edge) */
details#language-switcher > summary::-webkit-details-marker {
  display: none;
}
/* Firefox */
details#language-switcher > summary::marker {
  display: none;
}
/* Legacy Edge/IE (though Edge now uses Webkit) */
details#language-switcher > summary::-o-details-marker {
  display: none;
}
/* For older Firefox versions */
details#language-switcher > summary::-moz-list-bullet {
  list-style-type: none;
}

details summary {
  cursor: pointer;
}

.flag-index__thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 8rem;
  background-color: #fff;
}

.flag-index__image-box {
  display: flex;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background-color: #fff;
}

.flag-index__thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.flag-trait-links__grid {
  display: grid;
  row-gap: 2rem;
  column-gap: 3rem;
}

@media (min-width: 640px) {
  .flag-trait-links__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.flag-trait-links__swatches {
  display: inline-flex;
  height: 0.75rem;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  vertical-align: middle;
}

.flag-trait-links__swatch {
  display: block;
  width: 0.75rem;
  height: 0.75rem;
  border-right: 1px solid #e5e7eb;
}

.flag-trait-links__swatch:last-child {
  border-right: 0;
}

.flagmatch-engine {
  --flagmatch-board-width: min(100%, 37.5rem);
  --flagmatch-ink: #111827;
  --flagmatch-muted: #71717a;
  --flagmatch-line: #e5e7eb;
  --flagmatch-green: #65a30d;
  --flagmatch-cyan: #0ea5e9;
  --flagmatch-gold: #f59e0b;
  --flagmatch-red: #ef4444;
  width: min(calc(100vw - 2rem), 52rem);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
  color: var(--flagmatch-muted);
  letter-spacing: 0;
}

.flagmatch-canvas {
  display: none;
}

.flagmatch-playfield {
  position: relative;
  min-height: 38rem;
  height: auto !important;
  padding: clamp(0.875rem, 2.4vw, 1.25rem);
  overflow: visible !important;
  isolation: isolate;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none;
  color: var(--flagmatch-muted) !important;
  transform: translateZ(0);
}

.flagmatch-playfield::before,
.flagmatch-playfield::after {
  display: none;
  content: none;
}

.flagmatch-canvas {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}

.flagmatch-playfield > :not(.flagmatch-canvas):not([data-game-target="tapToStart"]):not([data-victory-target="overlay"]) {
  position: relative;
  z-index: 3;
}

.flagmatch-playfield > [data-game-target="tapToStart"],
.flagmatch-playfield > [data-victory-target="overlay"] {
  position: absolute !important;
  inset: 0 !important;
  z-index: 50 !important;
}

.flagmatch-playfield > .flex,
.flagmatch-playfield > .mt-4,
.flagmatch-playfield > [data-streak-target="combo"] {
  max-width: var(--flagmatch-board-width);
  margin-left: auto;
  margin-right: auto;
}

.flagmatch-engine--webgl-board:not(.flagmatch-engine--playing) .flagmatch-playfield > :not(.flagmatch-canvas):not([data-game-target="tapToStart"]):not([data-victory-target="overlay"]),
.flagmatch-engine--webgl-board.flagmatch-engine--paused .flagmatch-playfield > :not(.flagmatch-canvas):not([data-game-target="tapToStart"]):not([data-victory-target="overlay"]),
.flagmatch-engine--webgl-board.flagmatch-engine--finished .flagmatch-playfield > :not(.flagmatch-canvas):not([data-game-target="tapToStart"]):not([data-victory-target="overlay"]) {
  opacity: 0 !important;
  pointer-events: none;
}

.flagmatch-engine .flagmatch-progress [role="progressbar"] {
  height: 0.5rem !important;
  border: 0;
  background: #d4d4d4 !important;
  box-shadow: none;
}

.flagmatch-engine [data-progressbar-target="progress"] {
  background: var(--flagmatch-green) !important;
  box-shadow: none;
  transition: width 420ms ease;
}

.flagmatch-engine [data-timer-target="timer"] {
  color: var(--flagmatch-green);
  text-shadow: none;
}

.flagmatch-engine [data-action*="game#exit"],
.flagmatch-engine [data-action*="mute#toggle"],
.flagmatch-engine [data-game-target="hintButton"] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flagmatch-engine [data-game-target="hintButton"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 6.25rem;
  flex-shrink: 0;
  margin-right: 2px;
  overflow: visible;
  border: 1px solid #c7d2fe !important;
  border-bottom-width: 2px !important;
  border-radius: 0.75rem !important;
  color: #1e3a8a !important;
  background: #eef2ff !important;
  box-shadow: none;
  font-weight: 400;
  transition: transform 120ms ease, background-color 160ms ease;
}

.flagmatch-engine [data-game-target="hintButton"]:hover {
  background: #e0e7ff !important;
}

.flagmatch-engine [data-action*="game#exit"] svg,
.flagmatch-engine [data-action*="mute#toggle"] svg {
  color: var(--flagmatch-muted) !important;
  filter: none;
}

.flagmatch-engine [data-game-target="hintButton"]:active {
  transform: translateY(1px) scale(0.98);
}

.flagmatch-board {
  position: relative;
  width: 100%;
  max-width: var(--flagmatch-board-width) !important;
  gap: 0.7rem !important;
  margin-bottom: 0.75rem !important;
  perspective: 900px;
}

.flagmatch-tile {
  --flagmatch-energy: 0;
  --flagmatch-match-delay: 0ms;
  position: relative;
  min-width: 0;
  height: 4.5rem !important;
  overflow: hidden;
  border-radius: 8px !important;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-shadow: none;
  backface-visibility: hidden;
  contain: layout paint style;
  transform: none;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
  will-change: transform, opacity;
}

.flagmatch-tile.transition-opacity {
  transition-property: opacity !important;
}

.flagmatch-tile.duration-\[800ms\] {
  transition-duration: 800ms !important;
}

.flagmatch-tile.duration-300 {
  transition-duration: 300ms !important;
}

.flagmatch-tile.delay-700 {
  transition-delay: 700ms !important;
}

.flagmatch-tile.ease-in-out {
  transition-timing-function: ease-in-out !important;
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile {
  border: 1px solid #d1d5db !important;
  border-bottom-width: 4px !important;
  color: #111827 !important;
  background: #fff !important;
  box-shadow: none;
}

.flagmatch-tile::before,
.flagmatch-tile::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile::before {
  display: none;
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile::after {
  border-radius: 8px;
  box-shadow: 0 0 calc(var(--flagmatch-energy) * 12px) rgba(14, 165, 233, 0.16);
}

.flagmatch-tile:not([data-unclickable]):not(.is-disabled):not(.is-clearing):hover {
  transform: none;
}

.flagmatch-tile[data-unclickable],
.flagmatch-tile.is-disabled,
.flagmatch-tile.is-clearing {
  cursor: default !important;
  pointer-events: none;
}

.flagmatch-tile.is-selected {
  animation: flagmatchSelect 220ms ease-out;
  transform: none;
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile.is-selected {
  color: #78350f !important;
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  box-shadow: none;
}

.flagmatch-tile.is-hinting {
  animation: flagmatchHint 920ms ease-in-out infinite;
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile.is-hinting {
  color: #083344 !important;
  border-color: #06b6d4 !important;
  background: #ecfeff !important;
}

.flagmatch-tile.is-matched {
  animation: flagmatchMatch 680ms ease-out var(--flagmatch-match-delay);
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile.is-matched {
  color: #052e16 !important;
  border-color: #22c55e !important;
  background: #ecfdf5 !important;
  box-shadow: none;
}

.flagmatch-tile.is-clearing {
  pointer-events: none;
}

.flagmatch-tile.is-mismatched {
  animation: flagmatchMismatch 260ms ease-in-out;
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile.is-mismatched {
  color: #7f1d1d !important;
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.flagmatch-tile.is-entering {
  animation: flagmatchTileIn 360ms cubic-bezier(0.2, 0.9, 0.25, 1);
}

.flagmatch-engine:not(.flagmatch-engine--canvas-board) .flagmatch-tile.is-disabled {
  color: #64748b !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  box-shadow: none;
  opacity: 0.56 !important;
  transform: none;
}

.flagmatch-engine--canvas-board .flagmatch-tile {
  border-color: transparent !important;
  transform: none !important;
  animation: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  text-shadow: none !important;
}

.flagmatch-engine--canvas-board .flagmatch-tile::before,
.flagmatch-engine--canvas-board .flagmatch-tile::after {
  display: none !important;
}

.flagmatch-engine--webgl-board[data-game-quiz-value="quizzes/flags"] .flagmatch-tile[data-side="key"] {
  font-size: 1.125rem !important;
}

.flagmatch-engine--webgl-board[data-game-quiz-value="quizzes/flags"] .flagmatch-tile[data-side="lookup"] {
  font-size: 3.35rem !important;
}

.flagmatch-engine [data-game-target="tapToStart"],
.flagmatch-engine [data-victory-target="overlay"] {
  border-radius: 8px !important;
  background-color: rgba(17, 24, 39, 0.72) !important;
  background-blend-mode: multiply;
  color: #fff;
}

.flagmatch-engine--webgl-board [data-game-target="tapToStart"] {
  background-color: rgba(17, 24, 39, 0.72) !important;
  background-blend-mode: multiply;
  color: #fff !important;
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] {
  background-color: rgba(17, 24, 39, 0.36) !important;
  background-blend-mode: multiply;
}

.flagmatch-engine--webgl-board [data-game-target="tapToStart"] > div {
  opacity: 1 !important;
}

.flagmatch-engine [data-game-target="tapToStart"]::before,
.flagmatch-engine [data-victory-target="overlay"]::before {
  display: none;
  content: none;
}

.flagmatch-engine [data-game-target="tapToStart"] > div,
.flagmatch-engine [data-victory-target="overlay"] > div {
  position: relative;
  z-index: 1;
}

.flagmatch-engine [data-game-target="tapToStart"] .bg-black,
.flagmatch-engine [data-victory-target="overlay"] .bg-black {
  background: rgba(17, 24, 39, 0.76) !important;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.28);
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] > .bg-black {
  width: min(100%, 38rem) !important;
  margin-top: 0;
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1rem, 4vw, 3rem) !important;
  border: 0;
  border-radius: 0.5rem;
  background: rgba(17, 24, 39, 0.76) !important;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.28);
  backdrop-filter: none;
  pointer-events: auto;
  animation: none;
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] .mt-4 {
  pointer-events: auto;
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] .space-y-4 {
  pointer-events: auto;
}

.flagmatch-engine [data-victory-target="overlay"] ul > li > div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] ul > li {
  animation: none;
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] ul > li:nth-child(2) {
  animation-delay: 80ms;
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] ul > li:nth-child(3) {
  animation-delay: 150ms;
}

.flagmatch-engine--webgl-board [data-victory-target="overlay"] [data-action*="victory#restart"],
.flagmatch-engine--webgl-board [data-victory-target="overlay"] button,
.flagmatch-engine--webgl-board [data-victory-target="overlay"] a {
  pointer-events: auto;
}

.flagmatch-engine--paused .flagmatch-playfield {
  filter: saturate(0.82);
}

@keyframes flagmatchSelect {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-3px) scale(1.025);
  }
}

@keyframes flagmatchHint {
  0%, 100% {
    transform: translateY(-1px) scale(1.005);
  }
  50% {
    transform: translateY(-3px) scale(1.02);
  }
}

@keyframes flagmatchMatch {
  0% {
    transform: scale(1);
  }
  42% {
    transform: translateY(-7px) scale(1.055) rotateX(7deg);
  }
  100% {
    transform: translateY(-2px) scale(1.01);
  }
}

@keyframes flagmatchMismatch {
  0%, 100% {
    transform: translateX(0);
  }
  22% {
    transform: translateX(-7px) rotate(-1deg);
  }
  48% {
    transform: translateX(6px) rotate(1deg);
  }
  74% {
    transform: translateX(-3px);
  }
}

@keyframes flagmatchTileIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  transform: none;
  color: inherit;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-canvas {
  display: none !important;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-playfield {
  min-height: 0;
  height: 38rem !important;
  padding: 0;
  overflow: hidden !important;
  isolation: auto;
  border: 0;
  border-radius: 0.5rem !important;
  background: transparent;
  box-shadow: none;
  color: #71717a !important;
  transform: none;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-playfield > :not(.flagmatch-canvas):not([data-game-target="tapToStart"]):not([data-victory-target="overlay"]) {
  position: static;
  z-index: auto;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  opacity: 1 !important;
  pointer-events: auto;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-playfield > [data-game-target="tapToStart"],
.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-playfield > [data-victory-target="overlay"] {
  position: absolute !important;
  inset: 0 !important;
  z-index: 50 !important;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-progress [role="progressbar"] {
  height: 0.5rem !important;
  border: 0;
  background: #d4d4d4 !important;
  box-shadow: none;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) [data-progressbar-target="progress"] {
  background: #84cc16 !important;
  transition: width 500ms ease-out;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) [data-timer-target="timer"] {
  color: inherit;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) [data-game-target="hintButton"] {
  display: block;
  min-width: 0;
  margin-right: 0;
  border-color: #c7d2fe !important;
  border-radius: 0.75rem !important;
  background: #eef2ff !important;
  transition: opacity 100ms ease;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) [data-game-target="tapToStart"],
.flagmatch-engine:not(.flagmatch-engine--webgl-board) [data-victory-target="overlay"] {
  border-radius: 0.5rem !important;
  background-color: #f3f4f6 !important;
  background-blend-mode: normal;
  color: inherit;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) [data-game-target="tapToStart"] .bg-black,
.flagmatch-engine:not(.flagmatch-engine--webgl-board) [data-victory-target="overlay"] .bg-black {
  box-shadow: none;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-board {
  width: auto;
  max-width: none !important;
  column-gap: 1rem !important;
  row-gap: 0.5rem !important;
  margin-bottom: 120px !important;
  perspective: none;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-tile {
  height: 4.5rem !important;
  border-radius: 0.75rem !important;
  line-height: normal;
  text-shadow: none;
  contain: none;
  transform: none !important;
  transition: inherit;
  will-change: auto;
  animation: none !important;
  box-shadow: none !important;
}

.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-tile::before,
.flagmatch-engine:not(.flagmatch-engine--webgl-board) .flagmatch-tile::after {
  display: none !important;
}

@media (max-width: 640px) {
  .flagmatch-engine--webgl-board {
    width: calc(100% + 2rem);
    margin-left: -1rem;
    transform: none;
  }

  .flagmatch-playfield {
    min-height: 40rem;
    height: auto !important;
    padding: 0 1rem;
  }

  .flagmatch-board {
    gap: 0.5rem !important;
  }

  .flagmatch-tile {
    height: 4.65rem !important;
    padding: 0.7rem !important;
  }

  .flagmatch-engine--webgl-board[data-game-quiz-value="quizzes/flags"] .flagmatch-tile[data-side="key"] {
    font-size: 1rem !important;
  }

  .flagmatch-engine--webgl-board[data-game-quiz-value="quizzes/flags"] .flagmatch-tile[data-side="lookup"] {
    font-size: 2.65rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flagmatch-tile {
    transition-duration: 1ms !important;
  }

  .flagmatch-tile.is-selected,
  .flagmatch-tile.is-hinting,
  .flagmatch-tile.is-matched,
  .flagmatch-tile.is-mismatched,
  .flagmatch-tile.is-entering {
    animation: none !important;
  }
}
