* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body {
  background: #111;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: 'Roboto Condensed', 'Orbitron', sans-serif;
  padding: 4px;
  color: #fff;
  overflow-x: hidden;
}

#app { width: 100%; max-width: 980px; }

.machine {
  background: linear-gradient(180deg, #5a5a5a 0%, #3d3d3d 30%, #2f2f2f 100%);
  border: 6px solid #6a6a6a;
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.25),
    inset 0 -3px 8px rgba(0,0,0,0.5),
    0 10px 30px rgba(0,0,0,0.7);
  overflow: hidden;
}

/* ========== TOPO ========== */
.top {
  display: flex;
  background: linear-gradient(180deg, #4a4a4a, #333);
  padding: 6px;
  gap: 6px;
  border-bottom: 4px solid #222;
  flex-wrap: wrap;
}

/* Painel esquerdo */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 100px;
}
.box {
  background: linear-gradient(180deg, #1c1c1c, #0e0e0e);
  border: 2px solid #555;
  border-radius: 4px;
  padding: 3px 6px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}
.box .lbl { font-size: 9px; color: #aaa; letter-spacing: 0.5px; }
.box .num { font-size: 22px; font-weight: 900; font-family: 'Orbitron', sans-serif; line-height: 1.1; }
.box .num.gold { color: #ffd700; text-shadow: 0 0 6px #ffaa00; }
.box .num.orange { color: #ff9900; }
.box .num.green { color: #00ff66; }
.box .num.yellow { color: #ffcc00; font-size: 20px; }
.extra-box {
  background: linear-gradient(180deg, #3a2a00, #1a1200);
  border-color: #886600;
}
.extra-box .sub { font-size: 8px; color: #aa8800; }

/* Centro bolas */
.center-balls {
  flex: 1;
  min-width: 280px;
  background: linear-gradient(180deg, #1a1a2a, #0d0d18);
  border: 2px solid #444;
  border-radius: 6px;
  padding: 4px 6px 6px;
  position: relative;
  min-height: 150px;
}
.logo {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #4a9eff;
  letter-spacing: 1px;
  text-shadow: 0 0 8px #2a6ecc;
  margin-bottom: 2px;
}
.logo span {
  color: #00e5ff;
  font-size: 20px;
  text-shadow: 0 0 10px #00c0ff;
}
.balls-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  max-height: 120px;
  overflow-y: auto;
}

/* Bola individual */
.ball {
  width: 27px; height: 27px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #111;
  position: relative;
  box-shadow: 0 2px 3px rgba(0,0,0,0.5), inset 0 -2px 3px rgba(0,0,0,0.25), inset 0 1px 2px rgba(255,255,255,0.45);
  animation: pop 0.25s ease;
}
.ball::after {
  content: '';
  position: absolute;
  top: 7%; left: 14%;
  width: 28%; height: 16%;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
}
@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Cores das bolas (iguais ao original) */
.ball.c0 { background: radial-gradient(circle at 35% 30%, #ff9a9a, #e03131, #9b1c1c); }
.ball.c1 { background: radial-gradient(circle at 35% 30%, #ffe066, #f59f00, #e67700); }
.ball.c2 { background: radial-gradient(circle at 35% 30%, #8ce99a, #2f9e44, #1b6b2e); }
.ball.c3 { background: radial-gradient(circle at 35% 30%, #74c0fc, #1c7ed6, #0b5cad); }
.ball.c4 { background: radial-gradient(circle at 35% 30%, #e599f7, #ae3ec9, #6a1b8a); }
.ball.c5 { background: radial-gradient(circle at 35% 30%, #ffc078, #fd7e14, #e8590c); }
.ball.c6 { background: radial-gradient(circle at 35% 30%, #63e6be, #12b886, #0ca678); }
.ball.c7 { background: radial-gradient(circle at 35% 30%, #a5d8ff, #339af0, #1c7ed6); }
.ball.c8 { background: radial-gradient(circle at 35% 30%, #ffc9c9, #fa5252, #c92a2a); }
.ball.c9 { background: radial-gradient(circle at 35% 30%, #ffec99, #fcc419, #f59f00); }

/* Painel direito */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 130px;
  max-width: 150px;
}
.extra-ball-box {
  background: linear-gradient(180deg, #2a2a2a, #111);
  border: 2px solid #555;
  border-radius: 6px;
  text-align: center;
  padding: 4px;
  position: relative;
}
.eb-title { font-size: 9px; color: #aaa; }
.eb-val { font-size: 22px; font-weight: 900; color: #ffcc00; font-family: 'Orbitron', sans-serif; }
.eb-sub { font-size: 8px; color: #888; }
.eb-label {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%) rotate(90deg);
  font-size: 9px; color: #ff6600; letter-spacing: 1px; font-weight: 700;
}

.bola-atual {
  background: #000;
  border: 2px solid #333;
  border-radius: 4px;
  text-align: center;
  padding: 2px 4px;
}
.ba-lbl { font-size: 8px; color: #888; }
.ba-num {
  font-size: 26px; font-weight: 900;
  color: #ff2222;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 8px #ff0000;
}

.velocidade-box {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 2px 4px;
  text-align: center;
}
.v-lbl { font-size: 8px; color: #888; }
.velocidade-box input { width: 100%; height: 12px; accent-color: #00aaff; }

.acumulado-box {
  background: #000;
  border: 2px solid #333;
  border-radius: 4px;
  text-align: center;
  padding: 3px;
}
.ac-lbl { font-size: 9px; color: #888; letter-spacing: 1px; }
.ac-val {
  font-size: 18px; font-weight: 900;
  color: #ff2222;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px #ff0000;
  letter-spacing: 1px;
}

.patterns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  font-size: 9px;
}
.pat {
  background: #222;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px 4px;
  color: #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.picon { color: #4dabf7; font-size: 8px; }

/* ========== CARTELAS ========== */
.cards-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  background: #0a0a0a;
}
.card {
  background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
  border: 2px solid #555;
  border-radius: 6px;
  overflow: hidden;
}
.ch {
  display: flex;
  justify-content: space-between;
  padding: 3px 8px;
  background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
  font-size: 11px;
  color: #bbb;
  border-bottom: 1px solid #444;
}
.ch b { color: #ffcc00; }
.cg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 4px;
}
.cell {
  aspect-ratio: 1.15;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #eee;
  transition: all 0.15s;
}
.cell.marked {
  background: linear-gradient(135deg, #e03131, #c92a2a);
  color: #fff;
  border-color: #ff6b6b;
  box-shadow: 0 0 5px rgba(255,50,50,0.45);
}
.cell.line {
  background: linear-gradient(135deg, #00b894, #00a085) !important;
  border-color: #55efc4 !important;
  box-shadow: 0 0 8px rgba(0,200,150,0.5);
}
.cell.bingo {
  background: linear-gradient(135deg, #fdcb6e, #e17055) !important;
  border-color: #ffeaa7 !important;
  animation: blink 0.4s ease infinite alternate;
}
@keyframes blink {
  from { box-shadow: 0 0 4px #fdcb6e; }
  to { box-shadow: 0 0 14px #fdcb6e; }
}

/* ========== BOTÕES INFERIORES ========== */
.bottom-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
  border-top: 3px solid #1a1a1a;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.side-knobs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.knob {
  background: linear-gradient(180deg, #666, #444);
  border: 2px solid #777;
  border-radius: 20px;
  color: #ddd;
  font-size: 9px;
  font-family: 'Orbitron', sans-serif;
  padding: 6px 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 0 #222;
}
.knob:active { transform: translateY(1px); }
.knob.on { background: #00aaff; color: #111; border-color: #0088cc; }

.main-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.btn {
  border: none;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #fff;
  cursor: pointer;
  padding: 10px 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.45);
  transition: all 0.1s;
  line-height: 1.15;
  text-align: center;
  min-width: 88px;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.45); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.b-blue { background: linear-gradient(180deg, #4dabf7, #1c7ed6); }
.b-cyan { background: linear-gradient(180deg, #22b8cf, #0c8599); }
.b-orange { background: linear-gradient(180deg, #ff922b, #e67700); }
.b-red { background: linear-gradient(180deg, #ff6b6b, #e03131); font-size: 15px; padding: 12px 20px; min-width: 100px; }
.b-purple { background: linear-gradient(180deg, #da77f2, #9c36b5); }
.b-gray { background: linear-gradient(180deg, #868e96, #495057); }

.extra-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Toast */
#toast {
  position: fixed;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  color: #ffd700;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  border: 1px solid #ffd700;
}
#toast.show { opacity: 1; }

/* Responsivo */
@media (max-width: 750px) {
  .top { flex-direction: column; }
  .left-panel { flex-direction: row; flex-wrap: wrap; }
  .right-panel { flex-direction: row; flex-wrap: wrap; max-width: 100%; }
  .cards-wrap { grid-template-columns: 1fr; }
  .ball { width: 24px; height: 24px; font-size: 10px; }
  .cell { font-size: 13px; }
  .btn { min-width: 70px; padding: 8px 10px; font-size: 11px; }
}
