/* ===== RESET GERAL ===== */
* {
  box-sizing: border-box;
}

/* ===== BODY ===== */
body {
  margin: 0;
  padding: 20px;
  background: #eaeaea;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: sans-serif;
}

/* ===== VIEWER ===== */
#viewer{
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== BOOK ===== */
#book {
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 120px);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  background: white;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

/* ===== CONTROLS ===== */
.controls {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2px;
}

/* ===== BUTTON ===== */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 35px;
  min-height: 35px;
  padding: 6px;
  font-size: clamp(14px, 2vw, 18px);
  border: none;
  background: #333;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  user-select: none;
}

button:hover {
  background: #555;
}

/* ===== FULLSCREEN ===== */
:fullscreen #book {
  margin-top: 50px;
  height: calc(100vh - 140px);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

  .controls { display: none; }

  body {
    overflow-y: auto;
    padding: 0;
  }

  #book {
    width: 100%;
    height: auto;
    max-height: none;
    display: block;
    box-shadow: none;
  }

  #book img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 5px;
  }
}

/* ===== MENU DE IDIOMAS ===== */
.langMenu{
  position: absolute;
  top: 60px;
  right: 90px;
  z-index: 9999;

  background: rgba(90, 65, 55, 0.85); /* marrom elegante */
  border-radius: 12px;
  padding: 10px 12px;

  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
}

.langRow{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.flag{
  font-size: 15px;
  width: 20px;
  display: inline-flex;
  justify-content: center;
}

.sep{
  opacity: .8;
}

.langMenu a{
  color: #fff;
  text-decoration: none;
  transition: 0.2s;
}

.langMenu a:hover{
  opacity: 0.8;
}

.activeLang{
  opacity: .7;
  text-decoration: underline;
  cursor: default;
}

/* Linha do botão início */
.homeRow{
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.25);
}
.flagImg{
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .langMenu{
    left: 50%;
    right: auto;
    transform: translateX(-50%) scale(1.08);
    top: 20px;
    padding: 12px 14px;
    font-size: 15px;
  }

  .flag{
    font-size: 16px;
    width: 22px;
  }

  .flagImg{
    width: 20px;
    height: 13px;
  }

  .langRow{
    gap: 10px;
    margin: 6px 0;
  }
}
