/* ==========================================================================
   FzLingo Design System & Style Sheets
   Playful 3D language learning interface inspired by modern apps (Duolingo style)
   ========================================================================== */

:root {
  /* Colors */
  --color-primary-green: #58cc02;
  --color-primary-green-dark: #46a302;
  --color-primary-green-light: #a5ed5d;
  
  --color-primary-blue: #1cb0f6;
  --color-primary-blue-dark: #1899e8;
  --color-primary-blue-light: #84d8ff;

  --color-success-green: #58a700;
  --color-success-bg: #d7ffb8;
  --color-success-border: #8ee03f;
  
  --color-error-red: #ea2b2b;
  --color-error-dark: #c21d1d;
  --color-error-bg: #ffdfe0;
  --color-error-border: #ff9396;
  
  --color-yellow-xp: #ff9600;
  --color-yellow-xp-dark: #e68500;
  
  --color-slate: #3c3c3c;
  --color-slate-light: #777777;
  --color-border-gray: #e5e5e5;
  --color-border-gray-dark: #ccc;
  
  --color-bg-light: #fafafa;
  --color-bg-white: #ffffff;
  
  /* Fonts */
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
  
  /* Layout */
  --max-app-width: 600px;

  /* Default Active States Fallback */
  --color-active-bg: #e5f6fd;
  --color-active-border: #1899e8;
  --color-active-text: #1899e8;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  height: -webkit-fill-available;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-light);
  color: var(--color-slate);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.25s ease, font-family 0.25s ease;
}

/* App Container constraint */
.app-container {
  width: 100%;
  max-width: var(--max-app-width);
  height: 100%;
  height: -webkit-fill-available;
  background-color: var(--color-bg-white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Screen visibility controls */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden; /* Prevent both vertical and horizontal scrollbars */
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(20px + env(safe-area-inset-left, 0px));
  padding-right: calc(20px + env(safe-area-inset-right, 0px));
  background-color: var(--color-bg-white);
  
  /* Hide scrollbars completely as a fallback */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.screen::-webkit-scrollbar {
  display: none;
}

#dashboard-screen {
  overflow-y: auto;
  overflow-x: hidden;
}


.screen.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Tactile 3D Buttons (Duolingo style)
   ========================================================================== */

.btn-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 14px 24px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: filter 0.1s ease, transform 0.1s ease;
  position: relative;
  text-transform: uppercase;
}

/* Button Colors */
.btn-primary {
  background-color: var(--color-primary-green);
  color: white;
  box-shadow: 0 4px 0 var(--color-primary-green-dark);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0px 0 var(--color-primary-green-dark);
}

.btn-secondary {
  background-color: var(--color-primary-blue);
  color: white;
  box-shadow: 0 4px 0 var(--color-primary-blue-dark);
}

.btn-secondary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0px 0 var(--color-primary-blue-dark);
}

.btn-success {
  background-color: var(--color-primary-green);
  color: white;
  box-shadow: 0 4px 0 var(--color-primary-green-dark);
}

.btn-success:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0px 0 var(--color-primary-green-dark);
}

.btn-large {
  width: 100%;
  padding: 16px 32px;
  font-size: 18px;
}

/* Disabled State */
.btn-3d:disabled {
  background-color: #e5e5e5;
  color: #afafaf;
  box-shadow: 0 4px 0 #cccccc;
  cursor: not-allowed;
  transform: none !important;
}

/* ==========================================================================
   Dashboard / Welcome Screen Styles
   ========================================================================== */

.dashboard-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--color-border-gray);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary-blue);
}

.stats-overview {
  display: flex;
  gap: 10px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #f7f7f7;
  border: 2px solid var(--color-border-gray);
  border-radius: 12px;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.stat-badge.total-xp-badge {
  color: var(--color-yellow-xp-dark);
}

.stat-badge.dashboard-streak {
  color: #ff4b4b;
}

.dashboard-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 15px;
}

/* Mascot Card Greeting */
.mascot-welcome-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: #f7fffe;
  border: 2px solid #bdf1eb;
  border-radius: 20px;
  padding: 12px;
  margin-top: 4px;
}

.mascot-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.speech-bubble {
  position: relative;
  background: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-radius: 16px;
  padding: 12px 16px;
  flex-grow: 1;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: var(--color-bg-white);
  border-left: 2px solid var(--color-border-gray);
  border-bottom: 2px solid var(--color-border-gray);
}

.speech-bubble h2 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-slate);
  margin-bottom: 4px;
}

.speech-bubble p {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-slate-light);
}

/* Dashboard Control Setup Card */
.dashboard-controls-card {
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 0 var(--color-border-gray);
  margin-bottom: 6px;
}

.dashboard-controls-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-slate);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-slate-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Toggle Switch Pill design */
.toggle-pill-selector {
  display: flex;
  background-color: #f1f3f4;
  border: 2px solid var(--color-border-gray);
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
}

.toggle-pill-selector .pill-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-slate-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-pill-selector .pill-btn svg {
  transition: transform 0.2s ease;
}

.toggle-pill-selector .pill-btn.active {
  background-color: var(--color-bg-white);
  color: var(--color-primary-blue);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

.toggle-pill-selector .pill-btn.active svg {
  color: var(--color-primary-blue);
}

/* Level selector grid styling */
.level-selector-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.level-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-bottom: 4px solid var(--color-border-gray);
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-slate);
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}

.level-btn:hover {
  background-color: var(--color-bg-light);
  border-color: var(--color-border-gray-dark);
}

.level-btn.active {
  background-color: var(--color-active-bg);
  border-color: var(--color-active-border);
  border-bottom: 4px solid var(--color-active-border);
  color: var(--color-active-text);
}

.level-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}


/* Categories selection grid */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-bottom: 4px solid var(--color-border-gray);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.1s ease;
}

.category-card:hover {
  background-color: var(--color-bg-light);
  border-color: var(--color-border-gray-dark);
}

.category-card.active {
  background-color: var(--color-active-bg);
  border-color: var(--color-active-border);
  border-bottom: 4px solid var(--color-active-border);
}

.category-card.active .cat-title {
  color: var(--color-active-text);
}

.category-card.active .cat-desc {
  color: var(--color-active-text);
  opacity: 0.8;
}

.category-icon {
  font-size: 24px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f7f7f7;
  border-radius: 12px;
  flex-shrink: 0;
}

.category-card.active .category-icon {
  background-color: var(--color-bg-white);
}

.category-info {
  display: flex;
  flex-direction: column;
}

.cat-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-slate);
}

.cat-desc {
  font-size: 11px;
  color: var(--color-slate-light);
  margin-top: 2px;
}

/* ==========================================================================
   Practice Screen Styles
   ========================================================================== */

.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--color-border-gray);
  flex-shrink: 0;
}

.exit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-slate-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}

.exit-btn:hover {
  background-color: #f5f5f5;
  color: var(--color-slate);
}

.progress-bar-container {
  flex-grow: 1;
  height: 16px;
  background-color: #e5e5e5;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-primary-green);
  border-radius: 20px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 5px;
  right: 5px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
}

.header-status-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.audio-toggle-btn {
  background: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-bottom: 3px solid var(--color-border-gray);
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  transition: transform 0.1s ease, background-color 0.1s ease, border-color 0.1s ease;
  user-select: none;
}

.audio-toggle-btn:hover {
  background-color: #fafafa;
  border-color: var(--color-border-gray-dark);
  transform: translateY(-1px);
}

.audio-toggle-btn:active {
  transform: translateY(1px);
  border-bottom-width: 2px;
}

.audio-toggle-btn.muted {
  opacity: 0.65;
  background-color: #f0f0f0;
}

.hearts-container {
  display: flex;
  gap: 4px;
  font-size: 18px;
  user-select: none;
}

.heart {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.heart.lost {
  filter: grayscale(1) opacity(0.3);
  transform: scale(0.8);
}

/* Practice main workspace */
.practice-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  gap: 20px;
  overflow: hidden; /* Prevent vertical scrolling */
}

/* Character speech bubble dialog */
.character-prompt-container {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 10px;
}

.mascot-svg-wrapper {
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.mascot-svg-wrapper:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.question-bubble {
  position: relative;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-radius: 20px;
  padding: 16px;
  flex-grow: 1;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 0 var(--color-border-gray);
}

.question-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 25px;
  width: 14px;
  height: 14px;
  background-color: var(--color-bg-white);
  border-left: 2px solid var(--color-border-gray);
  border-bottom: 2px solid var(--color-border-gray);
  transform: rotate(45deg);
}

.bubble-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--color-primary-blue);
  text-transform: uppercase;
  margin-bottom: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.bubble-tag.bubble-tag-retry {
  color: #ff9600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff4e5;
  padding: 3px 8px;
  border-radius: 8px;
  width: fit-content;
  border: 1px solid #ffe0b2;
  font-weight: 800;
}

.question-prompt {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-slate);
}

/* Answer Slot Container */
.answer-slots-outer {
  border-top: 2px solid var(--color-border-gray);
  border-bottom: 2px solid var(--color-border-gray);
  padding: 16px 0;
  margin: 10px 0;
  min-height: 110px;
  display: flex;
  align-items: center;
}

.answer-slots-container {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 52px;
  align-content: flex-start;
  position: relative;
}

.empty-placeholder-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: var(--color-slate-light);
  width: 100%;
  text-align: center;
  pointer-events: none;
  font-style: italic;
  transition: opacity 0.2s ease;
}

/* Options/Tiles Pool */
.tiles-pool-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 0;
}

/* The actual word tile */
.word-tile {
  font-family: var(--font-body);
  font-size: 17.6px;
  font-weight: 700;
  color: var(--color-slate);
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-bottom: 4px solid var(--color-border-gray);
  border-radius: 13.2px;
  padding: 11px 17.6px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease, border-color 0.1s ease, background-color 0.1s ease;
  display: inline-block;
  box-sizing: border-box;
}

.word-tile:hover {
  background-color: #fafafa;
  border-color: var(--color-border-gray-dark);
}

.word-tile:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

/* In-use placeholder left in the pool */
.word-tile.tile-placeholder {
  background-color: #e5e5e5;
  border: 2px solid #e5e5e5;
  border-bottom: 2px solid #e5e5e5;
  color: transparent;
  pointer-events: none;
  cursor: default;
  box-shadow: none;
  transform: none !important;
}

/* Footer check bar */
.check-bar {
  border-top: 2px solid var(--color-border-gray);
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px)) 0;
  flex-shrink: 0;
  background-color: var(--color-bg-white);
}

.check-bar-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.check-bar-content #check-btn {
  flex: 1;
  width: auto;
  margin-bottom: 0;
}

/* Sliding feedback drawer */
.feedback-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-bg-white);
  border-top: 2px solid var(--color-border-gray);
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)) 20px;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15);
  z-index: 100;
}

.feedback-drawer.open {
  transform: translateY(0);
}

.feedback-drawer.correct-state {
  background-color: var(--color-success-bg);
  border-top-color: var(--color-success-border);
}

.feedback-drawer.incorrect-state {
  background-color: var(--color-error-bg);
  border-top-color: var(--color-error-border);
}

.feedback-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 480px) {
  .feedback-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.feedback-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-wrap: nowrap;
}

@media (min-width: 480px) {
  .feedback-actions {
    width: auto;
    flex-shrink: 0;
  }
}

.feedback-actions #continue-btn {
  flex: 1 1 auto !important;
  width: auto !important;
  margin: 0 !important;
}

@media (min-width: 480px) {
  .feedback-actions #continue-btn {
    min-width: 150px !important;
  }
}

.feedback-report-btn {
  width: 50px !important;
  height: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  flex: 0 0 50px !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  border-radius: 16px !important;
  margin: 0 !important;
}

.feedback-status-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feedback-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  flex-shrink: 0;
}

.correct-state .feedback-icon-circle {
  background-color: var(--color-primary-green);
  color: white;
}

.incorrect-state .feedback-icon-circle {
  background-color: var(--color-error-red);
  color: white;
}

.feedback-symbol {
  transform: translateY(-1px);
}

.feedback-text-block h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.correct-state .feedback-text-block h4 {
  color: var(--color-success-green);
}

.incorrect-state .feedback-text-block h4 {
  color: var(--color-error-red);
}

.feedback-text-block p {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-slate);
}

.feedback-container button {
  flex-shrink: 0;
}


/* ==========================================================================
   Session Summary / Victory Screen Styles
   ========================================================================== */

#summary-screen {
  justify-content: center;
  align-items: center;
}

#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.summary-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 5;
  padding: 10px 0;
}

.summary-mascot-animation {
  margin-top: 10px;
  flex-shrink: 0;
}

.summary-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-primary-green-dark);
  text-align: center;
}

.summary-subtitle {
  font-size: 15px;
  color: var(--color-slate-light);
  text-align: center;
  margin-top: -10px;
  margin-bottom: 10px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 10px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-radius: 18px;
  padding: 16px 8px;
  box-shadow: 0 4px 0 var(--color-border-gray);
  text-align: center;
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-slate);
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-slate-light);
  letter-spacing: 0.5px;
  margin-top: 2px;
  text-transform: uppercase;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

/* ==========================================================================
   Animations
   ========================================================================== */

/* Mascot Bobbing */
.animate-bob {
  animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Summary Mascot Bouncing */
.animate-bounce-slow {
  animation: bounceSlow 2.5s ease-in-out infinite;
}

@keyframes bounceSlow {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-12px) scale(0.98);
  }
}

/* Blinking animations for eyes */
.mascot-eye-outer {
  animation: eyeBlink 5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes eyeBlink {
  0%, 92%, 100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.15);
  }
}

/* Pupil blink translation offset to follow outer eye contraction */
.mascot-pupils {
  animation: pupilBlink 5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes pupilBlink {
  0%, 92%, 100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.15);
  }
}

/* Incorrect Answer Shake */
.shake-element {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* General Fade Slide transition for pages */
.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Pagination Controls */
.categories-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 4px 0;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-bottom: 4px solid var(--color-border-gray);
  cursor: pointer;
  user-select: none;
  transition: all 0.1s ease;
  color: var(--color-slate-light);
}

.pagination-btn:hover:not(:disabled) {
  background-color: #fafafa;
  border-color: var(--color-border-gray-dark);
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.pagination-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.pagination-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-border-gray-dark);
  transition: all 0.2s ease;
  cursor: pointer;
}

.pagination-dot.active {
  background-color: var(--color-primary-blue);
  transform: scale(1.2);
}

/* Course Dropdown Selector */
.course-dropdown-container {
  position: relative;
  width: 100%;
}

.course-dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 16px;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-bottom: 4px solid var(--color-border-gray);
  color: var(--color-slate);
  cursor: pointer;
  user-select: none;
  transition: all 0.1s ease;
  text-align: left;
}

.course-dropdown-btn:hover {
  background-color: #fafafa;
  border-color: var(--color-border-gray-dark);
}

.course-dropdown-btn:active,
.course-dropdown-container.open .course-dropdown-btn {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.course-dropdown-btn .arrow-icon {
  color: var(--color-slate-light);
  margin: 0 4px;
}

.course-dropdown-btn .dropdown-arrow {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-slate-light);
  transition: transform 0.2s ease;
}

.course-dropdown-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

.course-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-bottom: 4px solid var(--color-border-gray);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px;
  animation: fadeIn 0.2s ease-out forwards;
}

.course-dropdown-container.open .course-dropdown-menu {
  display: block;
}

.course-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-slate);
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.course-dropdown-item:hover {
  background-color: #f1f3f4;
  color: var(--color-primary-blue);
}

.course-dropdown-item.active {
  background-color: #e5f6fd;
  color: var(--color-primary-blue);
}

.course-flag {
  font-size: 18px;
}

/* Site Footer */
.site-footer {
  margin-top: 20px;
  border-top: 1px solid var(--color-border-gray);
  padding: 8px 0;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--color-slate-light);
  flex-shrink: 0;
}

.site-footer p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.site-footer strong {
  color: var(--color-slate);
}

.site-footer .tagline {
  color: var(--color-slate-light);
  font-weight: 600;
}

.site-footer .bullet {
  color: var(--color-border-gray-dark);
}


/* Theme Override Definitions */


/* 7. Cosmic Dust */
.theme-space {
  --color-primary-green: #7209b7;
  --color-primary-green-dark: #560bad;
  --color-primary-green-light: #b5179e;
  --color-primary-blue: #4361ee;
  --color-primary-blue-dark: #3f37c9;
  --color-primary-blue-light: #4cc9f0;
  --color-success-green: #4cc9f0;
  --color-success-bg: #151a30;
  --color-success-border: #4cc9f0;
  --color-error-red: #f72585;
  --color-error-dark: #b80f5c;
  --color-error-bg: #2d1020;
  --color-error-border: #f72585;
  --color-yellow-xp: #f72585;
  --color-yellow-xp-dark: #b5179e;
  --color-slate: #f8f9fa;
  --color-slate-light: #a0aec0;
  --color-border-gray: #2d3748;
  --color-border-gray-dark: #4a5568;
  --color-bg-light: #0b0c10;
  --color-bg-white: #1f2833;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --color-active-bg: #7209b7;
  --color-active-border: #4cc9f0;
  --color-active-text: #ffffff;
}


/* Stat badge refinements for space-consuming custom display fonts */
.theme-space .stat-badge {
  font-size: 11px;
  padding: 6px 10px;
}


/* Custom 3D Danger Button */
.btn-danger {
  background-color: var(--color-error-red);
  color: white;
  box-shadow: 0 4px 0 var(--color-error-dark);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0px 0 var(--color-error-dark);
}

/* Custom Modal Overlay & Dialog Card */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-card {
  width: 85%;
  max-width: 400px;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 8px 0 var(--color-border-gray-dark);
  transform: scale(0.9);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-slate);
  margin-bottom: 10px;
}

.modal-message {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-slate-light);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-actions button {
  flex: 1;
  font-size: 14px;
  padding: 12px 16px;
}


/* ==========================================================================
   Canopy Shop Modal & Accessory Toggles
   ========================================================================== */

/* Sunglasses Graphic Hidden by Default */
.mascot-sunglasses {
  display: none;
}
/* Display Sunglasses when equipped class is active on body */
body.equipped-sunglasses .mascot-sunglasses {
  display: block !important;
}

/* Shop Modal Styling */
.shop-modal-card {
  width: 90% !important;
  max-width: 440px !important;
  display: flex;
  flex-direction: column;
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--color-border-gray);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.shop-title-icon {
  font-size: 28px;
}

.shop-balance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--color-bg-light);
  border: 2px solid var(--color-border-gray);
  border-radius: 12px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-slate);
}

.leaves-icon {
  font-size: 18px;
}

/* Clickable Shop Stat Badge */
.shop-badge-btn {
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease, background-color 0.1s ease;
}

.shop-badge-btn:hover {
  background-color: var(--color-bg-light);
  border-color: var(--color-border-gray-dark);
}

.shop-badge-btn:active {
  transform: scale(0.95);
}

/* Item Rows */
.shop-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  text-align: left;
}

.shop-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 2px solid var(--color-border-gray);
  border-radius: 18px;
  background-color: var(--color-bg-white);
  transition: border-color 0.2s ease;
}

.shop-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
}

.shop-item-art {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-light);
  border-radius: 12px;
  flex-shrink: 0;
  user-select: none;
}

.shop-item-details {
  display: flex;
  flex-direction: column;
}

.shop-item-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-slate);
}

.shop-item-desc {
  font-size: 11px;
  color: var(--color-slate-light);
  margin-top: 2px;
  line-height: 1.3;
}

.shop-item-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.shop-item-qty {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary-blue);
  margin-right: 4px;
}

.shop-buy-btn, .shop-equip-btn {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  text-transform: none;
  font-family: var(--font-display);
}

.price-lbl {
  font-weight: 700;
  margin-left: 2px;
}

.btn-neutral {
  background-color: var(--color-bg-white);
  color: var(--color-slate-light);
  border: 2px solid var(--color-border-gray);
  border-bottom: 4px solid var(--color-border-gray);
  box-shadow: none;
}

.btn-neutral:hover:not(:disabled) {
  background-color: var(--color-bg-light);
  border-color: var(--color-border-gray-dark);
}

.btn-neutral:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

/* Extra Indicator Style in Practice Header Status Box */
.shield-indicator {
  font-size: 18px;
  animation: bob 2s ease-in-out infinite;
  user-select: none;
}

/* Progress Bar Exercise Count Label */
.progress-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Responsive Adjustments & Media Queries
   ========================================================================== */

/* 1. Mobile & Narrow Viewport Adjustments (width <= 479px) */
@media (max-width: 479px) {
  .feedback-container button {
    width: 100%;
  }
}

/* 2. Standard Mobile Adjustments (width <= 480px) */
@media (max-width: 480px) {
  /* Screen & Layout overrides */
  .screen {
    padding: 14px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }
  
  .logo-container {
    justify-content: center;
  }
  
  .stats-overview {
    justify-content: center;
    width: 100%;
    gap: 6px;
    flex-wrap: wrap;
  }
  
  .stat-badge {
    font-size: 12px;
    padding: 5px 8px;
    gap: 4px;
  }

  .stat-badge svg {
    width: 16px;
    height: 16px;
  }

  /* Specificity overrides for theme badges on mobile */
  .theme-space .stat-badge {
    padding: 5px 8px !important;
  }

  /* Level selector buttons override */
  .level-btn {
    padding: 8px 0;
    font-size: 13px;
    border-radius: 10px;
  }

  /* Squeezed category icons for narrow viewports */
  .category-icon {
    width: 32px;
    height: 32px;
    font-size: 20px;
    border-radius: 10px;
  }

  /* Compact shop row elements on mobile */
  .shop-item-row {
    padding: 10px;
    gap: 10px;
    border-radius: 14px;
  }

  .shop-item-art {
    width: 36px;
    height: 36px;
    font-size: 22px;
    border-radius: 10px;
  }

  .shop-item-name {
    font-size: 14px;
  }

  .shop-item-desc {
    font-size: 10px;
    line-height: 1.2;
  }

  .shop-buy-btn,
  .shop-equip-btn {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 10px;
  }

  /* Spacing squeeze */
  .dashboard-main {
    gap: 10px;
  }
  
  .dashboard-controls-card {
    padding: 12px;
    gap: 10px;
  }
  
  .mascot-welcome-card {
    padding: 10px;
    gap: 10px;
  }
  
  .mascot-welcome-card .mascot-svg {
    width: 100px;
    height: auto;
  }
  
  .speech-bubble {
    padding: 10px 12px;
  }
  
  .speech-bubble h2 {
    font-size: 16px;
  }
  
  .speech-bubble p {
    font-size: 13px;
  }

  /* Practice Screen adjustments */
  .practice-header {
    gap: 8px;
    padding-bottom: 6px;
  }

  .practice-main {
    padding: 8px 0;
    gap: 8px;
  }

  .character-prompt-container {
    gap: 8px;
    margin-top: 0;
  }

  /* Small mascot on mobile practice board */
  #practice-mascot {
    width: 70px;
    height: 75px;
  }

  .question-bubble {
    padding: 8px 12px;
    min-height: 56px;
    border-radius: 16px;
  }

  .question-bubble::before {
    bottom: 20px;
  }

  .question-prompt {
    font-size: 16px;
  }

  .answer-slots-outer {
    padding: 4px 0;
    min-height: 56px;
    margin: 2px 0;
  }

  .answer-slots-container {
    min-height: 38px;
    gap: 8px;
  }

  .word-tile {
    font-size: 16.5px;
    padding: 8.8px 13.2px;
    border-radius: 11px;
    border-bottom-width: 3px;
  }

  .tiles-pool-container {
    gap: 8px;
    padding: 6px 0;
  }

  .check-bar {
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)) 0;
  }

  .feedback-drawer {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
  }

  /* Summary screen stats grid scale */
  .summary-main {
    gap: 16px;
    padding: 5px 0;
  }

  #summary-mascot {
    width: 140px;
    height: 160px;
  }

  .summary-title {
    font-size: 24px;
  }

  .summary-subtitle {
    font-size: 14px;
  }

  .summary-stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 12px 6px;
    border-radius: 14px;
  }

  .stat-icon {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .stat-value {
    font-size: 17px;
  }

  .stat-label {
    font-size: 8px;
    letter-spacing: 0.2px;
  }

  .btn-large {
    padding: 14px 28px;
    font-size: 16px;
  }

  /* Custom Modal overlay mobile overrides */
  .modal-card {
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 6px 0 var(--color-border-gray-dark);
  }
  
  .modal-title {
    font-size: 20px;
  }
  
  .modal-message {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-actions button {
    width: 100%;
    padding: 12px 16px;
  }
}

/* 3. Short Screen height adjustments (height <= 780px) */
@media (max-height: 780px) {
  .screen {
    padding: 12px !important;
  }
  
  /* Scale mascot welcome card down to fit */
  .mascot-welcome-card {
    padding: 6px 10px;
    margin-top: 4px;
  }
  .mascot-welcome-card .mascot-svg {
    width: 75px;
    height: auto;
  }
  .speech-bubble {
    padding: 6px 8px;
  }
  .speech-bubble h2 {
    font-size: 13px;
    margin-bottom: 2px;
  }
  .speech-bubble p {
    font-size: 10px;
  }
  
  /* Squeeze dashboard card padding */
  .dashboard-controls-card {
    padding: 10px 12px;
    gap: 8px;
    box-shadow: 0 3px 0 var(--color-border-gray);
  }

  .control-group {
    gap: 4px;
  }
  
  .categories-grid {
    gap: 6px;
  }
  
  .category-card {
    padding: 6px 8px;
    border-radius: 12px;
  }

  .category-icon {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border-radius: 8px;
  }

  .cat-title {
    font-size: 12px;
  }

  .cat-desc {
    font-size: 10px;
  }

  .level-btn {
    padding: 6px 0;
    font-size: 12px;
  }

  .btn-large {
    padding: 12px 24px;
    font-size: 16px;
  }

  .practice-main {
    padding: 6px 0;
    gap: 10px;
  }

  .answer-slots-outer {
    min-height: 85px;
  }
  @media (max-width: 480px) {
    .answer-slots-outer {
      min-height: 56px;
    }
  }
}

/* 4. Very Short Screen height adjustments (height <= 740px) */
@media (max-height: 740px) {
  .mascot-welcome-card {
    display: none !important;
  }
  .summary-mascot-animation {
    display: none;
  }
  .dashboard-main {
    gap: 8px;
  }
  .dashboard-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }
}

/* 5. Compact Viewport Adjustments (Samsung Galaxy A54, height <= 720px) */
@media (max-height: 720px) {
  /* Reduce general screen padding */
  .screen {
    padding: 10px !important;
  }

  /* Squeeze practice lesson gameplay spacing */
  .practice-main {
    gap: 8px !important;
    padding: 4px 0 !important;
  }

  /* Hide mascot on very short viewports to save substantial vertical space */
  #practice-screen .mascot-svg-wrapper {
    display: none !important;
  }
  #practice-screen .character-prompt-container {
    margin-top: 2px !important;
    gap: 0 !important;
  }
  #practice-screen .question-bubble {
    min-height: 55px !important;
    padding: 8px 12px !important;
    border-radius: 14px !important;
    box-shadow: 0 3px 0 var(--color-border-gray) !important;
  }
  #practice-screen .question-bubble::before {
    display: none !important; /* Hide speech bubble tail */
  }

  /* Compact the translation answer slots */
  .answer-slots-outer {
    min-height: 70px !important;
    padding: 6px 0 !important;
    margin: 4px 0 !important;
  }
  /* Override for mobile-width devices that need tighter layout */
  @media (max-width: 480px) {
    .answer-slots-outer {
      min-height: 56px !important;
    }
  }
  .answer-slots-container {
    min-height: 38px !important;
    gap: 6px !important;
  }

  /* Squeeze tiles pool */
  .tiles-pool-container {
    gap: 6px !important;
  }
  .word-tile {
    font-size: 15.4px !important;
    padding: 6.6px 11px !important;
    border-radius: 11px !important;
    border-bottom-width: 2.5px !important;
  }

  /* Compact check bar */
  .check-bar {
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)) 0 !important;
  }
  
  /* Squeeze feedback drawer */
  .feedback-drawer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px !important;
  }
}

/* Show custom scrollbar on dashboard screen to indicate scrolling capability */
#dashboard-screen {
  scrollbar-width: auto;
  -ms-overflow-style: auto;
}
#dashboard-screen::-webkit-scrollbar {
  display: block;
  width: 6px;
}
#dashboard-screen::-webkit-scrollbar-track {
  background: transparent;
}

/* ==========================================================================
   WhatsApp Issue Reporting System Styles
   ========================================================================== */
.check-bar-content {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.check-bar-content #check-btn {
  flex: 1;
  width: auto;
}

.report-btn, #report-btn {
  width: 50px !important;
  height: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  flex: 0 0 50px !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-white, #ffffff);
  border: 2px solid var(--color-border-gray, #e5e5e5);
  border-bottom: 4px solid var(--color-border-gray-dark, #cecece);
  border-radius: 16px;
  color: #777777;
  cursor: pointer;
  transition: all 0.15s ease;
}

.report-btn:hover {
  background-color: #f7f7f7;
  color: var(--color-slate, #3c3c3c);
  border-color: var(--color-border-gray-dark, #cecece);
}

.report-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

/* Report Modal Styling */
.report-modal-card {
  max-width: 440px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 24px;
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-border-gray);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.modal-header-flex {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.modal-header-flex .modal-emoji {
  font-size: 24px;
}

.modal-header-flex .modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-slate);
  flex: 1;
}

.modal-close-icon {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--color-slate-light);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close-icon:hover {
  color: var(--color-slate);
}

.report-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.report-options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-option-pill {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--color-border-gray);
  background-color: var(--color-bg-light);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.report-option-pill:hover {
  border-color: var(--color-primary-blue);
  background-color: var(--color-bg-white);
}

.report-option-pill input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--color-primary-blue);
  transform: scale(1.2);
  flex-shrink: 0;
}

.report-option-pill .pill-content {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-slate);
}

.report-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--color-border-gray);
  background-color: var(--color-bg-light);
  color: var(--color-slate);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.report-textarea::placeholder {
  color: var(--color-slate-light);
}

.report-textarea:focus {
  border-color: var(--color-primary-blue, #1cb0f6);
  box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.15);
}

/* Toast notification styling */
.report-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30, 30, 40, 0.94);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  pointer-events: none;
  font-size: 13.5px;
  font-weight: 600;
  max-width: 90%;
  text-align: center;
}

.report-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.report-toast.hidden {
  display: none;
}

/* Mobile Responsive Overrides for Report Modal */
@media (max-width: 480px) {
  .report-modal-card {
    width: 92%;
    padding: 18px;
    border-radius: 20px;
  }

  .report-option-pill {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .report-option-pill .pill-content {
    font-size: 13px;
  }

  .report-textarea {
    font-size: 13px;
    padding: 10px 12px;
  }
}

@media (max-height: 720px) {
  .report-modal-card {
    max-height: 85vh;
    padding: 16px 18px;
  }
}

/* ==========================================================================
   Fill in the Blank Typing Exercise Styles
   ========================================================================== */
.fill-blank-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 4px 16px;
}

.fill-blank-sentence {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--color-slate);
  text-align: center;
  line-height: 1.4;
  background: var(--color-bg-white);
  padding: 10px 16px;
  border-radius: 16px;
  border: 2px solid var(--color-border-gray);
  box-shadow: 0 3px 0 var(--color-border-gray);
  width: 100%;
}

.blank-highlight {
  display: inline-block;
  min-width: auto;
  padding: 2px 8px;
  margin: 0 4px;
  border-bottom: 3px dashed var(--color-purple);
  color: var(--color-purple-dark);
  font-weight: 800;
  letter-spacing: 3px;
}

.fill-blank-input-wrapper {
  position: relative;
  width: 100%;
}

.fill-blank-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 3px 0 #cbd5e1;
  outline: none;
  transition: all 0.2s ease;
  text-align: center;
}

.fill-blank-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 3px 0 #7c3aed, 0 0 0 3px rgba(139, 92, 246, 0.25);
  background: #f8fafc;
}

.fill-blank-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  font-size: 14px;
}

/* ==========================================================================
   Matching Pairs Exercise Styles
   ========================================================================== */
.matching-pairs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 10px 16px;
}

.pair-button {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 16px 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 #cbd5e1;
  transition: all 0.15s ease;
  user-select: none;
}

.pair-button:hover {
  background: #f8fafc;
}

.pair-button.selected {
  border-color: #8b5cf6;
  background: #ede9fe;
  box-shadow: 0 4px 0 #8b5cf6;
}

.pair-button.matched {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  box-shadow: 0 4px 0 #22c55e;
  cursor: default;
  opacity: 0.75;
}

.pair-button.incorrect {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
  box-shadow: 0 4px 0 #ef4444;
}

/* Hide mascot and squeeze header space immediately when the fill-blank input is focused to maximize vertical space for mobile keyboards */
#practice-screen:has(.fill-blank-input:focus) .mascot-svg-wrapper {
  display: none !important;
}

#practice-screen:has(.fill-blank-input:focus) .character-prompt-container {
  margin-top: 2px !important;
  gap: 0 !important;
}

#practice-screen:has(.fill-blank-input:focus) .question-bubble {
  min-height: 50px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
}

#practice-screen:has(.fill-blank-input:focus) .question-bubble::before {
  display: none !important;
}

#practice-screen:has(.fill-blank-input:focus) .practice-main {
  gap: 6px !important;
  padding: 2px 0 !important;
}

/* Position input box directly below exercise text for fill_blank exercises without margin-top push */
#practice-screen:has(.fill-blank-input) .practice-main {
  justify-content: flex-start !important;
  gap: 8px !important;
}

#practice-screen:has(.fill-blank-input) .answer-slots-outer {
  border: none !important;
  min-height: auto !important;
  padding: 0 !important;
  margin: 4px 0 !important;
}

#practice-screen:has(.fill-blank-input) .tiles-pool-container {
  margin-top: 0 !important;
  padding: 4px 0 !important;
}

.fill-blank-check-btn {
  width: 100%;
  max-width: 480px;
  min-height: 48px;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fill-blank-check-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 4px 0 #cbd5e1 !important;
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  border-color: #cbd5e1 !important;
  transform: none !important;
}

#practice-screen:has(.fill-blank-container) #check-bar {
  display: none !important;
}

/* Invite Friends Badge Button */
.invite-badge-btn {
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  color: #ffffff !important;
  border-color: #9333ea !important;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.invite-badge-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Invite Friends QR Modal */
.invite-modal-card {
  max-width: 440px;
  width: 92%;
  text-align: center;
  padding: 24px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.close-x-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  font-weight: 800;
  color: var(--color-slate-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.close-x-btn:hover {
  background: var(--color-bg-gray);
  color: var(--color-slate);
}

.invite-qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  padding: 12px;
  background: #ffffff;
  border-radius: 20px;
  border: 3px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.invite-qr-image {
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: 12px;
  display: block;
}

.invite-url-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  box-sizing: border-box;
}

.invite-url-box input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invite-url-box button {
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .invite-modal-card {
    padding: 16px;
    width: 95%;
  }

  .invite-url-box input {
    font-size: 11px;
    padding: 8px 10px;
  }

  .invite-url-box button {
    padding: 8px 10px;
    font-size: 12px;
  }
}




