:root {
  --color-text: #fff;
  --color-bg: #2d2431;
  --color-bg-secondary: #423847;
  --color-text-secondary: #615e81;
  --color-text-tertiary: #7b90bd;
  --color-border: #f0f0f0;
  --color-accent: #d49e24;
  --game-correct: #44b44f;
  --game-incorrect: #c40001;
}

.colorblind-mode {
  --game-correct: #0085ff;
  --game-incorrect: #ffb82e;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

* {
  font-family: "EB Garamond", serif;
}

p {
  font-size: 32px;
}

h1 {
  font-family: "Gill Sans", sans-serif;
}

a {
  font-family: "Gill Sans", sans-serif;
  text-decoration: none;
  color: var(--color-text-tertiary);
  font-size: 32px;
}

hr {
  border: var(--color-text-tertiary) solid 2px;
  width: 270px;
}

a:hover {
  text-decoration: none;
  color: var(--color-accent);
}

i:hover {
  cursor: pointer;
}

.form-font {
  color: var(--color-text-tertiary);
  font-size: 32px;
}

input {
  width: 350px;
  height: 60px;
  border: none;
  border-radius: 4px 0 0 4px;
}

input:focus {
  outline: none;
}

.white-btn {
  background-color: white;
  border-radius: 0 4px 4px 0;
  border: none;
}

.white-btn:focus {
  outline: none;
}

.white-btn:hover {
  color: var(--color-accent);
}

.blue-btn {
  background-color: var(--color-text-tertiary);
  font-family: "Gill Sans", sans-serif;
  color: white;
  padding: 0;
  width: 340px;
  height: auto;
  line-height: normal;
  border: none;
}

.blue-btn-small {
  width: 250px;
}

.blue-btn:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

.btn-font {
  font-family: "Gill Sans", sans-serif;
  font-size: 25px;
}

.link {
  color: var(--color-text-tertiary);
  outline: none;
  border: none;
  background-color: transparent;
}

.link:hover {
  color: var(--color-accent);
}

.mm-btn {
  position: relative;
}

.mm-btn:hover p {
  display: none;
}

.mm-btn[data-hover-text]::before {
  content: attr(data-hover-text);
  color: var(--color-bg);
  background-color: var(--color-accent);
  position: absolute;
  border-radius: 0.3rem;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.mm-btn[data-hover-text]:hover::before {
  opacity: 1;
}

button:focus {
  outline: none;
}

ul {
  list-style-type: none;
}

.character-img-lg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.character-img-wizard {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.img-container {
  width: 100px;
  height: 100px;
  padding: 0;
  background-color: var(--color-bg-secondary);
  border-radius: 6px;
}

.category-img-container {
  width: 100px;
  height: 100px;
  border: var(--color-accent) 3px solid;
  padding: 0;
  background-color: var(--color-bg-secondary);
  border-radius: 4px;
}

.color-container {
  width: 94px;
  height: 94px;
  padding: 0;
  background-color: var(--color-bg-secondary);
  border-radius: 6px;
}

.category-box {
  border: var(--color-accent) 3px solid;
  width: 100px;
  height: 100px;
  border-radius: 4px;
  padding: 0;
}

.results-category-box {
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  padding: 0;
}

.legend-box {
  z-index: 0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  padding: 0;
}

.search-options {
  background-color: rgb(240, 240, 240, 90%);
  width: 100%;
  border-radius: 4px;
}

/* stylelint-disable selector-class-pattern -- react-select BEM class names */
.character-select__option {
  cursor: pointer;
  transition: background-color 60ms ease;
}

.character-select__option:hover,
.character-select__option--is-focused {
  background-color: var(--color-accent) !important;
  color: var(--color-text) !important;
}

.character-select__menu-list:hover .character-select__option--is-focused:not(:hover) {
  background-color: transparent !important;
  color: var(--color-bg) !important;
}

.character-select__option--is-selected {
  background-color: var(--color-text-tertiary) !important;
  color: var(--color-text) !important;
}

.character-select__option .row {
  pointer-events: none;
  background-color: transparent;
}
/* stylelint-enable selector-class-pattern */

.btn-absolute {
  position: absolute;
  right: 1px;
  bottom: 1px;
}

.overlay {
  position: absolute;
  top: 50%;
  left: 2.4px;
  width: 94px;
  transform: translateY(-50%);
  background-color: rgb(123, 144, 189, 56%);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}

.td-font {
  font-size: 1rem;
  margin: 0;
}

.error-font {
  color: var(--game-incorrect);
  font-size: x-large;
}

.legend-container {
  width: 325px;
  border: solid 2px var(--color-accent);
}

.results-table-container {
  max-width: 100%;
  box-sizing: border-box;
}

.results-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.results-td {
  width: auto;
}

.results-tr {
  min-width: auto;
}

table {
  table-layout: fixed;
  width: 100%;
  min-width: 300px;
  height: auto;
}

tr {
  width: 100%;
  min-width: 960px;
}

th {
  padding: 0.25rem;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: large;
  text-align: center;
}

td {
  padding: 0.25rem;
}

td.show {
  opacity: 1;
}

.guess-cell.revealed {
  opacity: 1;
}

.guess-cell.animating {
  opacity: 0;
  animation: guess-reveal 0.3s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.5s);
}

th,
td {
  width: 115px;
}

.green {
  background-color: var(--game-correct);
}

.red {
  background-color: var(--game-incorrect);
}

.yellow {
  background-color: var(--color-accent);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  width: 10px;
  background-color: var(--color-text-secondary);
  border-radius: 4px;
  background-clip: padding-box;
}

/* Custom Scrollbar */
.scroll-container {
  min-width: 300px;
  max-width: 980px;
  height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  border: solid 2px var(--color-accent);
}

.scroll-btn-font {
  color: rgb(123, 144, 189, 56%);
  font-size: 1rem;
  letter-spacing: 0.5px;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
}

.scroll-buttons {
  display: flex;
  justify-content: space-between;
  position: relative;
  min-width: calc(100% - 50px);
}

.scroll-arrow-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.chart-view-toggle-container {
  display: none;
}

.chart-view-toggle-btn {
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  font-size: 1.75rem;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  line-height: 1;
}

.chart-view-toggle-btn:hover,
.chart-view-toggle-btn:focus,
.chart-view-toggle-btn:active {
  color: var(--color-text-tertiary);
  outline: none;
}

.chart-view-toggle-btn i {
  color: var(--color-text-tertiary);
}

.chart-view-toggle-btn:hover i,
.chart-view-toggle-btn:focus i,
.chart-view-toggle-btn:active i {
  color: var(--color-text-tertiary);
}

.scroll-btn-container-hidden {
  display: none !important;
}

.scroll-container-fit {
  overflow-x: hidden;
}

.scroll-container-fit tr {
  min-width: 100%;
}

.scroll-container-fit th,
.scroll-container-fit td {
  width: 12.5%;
  padding: 0.1rem;
}

.scroll-container-fit th {
  font-size: 0.7rem;
  line-height: 1.15;
  padding: 0.15rem 0.05rem;
}

.scroll-container-fit td .position-relative {
  position: relative;
  width: 100%;
  max-width: 52px;
  aspect-ratio: 1;
  margin: 0 auto;
}

.scroll-container-fit .category-box,
.scroll-container-fit .category-img-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border-width: 2px;
  box-sizing: border-box;
  overflow: hidden;
}

.scroll-container-fit .overlay:not(.overlay-full) {
  top: 50%;
  left: 50%;
  width: calc(100% - 6px);
  height: auto;
  transform: translate(-50%, -50%);
  border-radius: 2px;
  box-sizing: border-box;
  padding: 1px;
}

.scroll-container-fit .overlay.overlay-full {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  border-radius: 3px;
  box-sizing: border-box;
  padding: 1px;
}

.scroll-container-fit .td-font {
  font-size: 0.72rem;
  line-height: 1.15;
  word-break: break-word;
  text-align: center;
  hyphens: auto;
}

.guesses-font {
  color: white;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 20px;
}

.blue-font {
  color: var(--color-text-tertiary);
}

.green-font {
  color: var(--game-correct);
}

.yellow-font {
  color: var(--color-accent);
}

.red-font {
  color: var(--game-incorrect);
}

.results-container {
  border: var(--color-accent) solid;
  background-color: rgb(240, 240, 240, 20%);
  max-width: 600px;
}

.hidden {
  opacity: 0;
}

.show {
  position: relative;
  animation-name: guess;
  animation-duration: 0.25s;
}

@keyframes guess-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes guess {
  0% {
    opacity: 5%;
    right: 0;
    bottom: 20px;
  }

  25% {
    opacity: 10%;
    right: 0;
    bottom: 15px;
  }

  50% {
    opacity: 25%;
    right: 0;
    bottom: 10px;
  }

  100% {
    opacity: 100%;
    right: 0;
    bottom: 0;
  }
}

/* Loading.css */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-spinner {
  animation: spin 1.75s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.modal-overlay {
  position: absolute;
  height: 100vh;
  width: 100%;
  background-color: rgb(45, 36, 49, 75%);
  z-index: 1000;
}

.modal-content-box {
  background-color: #f0f0f0;
  border-radius: 4px;
  height: auto;
}

.modal-font {
  color: var(--color-bg);
  font-size: 21px;
}

.modal-position {
  position: absolute;
  top: 40%;
  z-index: 1005;
}

.modal-btn {
  width: 150px;
  color: white;
  font-size: 25px;
  border: none;
}

.modal-btn:hover {
  color: var(--color-bg);
}

.modal-btn:focus {
  outline: none;
}

.count-down {
  font-size: 45px;
}

.count-down-details {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  color: white;
  font-size: 20px;
}

.count-down-details.yellow-font {
  color: var(--color-accent);
}

.yellow-instructions {
  font-size: 20px;
  color: var(--color-text-tertiary);
  max-width: 480px;
  border: solid 2px var(--color-accent);
  border-radius: 4px;
}

.font-sub {
  font-size: 15px;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  color: var(--color-accent);
}

/* Navbar */
.navbar-custom {
  background-color: var(--color-text-tertiary);
  color: var(--color-text);
  padding: 0;
  overflow: visible;
}

.navbar.navbar-custom > .navbar-container {
  display: grid;
  grid-template-columns: minmax(2.75rem, 1fr) auto minmax(2.75rem, 1fr);
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}

.navbar-custom .navbar-brand {
  margin: 0;
  padding: 0;
  justify-self: center;
  max-width: 100%;
}

.navbar-brand img {
  display: block;
  max-width: min(100%, 320px);
  max-height: 48px;
  width: auto;
  height: auto;
}

.navbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.settings-btn {
  position: relative;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.settings-btn:focus {
  outline: none;
}

.settings-btn:hover {
  color: var(--color-accent);
}

.tooltip-trigger {
  position: relative;
  display: inline-flex;
}

.tooltip-popup {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.6rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  font-family: "Gill Sans", sans-serif;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.tooltip-popup-above {
  bottom: calc(100% + 0.5rem);
}

.tooltip-popup-below {
  top: calc(100% + 0.5rem);
}

.tooltip-trigger:hover .tooltip-popup,
.tooltip-trigger:focus-within .tooltip-popup {
  opacity: 1;
  visibility: visible;
}

/* Settings Modal */
.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(45, 36, 49, 75%);
  z-index: 2000;
}

.settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 2rem));
  background-color: var(--color-bg-secondary);
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  padding: 1.25rem 1.5rem 1.5rem;
  z-index: 2001;
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-modal-title {
  font-family: "Gill Sans", sans-serif;
  font-size: 1.75rem;
  color: var(--color-text);
  margin: 0;
}

.settings-modal-close {
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 1.5rem;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}

.settings-modal-close:focus {
  outline: none;
}

.settings-modal-close:hover {
  color: var(--color-accent);
}

.settings-modal-divider {
  border: none;
  border-top: 1px solid var(--color-text);
  width: 100%;
  margin: 0.75rem 0 1.25rem;
}

.settings-modal-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-modal-icon {
  font-size: 1.25rem;
  color: var(--color-text);
}

.settings-modal-label {
  flex: 1;
  font-family: "Gill Sans", sans-serif;
  font-size: 1.25rem;
  color: var(--color-text);
  margin: 0;
}

.settings-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border: none;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.settings-toggle:focus {
  outline: none;
}

.settings-toggle.off {
  background-color: var(--color-text-tertiary);
}

.settings-toggle.on {
  background-color: var(--color-accent);
}

.settings-toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background-color: var(--color-text);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.settings-toggle.on .settings-toggle-slider {
  transform: translateX(24px);
}

.win-confetti {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
}

.win-confetti-piece {
  position: absolute;
  top: -12%;
  line-height: 1;
  animation-name: win-confetti-burst;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}

@keyframes win-confetti-burst {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translate3d(var(--drift, 0), 115vh, 0) rotate(var(--spin, 360deg));
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .win-confetti {
    display: none;
  }
}

@media only screen and (max-width: 500px) {
  .navbar-brand img {
    max-width: min(calc(100vw - 6.5rem), 220px);
    max-height: 40px;
  }
}
