* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #1a2353;
  color: #ffffff;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 440px;
  background-color: #222b64;
  min-height: 100vh;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 60px;
  position: relative;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
}
.top-bar h1 {
  color: #22d3ee;
  font-style: italic;
  font-weight: 900;
  font-size: 22px;
}

/* Wallet */
.wallet-box {
  background: linear-gradient(135deg, #2563eb, #4338ca);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.wallet-box p {
  font-size: 12px;
  color: #bfdbfe;
}
.wallet-box h2 {
  font-size: 32px;
  font-weight: 900;
  margin-top: 4px;
}
.wallet-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.wallet-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 25px;
  border: none;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}

/* Tabs */
.tab-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.tab {
  background-color: #293475;
  border: 1px solid transparent;
  color: #fff;
  padding: 10px 2px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
}
.tab.active {
  background-color: #2563eb;
  border-color: #60a5fa;
}

/* Countdown Card */
.clock-box {
  background: linear-gradient(135deg, #29357a, #1c2459);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(99,102,241,0.2);
}
.clock-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.digits {
  display: flex;
  gap: 4px;
  font-family: monospace;
  font-size: 22px;
  font-weight: 900;
  justify-content: flex-end;
}
.digit {
  background-color: #111738;
  padding: 4px 8px;
  border-radius: 6px;
}
.digit-red {
  color: #f43f5e;
}

/* Colors */
.color-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.btn-color {
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Balls */
.ball-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  background-color: #192152;
  padding: 12px;
  border-radius: 16px;
  justify-items: center;
}
.ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.ball-0 {
  background: linear-gradient(135deg, #9333ea 50%, #ef4444 50%) !important;
}
.ball-5 {
  background: linear-gradient(135deg, #9333ea 50%, #10b981 50%) !important;
}

/* Big / Small */
.bs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.btn-bs {
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* History */
.history-wrap {
  margin-top: 4px;
}
.history-wrap h3 {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: bold;
  margin-bottom: 8px;
}
table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: #192257;
  color: #94a3b8;
  padding: 10px;
}
td {
  padding: 10px;
  border-bottom: 1px solid rgba(30,27,75,0.6);
  background: #161e4e;
}
.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* Modal Sheet */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: none;
  align-items: flex-end;
}
.sheet-card {
  background: #242f6d;
  width: 100%;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
}
.sheet-head {
  background: #f59e0b;
  padding: 14px;
  text-align: center;
}
.sheet-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 12px;
}
.chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.chip {
  background: #1a2355;
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}
.chip.active {
  background: #f59e0b;
  color: #000;
}
.muls {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.mul {
  background: #1a2355;
  color: #fff;
  border: none;
  padding: 6px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 11px;
  cursor: pointer;
}
.mul.active {
  background: #f59e0b;
  color: #000;
}
.sheet-actions {
  display: flex;
}
.sheet-actions button {
  border: none;
  padding: 14px;
  font-weight: bold;
  cursor: pointer;
}

/* Result Modal */
.res-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.res-box {
  background: #222b64;
  width: 100%;
  max-width: 300px;
  border-radius: 24px;
  overflow: hidden;
  text-align: center;
}
.res-head {
  background: linear-gradient(135deg, #10b981, #0d9488);
  padding: 18px;
  color: #fff;
}
.res-head.lost {
  background: linear-gradient(135deg, #e11d48, #b91c1c);
}

/* 5s Big Countdown */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,19,53,0.95);
  z-index: 150;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lock-digits {
  display: flex;
  gap: 14px;
}
.lock-box {
  width: 90px;
  height: 130px;
  background-color: #1f2963;
  border: 2px solid #3b82f6;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  font-weight: 900;
  color: #f43f5e;
}
