/*
 * ===================================================================
 * i̅n̅t̅u̅i̅ — Estilos da Interface Refatorada com CSS Custom Properties
 * ===================================================================
 */

:root {
  /* ── Temas e Cores ── */
  --theme-bg: url("./temas/mesa_myst.webp");
  --table-brightness: 100%;
  --card-opacity: 1;
  --card-back-img: url("./icones/verso_intui.webp");

  /* ── Dimensões ── */
  --card-width: 240px;
  --card-height: 430px;

  /* ── Fontes ── */
  --font-title: "IMFellEnglish-Regular", Georgia, serif;
  --font-body: "Lato-Regular", Helvetica, sans-serif;
}

@font-face {
  font-family: "IMFellEnglish-Regular";
  src: url("fonts/IMFellEnglish-Regular.ttf");
  font-display: swap;
}

@font-face {
  font-family: "Lato-Regular";
  src: url("fonts/Lato-Regular.ttf");
  font-display: swap;
}

/* ── Reset Mínimo e Fundo ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: #000;
  user-select: none;
}

#background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#backgroundimagem {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(var(--table-brightness));
  transition: filter 0.3s ease;
}

#mesa {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
}

#moldura {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

/* ── Baralho das Cartas (tarot-deck) ── */
tarot-deck#baralho {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}

.divcartas {
  position: absolute;
  cursor: pointer;
  user-select: none;
}

.divcartas img.cartas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.divcartas img.cartas:hover {
  filter: brightness(1.15);
}

.divcartas img.cartas.tiradas,
.divcartas img.cartas[data-retirada="true"] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ── Cartas Sorteadas (tarot-card) ── */
tarot-card {
  opacity: var(--card-opacity);
  transition: opacity 0.3s ease;
  width: var(--card-width);
  height: var(--card-height);
  z-index: 100;
  pointer-events: auto;
}

tarot-card img.imagem-carta {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.6));
}

tarot-card img.estado2 {
  transform: rotate(180deg);
}

/* Toolbars da carta ao passar o mouse */
tarot-card .cabecalhodascartas {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 20px;
  padding: 4px 8px;
  gap: 8px;
  z-index: 150;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
}

tarot-card .rodapedascartas {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 20px;
  padding: 4px 8px;
  gap: 8px;
  z-index: 150;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
}

tarot-card .cabecalhodascartas img,
tarot-card .rodapedascartas img {
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

tarot-card .cabecalhodascartas img:hover,
tarot-card .rodapedascartas img:hover {
  transform: scale(1.2);
}

/* Palavras-chave */
.palavrasChaveFundo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 10, 5, 0.92);
  border: 1px solid #ff9d00;
  border-radius: 8px;
  padding: 10px 14px;
  color: #f2e3c6;
  width: 220px;
  z-index: 160;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.palavrasChave h2 {
  font-family: var(--font-title);
  font-size: 16px;
  color: #ff9d00;
  text-align: center;
  margin-bottom: 6px;
}

.palavrasChave ul {
  list-style: none;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

/* ── Overlays (Texto Explicativo & Menuzão) ── */
.overlay, .menuzao-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: rgba(12, 6, 3, 0.96);
  overflow-y: auto;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
  color: #e8d7be;
}

/* ── Estilização sutil da Barra de Rolagem (Scrollbar Marrom) ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 8, 4, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #5c3a21;
  border-radius: 4px;
  border: 1px solid rgba(255, 157, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: #8c5732;
  border-color: rgba(255, 157, 0, 0.5);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #5c3a21 rgba(15, 8, 4, 0.5);
}

.overlay .closebtn, .menuzao-overlay .closebtn-menuzao {
  position: fixed;
  top: 20px;
  right: 25px;
  z-index: 210;
}

.overlay .closebtn img, .menuzao-overlay .closebtn-menuzao img {
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.textoPrincipal {
  max-width: 800px;
  margin: 60px auto 40px 100px;
}

.textoPrincipal h1 {
  font-family: var(--font-title);
  font-size: 38px;
  color: #ffb74d;
  margin-bottom: 20px;
}

.textoPrincipal p {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 16px;
  color: #d1c4e9;
}

.colunaDireita {
  position: absolute;
  top: 80px;
  right: 80px;
  width: 320px;
}

.colunaDireita img {
  width: 180px;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7);
}

/* ── Menuzão Grid ── */
.conteudoMenuzao {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.conteudoMenuzao h1 {
  font-family: var(--font-title);
  font-size: 36px;
  color: #ff9d00;
  text-align: center;
  margin-bottom: 40px;
}

.secaoNaipe h2 {
  font-family: var(--font-title);
  font-size: 24px;
  color: #ffa726;
  border-bottom: 1px solid #4a2c00;
  padding-bottom: 8px;
  margin: 30px 0 15px 0;
}

.gridMenuzao {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 15px;
}

.itemMenuzao {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.itemMenuzao:hover {
  transform: scale(1.08);
}

.itemMenuzao img {
  width: 90px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.itemMenuzao span {
  font-size: 11px;
  text-align: center;
  margin-top: 4px;
  color: #c7b299;
}

/* ── Barra de Ferramentas (settings-toolbar) ── */
settings-toolbar {
  position: fixed;
  top: 15px;
  left: 20px;
  z-index: 100;
}

.toolbar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px; /* Mantém a altura constante para evitar que o hambúrguer se mova verticalmente */
}

.menu-hamburger {
  width: 38px;
  height: 38px;
  cursor: pointer;
  background: rgba(15, 8, 4, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 157, 0, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.menu-hamburger:hover {
  transform: scale(1.1);
  border-color: #ff9d00;
}

.toolbar-container {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 8, 4, 0.85);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 157, 0, 0.3);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
}

.toolbar-container.collapsed {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

.btn-tool {
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-tool:hover {
  transform: scale(1.15);
}

#textInput {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #ff9d00;
  border-radius: 15px;
  color: #ffe0b2;
  padding: 4px 12px;
  font-size: 13px;
  outline: none;
  width: 180px;
}

.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 8, 4, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid #ff9d00;
  border-radius: 12px;
  padding: 12px;
  z-index: 110;
  box-shadow: 0 8px 25px rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropdown-grid {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
}

.dropdownTemas-grid {
  grid-template-columns: repeat(5, 1fr);
}

.dropdownVersos-grid {
  grid-template-columns: repeat(5, 1fr);
}

.dropdownBaralhos-grid {
  grid-template-columns: repeat(3, 1fr);
}

.dropdownDisposicoes-grid {
  grid-template-columns: 1fr;
}

.item-dropdown-thumb {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 157, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Dimensões específicas para cada menu */
.dropdownTemas-grid .item-dropdown-thumb {
  width: 68px;
  height: 40px; /* Formato paisagem */
}

.dropdownBaralhos-grid .item-dropdown-thumb,
.dropdownVersos-grid .item-dropdown-thumb {
  width: 68px;
  height: 120px; /* Formato vertical (carta) */
}

.dropdownDisposicoes-grid .item-dropdown-thumb {
  width: 68px;
  height: 68px; /* Dobro do tamanho */
}

.item-dropdown-thumb:hover {
  transform: scale(1.1);
  border-color: #ff9d00;
  box-shadow: 0 0 10px rgba(255, 157, 0, 0.6);
}

.item-dropdown-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Player de Música (Topo Direito Expansível) ── */
music-player {
  position: fixed;
  top: 21px;
  right: 20px;
  z-index: 100;
}

.music-player-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  background: rgba(15, 8, 4, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 157, 0, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

music-player:hover .music-player-wrapper {
  width: auto;
  height: 38px;
  border-radius: 20px;
  padding: 5px 12px;
  justify-content: flex-end;
}

.music-player-items {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

music-player:hover .music-player-items {
  max-width: 320px;
  opacity: 1;
  pointer-events: auto;
  margin-right: 6px;
}

.icone-player {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.icone-player:hover {
  transform: scale(1.15);
}

.volume-trigger {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#volume {
  width: 70px;
  accent-color: #ff9d00;
  cursor: pointer;
}

/* ── Modais de Confirmação e Info ── */
.confirmacao-overlay, .modal-info-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.confirmacao-box, .modal-info-box {
  background: #190f07;
  border: 2px solid #ff9d00;
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  color: #f5e6d3;
  box-shadow: 0 10px 30px rgba(0,0,0,0.9);
}

.botoes-confirmacao {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.btn-confirmar, .btn-mp-primary {
  background: #ff9d00;
  color: #000;
  font-weight: bold;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-cancelar, .btn-mp-secundary {
  background: #3a2512;
  color: #fff;
  border: 1px solid #ff9d00;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
}

/* ── Cursores Remotos (Multiplayer) ── */
.virtual-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 250;
  transition: left 0.05s linear, top 0.05s linear;
}

.virtual-cursor-label {
  position: absolute;
  top: 16px;
  left: 10px;
  font-size: 11px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}

/* ── Embaralhamento Interativo ── */
#embaralhamentoInterativo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 290;
}

.cartaEmbInt {
  width: 80px;
  height: 143px; /* Mantém a proporção das cartas 200x358 */
  cursor: grab;
  user-select: none;
}

.imagemEmbInt {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  pointer-events: none;
}
