/* Modal avanzado y lista de palabras */
#advanced-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000a;
  z-index: 1000;
}

#advanced-modal > div {
  background: #fff;
  color: #222;
  max-width: 480px;
  min-width: 320px;
  margin: 5vh auto;
  padding: 1.5rem 1.2rem 1.2rem 1.2rem;
  border-radius: 18px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

#close-advanced {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

#advanced-modal .controls {
  margin-bottom: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: flex-start;
}

#advanced-modal .controls span {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

#advanced-modal .controls label {
  font-size: 0.98em;
}

#advanced-modal .controls button {
  padding: 0.3em 0.8em;
  font-size: 0.97em;
  border-radius: 6px;
  border: 1px solid #bbb;
  background: #f3f4f6;
  cursor: pointer;
}

/* Resto de estilos */
#all-words-list {
  max-height: 48vh;
  overflow: auto;
  margin-top: 0.2rem;
}

#all-words-list > div {
  border-bottom: 1px solid #eee;
  padding: 8px 0;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#all-words-list > div:hover {
  background: #f8fafc;
}
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5em;
  outline: none;
}
.fav-btn svg {
  vertical-align: middle;
  transition: transform 0.2s;
  width: 22px;
  height: 22px;
}
.fav-btn:hover svg {
  transform: scale(1.2);
  filter: drop-shadow(0 0 2px #FFD700);
}
body {
  font-family: sans-serif;
  padding: 2rem;
  background: #fdf6e3;
  transition: background 0.3s, color 0.3s;
}
body.dark {
  background: #1e1e1e;
  color: #f0f0f0;
}

.card {
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  border: 2px solid #999;
  border-radius: 8px;
  background: #fff;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
  cursor: grab;
  width: fit-content;
}
body.dark .card {
  background: #2a2a2a;
  border-color: #777;
}
.card.m { background-color: #bfdbfe; border-color: #60a5fa; }
.card.f { background-color: #fbcfe8; border-color: #f472b6; }
.card.n { background-color: #bbf7d0; border-color: #34d399; }

.drop-slot {
  min-height: 40px;
  padding: 1rem;
  border: 2px dashed #aaa;
  border-radius: 8px;
  text-align: center;
  background: #fff;
  transition: background 0.3s;
  position: relative;
}
.drop-slot:hover { background: #f3f4f6; }

.drop-slot.drop-accepted {
  animation: slotPulse 0.4s ease;
  border-color: #2563eb;
}
@keyframes slotPulse {
  0% { transform: scale(1); background-color: #e0f2fe; }
  50% { transform: scale(1.05); background-color: #bae6fd; }
  100% { transform: scale(1); background-color: #fff; }
}

.declined.m { color: #1d4ed8; }
.declined.f { color: #be185d; }
.declined.n { color: #047857; }

.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: gold;
  border-radius: 50%;
  opacity: 0.8;
  pointer-events: none;
  animation: sparkleFade 0.8s forwards;
}
@keyframes sparkleFade {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.tooltip {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.verb-container:hover .tooltip {
  visibility: visible;
}
.verb-container {
  position: relative;
  text-align: center;
}

.sentence-output {
  grid-column: 1 / -1;
  font-style: italic;
  margin-top: 0.5rem;
}

#export-area {
  white-space: pre-wrap;
  margin-top: 2rem;
}

#noun-container {
  display: flex;
  flex-wrap: wrap;
}

#advanced-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000a;
  z-index: 1000;
}

#advanced-modal > div {
  background: #fff;
  color: #222;
  max-width: 480px;
  min-width: 320px;
  margin: 5vh auto;
  padding: 1.5rem 1.2rem 1.2rem 1.2rem;
  border-radius: 18px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

#close-advanced {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

span {
  flex: 1;
}

#go-to-game-btn {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius, 8px);
  background-color: var(--primary, #3b82f6);
  color: var(--text, #fff);
  border: none;
  cursor: pointer;
  margin-top: 1rem;
}

#go-to-game-btn:hover {
  background-color: var(--secondary, #9333ea);
}