/* ═══════════════════════════════════════════════════════════════
   mb-shared.css — Mesa Virtual · Estilos compartilhados
   Importado por index.html e mesa.html
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Cinzel:wght@400;600&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

/* ─── Variáveis ─── */
:root {
  --black:    #0a0806;
  --deep:     #110e0a;
  --stone:    #1c1712;
  --ember:    #c8712a;
  --gold:     #d4a843;
  --pale:     #e8dcc8;
  --dim:      #8a7a65;
  --blood:    #8b1a1a;
  --glow:     rgba(200,113,42,0.18);
  --success:  #5a9a5a;
  --info:     #3a7aaa;
  --danger:   #9a3a3a;
  --panel-bg: rgba(10,8,6,0.95);
  --border:   rgba(200,113,42,0.22);
  --border-h: rgba(200,113,42,0.5);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--black);
  color: var(--pale);
  font-family: 'EB Garamond', Georgia, serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(200,113,42,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(200,113,42,0.5); }

/* ─── Fundo ─── */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(200,113,42,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 100% 80% at 50% -10%, rgba(139,26,26,0.07) 0%, transparent 60%),
    var(--black);
}
.bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 0h60v60H0z' fill='none' stroke='%23ffffff04' stroke-width='0.5'/%3E%3Cline x1='60' y1='0' x2='0' y2='60' stroke='%23ffffff03' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}
.bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; opacity: 0.5;
}

/* ─── Bordas de runa ─── */
.rune-top, .rune-bottom {
  position: fixed; left: 0; right: 0; height: 2px; z-index: 100;
  background: linear-gradient(90deg, transparent 0%, var(--blood) 20%, var(--ember) 50%, var(--blood) 80%, transparent 100%);
}
.rune-top { top: 0; }
.rune-bottom { bottom: 0; }
.rune-left, .rune-right {
  position: fixed; top: 0; bottom: 0; width: 2px; z-index: 100;
  background: linear-gradient(180deg, transparent 0%, var(--blood) 20%, var(--ember) 50%, var(--blood) 80%, transparent 100%);
}
.rune-left { left: 0; }
.rune-right { right: 0; }

/* ─── Tochas ─── */
.torch { position: fixed; z-index: 5; }
.torch-tl { top: 36px; left: 36px; }
.torch-tr { top: 36px; right: 36px; }
.torch-bl { bottom: 36px; left: 36px; }
.torch-br { bottom: 36px; right: 36px; }
.torch svg { width: 24px; height: 24px; }
.flame {
  transform-origin: bottom center;
  animation: flicker 1.4s ease-in-out infinite alternate;
}
.torch-tl .flame { animation-delay: 0.0s; }
.torch-tr .flame { animation-delay: 0.3s; }
.torch-bl .flame { animation-delay: 0.7s; }
.torch-br .flame { animation-delay: 1.1s; }
@keyframes flicker {
  0%   { transform: scaleX(1.00) scaleY(1.00) rotate(-2deg); opacity: 1.00; }
  25%  { transform: scaleX(0.90) scaleY(1.10) rotate( 1deg); opacity: 0.90; }
  50%  { transform: scaleX(1.05) scaleY(0.95) rotate(-1deg); opacity: 1.00; }
  75%  { transform: scaleX(0.95) scaleY(1.05) rotate( 2deg); opacity: 0.85; }
  100% { transform: scaleX(1.10) scaleY(0.90) rotate(-3deg); opacity: 0.95; }
}
.torch-glow {
  position: absolute; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,113,42,0.20) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  animation: glowpulse 2s ease-in-out infinite alternate;
}
@keyframes glowpulse {
  0%   { opacity: 0.6; transform: translate(-50%,-50%) scale(1.0); }
  100% { opacity: 1.0; transform: translate(-50%,-50%) scale(1.3); }
}

/* ─── Partículas de brasa ─── */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.particle {
  position: absolute; width: 2px; height: 2px;
  background: var(--ember); border-radius: 50%;
  animation: rise linear infinite; opacity: 0;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-100vh) translateX(var(--drift)); opacity: 0; }
}

/* ─── Toast de notificação ─── */
.toast {
  position: fixed; bottom: 40px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28,23,18,0.97);
  border: 1px solid var(--ember);
  padding: 10px 22px;
  font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.15em;
  color: var(--gold); border-radius: 2px;
  opacity: 0; transition: all 0.35s; z-index: 9999;
  white-space: nowrap; box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Botão CTA ─── */
.cta-btn {
  width: 100%; padding: 12px 16px;
  background: linear-gradient(135deg, #7a3a12 0%, #5c2a0e 50%, #3d1a08 100%);
  border: 1px solid var(--ember); border-radius: 2px;
  color: var(--gold); font-family: 'Cinzel', serif;
  font-size: 0.78rem; letter-spacing: 0.25em; text-transform: uppercase;
  cursor: pointer; position: relative; overflow: hidden;
  transition: all 0.2s; box-shadow: 0 4px 20px rgba(200,113,42,0.2);
}
.cta-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212,168,67,0.15), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.cta-btn:hover { box-shadow: 0 6px 30px rgba(200,113,42,0.4); transform: translateY(-1px); }
.cta-btn:hover::before { opacity: 1; }
.cta-btn:active { transform: translateY(0); }
.cta-btn.secondary {
  background: transparent; border-color: rgba(200,113,42,0.3);
  color: var(--dim); box-shadow: none; margin-top: 8px;
}
.cta-btn.secondary:hover { color: var(--pale); border-color: var(--ember); transform: none; }
.cta-btn.sm {
  padding: 7px 12px; font-size: 0.65rem; width: auto;
}
.cta-btn.danger {
  background: linear-gradient(135deg, #5a1010, #3a0808);
  border-color: #8b1a1a; color: #e87070;
}

/* ─── Inputs genéricos ─── */
.mb-input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 2px; padding: 9px 12px;
  color: var(--pale); font-family: 'EB Garamond', serif; font-size: 0.95rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.mb-input::placeholder { color: rgba(138,122,101,0.5); font-style: italic; }
.mb-input:focus {
  border-color: var(--border-h);
  box-shadow: 0 0 0 2px rgba(200,113,42,0.08);
}
.mb-input.sm { padding: 5px 8px; font-size: 0.85rem; }

/* ─── Label ─── */
.mb-label {
  display: block;
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 5px;
}

/* ─── Modal overlay ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: linear-gradient(160deg, rgba(28,23,18,0.99), rgba(17,14,10,0.99));
  border: 1px solid var(--border-h);
  border-radius: 2px; padding: 28px 32px;
  min-width: 320px; max-width: 480px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,113,42,0.08);
  position: relative;
}
.modal-title {
  font-family: 'Cinzel', serif; font-size: 0.9rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--dim);
  font-size: 1.2rem; cursor: pointer; line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--pale); }

/* ─── Divider decorativo ─── */
.mb-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ─── Animações ─── */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(18px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ─── Torch SVG helper (reutilizável via template) ─── */
.torch-svg-wrap { position: relative; }
