/*
 * Écran du café (version ordinateur) : carte du chat à gauche, lecteur de messages à droite.
 * L'onglet Amoureux pose la classe .lovers sur .cafe, qui passe tout le décor en rose.
 * Les adaptations téléphone sont dans cafe-mobile.css.
 */
.cafe {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--white-off);
  font-family: var(--pixel-font);
  font-size: 20px;
  background: url(../background.png) center / cover;
  transition: filter 1s ease-in-out, transform 1s ease-in-out;
}
.cafe.leaving { filter: blur(15px); transform: scale(1.1); }
.cafe.leaving .content-wrapper,
.cafe.leaving .back-button { opacity: 0; transform: scale(.95); pointer-events: none; }

.back-button {
  color: var(--purple-primary);
  background: var(--white-off);
  border: 2px solid var(--purple-primary);
  box-shadow: 3px 3px rgba(0, 0, 0, .2);
  transition: opacity .5s ease-in-out, transform .5s ease-in-out;
}

/* Zone invisible sur le chat endormi du décor : ouvre la photo de Bibou */
.cat-hotspot {
  position: absolute;
  bottom: 20px;
  left: 150px;
  z-index: 100;
  width: 400px;
  height: 200px;
  padding: 0;
  background: none;
  border: none;
  cursor: help;
}

.content-wrapper {
  position: relative;
  z-index: 101;
  display: flex;
  align-items: center;
  gap: 30px;
  width: 95%;
  max-width: 1200px;
  height: 80vh;
  pointer-events: none;
  transition: opacity .5s ease-in-out, transform .5s ease-in-out;
}
.content-wrapper > * { pointer-events: auto; }

.pixel-box { border-radius: var(--radius-pixel); box-shadow: 6px 6px rgba(0, 0, 0, .2); }
.white-theme { color: var(--text-dark); background-color: var(--white-off); }
.glass-theme {
  background-color: var(--glass-bg);
  border: 2px solid rgba(168, 132, 243, .3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Carte de gauche */
.profile-card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  width: 260px;
  height: 45vh;
  padding: 30px 15px;
  overflow: hidden;
  text-align: center;
}
.user-name {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: auto 0;
  font-size: 2.5rem;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: break-word;
}
.speaker-name-sub {
  position: relative;
  z-index: 5;
  min-height: 1.5em;
  margin: -10px 0 10px;
  color: var(--purple-primary);
  font-size: 1.5rem;
  text-align: center;
}
.pixel-button {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 25px;
  color: #fff;
  font-family: var(--pixel-font);
  font-size: 1.4rem;
  background-color: var(--purple-primary);
  border: none;
  border-radius: 25px;
  box-shadow: 3px 3px rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: transform .1s;
}
.pixel-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px rgba(0, 0, 0, .3); }

/* Lecteur de droite */
.message-box {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  padding: 30px;
  overflow: hidden;
  position: relative;
}
.tabs-container { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-btn {
  flex: 1;
  padding: 8px;
  color: #fff;
  font-family: var(--pixel-font);
  font-size: 1.2rem;
  background: rgba(255, 255, 255, .1);
  border: 2px solid rgba(168, 132, 243, .3);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}
.tab-btn.active { background: var(--purple-primary); border-color: #fff; box-shadow: 0 0 10px rgba(168, 132, 243, .5); }
.tab-btn:hover:not(.active) { background: rgba(255, 255, 255, .2); }

.message-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.message-title { margin: 0; font-size: 2rem; }
.quote-counter {
  padding: 2px 10px;
  color: rgba(255, 255, 255, .7);
  font-size: 1.4rem;
  background: rgba(0, 0, 0, .2);
  border-radius: 6px;
}

.sender-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 10px 0;
}
.sender-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin-bottom: 10px;
  overflow: hidden;
}
.pixel-avatar {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 3px solid var(--purple-primary);
  border-radius: 15px;
  box-shadow: 4px 4px rgba(0, 0, 0, .2);
}
.pixel-avatar[hidden], .pixel-art-icon[hidden] { display: none; }
.pixel-art-icon { font-size: 4rem; }

.player-error {
  margin: 0 0 10px;
  padding: 6px 12px;
  color: #fff;
  font-size: 1.3rem;
  text-align: center;
  background: rgba(220, 20, 60, .6);
  border-radius: 8px;
}

.audio-player-custom {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: auto;
  padding: 15px 20px;
  border-radius: 40px;
}
.play-button {
  display: flex;
  justify-content: center;
  width: 30px;
  padding: 0;
  color: var(--purple-primary);
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.play-button.loading { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.voice-volume-control { position: relative; display: flex; align-items: center; height: 30px; cursor: pointer; }
.voice-icon { z-index: 2; padding: 0 5px; font-size: 1.2rem; background: var(--white-off); }
.voice-slider-wrapper { display: flex; align-items: center; width: 0; overflow: hidden; transition: width .3s ease; }
.voice-volume-control:hover .voice-slider-wrapper,
.voice-volume-control:focus-within .voice-slider-wrapper { width: 80px; margin-left: 5px; }
.voice-v-slider { width: 70px; }

.progress-bar-container {
  flex-grow: 1;
  height: 12px;
  overflow: hidden;
  background-color: #eaeaea;
  border-radius: 6px;
  cursor: pointer;
}
.progress-bar-fill {
  width: 0;
  height: 100%;
  background-color: var(--purple-primary);
  border-radius: 6px;
  transition: width .1s linear;
}

/* Le chat animé de la carte */
.cat-container { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: center; width: 100%; height: 180px; transform: scale(.8); }
.cat { position: relative; width: 100%; max-width: 200px; margin-top: 50px; animation: purr 5s cubic-bezier(0, .75, 1, .25) infinite; }
.cat * { margin-left: auto; margin-right: auto; text-align: center; }
.cat .body, .cat .ears, .cat .eyes, .cat .muzzle, .cat .paw, .cat .tail, .cat .tail-segment { position: relative; }
.cat .body, .cat .head, .cat .paw, .cat .tail-segment { background-color: #3e2f5b; }
.cat .left { float: left; }
.cat .right { float: right; }
.cat .head { position: relative; z-index: 100; width: 100px; height: 90px; border-radius: 50%; animation: head-bob 5s ease-in-out infinite; }
.cat .ears { top: -20px; z-index: -100; }
.cat .ear { width: 0; height: 0; border-left: 25px solid transparent; border-right: 25px solid transparent; border-bottom: 50px solid #3e2f5b; }
.cat .ear.left { transform: rotate(-20deg) translate(-10px); }
.cat .ear.right { transform: rotate(20deg) translate(10px); }
.cat .eyes { top: -18px; width: 60%; }
.cat .eye { width: 16px; height: 16px; background-color: gold; border-radius: 50%; animation: eye-blink 5s infinite; }
.cat .muzzle { top: 50px; }
.cat .nose { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid var(--purple-primary); }
.cat .body { top: -75px; left: 0; z-index: -10; width: 200px; height: 120px; border-top-left-radius: 200px; border-top-right-radius: 200px; }
.cat .paw { top: 90px; left: -80px; width: 50px; height: 30px; border-radius: 25px; }
.cat .tail { top: -100px; left: 85px; width: 30px; transform: rotate(90deg); }
.cat .tail-segment { top: 0; left: 10px; width: 30px; height: 20px; border-radius: 25px; animation: tail-swish 5s cubic-bezier(.8, 0, .2, 1) infinite; }
.heart-overlay { display: none; position: absolute; top: -40px; left: 50%; font-size: 2rem; transform: translate(-50%); animation: float-heart 2s ease-in-out infinite; }

@keyframes float-heart { 0%, to { transform: translate(-50%) translateY(0); } 50% { transform: translate(-50%) translateY(-10px); } }
@keyframes tail-swish { 0%, 10% { transform: rotate(12deg); } 40% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } 60% { transform: rotate(-5deg); } to { transform: rotate(12deg); } }
@keyframes head-bob { 0%, 10%, 90%, to { transform: translate(-15px) translateY(45px); } 30%, 75% { transform: translate(0) translateY(0); } }
@keyframes eye-blink { 0%, 10% { transform: scaleY(0); } 15%, 48% { transform: scaleY(1); } 50% { transform: scaleY(0); } 52%, 90% { transform: scaleY(1); } 95%, to { transform: scaleY(0); } }
@keyframes purr { 0%, 2%, 4%, 6%, 8%, 10%, 12%, 14%, 16%, 18%, 20%, 95%, 97%, 99% { left: -1px; } 1%, 3%, 5%, 7%, 9%, 11%, 13%, 15%, 17%, 19%, 21%, 94%, 96%, 98%, to { left: 0; } }

/* Thème Amoureux */
.cafe.lovers .profile-card { background-color: #fff0f5; border: 3px solid var(--pink); }
.cafe.lovers .speaker-name-sub { color: var(--pink); text-shadow: 0 0 5px rgba(255, 105, 180, .3); }
.cafe.lovers .next-button { background-color: var(--pink); box-shadow: 3px 3px rgba(220, 20, 60, .4); }
.cafe.lovers .message-box { background: linear-gradient(135deg, rgba(255, 105, 180, .4), rgba(220, 20, 60, .4)); border: 2px solid var(--pink); box-shadow: 0 0 20px rgba(255, 105, 180, .5); }
.cafe.lovers .message-box::before { content: "❤️"; position: absolute; top: -20px; right: -20px; font-size: 5rem; opacity: .1; transform: rotate(20deg); pointer-events: none; }
.cafe.lovers .quote-counter { color: var(--pink); background: rgba(255, 255, 255, .5); box-shadow: 0 0 5px rgba(255, 105, 180, .2); }
.cafe.lovers .pixel-avatar { border: 3px solid var(--pink); box-shadow: 0 0 15px rgba(255, 105, 180, .6); }
.cafe.lovers .cat .body, .cafe.lovers .cat .head, .cafe.lovers .cat .paw, .cafe.lovers .cat .tail-segment { background-color: var(--pink); }
.cafe.lovers .cat .ear { border-bottom-color: var(--pink); }
.cafe.lovers .heart-overlay { display: block; }

/* Photo de Bibou */
.easter-egg-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
  animation: fade-in .3s ease;
}
.easter-egg-modal[hidden] { display: none; }
.easter-egg-content {
  padding: 20px;
  text-align: center;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(168, 132, 243, .5);
  animation: pop-in .3s cubic-bezier(.175, .885, .32, 1.275) both;
}
.easter-egg-content img { max-width: 80vw; max-height: 70vh; border: 3px solid var(--purple-primary); border-radius: 10px; }
.easter-egg-content p { margin: 10px 0 0; color: var(--bg-purple-dark); font-family: var(--pixel-font); font-size: 2rem; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.8); } to { transform: scale(1); } }
