/* ============================================================
   Economia dos Milionários — Estilos
   ============================================================ */

body {
  font-family: 'Segoe UI', sans-serif;
  background: #0d1117;
  color: #eee;
  padding-top: 62px;
}

/* ── Tabuleiro 3D ─────────────────────────────────────────── */

/* Remove o padding/background do painel para o tabuleiro não desperdiçar espaço */
#divTabuleiro {
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  min-height: 0 !important;
  margin-top: 4px !important;
}

.tabuleiro-wrapper {
  perspective: 1400px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4px 4px 0;
}

.tabuleiro-frame {
  width: min(98vw, calc(100vh - 82px));
  transform: rotateX(10deg);
  transform-origin: center 92%;
  transition: transform 0.55s ease;

  /* Wood frame */
  background:
    linear-gradient(160deg,
      #a0621e 0%, #6b3a10 20%, #8b4513 40%,
      #5c2e0a 60%, #9c5a1c 80%, #6b3a10 100%);
  padding: 15px;
  border-radius: 20px;
  box-shadow:
    0 0 0 2px #D2B48C,
    0 0 0 5px #4a2008,
    0 0 0 7px rgba(210,180,140,0.3),
    0 35px 70px rgba(0,0,0,0.8),
    0 15px 35px rgba(0,0,0,0.5),
    inset 0 2px 6px rgba(255,200,100,0.25),
    inset 0 -2px 6px rgba(0,0,0,0.5);
}

.tabuleiro-wrapper:hover .tabuleiro-frame {
  transform: rotateX(3deg);
}

.tabuleiro-grid {
  display: grid;
  grid-template-columns: 3fr repeat(15, 1fr) 3fr;
  grid-template-rows: 3fr repeat(15, 1fr) 3fr;
  gap: 2px;
  background: #050d1a;
  border-radius: 10px;
  padding: 2px;
  aspect-ratio: 1;
}

/* ── Casas individuais ────────────────────────────────────── */

.casa {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  cursor: default;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.casa:hover {
  transform: scale(1.14);
  z-index: 30;
  box-shadow: 0 0 18px rgba(255,255,255,0.35), 0 0 6px rgba(255,255,255,0.15);
}

.casa-conteudo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2px 1px;
}

.casa-num {
  font-size: clamp(0.3rem, 0.5vmin, 0.65rem);
  opacity: 0.3;
  align-self: flex-end;
  line-height: 1;
  color: #fff;
}

.casa-icone {
  font-size: clamp(1rem, 2vmin, 2.4rem);
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.65));
  flex-shrink: 0;
}

.casa-nome {
  font-size: clamp(0.34rem, 1vmin, 0.95rem);
  text-align: center;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  word-break: break-word;
  line-height: 1.1;
  padding: 0 1px;
}

.casa-bonus-tag {
  display: inline-block;
  background: rgba(0,0,0,0.5);
  border-radius: 2px;
  padding: 0 1px;
  font-size: clamp(0.28rem, 0.6vmin, 0.75rem);
  margin-left: 1px;
}

/* ── Cores das casas — gradientes 3D ─────────────────────── */

.casa-inicio {
  background: linear-gradient(145deg, #ff7675, #c0392b);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-estrela {
  background: linear-gradient(145deg, #ffeaa7, #e17055);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-bolsa {
  background: linear-gradient(145deg, #00cec9, #00b894);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-emergencias {
  background: linear-gradient(145deg, #fd79a8, #d63031);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-sonhos {
  background: linear-gradient(145deg, #a29bfe, #6c5ce7);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-inquebravelis {
  background: linear-gradient(145deg, #74b9ff, #0984e3);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-compra {
  background: linear-gradient(145deg, #55efc4, #00b894);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-bonus {
  background: linear-gradient(145deg, #6fcf97, #27ae60);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-penalidade {
  background: linear-gradient(145deg, #e74c3c, #922b21);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.casa-neutra {
  background: linear-gradient(145deg, #636e72, #2d3436);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* ── Piões ──────────────────────────────────────────────────── */

.casa-pioes {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  min-height: 8px;
  justify-content: center;
  align-items: center;
}

.piao {
  width: clamp(15px, 2.6vmin, 34px);
  height: clamp(15px, 2.6vmin, 34px);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.38rem, 0.85vmin, 1rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,1);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.4);
}

.piao-ativo {
  animation: piscar 0.8s step-start infinite;
  border-color: gold;
  box-shadow: 0 0 10px gold, 0 0 20px rgba(255,215,0,0.5);
  width: clamp(18px, 3.1vmin, 40px);
  height: clamp(18px, 3.1vmin, 40px);
  font-size: clamp(0.45rem, 1vmin, 1.2rem);
}

@keyframes piscar {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Destaque visual de posições dos jogadores ──────────────── */

.casa-com-jogador {
  outline: 2px solid rgba(255,255,255,0.45);
  outline-offset: -2px;
}

.casa-jogador-ativo {
  outline: 3px solid gold !important;
  outline-offset: -3px;
  box-shadow:
    0 0 28px rgba(255,215,0,0.75),
    0 0 55px rgba(255,215,0,0.4),
    inset 0 -3px 0 rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.25) !important;
  z-index: 5;
}

/* ── Animação de salto do pião ──────────────────────────────── */

@keyframes piaoSalta {
  0%   { transform: translateY(0)    scale(1);    }
  25%  { transform: translateY(-11px) scale(1.45); }
  55%  { transform: translateY(3px)  scale(0.85); }
  75%  { transform: translateY(-4px) scale(1.1);  }
  100% { transform: translateY(0)    scale(1);    }
}

.piao-movendo {
  animation: piaoSalta 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ── Centro do tabuleiro ────────────────────────────────────── */

.tabuleiro-centro {
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255,215,0,0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 75%, rgba(80,120,255,0.05) 0%, transparent 55%),
    linear-gradient(135deg, #060e20 0%, #0a1530 50%, #060e20 100%);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255,215,0,0.12);
  position: relative;
  overflow: hidden;
}

/* Dot grid pattern */
.tabuleiro-centro::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,215,0,0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

/* Corner ornaments */
.tabuleiro-centro::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255,215,0,0.06);
  border-radius: 5px;
  pointer-events: none;
}

.centro-logo {
  font-size: clamp(2.2rem, 4.5vmin, 5.5rem);
  filter: drop-shadow(0 0 18px rgba(255,215,0,0.55));
  line-height: 1;
  position: relative;
}

.centro-titulo {
  font-size: clamp(0.72rem, 1.5vmin, 1.8rem);
  font-weight: 900;
  text-align: center;
  color: #ffd700;
  text-shadow:
    0 0 24px rgba(255,215,0,0.7),
    0 0 8px rgba(255,215,0,0.4),
    0 2px 4px rgba(0,0,0,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.35;
  position: relative;
}

.centro-dado {
  font-size: clamp(3.2rem, 6.5vmin, 8rem);
  line-height: 1;
  filter:
    drop-shadow(0 6px 12px rgba(0,0,0,0.6))
    drop-shadow(0 0 20px rgba(255,215,0,0.15));
  cursor: default;
  transition: transform 0.25s;
  position: relative;
}

.centro-dado.acender {
  animation: acenderDado 0.4s ease-out;
}
@keyframes acenderDado {
  0%   { transform: scale(0.6); filter: brightness(3) drop-shadow(0 0 30px gold); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6)); }
}

.centro-player {
  font-size: clamp(0.58rem, 1.2vmin, 1.4rem);
  color: rgba(255,255,255,0.62);
  text-align: center;
  position: relative;
  letter-spacing: 0.03em;
}

.centro-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  justify-content: center;
  font-size: clamp(0.45rem, 1.8vmin, 2.05rem);
  color: rgba(255,255,255,0.32);
  padding: 0 6px;
  position: relative;
}

/* ── Dado 3D no navbar ───────────────────────────────────── */

.btn-dado-3d {
  background: linear-gradient(145deg, #fff9e0, #fdcb6e, #e8a838);
  border: none;
  border-radius: 12px;
  padding: 3px 10px;
  cursor: pointer;
  box-shadow:
    4px 4px 0 rgba(100,60,0,0.65),
    0 6px 16px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.5);
  transition: box-shadow 0.08s, top 0.08s, filter 0.15s;
  position: relative;
  top: 0;
  line-height: 1;
  user-select: none;
}

.btn-dado-3d:hover {
  filter: brightness(1.08);
}

.btn-dado-3d:active {
  top: 4px;
  box-shadow:
    0 0 6px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

#faceDado {
  font-size: 2rem;
  display: block;
  transition: transform 0.1s;
}

@keyframes shakeDado {
  0%   { transform: translate(0,0) rotate(0deg); }
  10%  { transform: translate(-5px,-2px) rotate(-14deg); }
  20%  { transform: translate(5px, 3px) rotate(14deg); }
  30%  { transform: translate(-4px, 3px) rotate(-10deg); }
  40%  { transform: translate(4px,-3px) rotate(10deg); }
  50%  { transform: translate(-3px,-4px) rotate(-7deg); }
  60%  { transform: translate(3px, 4px) rotate(7deg); }
  70%  { transform: translate(-2px, 2px) rotate(-4deg); }
  80%  { transform: translate(2px,-2px) rotate(4deg); }
  90%  { transform: translate(-1px, 0) rotate(-2deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}

.btn-dado-3d.rolando {
  animation: shakeDado 0.72s ease-out;
  pointer-events: none;
}

/* ── Navegação entre jogadores ◄ | ▶ ───────────────────────── */
.nav-jogador-ctrl {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 2px 3px;
  gap: 0;
}

.nav-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.9);
  padding: 3px 10px;
  cursor: pointer;
  border-radius: 16px;
  font-size: 0.8rem;
  line-height: 1;
  transition: background 0.15s;
}
.nav-btn:hover     { background: rgba(255,255,255,0.18); }
.nav-btn-next      { color: #74b9ff; }
.nav-btn-next:hover{ background: rgba(116,185,255,0.2); }

.nav-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 5px;
  white-space: nowrap;
  user-select: none;
}

/* ── Centro: ranking e cofrinhos ────────────────────────────── */
.centro-ranking {
  font-size: clamp(0.62rem, 1.25vmin, 1.5rem);
  color: rgba(255,215,0,0.75);
  letter-spacing: 0.04em;
  position: relative;
}

.centro-cofrinhos {
  font-size: clamp(0.48rem, 2vmin, 2.15rem);
  color: rgba(255,255,255,0.55);
  text-align: center;
  line-height: 1.7;
  position: relative;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar-brand { font-weight: 700; font-size: 0.9rem; }

.indicador {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 4px;
  font-size: 0.7rem;
  line-height: 1;
}
.indicador strong { font-size: 0.85rem; }

/* ── Painéis ────────────────────────────────────────────────── */
.panel {
  background: #161b2e;
  border-radius: 10px;
  padding: 16px;
  margin-top: 10px;
  min-height: 200px;
}

/* ── Cards de cofrinho ───────────────────────────────────────── */
.card { background: #0f3460; color: #eee; border-color: rgba(255,255,255,0.1) !important; }
.card-header { opacity: .9; }

/* ── Tabelas ────────────────────────────────────────────────── */
.table { color: #eee; }
.table-bordered td, .table-bordered th { border-color: rgba(255,255,255,.15); }
.table-sm td, .table-sm th { font-size: .85rem; }
.table-warning  { background-color: rgba(255,215,0,.22) !important; }
.table-secondary{ background-color: rgba(180,180,180,.22) !important; }
.table-danger   { background-color: rgba(205,100,50,.22) !important; }

/* ── Modais ─────────────────────────────────────────────────── */
.modal-content  { background: #0f3460; color: #eee; border: 1px solid rgba(255,255,255,.2); }
.modal-header   { border-bottom-color: rgba(255,255,255,.15); }
.modal-footer   { border-top-color:    rgba(255,255,255,.15); }

/* ── Formulários ────────────────────────────────────────────── */
.form-control, .form-select {
  background: #1a1a2e;
  border-color: rgba(255,255,255,.2);
  color: #eee;
}
.form-control:focus, .form-select:focus {
  background: #1a1a2e;
  border-color: #3498db;
  color: #eee;
  box-shadow: 0 0 0 .2rem rgba(52,152,219,.25);
}

/* ── Responsividade ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .tabuleiro-frame {
    padding: 8px;
    transform: rotateX(4deg) !important;
  }
  .casa-nome      { display: none; }
  .centro-legenda { display: none; }
}
