/* ============================================
   FLIP BOMB
   ============================================ */

.fb-wrap { max-width: 500px !important; }

.fb-machine {
  background: linear-gradient(160deg, #0a1628 0%, #0d1117 60%, #0a1628 100%);
  border: 3px solid #3b82f6;
  border-radius: 24px;
  padding: 0 1.2rem 2rem;
  box-shadow:
    0 0 0 5px #0a1628,
    0 0 0 7px rgba(59,130,246,0.3),
    0 24px 60px rgba(0,0,0,0.7),
    inset 0 0 50px rgba(0,0,0,0.4);
  overflow: hidden;
}

/* ── Topo ── */
.fb-top {
  text-align: center;
  padding: 1.2rem 0 0.8rem;
  border-bottom: 1px solid rgba(59,130,246,0.2);
  margin: 0 -1.2rem 1rem;
  background: rgba(0,0,0,0.3);
}

.fb-top-text {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.4rem;
  letter-spacing: 0.25em;
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(59,130,246,0.5));
  line-height: 1;
}

.fb-top-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: rgba(96,165,250,0.6);
  margin-top: 0.25rem;
}

/* ── Status bar ── */
.fb-status-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.fb-status-item {
  flex: 1;
  background: #000;
  border: 2px solid rgba(59,130,246,0.25);
  border-radius: 8px;
  padding: 0.4rem 0.3rem;
  text-align: center;
}

.fb-status-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.45rem;
  letter-spacing: 0.1em;
  color: #444;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.fb-status-val {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.3rem;
  color: #60a5fa;
  text-shadow: 0 0 8px rgba(96,165,250,0.4);
  line-height: 1;
}

/* ── Tabuleiro ── */
.fb-board-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 4px;
  margin-bottom: 0.8rem;
}

.fb-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  grid-row: 1;
  grid-column: 1;
}

.fb-row-hints {
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-row: 1;
  grid-column: 2;
}

.fb-col-hints {
  display: flex;
  flex-direction: row;
  gap: 4px;
  grid-row: 2;
  grid-column: 1;
}

/* ── Células ── */
.fb-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', cursive;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(135deg, #1e3a5f, #162d4a);
  border: 2px solid rgba(59,130,246,0.3);
  color: rgba(255,255,255,0.5);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.fb-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}

.fb-cell:hover:not(.fb-cell-open):not(.fb-cell-ghost) {
  transform: scale(1.08);
  border-color: rgba(96,165,250,0.7);
  background: linear-gradient(135deg, #2a4d7f, #1e3a5f);
  color: white;
  z-index: 2;
}

.fb-cell:active:not(.fb-cell-open) {
  transform: scale(0.95);
}

/* Células abertas */
.fb-cell-open {
  cursor: default;
  animation: fbPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fbPop {
  from { transform: scale(0.5) rotateY(90deg); opacity: 0; }
  to   { transform: scale(1)   rotateY(0deg);  opacity: 1; }
}

/* Valores */
.fb-cell-1 {
  background: linear-gradient(135deg, #1f2937, #111827);
  border-color: rgba(107,114,128,0.4);
  color: rgba(156,163,175,0.8);
  font-size: 1rem;
}

.fb-cell-2 {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  border-color: rgba(96,165,250,0.6);
  color: white;
  text-shadow: 0 0 10px rgba(96,165,250,0.8);
  box-shadow: inset 0 0 12px rgba(96,165,250,0.2);
}

.fb-cell-3 {
  background: linear-gradient(135deg, #d97706, #92400e);
  border-color: rgba(245,197,24,0.6);
  color: white;
  text-shadow: 0 0 10px rgba(245,197,24,0.8);
  box-shadow: inset 0 0 12px rgba(245,197,24,0.2);
}

.fb-cell-bomb {
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
  border-color: rgba(239,68,68,0.7);
  font-size: 1.2rem;
  animation: fbExplode 0.5s ease;
  box-shadow: 0 0 20px rgba(239,68,68,0.5);
}

@keyframes fbExplode {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Ghost (revelado ao fim) */
.fb-cell-ghost {
  opacity: 0.35;
  cursor: default;
  font-size: 0.9rem;
}

/* Memo */
.fb-cell-memo-bomb {
  border-color: rgba(239,68,68,0.5);
  background: linear-gradient(135deg, rgba(127,29,29,0.3), rgba(30,10,10,0.5));
}

.fb-cell-memo-safe {
  border-color: rgba(34,197,94,0.5);
  background: linear-gradient(135deg, rgba(20,83,45,0.3), rgba(10,30,20,0.5));
}

.fb-memo-dot {
  font-size: 0.75rem;
}

/* ── Hints ── */
.fb-hint {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 4px;
}

.fb-hint-row {
  width: 44px;
  aspect-ratio: unset;
  flex: 1;
}

.fb-hint-col {
  flex: 1;
  height: 44px;
}

.fb-hint-sum {
  font-family: 'Bebas Neue', cursive;
  font-size: 1rem;
  color: #60a5fa;
  line-height: 1;
}

.fb-hint-sep {
  display: block;
  width: 80%;
  height: 1px;
  background: rgba(59,130,246,0.3);
}

.fb-hint-bombs {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(239,68,68,0.8);
  line-height: 1;
}

/* ── Mensagem ── */
.fb-msg {
  text-align: center;
  font-family: 'Bebas Neue', cursive;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  min-height: 28px;
  opacity: 0;
  margin-bottom: 0.8rem;
  transition: opacity 0.2s;
  line-height: 1.3;
}

.fb-msg-visible { opacity: 1; animation: msgPop 0.35s cubic-bezier(0.34,1.56,0.64,1); }
.fb-msg-win     { color: #60a5fa; }
.fb-msg-jackpot { color: #f5c518; text-shadow: 0 0 16px rgba(245,197,24,0.7); }
.fb-msg-lose    { color: #ef4444; }

/* ── Controles ── */
.fb-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.fb-btn {
  flex: 1;
  padding: 0.75rem 0.4rem;
  border: none;
  border-radius: 10px;
  font-family: 'Bebas Neue', cursive;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.18s;
}

.fb-btn-new {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  color: white;
  box-shadow: 0 4px 16px rgba(29,78,216,0.35);
}

.fb-btn-new:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(29,78,216,0.5); }

.fb-btn-hint {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
}

.fb-btn-hint:hover { background: rgba(255,255,255,0.12); color: white; }

.fb-btn-hint-active {
  background: rgba(245,197,24,0.15) !important;
  border-color: rgba(245,197,24,0.5) !important;
  color: #f5c518 !important;
}

.fb-btn-next {
  background: linear-gradient(135deg, #059669, #065f46);
  color: white;
  box-shadow: 0 4px 16px rgba(5,150,105,0.35);
}

.fb-btn-next:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(5,150,105,0.5); }

/* ── Legenda ── */
.fb-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.fb-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
}

.fb-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 5px;
  font-family: 'Bebas Neue', cursive;
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.15);
}

.fb-card-open { }
.fb-card-1 { background: #1f2937; color: #9ca3af; }
.fb-card-2 { background: #1d4ed8; color: white; }
.fb-card-3 { background: #d97706; color: white; }
.fb-card-b { background: #dc2626; }

/* ── Light mode ── */
[data-theme="light"] .fb-machine {
  background: linear-gradient(160deg, #dbeafe 0%, #eff6ff 60%, #dbeafe 100%);
  border-color: #2563eb;
  box-shadow: 0 0 0 5px #dbeafe, 0 0 0 7px rgba(37,99,235,0.2), 0 24px 60px rgba(0,0,0,0.15);
}

[data-theme="light"] .fb-top { background: rgba(219,234,254,0.5); border-bottom-color: rgba(37,99,235,0.2); }
[data-theme="light"] .fb-status-item { background: white; border-color: rgba(37,99,235,0.2); }
[data-theme="light"] .fb-status-label { color: #9ca3af; }
[data-theme="light"] .fb-cell { background: linear-gradient(135deg, #bfdbfe, #93c5fd); border-color: rgba(37,99,235,0.3); color: rgba(30,58,138,0.6); }
[data-theme="light"] .fb-cell:hover:not(.fb-cell-open):not(.fb-cell-ghost) { background: linear-gradient(135deg, #93c5fd, #60a5fa); }
[data-theme="light"] .fb-cell-1 { background: linear-gradient(135deg, #e5e7eb, #d1d5db); border-color: rgba(107,114,128,0.4); color: #6b7280; }
[data-theme="light"] .fb-hint { background: rgba(255,255,255,0.7); border-color: rgba(37,99,235,0.2); }
[data-theme="light"] .fb-legend-item { color: rgba(0,0,0,0.4); }

/* ── Responsivo ── */

/* Tablet / celular grande (≤ 540px) — alinhado com slot e roleta */
@media (max-width: 540px) {
  .fb-wrap { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
  .fb-machine { padding: 0 1rem 1.5rem; border-radius: 20px; border-width: 2px; }
  .fb-top { margin: 0 -1rem 0.8rem; }
  .fb-top-text { font-size: 2rem; }
  .fb-top-sub  { font-size: 0.58rem; }
  .fb-status-val { font-size: 1.1rem; }
  .fb-status-label { font-size: 0.42rem; }
  .fb-btn { font-size: 0.88rem; }
}

/* Celular médio (≤ 480px) */
@media (max-width: 480px) {
  .fb-wrap { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
  .fb-machine { padding: 0 0.7rem 1.5rem; border-radius: 18px; }
  .fb-top { margin: 0 -0.7rem 0.8rem; }
  .fb-top-text { font-size: 1.9rem; }
  .fb-cell { border-radius: 6px; font-size: 1.1rem; }
  .fb-hint-row { width: 36px; }
  .fb-hint-col { height: 36px; }
  .fb-hint-sum { font-size: 0.85rem; }
  .fb-hint-bombs { font-size: 0.48rem; }
  .fb-status-val { font-size: 1rem; }
  .fb-btn { font-size: 0.82rem; padding: 0.65rem 0.3rem; }

  /* Quando os 3 botões aparecem, "Próximo Nível" ocupa linha própria */
  .fb-controls { flex-wrap: wrap; }
  .fb-btn-next { flex: 1 1 100%; }
}

/* Celular pequeno (≤ 360px) */
@media (max-width: 360px) {
  .fb-board { gap: 3px; }
  .fb-row-hints { gap: 3px; }
  .fb-col-hints { gap: 3px; }
  .fb-hint-row { width: 32px; }
  .fb-hint-col { height: 32px; }
  .fb-cell { border-radius: 5px; font-size: 1rem; border-width: 1px; }
  .fb-top-text { font-size: 1.6rem; }
  .fb-top-sub  { display: none; }
}
