/* Estils generals */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  background-color: #23272e;
  color: #e0e0e0;
  transition: background-image 0.5s ease-in-out;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url('../assets/img/oficina.png'); /* Fallback retro office */
}

body.cartell-bg {
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #000 !important;
}

/* Fons per cada escena */
body[data-scene="preinici"] { background-image: url('../assets/img/edifici.png'); }
body[data-scene="inici"] { background-image: url('../assets/img/oficina.png'); }
body[data-scene="capDisponible"] { background-image: url('../assets/img/despatx-outside.png'); }
body[data-scene="trucarPorta"] { background-image: url('../assets/img/despatx-outside.png'); }
body[data-scene="esperaPassadis1"] { background-image: url('../assets/img/passadis.png'); }
body[data-scene="tornarOCercarIolanda"] { background-image: url('../assets/img/passadis.png'); }
body[data-scene="anarIolanda"] { background-image: url('../assets/img/sala-espera.png'); }
body[data-scene="iolandaDisponible"] { background-image: url('../assets/img/secretaria-outside.png'); }
body[data-scene="humorIolanda"] { background-image: url('../assets/img/secretaria.png'); }
body[data-scene="conversaIolanda"] { background-image: url('../assets/img/secretaria.png'); }
body[data-scene="voltaOrganitzacio"] { background-image: url('../assets/img/sala-espera.png'); }
body[data-scene="capTornaOno"] { background-image: url('../assets/img/secretaria.png'); }
body[data-scene="conversaEterna"] { background-image: url('../assets/img/secretaria.png'); }
body[data-scene="trucarPorta2"] { background-image: url('../assets/img/despatx-outside.png'); }
body[data-scene="esperarOMitjaVolta"] { background-image: url('../assets/img/despatx-outside.png'); }
body[data-scene="entrarDespatx"] { background-image: url('../assets/img/despatx.png'); }
body[data-scene="parlarProblema"] { background-image: url('../assets/img/despatx.png'); }
body[data-scene="alarmaSanitaria"] { background-image: url('../assets/img/edifici.png'); }
body[data-scene="nouCapSeccio"] { background-image: url('../assets/img/despatx-outside.png'); }
body[data-scene="discursEmpleat"] { background-image: url('../assets/img/despatx.png'); }
body[data-scene="fiIntent1"] { background-image: url('../assets/img/despatx-outside.png'); }
body[data-scene="hermenegildaIntroduccio"] { background-image: url('../assets/img/oficina.png'); }
body[data-scene="anarHermenegilda"] { background-image: url('../assets/img/sala-espera.png'); }
body[data-scene="hermenegildaDisponible"] { background-image: url('../assets/img/secretaria-outside.png'); }
body[data-scene="humorHermenegilda"] { background-image: url('../assets/img/secretaria2.png'); }
body[data-scene="conversaHermenegilda"] { background-image: url('../assets/img/secretaria2.png'); }
body[data-scene="finalVane"] { background-image: url('../assets/img/sala-espera.png'); }
body[data-scene="anarVanessa"] { background-image: url('../assets/img/sala-espera.png'); }
body[data-scene="vanessaDisponible"] { background-image: url('../assets/img/secretaria-outside.png'); }
body[data-scene="cafeteraVane"] { background-image: url('../assets/img/secretaria.png'); }
body[data-scene="condecoracio"] { background-image: url('../assets/img/edifici.png'); }
body[data-scene="banquet"] { background-image: url('../assets/img/edifici.png'); }
body[data-scene="loopFinal"] { background-image: url('../assets/img/edifici.png'); }
body[data-scene="end"] { background-image: url('../assets/img/edifici.png'); }

/* Contenidor principal */
#app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* Contenidor de l'escena */
.scene-container {
  background: rgba(30, 32, 38, 0.92);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease-in-out;
  overflow-y: auto;
}

.scene-overlay {
  position: relative;
  z-index: 1;
}

/* Elements interactius */
#options {
  margin-top: 2rem;
}

/* Botons generals del joc (aplica a button i a.button) */
button, .button, a.button, .theater-more-info-btn {
  display: inline-block;
  background: #2c3e50;
  color: white !important;
  border: none;
  padding: 12px 20px;
  margin: 8px 0 0 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
button:hover, .button:hover, a.button:hover, .theater-more-info-btn:hover {
  background: #34495e;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  text-decoration: underline;
}
button:active, .button:active, a.button:active, .theater-more-info-btn:active {
  transform: translateY(0);
}

button.hidden {
  opacity: 0.3;
  pointer-events: none;
}

button.special {
  background: #8e44ad;
  border-left: 4px solid #9b59b6;
}

button.special:hover {
  background: #9b59b6;
}

/* Barra de progrés */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #eee;
  z-index: 1000;
}

#progress-fill {
  height: 100%;
  background: #2ecc71;
  width: 0%;
  transition: width 0.3s ease-in-out;
}

/* Display del temps */
#time-display {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(30, 32, 38, 0.92);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  z-index: 1000;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#time-value {
  font-weight: bold;
  color: #2ecc71;
}

/* Missatges irònics */
#ironic-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 1000;
}

#ironic-message.show {
  opacity: 1;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal h2 {
  margin-top: 0;
  color: #2c3e50;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.modal-buttons button {
  width: auto;
  min-width: 120px;
}

/* Logros */
.achievement {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(46, 204, 113, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 0.9rem;
  transform: translateX(120%);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
}

.achievement.show {
  transform: translateX(0);
}

/* Animacions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
  animation: slideUp 0.5s ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(-8px); }
  40% { transform: translateY(0); }
  60% { transform: translateY(-5px); }
  80% { transform: translateY(0); }
}
.theater-notif-btn .notif-icon.bounce {
  animation: bounce 0.8s;
}

/* Responsive */
@media (max-width: 768px) {
  .scene-container {
    margin: 1rem;
    padding: 1rem;
  }

  button {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  #ironic-message {
    top: auto;
    bottom: 10px;
    left: 10px;
  }
}

/* Estils per a la llista de logros */
.achievements-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.achievements-list li {
  padding: 8px 12px;
  margin: 4px 0;
  background: #f8f9fa;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.achievements-list li.unlocked {
  background: #e8f5e9;
  color: #2e7d32;
}

.achievements-list li.locked {
  opacity: 0.6;
}

/* Estils per al modal d'estadístiques */
#stats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.stats-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
}

.stats-content h2 {
  margin-top: 0;
  color: #2c3e50;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 4px;
}

.stat-item h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

.stat-item p {
  margin: 0.5rem 0 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
}

.close-stats {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: auto;
}

.close-stats:hover {
  color: #333;
  background: none;
  transform: none;
  box-shadow: none;
}

#situation {
  color: #f0f0f0;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.mute-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mute-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.mute-button.muted {
  background: rgba(255, 0, 0, 0.7);
}

/* Banner de l'obra de teatre */
.theater-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #666;
  max-width: 80%;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.theater-banner:hover {
  transform: translateX(-50%) translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.theater-banner h3 {
  margin: 0 0 8px 0;
  font-size: 1.2em;
  color: #ffd700;
}

.theater-banner p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
}

.theater-banner a {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.theater-banner a:hover {
  color: #fff;
  text-decoration: underline;
}

.theater-banner .dates {
  margin-top: 8px;
  font-style: italic;
  color: #ccc;
}

@media (max-width: 600px) {
  .theater-banner {
    padding: 8px 8px;
    font-size: 0.8em;
    max-width: 96%;
    left: 2%;
    border-radius: 6px;
  }
  .theater-banner .dates {
    font-size: 0.95em;
  }
  .theater-banner a {
    font-size: 1em;
  }
}

/* Botó de notificació teatre */
.theater-notif-btn {
  position: fixed;
  top: 20px;
  right: 70px;
  background: rgba(0,0,0,0.85);
  color: #ffd700;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1101;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-left: 0;
}
.mute-button {
  right: 20px;
  top: 20px;
}
.theater-notif-btn:hover {
  background: #222;
  transform: scale(1.08);
}
.theater-notif-btn .notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #ff2d2d;
  border-radius: 50%;
  border: 2px solid #fff;
  display: block;
  z-index: 2;
}
@media (max-width: 600px) {
  .theater-notif-btn {
    right: 70px;
    top: 20px;
    width: 36px;
    height: 36px;
    font-size: 1.1em;
  }
  .mute-button {
    right: 20px;
    top: 20px;
    width: 36px;
    height: 36px;
    font-size: 1.1em;
  }
  .theater-notif-btn .notif-dot {
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
  }
}

/* Modal de teatre */
.theater-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.theater-modal-content {
  background: #181818;
  color: #fff;
  border-radius: 12px;
  padding: 2.2em 1.5em 1.5em 1.5em;
  max-width: 95vw;
  width: 350px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  position: relative;
  font-family: 'Courier New', monospace;
}
.theater-modal-content .dates {
  font-size: 1.1em;
  font-style: italic;
  color: #ffd700;
  margin-bottom: 1.2em;
}
.theater-modal-content a {
  color: #ffd700;
  font-weight: bold;
  text-decoration: none;
  font-size: 1.1em;
}
.theater-modal-content a:hover {
  color: #fff;
  text-decoration: underline;
}
.theater-modal-close {
  position: absolute;
  top: 0.7em;
  right: 1em;
  background: none;
  border: none;
  color: #ffd700;
  font-size: 2em;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}
.theater-modal-close:hover {
  color: #fff;
}

/* Amaga el banner flotant antic a mòbil */
@media (max-width: 600px) {
  .theater-banner { display: none !important; }
}

.theater-more-info-btn {
  display: inline-block;
  background: #2c3e50;
  color: white !important;
  border: none;
  padding: 12px 20px;
  margin: 8px 0 0 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.theater-more-info-btn:hover {
  background: #34495e;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  text-decoration: underline;
}
.theater-more-info-btn:active {
  transform: translateY(0);
} 