:root {
  --shadow-strong: 0 8px 0 0 rgba(0, 0, 0, 0.12);
  --shadow-strong-active: 0 4px 0 0 rgba(0, 0, 0, 0.12);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: "Lexend", system-ui, sans-serif;
}

button, .tap {
  touch-action: manipulation;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 40;
  user-select: none;
}

/* Tactile block-shadow buttons */
.btn-tactile {
  position: relative;
  border-bottom-width: 8px;
  transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              border-bottom-width 0.1s ease,
              box-shadow 0.1s ease;
}
.btn-tactile:active:not(:disabled) {
  transform: translateY(4px);
  border-bottom-width: 4px;
}

.tactile-card {
  box-shadow: 0 8px 0 0 rgba(0, 0, 0, 0.08);
}

.module-tile-blue { box-shadow: 0 10px 0 0 #004494; }
.module-tile-blue:active { transform: translateY(6px); box-shadow: 0 4px 0 0 #004494; }
.module-tile-yellow { box-shadow: 0 10px 0 0 #b59700; }
.module-tile-yellow:active { transform: translateY(6px); box-shadow: 0 4px 0 0 #b59700; }
.module-tile-green { box-shadow: 0 10px 0 0 #165200; }
.module-tile-green:active { transform: translateY(6px); box-shadow: 0 4px 0 0 #165200; }
.module-tile-blue, .module-tile-yellow, .module-tile-green {
  transition: transform 0.1s, box-shadow 0.1s;
}

/* Answer flash animations */
@keyframes flash-correct {
  0%   { background-color: var(--c-from); transform: scale(1); }
  30%  { background-color: #298600; transform: scale(1.06); }
  100% { background-color: var(--c-from); transform: scale(1); }
}
@keyframes flash-wrong {
  0%   { background-color: var(--c-from); transform: translateX(0); }
  20%  { background-color: #ba1a1a; transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { background-color: var(--c-from); transform: translateX(0); }
}
.flash-correct { animation: flash-correct 0.45s ease-out; }
.flash-wrong   { animation: flash-wrong 0.45s ease-out; }

/* Decorative blobs */
#bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.deco-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(60px);
  opacity: 0.25;
}
.deco-blob-1 {
  width: 480px; height: 480px;
  background: #d8e2ff;
  bottom: -160px; left: -160px;
}
.deco-blob-2 {
  width: 320px; height: 320px;
  background: #ffe171;
  top: -80px; right: -80px;
}

/* Tightening for shorter iPad heights */
@media (max-height: 800px) {
  .h-pad-sm { padding-top: 0.75rem; padding-bottom: 0.75rem; }
}

/* Helper: prevent text selection on big numbers */
.no-select { user-select: none; }

/* Fade-in for screen mounts */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen-enter { animation: fade-in 0.2s ease-out; }

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  border-radius: 9999px;
  background: #e1e3e4;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px; height: 32px;
  border-radius: 9999px;
  background: #0058bd;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 0 0 #004494;
  cursor: pointer;
}
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
