:root {
  --bg: #f8fafc;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --secondary: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --surface: #ffffff;
  --border: #e2e8f0;
  --focus-ring: rgba(99, 102, 241, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.3);

  /* Game Themes */
  --g1-bg: #f5f3ff;
  /* Light Violet */
  --g1-accent: #8b5cf6;
  --g2-bg: #f0fdf4;
  /* Light Emerald */
  --g2-accent: #10b981;
  --g3-bg: #fff7ed;
  /* Light Orange */
  --g3-accent: #f97316;
  --g4-bg: #eff6ff;
  /* Light Blue */
  --g4-accent: #3b82f6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
    radial-gradient(at 50% 0%, rgba(139, 92, 246, 0.1) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.1) 0, transparent 50%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 span {
  display: inline-block;
  animation: wave 2s infinite ease-in-out;
}

@keyframes wave {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(10deg);
  }
}

main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container {
  width: 100%;
}

/* Cards & Sections */
.selector-container,
.game-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  border-bottom: 2px solid var(--bg);
  padding-bottom: 0.5rem;
}

.progress-counter {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--muted);
  float: right;
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 2px;
}

/* TTS Settings Panel */
.tts-settings-panel {
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  /* Hide default arrow */
}

.settings-title::-webkit-details-marker {
  display: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.setting-item label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-control {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: white;
}

.settings-control:focus {
  outline: none;
  border-color: var(--primary);
}

/* Inputs */
.word-input {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 1.1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  resize: vertical;
  margin-bottom: 1rem;
  color: var(--text);
}

.word-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-size: 1rem;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--muted);
}

.btn-nav {
  min-width: 120px;
  background: white;
  border: 2px solid var(--border);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
}

.btn-nav:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Specific button colors when NOT hovered to be more visible */
#g1 .btn-nav {
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--g1-accent);
}

#g2 .btn-nav {
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--g2-accent);
}

#g3 .btn-nav {
  border-color: rgba(249, 115, 22, 0.3);
  color: var(--g3-accent);
}

#g4 .btn-nav {
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--g4-accent);
}

/* Hover states override */
#g1 .btn-nav:hover {
  background: var(--g1-bg);
  border-color: var(--g1-accent);
}

#g2 .btn-nav:hover {
  background: var(--g2-bg);
  border-color: var(--g2-accent);
}

#g3 .btn-nav:hover {
  background: var(--g3-orange-bg, #fff7ed);
  border-color: var(--g3-accent);
}

#g4 .btn-nav:hover {
  background: var(--g4-bg);
  border-color: var(--g4-accent);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #fb7185);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: white;
  color: var(--text);
  border: 2px dashed var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f5f3ff;
}

.control-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.button-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Utility */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Game Themes & Selection Buttons */
#selectG1 {
  color: var(--g1-accent);
  border-color: var(--g1-accent);
}

#selectG1:hover {
  background: var(--g1-bg);
}

#selectG2 {
  color: var(--g2-accent);
  border-color: var(--g2-accent);
}

#selectG2:hover {
  background: var(--g2-bg);
}

#selectG3 {
  color: var(--g3-accent);
  border-color: var(--g3-accent);
}

#selectG3:hover {
  background: var(--g3-bg);
}

#selectG4 {
  color: var(--g4-accent);
  border-color: var(--g4-accent);
}

#selectG4:hover {
  background: var(--g4-bg);
}

#g1 {
  background: var(--g1-bg);
  border-color: rgba(139, 92, 246, 0.2);
}

#g1 .btn-primary {
  background: linear-gradient(135deg, var(--g1-accent), #a78bfa);
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.3);
  color: white;
}

#g1 .btn-nav:hover {
  border-color: var(--g1-accent);
  color: var(--g1-accent);
}

#g2 {
  background: var(--g2-bg);
  border-color: rgba(16, 185, 129, 0.2);
}

#g2 .btn-primary {
  background: linear-gradient(135deg, var(--g2-accent), #34d399);
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
  color: white;
}

#g2 .btn-nav:hover {
  border-color: var(--g2-accent);
  color: var(--g2-accent);
}

#g3 {
  background: var(--g3-bg);
  border-color: rgba(249, 115, 22, 0.2);
}

#g3 .btn-primary {
  background: linear-gradient(135deg, var(--g3-accent), #fb923c);
  box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.3);
  color: white;
}

#g3 .btn-nav:hover {
  border-color: var(--g3-accent);
  color: var(--g3-accent);
}

#g4 {
  background: var(--g4-bg);
  border-color: rgba(59, 130, 246, 0.2);
}

#g4 .btn-primary {
  background: linear-gradient(135deg, var(--g4-accent), #60a5fa);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
  color: white;
}

#g4 .btn-nav:hover {
  border-color: var(--g4-accent);
  color: var(--g4-accent);
}

.g1-boxes {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 3.5rem 0.5rem;
  /* Large vertical padding to accommodate pop up */
  overflow: hidden;
  width: 100%;
}

.g1-box {
  flex: 0 1 auto;
  min-width: 0;
  width: 60px;
  height: 72px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.g1-box.emph {
  border-color: var(--warning);
  background: #fffbeb;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
  z-index: 10;
}

.g1-box.pop-after {
  animation: popAfterPlace 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popAfterPlace {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }

  50% {
    transform: scale(1.8);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 20;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    z-index: 1;
  }
}

/* Game 2 - Missing Letters */
.g2-word-area {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  padding: 2rem 0.5rem;
  width: 100%;
  overflow: hidden;
}

.mc-blank {
  flex: 0 1 auto;
  min-width: 0;
  width: 56px;
  height: 68px;
  border: 2px dashed var(--warning);
  border-radius: 12px;
  background: #fffbeb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(1rem, 5vw, 1.8rem);
  color: var(--warning);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mc-blank:hover {
  border-style: solid;
  background: #fff3c4;
  transform: translateY(-2px);
}

.mc-blank.selected {
  border-style: solid;
  border-color: var(--warning);
  background: #fff3c4;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2);
  transform: translateY(-4px) scale(1.05);
}

.g2-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 20px;
}

.g2-option {
  min-width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: white;
  font-weight: 800;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.g2-option:hover:not(.used) {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.g2-option.used {
  opacity: 0.4;
  cursor: default;
  background: #e2e8f0;
}

/* Game 3 - Type Boxes */
.g3-boxes {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  padding: 2rem 0.5rem;
  width: 100%;
  overflow: hidden;
}

.g3-box {
  flex: 0 1 auto;
  min-width: 0;
  width: 56px;
  height: 68px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.g3-box input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: clamp(1rem, 5vw, 2rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text);
  font-family: inherit;
}

.g3-box input:focus {
  outline: none;
}

.g3-box.working {
  background: #fff1f2;
  border-color: var(--danger);
}

.g3-box.correct {
  background: #ecfdf5;
  border-color: var(--secondary);
}

.g3-box.wrong,
.mc-blank.wrong,
.g1-box.wrong {
  background: #fef2f2;
  border-color: var(--danger);
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

/* Game 4 - Final List */
.g4-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.g4-item {
  display: grid;
  grid-template-columns: 40px 1fr 60px 100px;
  gap: 1rem;
  align-items: center;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.g4-number {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary);
  text-align: center;
}

.g4-label {
  font-weight: 700;
  color: var(--muted);
}

.btn-row-check {
  min-width: auto;
  width: 100%;
  padding: 0.6rem;
  font-size: 0.9rem;
}

.g4-toggle-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--bg);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--secondary);
}

.toggle-switch input:focus+.toggle-slider {
  box-shadow: 0 0 1px var(--secondary);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-weight: 600;
  color: var(--text);
}

.g4-list.no-quick-check .g4-item {
  grid-template-columns: 40px 1fr 60px;
}

.g4-list.no-quick-check .btn-row-check {
  display: none;
}

.g4-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.g4-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.btn-pron {
  width: 50px;
  height: 50px;
  padding: 0;
  font-size: 1.5rem;
  border-radius: 12px;
}

/* Footer */
footer {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* How to Play Section */
.how-to-play {
  background: linear-gradient(to bottom right, #ffffff, #f1f5f9);
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.how-to-item {
  background: white;
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.how-to-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.how-to-item h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.how-to-item p,
.how-to-item ol {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

.how-to-item ol {
  padding-left: 1.2rem;
  margin-top: 0.5rem;
}

.how-to-item li {
  margin-bottom: 0.25rem;
}

.modal-overlay,
.completion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 2rem;
}

@keyframes scaleUp {
  from {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Completion Overlay Styles */
.completion-box {
  background: rgba(255, 255, 255, 0.95);
  padding: 3.5rem 2.5rem;
  border-radius: 40px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.3);
  animation: scaleUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.completion-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--warning), var(--danger));
}

.completion-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.completion-text {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.completion-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--bg);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  display: inline-block;
}

.modal-box {
  background: white;
  padding: 2rem;
  border-radius: 24px;
  max-height: 85vh;
  overflow-y: auto;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.set-row {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.set-row:last-child {
  border-bottom: none;
}

.set-info h4 {
  font-weight: 700;
  font-size: 1.1rem;
}

.set-preview {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.set-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  header h1 {
    font-size: 1.8rem;
  }

  .how-to-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .selector-container,
  .game-section {
    padding: 1.25rem;
  }

  .g4-item {
    grid-template-columns: 40px auto 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .g4-number {
    grid-column: 1;
    grid-row: 1;
  }

  .btn-pron {
    grid-column: 2;
    grid-row: 1;
  }

  .btn-row-check {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: auto;
    min-width: 80px;
  }

  .g4-input {
    grid-column: 1 / 4;
    grid-row: 2;
  }

  .g4-list.no-quick-check .g4-item {
    grid-template-columns: 40px auto;
  }

  .g4-list.no-quick-check .g4-input {
    grid-column: 1 / 3;
  }

  .btn {
    width: 100%;
  }

  .completion-box {
    padding: 2.5rem 1.5rem;
  }

  .completion-title {
    font-size: 1.8rem;
  }

  .completion-icon {
    font-size: 4rem;
  }
}

.completion-icon {
  font-size: 6rem;
  margin-bottom: 1.5rem;
  display: block;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 1rem 2rem;
  border-radius: 50px;
  background: white;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 200000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  border: 2px solid var(--border);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: var(--secondary);
  color: var(--secondary);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.back-button {
  display: inline-block;
  margin-top: 90px;
  margin-bottom: 20px;
  padding: 15px 30px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.back-button:hover {
  background: linear-gradient(135deg, #45a049, #4CAF50);
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

.back-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
  background: linear-gradient(135deg, #e30f16, #033ca0);
  color: white;
  padding: 20px;
  text-align: center;
  border-top: 2px solid #fff;
}

.social-media a {
  margin: 0 10px;
  text-decoration: none;
  color: white;
  font-size: 1.2em;
}

.footer-links {
  margin-top: 10px;
}

.footer-links a {
  color: #a6c1ee;
  text-decoration: none;
  margin: 0 10px;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Emoji Styles */
.emoji {
  font-size: 1.5em;
  margin: 0 5px;
}

/* Wrapper for AdSense units */
.adsense-banner-container {
    width: 100%; /* Take full width of parent */
    max-width: 970px; /* Limit max width for large screens (e.g., typical desktop ad banner size) */
    margin: 20px auto; /* Center the container horizontally and add vertical space */
    min-height: 100px; /* Ensure there's space for the ad, even if blank initially */
    text-align: center; /* Center the ad visually within its container if it's smaller than the container */
    /* Optional: Add a temporary background or border here to visualize the container during testing */
    /* background-color: rgba(0, 255, 0, 0.1); */
    /* border: 1px dashed green; */
}

/* Styles for the AdSense INS tag itself */
ins.adsbygoogle {
    display: block; /* This is crucial and must remain */
    /* AdSense JavaScript will manage its width and height based on the parent container (.adsense-banner-container) */
    /* Any other purely visual styles for the ins tag like border-radius can go here */
    border-radius: 10px; /* Optional: Matches your general design */
    overflow: hidden; /* Important: Prevents content from spilling out */
}

/* This rule is good for hiding completely blank ad slots */
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}
/* Responsive AdSense tweaks for smaller screens - Apply to container! */
@media (max-width: 768px) {
    .adsense-banner-container {
        margin: 15px auto; /* Adjust margin for smaller screens */
    }
    /* No need to adjust ins.adsbygoogle here, as the container manages size */
}