@import url('https://fonts.googleapis.com/css2?family=Gajraj+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@100;900&family=Paytone+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

:root {
  --card-font-scale: 0.8;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: Helvetica, sans-serif;
  color: black;
  background-color: #f4f4f4;
  overflow:hidden;
  -webkit-tap-highlight-color:rgba(16,27,30,0)
}

a {
  color: #000;
}

p {
  display: inline;
}

mark {
  color: red;
  background-color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1, h2 {
  font-family: 'Arial', sans-serif;
  font-size: calc(10 * 1vw);
  /* font-size: calc(12px + 6vw); */
  line-height: 1em;
  color: rgba(32, 39, 70, 0.9);
  text-align: center;
}

.card-div-full {
  user-select: none;
  display: block;
  color: white;
  margin-right: 1%;
  margin-left: 1%;
  text-align: center;
  vertical-align: middle;
}

/* .card-div {
  display: grid;
  grid-template-columns: 50% 50%;
  align-items: center;
} */

.card-item {
  flex: 50%;
  text-align: center;
}

img {
  width: 30%;
}

.sizeable {
  transition: transform 0.9s ease-in-out, opacity 0.7s ease-in-out, font-size 0.5s ease-in-out;
  font-size: calc(var(--card-font-scale, 1) * 5vw);
  /* transform: translateX(100%) scale(1.1); */
}

.shuffleButton, .inOrderButton, .toggleSidesButton {
  font-family: 'Paytone One', sans-serif;
  /* font-family: 'Gajraj One'; */
  font-size: calc(8px + 1vw);
  border: 1px solid black;
  border-radius: 5px;
  cursor: pointer;
  display: inline;
  top: 2%;
  float: right;
  margin-top: 20px;
  margin-right: 10px;
  user-select: none;
  z-index: 3;
  width: 9%;
}

.flashcard-text .choice {
  display: inline-block;
  color: white;
  font-size: clamp(
    0.9rem,
    calc(var(--card-text-size, 1em) * 0.35),
    4rem
  );
  line-height: 1.3;
  background-color: rgb(27, 149, 48);
  padding: 0.4em 1em;
  min-width: 100px;
  margin-right: 2vw;
  margin-left: 2vw;
  margin-top: 10vh;
  border-radius: 3vw;
}

.fullScreenButton {
  position: fixed;
  display: inline;
  float: right;
  right: 2%;
  bottom: 2%;
  font-family: 'Paytone One', sans-serif;
  font-size: calc(8px + 1vw);
  border: none;
  cursor: pointer;
  user-select: none;
  z-index: 3;
  width: 2.5%;
  transition: all .5s ease-in-out;
}

.fullScreenButtonImage, .shuffleButton, .inOrderButton, .toggleSidesButton {
  transition: transform .15s ease-in-out;
}

.fullScreenButtonImage:hover, .shuffleButton:hover, .inOrderButton:hover, .toggleSidesButton:hover {
  transform: scale(1.3);
}

.control-menu__footer {
  border-top: 1px solid #e5e7eb;
  margin-top: 12px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.control-menu__timer {
  margin-top: 12px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.control-menu__section {
  margin-top: 12px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.control-menu__timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.control-menu__timer-label {
  font-family: 'Paytone One', sans-serif;
  font-size: 0.95rem;
  color: #111827;
}

.control-menu__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.control-menu__section-label {
  font-family: 'Paytone One', sans-serif;
  font-size: 0.95rem;
  color: #111827;
}

.control-menu__timer-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'Paytone One', sans-serif;
  color: #374151;
  font-size: 0.85rem;
  flex: 1;
}

.timer-input input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Paytone One', sans-serif;
  width: 100%;
  box-sizing: border-box;
  min-width: 110px;
}

.timer-input input:focus {
  outline: 2px solid #31AFD4;
  border-color: #31AFD4;
}

.number-input {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: stretch;
  gap: 8px;
}

.number-input input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.number-input input[type=number]::-webkit-inner-spin-button,
.number-input input[type=number]::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.number-input__button {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  font-family: 'Paytone One', sans-serif;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-input__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  border-color: #31AFD4;
}

.number-input__button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: .3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: #31AFD4;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.control-menu {
  position: fixed;
  top: 0;
  right: 14px;
  z-index: 100;
  display: flex;
  gap: 8px;
  align-items: center;
}

.control-menu__trigger {
  font-family: 'Paytone One', sans-serif;
  font-size: 0.95rem;
  padding: 10px 12px 12px;
  border-radius: 0 0 12px 12px;
  border: 1px solid #d1d5db;
  border-top: none;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  min-width: 48px;
}

.control-menu__trigger::before,
.control-menu__trigger::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
  margin: 0 auto;
  position: relative;
}

.control-menu__trigger::before {
  box-shadow: 0 6px 0 #111827;
  top: 2px;
}

.control-menu__trigger::after {
  top: 8px;
}

.control-menu__trigger:hover {
  transform: translateY(2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
  border-color: #31AFD4;
}

.control-menu__trigger--muted {
  background: #f5f5f5;
  color: #9ca3af;
  border-color: #e5e7eb;
  box-shadow: none;
  transition: none;
}

.control-menu__trigger--muted:hover {
  transform: none;
  box-shadow: none;
  border-color: #e5e7eb;
}

.favorite-star {
  width: 48px;
  padding: 10px 0;
  text-align: center;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #9ca3af;
  font-family: 'Paytone One', sans-serif;
  font-size: 1.4rem;
  cursor: pointer;
  outline: none;
  appearance: none;
}

.favorite-star:focus,
.favorite-star:focus-visible,
.favorite-star:focus-within {
  outline: none;
  box-shadow: none;
}

.favorite-star--active {
  color: #fbbf24;
}

.control-menu__panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(260px, 80vw);
  min-width: 220px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@supports (height: 100dvh) {
  .control-menu__panel {
    max-height: calc(100dvh - 80px);
  }
}

.control-menu__set-info {
  padding: 12px;
  margin-bottom: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.control-menu__set-title {
  font-family: 'Paytone One', sans-serif;
  font-size: 1rem;
  color: #111827;
  line-height: 1.2;
}

.control-menu__set-count {
  margin-top: 4px;
  font-family: 'Paytone One', sans-serif;
  font-size: 0.9rem;
  color: #6b7280;
}

.control-menu__panel.open {
  display: block;
  animation: menu-pop 0.18s ease;
}

@keyframes menu-pop {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.control-menu .shuffleButton,
.control-menu .toggleSidesButton,
.control-menu #start {
  float: none;
  display: block;
  width: 100%;
  margin: 0 0 10px 0;
  text-align: left;
  padding: 10px 12px;
}

.control-menu__panel button:last-child {
  margin-bottom: 0;
}

.teams-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.teams-count {
  flex: 1;
  text-align: center;
  font-family: 'Paytone One', sans-serif;
  font-size: 1rem;
  color: #111827;
  padding: 10px 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.teams-stepper-button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  font-family: 'Paytone One', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teams-stepper-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  border-color: #31AFD4;
}

.teams-stepper-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.card-timer {
  font-family: 'Orbitron', monospace;
  position: fixed;
  top: 5px;
  left: 14px;
  transform: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  color: #2d8000;
  border: none;
  outline: none;
  box-shadow: none;
  min-width: 72px;
  text-align: center;
  font-size: 1.3rem;
  z-index: 7;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.card-timer--alert {
  background: transparent;
  border: none;
  color: #b00000;
}

.flashcard-timeout {
  background: transparent;
  border: none;
}

body.timeout-active {
  background: #b00000;
  color: #ffffff;
}

body.timeout-active .flashcard,
body.timeout-active .flashcard .sizeable {
  color: #ffffff;
}

body.timeout-active .flashcard .thumb-button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

body.timeout-active .flashcard .thumb-button.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

body.timeout-active .card-hint {
  color: #ffffff;
}

body.timeout-active #wrapper,
body.timeout-active #card-div {
  background: transparent;
}

body.timeout-active .card-timer,
body.timeout-active .card-timer--alert {
  background: transparent;
  border: none;
  color: #ffffff;
}

body.timeout-shake {
  animation: violent-shake 0.15s infinite;
}

@keyframes violent-shake {
  0% { transform: translate(0); }
  10% { transform: translate(-14px, -6px) rotate(-2deg); }
  20% { transform: translate(12px, 8px) rotate(2deg); }
  30% { transform: translate(-16px, 10px) rotate(-3deg); }
  40% { transform: translate(14px, -10px) rotate(3deg); }
  50% { transform: translate(-12px, 6px) rotate(-2deg); }
  60% { transform: translate(10px, -8px) rotate(2deg); }
  70% { transform: translate(-8px, 4px) rotate(-1deg); }
  80% { transform: translate(6px, -6px) rotate(1deg); }
  90% { transform: translate(-4px, 4px) rotate(-1deg); }
  100% { transform: translate(0); }
}

.drip-overlay {
  display: block;
  box-sizing: border-box;
  position: fixed;
  top: -15px;
  right: 0;
  bottom: -15px;
  left: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
}

.drip-hidden {
  transition: opacity 2s;
  opacity: 0;
}

.drip-overlay line {
  stroke: white;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.font-size-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.font-size-button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  font-family: 'Paytone One', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-size-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.font-size-label {
  flex: 1;
  text-align: center;
  font-family: 'Paytone One', sans-serif;
  font-size: 1rem;
  color: #111827;
  padding: 10px 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  position: relative;
  padding: 0 0;
}

#card-div {
  opacity: 1;
  transition: opacity 0.25s, transform 1s;
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  touch-action: none;
}


@keyframes slide-out {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-100%);
  }
  50.1% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(0);
  }
}


#card-div.slide-card-out {
  animation: slide-out .5s forwards;
}

#card-div.slide-card-out-reverse {
  animation: slide-out .5s reverse;
}






@keyframes slide-down-out-in {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(120vh);
  }
  51% {
    transform: translateY(-120vh);
  }
  100% {
    transform: translateY(0);
  }
}


@keyframes slide-up-out-in {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-120vh);
  }
  51% {
    transform: translateY(120vh);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes slide-left-out-in {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-120vw);
  }
  51% {
    transform: translateX(120vw);
  }
  100% {
    transform: translateX(0);
  }
}

#card-div.flip-card,
#card-div.flip-card-up {
  animation: none;
}

.flashcard--no-image .flashcard-text.flip-card,
.flashcard--no-image .flashcard-text.flip-card-up {
  animation: slide-down-out-in .5s forwards;
}

.flashcard--has-image .flashcard-text.flip-card,
.flashcard--has-image .flashcard-text.flip-card-up {
  animation: slide-left-out-in .5s forwards;
}

/* button {
  padding: 10px 20px;
  font-size: 20px;
} */


/* Slider CSS */

/* input[type=range] {
-webkit-appearance: none;
margin: 10px 0;
width: 100%;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 12.8px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
background: #007bff;
border-radius: 25px;
border: 0px solid #000101;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 0px solid #000000;
height: 20px;
width: 39px;
border-radius: 7px;
background: #fff;
cursor: pointer;
box-shadow: 0px 0px 5px rgb(143, 143, 143);
-webkit-appearance: none;
margin-top: -3.6px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #007bff;
}

body {
padding: 30px;
text-transform: capitalize;} */

.flashcard {
  --card-font-scale-adjusted: var(--card-font-scale, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.1rem;
  width: 90vw; max-width: 1400px;
  max-width: 100%;
  margin: 0 auto;
  max-height: calc(100vh - 2rem);
  overflow: visible;
}

.flashcard .flashcard-text {
  --card-text-size: calc(var(--card-font-scale-adjusted, var(--card-font-scale, 1)) * 10vw);
  font-family: 'Arial', sans-serif;
  font-size: var(--card-text-size);
  line-height: 1.1;
  color: rgba(32, 39, 70, 0.9);
  text-align: center;
  margin: 0;
  width: 100%;
  flex: 0 0 auto;
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.flashcard .flashcard-text p,
.flashcard .flashcard-text ul,
.flashcard .flashcard-text ol,
.flashcard .flashcard-text blockquote,
.flashcard .flashcard-text pre,
.flashcard .flashcard-text table {
  margin: 0.35em auto;
}

.flashcard .flashcard-text ul,
.flashcard .flashcard-text ol,
.flashcard .flashcard-text blockquote,
.flashcard .flashcard-text pre,
.flashcard .flashcard-text table {
  display: inline-block;
  text-align: left;
}

.flashcard .flashcard-text ul,
.flashcard .flashcard-text ol {
  padding-left: 1.4em;
}

.flashcard .flashcard-text li + li {
  margin-top: 0.15em;
}

.flashcard .flashcard-text blockquote {
  border-left: 4px solid #d4e3ff;
  background: #f6f8ff;
  border-radius: 10px;
  padding: 0.35em 0.75em;
}

.flashcard .flashcard-text code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: #f2f4f8;
  border-radius: 6px;
  padding: 0.15em 0.35em;
  font-size: clamp(0.65rem, calc(var(--card-text-size) * 0.5), 1.4rem);
}

.flashcard .flashcard-text pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  padding: 0.75em 1em;
  border: 1px solid #dbeafe;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-x: auto;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.18);
}

.flashcard .flashcard-text h1,
.flashcard .flashcard-text h2,
.flashcard .flashcard-text h3,
.flashcard .flashcard-text h4,
.flashcard .flashcard-text h5,
.flashcard .flashcard-text h6 {
  margin: 0.2em 0;
  line-height: 1.1;
}

.flashcard .flashcard-text h1 { font-size: 1.15em; }
.flashcard .flashcard-text h2 { font-size: 1.08em; }
.flashcard .flashcard-text h3 { font-size: 1.02em; }
.flashcard .flashcard-text h4 { font-size: 0.96em; }
.flashcard .flashcard-text h5 { font-size: 0.92em; }
.flashcard .flashcard-text h6 { font-size: 0.88em; }

.flashcard .flashcard-text hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 0.6em auto;
  width: 60%;
}

.flashcard .flashcard-text table {
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

.flashcard .flashcard-text th,
.flashcard .flashcard-text td {
  border: 1px solid #e5e7eb;
  padding: 0.35em 0.65em;
}

.flashcard .flashcard-text th {
  background: #f3f5f9;
  font-weight: 700;
}

.flashcard-text--timeout-fade {
  animation: timeout-answer-fade 1.4s ease forwards;
}

@keyframes timeout-answer-fade {
  0% { opacity: 1; }
  45% { opacity: 0; }
  100% { opacity: 1; }
}

.flashcard--has-image {
  --card-font-scale-adjusted: clamp(
    0,
    calc(var(--card-font-scale, 1) - 0.4),
    2
  );
}

.flashcard--no-image {
  --card-font-scale-adjusted: clamp(
    0,
    calc(var(--card-font-scale, 1) - 0.2),
    2
  );
  justify-content: center;
  align-self: center;
  min-height: 60vh;
}

.flashcard__image-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
  background: #fff;
  flex: 0 0 auto;
}

.flashcard__image-wrap img {
  width: 100%;
  height: auto;
  max-height: min(880px, 70vh);
  object-fit: contain;
  display: block;
  background: transparent;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.thumb-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Paytone One', sans-serif;
  color: #222;
}

.thumb-button span {
  font-size: 0.9rem;
}

.thumb-button:hover {
  transform: translateY(-2px);
  box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.12);
}

.thumb-button.active {
  color: #fff;
  border-color: transparent;
}

.thumb-button.thumb-known.active {
  background: #22c55e;
}

.thumb-button.thumb-unknown.active {
  background: #ef4444;
}

.card-hint {
  text-align: center;
  margin-top: 10px;
  color: #4b5563;
  font-size: 0.95rem;
}
