/* ============================================
   Tricky Words Trainer - Slim Version CSS
   Mobile-first responsive design
   + Hint System Styles
   ============================================ */

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  padding: 10px;
  font-family: 'Baloo 2', Arial, sans-serif;
  background: #f0f9ff;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ========== HEADER ========== */
.header-section {
  background: linear-gradient(to right, #b3e5fc, #e1f5fe);
  border-radius: 20px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  position: relative;
  width: 100%;
}

.Mainlogo {
  text-align: center;
  margin-bottom: 15px;
  position: relative;
}

.Mainlogo img {
  max-width: 100%;
  height: auto;
  width: 280px;
}


/* Floating stars decoration */
.header-stars {
  position: absolute;
  top: 0;
  left: 100%;
  width: 350px;
  height: 100%;
  pointer-events: none;
  display: none; /* Hidden on mobile */
  margin-left: 20px;
}

.header-stars .star {
  position: absolute;
  font-size: 16px;
  opacity: 0.5;
  animation: floatStar 4s ease-in-out infinite;
}

.star-1 {
  top: 10%;
  left: 40px;
  animation-delay: 0s;
  font-size: 18px;
}

.star-2 {
  top: 20%;
  left: 200px;
  font-size: 14px;
  animation-delay: 1s;
}

.star-3 {
  top: 35%;
  left: 120px;
  font-size: 16px;
  animation-delay: 2s;
}

.star-4 {
  top: 50%;
  left: 280px;
  font-size: 13px;
  animation-delay: 3s;
}

.star-5 {
  top: 65%;
  left: 60px;
  font-size: 15px;
  animation-delay: 1.5s;
}

.star-6 {
  top: 75%;
  left: 220px;
  font-size: 14px;
  animation-delay: 2.5s;
}

.star-7 {
  top: 88%;
  left: 160px;
  font-size: 17px;
  animation-delay: 0.5s;
}

@keyframes floatStar {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-8px) rotate(5deg);
    opacity: 0.9;
  }
}

/* Show stars on larger screens */
@media (min-width: 768px) {
  .header-stars {
    display: block;
  }
}

@media (min-width: 1200px) {
  .header-stars {
    width: 450px;
    margin-left: 50px;
  }
  
  .header-stars .star {
    font-size: 20px;
  }
  
  .star-1 {
    left: 60px;
    font-size: 22px;
  }
  
  .star-2 {
    left: 280px;
    font-size: 17px;
  }
  
  .star-3 {
    left: 160px;
    font-size: 20px;
  }
  
  .star-4 {
    left: 380px;
    font-size: 16px;
  }
  
  .star-5 {
    left: 90px;
    font-size: 18px;
  }
  
  .star-6 {
    left: 310px;
    font-size: 17px;
  }
  
  .star-7 {
    left: 220px;
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-stars .star {
    animation: none;
  }
}

.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Base button styles - only for Shelf and Upgrade now */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-grey2 { background: #f2f3fc; color: #000; }
.btn-grey4 { background: #f2f3fc; color: #000; }
/* Menu button and dropdown - positioned outside header */
.menu-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: block; /* Show on ALL screens including mobile */
  z-index: 2000;
}

@media (min-width: 1200px) {
  .menu-container {
    top: 30px;
    right: 40px;
  }
}

#menuBtn {
  font-size: 24px;
  line-height: 1;
  padding: 8px 12px;
  min-width: auto;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 150px;
  z-index: 1000;
  overflow: hidden;
}

.menu-dropdown.show {
  display: block;
}

.menu-dropdown a {
  display: block;
  padding: 12px 20px;
  color: #004080;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
  border-bottom: 1px solid #e0e0e0;
}

.menu-dropdown a:last-child {
  border-bottom: none;
}

.menu-dropdown a:hover {
  background: #e1f5fe;
}

.menu-dropdown a:active {
  background: #b3e5fc;
}

/* ========== MAIN CONTENT ========== */
.main-section {
  background: linear-gradient(135deg, #e8f7ff, #c7ebff);
  padding: 20px 15px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 20px;
}

.settings-card {
  background: #b3ebff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 0px;
  text-align: center;
}

.settings-card h2 {
  font-size: 1.5rem;
  color: #004080;
  margin: 0 0 15px 0;
}

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 8px;
  color: #003366;
}

/* Mode toggle buttons */
.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #ddd;
  border-radius: 12px;
  background: #f5f5f5;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.active {
  background: linear-gradient(135deg, #4dabff, #0059b3);
  color: #fff;
  border-color: #0059b3;
}

.mode-btn:hover {
  transform: translateY(-1px);
}

/* Select dropdowns */
.select-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 15px;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: none;
  border-radius: 50px;
  padding: 12px 40px 12px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: inset -2px -2px 4px rgba(255,255,255,.35), inset 2px 2px 4px rgba(0,0,0,.18);
}

.select-wrap.gold select {
  background: radial-gradient(circle at 30% 30%, #f9c22f, #c98600);
  color: #1b2340;
}

.select-wrap.blue select {
  background: radial-gradient(circle at 30% 30%, #4dabff, #0059b3);
  color: #fff;
}

.select-wrap.blue select option {
  background: #fff;
  color: #000;
}
.select-wrap .caret {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset -2px -2px 4px rgba(255,255,255,.35), inset 2px 2px 4px rgba(0,0,0,.18);
}

.select-wrap.gold .caret { color: #fff; }
.select-wrap.blue .caret { color: #fff; }

.select-wrap .caret::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
}

/* Generic inputs */
select, input[type="text"], input[type="number"], textarea {
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  width: 100%;
  outline: none;
  transition: border 0.2s;
}

select:focus, input:focus, textarea:focus {
  border-color: #59c5f9;
  box-shadow: 0 0 0 3px rgba(89,197,249,0.3);
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

#playBtn, #nextBtn {
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.2s;
  color: #fff;
}

#playBtn { background: #299bff; }
#nextBtn { background: #f9a22f; }

#playBtn:hover, #nextBtn:hover {
  transform: scale(1.05);
}

#setsBtn {
  background: #f9a22f;
  color: #fff;
  padding: 8px 16px;
  border-radius: 50px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 10px;
}

/* ========== OWL ========== */
.practice-wrap {
  position: relative;
}

.coach-owl {
  display: block;
  width: 180px;
  height: auto;
  margin: -20px auto 0 auto; /* Reduced from -40px to move owl down */
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.2));
  position: relative;
  z-index: 5;
  left: 70px;
}

.owl-idle {
  animation: owlIdle 3.2s ease-in-out infinite;
  transform-origin: 55% 60%;
}

@keyframes owlIdle {
  0%   { transform: translateY(0) rotate(0deg) scale(1); }
  50%  { transform: translateY(-4px) rotate(0.6deg) scale(1.012); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

.happy-anim { animation: owlBounce .7s ease-out; }
@keyframes owlBounce {
  0%{transform:translateY(0)}
  30%{transform:translateY(-12px) rotate(-2deg)}
  60%{transform:translateY(0)}
  85%{transform:translateY(-4px)}
  100%{transform:translateY(0)}
}

.sad-anim { animation: owlShake .55s ease-in-out; }
@keyframes owlShake {
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-7px) rotate(-2deg)}
  50%{transform:translateX(7px)  rotate( 2deg)}
  75%{transform:translateX(-4px)}
}

@media (prefers-reduced-motion: reduce) {
  .owl-idle, .happy-anim, .sad-anim { animation: none; }
}

.owl-bubble {
  background: linear-gradient(#fffdf6, #ffffff);
  border: 3px solid #1b2340;
  border-radius: 15px;
  padding: 10px 15px;
  font-weight: 700;
  font-size: 1rem;
  color: #1b2340;
  text-align: center;
  margin: 0 auto 15px auto;
  max-width: 200px;
  box-shadow: 0 6px 12px rgba(0,0,0,.15);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
}

.owl-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== PRACTICE CARD ========== */
.play {
  background: #fff7e6;
  border-radius: 18px;
  padding: 60px 20px 20px 20px;
  color: #163560;
  position: relative;
  margin-top: -20px;
}

.play h2 {
  font-size: 1.5rem;
  margin: 0 0 15px 0;
}

/* ========== HINT SYSTEM ========== */
.hint-display {
  background: linear-gradient(135deg, #fffacd, #ffeaa7);
  border: 3px solid #f9a22f;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #1b2340;
  text-align: center;
  letter-spacing: 2px;
  box-shadow: 0 4px 8px rgba(249, 162, 47, 0.3);
  animation: hintPulse 0.4s ease-out;
}

@keyframes hintPulse {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.hint-btn {
  background: linear-gradient(135deg, #ffd93d, #f9a22f);
  color: #1b2340;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 8px rgba(249, 162, 47, 0.3);
}

.hint-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(249, 162, 47, 0.4);
}

.hint-btn:active {
  transform: translateY(0);
}

#spellRow {
  margin-bottom: 15px;
}

#spellInput {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 10px;
}

.check-btn, .clear-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  margin-right: 10px;
}

.check-btn { background: #34c759; }
.clear-btn { background: #ff5e57; }

#choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

#choices .choice,
#choices .choice-btn {
  background: radial-gradient(circle at 30% 30%, #4dabff, #0059b3);
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: inset -2px -2px 4px rgba(255,255,255,.4), inset 2px 2px 4px rgba(0,0,0,.2), 0 4px 8px rgba(0,0,0,.3);
  width: 100%;
  text-align: center;
}

#choices .choice:hover,
#choices .choice-btn:hover {
  transform: scale(1.02);
}

#choices .choice.correct,
#choices .choice-btn.correct {
  background: radial-gradient(circle at 30% 30%, #47d16a, #0a8a1f);
}

#choices .choice.incorrect,
#choices .choice-btn.incorrect {
  background: radial-gradient(circle at 30% 30%, #ff6b6b, #b00000);
}

#choices .choice:disabled,
#choices .choice-btn:disabled {
  opacity: .9;
  cursor: default;
}

.Newbuttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.pill {
  background: #ffe6b3;
  padding: 6px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

#feedback {
  display: none !important;
}

/* ========== SHELF DIALOG ========== */

.shelf-stage {
  position: relative;
  width: 100%;
  min-height: 250px;
  height: 250px;
  background: linear-gradient(135deg, #fff9e6 0%, #ffe6cc 100%);
  border: 3px dashed #ddd;
  border-radius: 16px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

.stage-sticker {
  position: absolute;
  font-size: 2rem;
  cursor: move;
  user-select: none;
  touch-action: none;
  padding: 6px;
  transition: transform 0.1s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.stage-sticker:hover {
  transform: scale(1.15);
  z-index: 10;
}

.stage-sticker.dragging {
  cursor: grabbing;
  z-index: 999;
  opacity: 0.9;
  transform: scale(1.2);
}

.shelf-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 8px;
}

.shelf-toolbar button {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.shelf-toolbar button:hover {
  transform: translateY(-2px);
}

.shelf-toolbar .tertiary {
  background: #f2f3fc;
  color: #333;
}

.inventory {
  margin-top: 15px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 12px;
}

.inventory-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #333;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.inv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 12px;
  transition: transform 0.2s;
}

.inv-item:hover {
  transform: translateY(-2px);
  border-color: #4dabff;
}

.inv-item span:first-child {
  font-size: 2rem;
}

.inv-item .count {
  font-size: 0.85rem;
  font-weight: bold;
  color: #666;
}

.inv-item button {
  padding: 3px 8px;
  background: #4dabff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
/* Close button for dialogs */
.dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f2f3fc;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.dialog-close:hover {
  background: #ff5e57;
  color: white;
  transform: scale(1.1);
}

/* Print button in corner */
.print-btn-corner {
  position: absolute;
  top: 15px;
  right: 65px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f9a22f;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.print-btn-corner:hover {
  background: #ff8c00;
  transform: scale(1.1);
}

/* Adjust dialog header and buttons on mobile to prevent overlap */
@media (max-width: 600px) {
  dialog h2 {
    padding-right: 0; /* No padding needed since buttons are lower */
    padding-top: 0;
    margin-top: 0;
    line-height: 1.3;
  }
  
  /* Move buttons down to align with the trickywords.fun line - ONLY for Word Lists dialog */
  #wordListsDialog .print-btn-corner {
    right: 60px; /* More space between buttons */
    width: 32px;
    height: 32px;
    font-size: 16px;
    top: 48px; /* Position on the trickywords.fun line */
  }
  
  #wordListsDialog .dialog-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
    top: 48px; /* Position on the trickywords.fun line */
    right: 15px;
  }
}

@media (max-width: 480px) {
  dialog h2 {
    font-size: 1.25rem;
  }
  
  #wordListsDialog .print-btn-corner {
    right: 58px;
    top: 46px;
  }
  
  #wordListsDialog .dialog-close {
    top: 46px;
  }
}

@media (max-width: 400px) {
  dialog h2 {
    font-size: 1.15rem;
  }
  
  #wordListsDialog .print-btn-corner {
    right: 54px; /* More space for smaller buttons */
    width: 30px;
    height: 30px;
    font-size: 14px;
    top: 44px;
  }
  
  #wordListsDialog .dialog-close {
    width: 30px;
    height: 30px;
    font-size: 18px;
    top: 44px;
    right: 12px;
  }
}

@media (max-width: 360px) {
  dialog h2 {
    font-size: 1.1rem;
  }
  
  #wordListsDialog .print-btn-corner {
    right: 52px;
    width: 28px;
    height: 28px;
    font-size: 13px;
    top: 42px;
  }
  
  #wordListsDialog .dialog-close {
    width: 28px;
    height: 28px;
    font-size: 16px;
    top: 42px;
    right: 10px;
  }
}

/* Make sure dialog has position context */
dialog > form {
  position: relative;
}
.inv-item button:hover {
  background: #0059b3;
}
.inv-item button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

.inv-item button:disabled:hover {
  background: #ccc;
  transform: none;
}
/* ========== DIALOGS ========== */
dialog {
  max-width: 750px;
  width: 90%;
  max-height: 90vh;
  border: none;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  overflow: hidden;
  background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
}

dialog > form {
  display: flex;
  flex-direction: column;
  max-height: calc(90vh - 40px);
  overflow: hidden;
}

#shelfDialog {
  max-width: 900px;
}

#setsDialog {
  max-height: 90vh;
}

#wordListsDialog {
  max-height: 90vh;
}

#faqDialog {
  max-height: 90vh;
}

/* Make the custom sets list scrollable instead of the whole dialog */
#customSetsList {
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 12px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

dialog h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.4rem;
}

#setsDialog h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

#setsDialog h4 {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 1rem;
}

#setsDialog label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

#setsDialog input,
#setsDialog textarea,
#setsDialog select {
  margin-top: 4px;
}

#setsDialog .sep {
  margin: 12px 0;
}

dialog menu {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0;
  margin: 15px 0 0 0;
}

dialog button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

dialog button.primary {
  background: #299bff;
  color: #fff;
}

dialog button.secondary {
  background: #f2f3fc;
  color: #000;
}

/* Special styling for "See My Rewards" button */
#goToShelfBtn {
  background: linear-gradient(135deg, #ffd93d, #f9a22f) !important;
  color: #1b2340 !important;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(249, 162, 47, 0.3);
  transition: all 0.2s;
}

#goToShelfBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(249, 162, 47, 0.4);
}

.muted {
  color: #666;
  font-size: 0.9rem;
}

.small {
  font-size: 0.85rem;
}

/* For sets manager */
.list-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.row-btns {
  display: flex;
  gap: 8px;
}

.meta {
  color: #999;
  font-size: 0.9rem;
}
/* Set name row with buttons on the right */
.set-name-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.set-name-row label {
  margin-bottom: 0;
}

.set-name-row .buttons {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.set-name-row button {
  padding: 10px 16px;
  white-space: nowrap;
}

/* Stack on very small screens */
@media (max-width: 480px) {
  .set-name-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .set-name-row .buttons {
    justify-content: flex-start;
  }
}

/* ========== TABLET AND UP ========== */
@media (min-width: 600px) {
  body {
    padding: 20px;
  }
  
  .Mainlogo img {
    width: 400px;
  }
  
  .btn {
    font-size: 16px;
    padding: 12px 20px;
  }
  
  .settings-card {
    margin-bottom: 0px;
  }
  
  .coach-owl {
    width: 220px;
    margin: -30px auto 0 auto; /* Reduced from -50px to move owl down */
    left: 80px;
  }
  
  .play {
    padding: 70px 20px 20px 20px;
    margin-top: -25px;
  }
  
  #choices {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  #choices .choice,
  #choices .choice-btn {
    flex: 1 1 45%;
    min-width: 200px;
  }
}

/* ========== DESKTOP ========== */
@media (min-width: 1200px) {
  body {
    padding: 15px; /* Further reduced from 20px */
  }
  
  .header-section {
    padding: 10px 15px; /* Further reduced vertical padding */
    margin-bottom: 12px; /* Further reduced from 15px */
  }
  
  .Mainlogo {
    margin-bottom: 8px; /* Further reduced from 10px */
  }
  
  .Mainlogo img {
    width: 420px; /* Smaller logo */
  }
  
  .main-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 15px; /* Further reduced from 20px */
  }
  
  .settings-card {
    width: 420px; /* Back to original width */
    flex-shrink: 0;
    margin-bottom: 0;
    padding: 10px; /* Further reduced padding */
  }
  
  .settings-card h2 {
    font-size: 1.3rem;
    margin: 0 0 6px 0; /* Further reduced bottom margin */
  }
  
  .field {
    margin-bottom: 8px; /* Further reduced from 10px */
  }
  
  .field label {
    margin-bottom: 5px; /* Further reduced label spacing */
  }
  
  /* Make buttons side by side on desktop */
  .settings-card .buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    margin-top: 6px; /* Further reduced spacing above buttons */
  }
  
  .settings-card .buttons button {
    flex: 1;
    max-width: 200px;
  }
  
  .practice-wrap {
    flex: 1;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: relative;
  }
  
  .coach-owl {
    width: 280px;
    flex-shrink: 0;
    order: 1;
    margin-top: 0;
    margin-left: -150px; /* Move owl further left into the gap */
  }
  
  .play {
    width: 600px; /* Hard coded width to maintain previous size */
    order: 2;
    padding: 15px; /* Reduced padding */
    margin-top: 0;
    margin-left: 0; /* Remove the pull-left that was making it wider */
  }
  
  .owl-bubble {
    position: absolute;
    right: 100%;
    margin-right: 15px;
    top: 30px;
  }
  
  #choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  #choices .choice,
  #choices .choice-btn {
    width: 100%;
  }
  
  /* Shelf styles */
  .shelf-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 15px;
  }

  .shelf-stage {
    height: 300px;
    min-height: 300px;
  }

  .inventory {
    margin-top: 0;
    max-height: 300px;
    overflow-y: auto;
  }

  .inventory-grid {
    max-height: none;
    overflow-y: visible;
  }
}
/* ========== SMALL PHONES ========== */
@media (max-width: 430px) {
  body {
    padding: 5px;
  }
  
  .header-section {
    padding: 10px;
  }
  
  .Mainlogo img {
    width: 220px;
  }
  
  .nav-buttons {
    gap: 5px;
  }
  
  .btn {
    font-size: 12px;
    padding: 8px 12px;
    gap: 4px;
  }
  
  .btn span {
    font-size: 14px;
  }
  
  .main-section {
    padding: 15px 10px;
    border-radius: 15px;
  }
  
  .settings-card {
    padding: 15px;
  }
  
  .settings-card h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }
  
  .field label {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }
  
  .select-wrap select {
    padding: 10px 35px 10px 15px;
    font-size: 13px;
  }
  
  .select-wrap .caret {
    width: 20px;
    height: 20px;
    right: 10px;
  }
  
  #playBtn, #nextBtn {
    font-size: 0.9rem;
    padding: 10px 18px;
  }
  
  #setsBtn {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .coach-owl {
    width: 140px;
    margin-bottom: 15px;
  }
  
  .owl-bubble {
    font-size: 0.9rem;
    padding: 8px 12px;
    max-width: 180px;
  }
  
  .play {
    padding: 15px;
  }
  
  .play h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }
  
  #spellInput {
    padding: 10px;
    font-size: 15px;
  }
  
  .check-btn, .clear-btn, .hint-btn {
    padding: 8px 16px;
    font-size: 14px;
    margin-right: 5px;
  }
  
  .hint-display {
    font-size: 1rem;
    padding: 10px 12px;
    letter-spacing: 1px;
  }
  
  #choices {
    gap: 8px;
    margin-bottom: 15px;
  }
  
  #choices .choice,
  #choices .choice-btn {
    padding: 12px 16px;
    font-size: 1rem;
  }
  
  .Newbuttons {
    gap: 6px;
    font-size: 12px;
  }
  
  .pill {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .shelf-stage {
    min-height: 300px;
  }
  
  .stage-sticker {
    font-size: 1.8rem;
  }
  
  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  
  .inv-item span:first-child {
    font-size: 2rem;
  }
  
  /* Word lists on small screens */
  .word-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .word-item {
    font-size: 1rem;
    padding: 10px;
  }
}

/* ========== VERY SMALL PHONES ========== */
@media (max-width: 375px) {
  .Mainlogo img {
    width: 200px;
  }
  
  .btn {
    font-size: 11px;
    padding: 7px 10px;
  }
  
  .settings-card h2 {
    font-size: 1.2rem;
  }
  
  .coach-owl {
    width: 120px;
  }
  
  #choices .choice,
  #choices .choice-btn {
    font-size: 0.95rem;
    padding: 10px 14px;
  }
  
  .pill {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .hint-display {
    font-size: 0.9rem;
    padding: 8px 10px;
  }
}

/* ========== FAQ DIALOG STYLES ========== */

.faq-content {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 10px;
  flex: 1;
}

.faq-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
  color: #004080;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.faq-question::before {
  content: "Q:";
  font-weight: 700;
  color: #0059b3;
  flex-shrink: 0;
}

.faq-answer {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
  margin-left: 20px;
}

.faq-answer strong {
  color: #004080;
}

.faq-content .muted {
  text-align: center;
  padding: 40px 20px;
}

.faq-content::-webkit-scrollbar {
  width: 8px;
}

.faq-content::-webkit-scrollbar-track {
  background: #f0f9ff;
  border-radius: 4px;
}

.faq-content::-webkit-scrollbar-thumb {
  background: #4dabff;
  border-radius: 4px;
}

.faq-content::-webkit-scrollbar-thumb:hover {
  background: #0059b3;
}

/* ========== WORD LISTS STYLES ========== */

.word-list-display {
  background: white;
  border-radius: 12px;
  padding: 20px;
  max-height: 50vh;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
  flex: 1;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.word-item {
  background: linear-gradient(135deg, #e1f5fe, #b3e5fc);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: #004080;
  border: 2px solid #81d4fa;
}

/* Print styles for Word Lists */

/* ========== WORD LISTS DIALOG ========== */

.word-list-display {
  background: white;
  border-radius: 12px;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.word-item {
  background: linear-gradient(135deg, #e1f5fe, #b3e5fc);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: #004080;
  border: 2px solid #81d4fa;
}

/* ========== INVENTORY SCROLLING ========== */

.inventory {
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

.inventory-title {
  flex-shrink: 0;
}

.inventory-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
-webkit-overflow-scrolling: touch; 
}

.inventory-grid::-webkit-scrollbar {
  width: 8px;
}

.inventory-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.inventory-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 64, 128, 0.3);
  border-radius: 4px;
}

.inventory-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 64, 128, 0.5);
}

/* ========== PRINT STYLES ========== */

@media print {
  /* Hide everything except the word list dialog */
  body * {
    visibility: hidden;
  }
  
  #wordListsDialog,
  #wordListsDialog * {
    visibility: visible;
  }
  
  #wordListsDialog {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    height: auto;
    overflow: visible;
    box-shadow: none;
    background: white;
    padding: 20px;
  }
  
  #wordListsDialog form {
    max-height: none;
    height: auto;
    overflow: visible;
  }
  
  /* Hide UI elements */
  .dialog-close,
  #printListBtn,
  #wordListSetSelect,
  .select-wrap,
  .field,
  .caret,
  dialog > form > p.small.muted {
    display: none !important;
  }
  
  /* Print header */
  .print-header {
    margin-bottom: 15px;
  }
  
  /* Dialog title */
  #wordListsDialog h2 {
    color: black;
    margin-top: 0;
    margin-bottom: 15px;
  }
  
  /* Word list display */
  .word-list-display {
    max-height: none;
    height: auto;
    overflow: visible;
    box-shadow: none;
    padding: 0;
  }
  
  /* Word grid for printing */
  .word-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    page-break-inside: auto;
  }
  
  /* Individual words */
  .word-item {
    background: white;
    border: 2px solid #333;
    color: black;
    font-size: 14pt;
    padding: 10px;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  /* Print footer */
  .print-footer {
    margin-top: 20px;
  }
  
  h2, h3 {
    color: black;
  }
}
/* =================================================================
   OFFLINE DOWNLOAD PROGRESS UI - UPDATED
   Add this CSS to your style-slim-complete.css file
   ================================================================= */

.download-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.download-progress-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.download-progress-content h3 {
  margin: 0 0 20px 0;
  color: #004080;
  font-size: 1.3rem;
}

.progress-bar-wrapper {
  position: relative;
  margin: 30px 0 20px 0;
  height: 50px;
}

.progress-bar-track {
  width: 100%;
  height: 30px;
  background: #e0e0e0;
  border-radius: 15px;
  overflow: visible;
  position: relative;
  margin-top: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #81d4fa, #4fc3f7, #29b6f6);
  border-radius: 15px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
  z-index: 1;
}

.progress-owl {
  position: absolute;
  width: 35px !important;
  height: 35px !important;
  max-width: 35px !important;
  max-height: 35px !important;
  top: -2px;
  left: 0;
  transition: left 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  z-index: 2;
  object-fit: contain;
}

.progress-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #004080;
  margin: 15px 0 5px 0;
}

.progress-message {
  color: #666;
  margin: 5px 0 20px 0;
  font-size: 0.9rem;
}

.download-progress-content .btn {
  margin-top: 10px;
}
