/* bbx-lottery.css
   For shortcode: [bbx_lottery]
*/

/* Namespace: .bbx */
.bbx {
  box-sizing: border-box;
  font-family: inherit;
  color: inherit;
}

.bbx * {
  box-sizing: border-box;
}

.bbx-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  max-width: 980px;
}

.bbx-card__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.bbx-muted {
  color: rgba(0,0,0,0.62);
}

.bbx-kv {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.bbx-kv__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
}

.bbx-kv__k {
  font-weight: 600;
  color: rgba(0,0,0,0.72);
}

.bbx-kv__v {
  word-break: break-word;
}

.bbx-block {
  margin-top: 10px;
}

.bbx-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,0,0,0.68);
  margin-bottom: 6px;
}

.bbx-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.04);
  border: 1px dashed rgba(0,0,0,0.18);
  word-break: break-all;
}

.bbx-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.bbx-btn {
  appearance: none;
  border: 1px solid rgba(0,0,0,0.15);
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.06s ease, opacity 0.15s ease;
}

.bbx-btn:hover { transform: translateY(-1px); }
.bbx-btn:active { transform: translateY(0px); opacity: 0.9; }
.bbx-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.bbx-msg {
  font-size: 14px;
  color: rgba(0,0,0,0.7);
}

.bbx-section {
  margin-top: 16px;
}

.bbx-section__title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}

.bbx-history {
  margin-top: 6px;
}

/* Table */
.bbx-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

.bbx-table th,
.bbx-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  vertical-align: top;
  font-size: 14px;
}

.bbx-table thead th {
  background: rgba(0,0,0,0.04);
  font-weight: 800;
}

.bbx-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 8px;
}

/* Pagination */
.bbx-pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.bbx-page-link {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  text-decoration: none;
  color: inherit;
}

.bbx-page-link:hover {
  background: rgba(0,0,0,0.03);
}

.bbx-page-info {
  color: rgba(0,0,0,0.65);
  font-size: 14px;
}

/* Mobile card view for history */
.bbx-history-cards {
  display: none;
  gap: 10px;
}

.bbx-history-card {
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.02);
  border-radius: 12px;
  padding: 12px;
}

.bbx-history-card__row {
  font-size: 14px;
  margin: 6px 0;
  word-break: break-word;
}

.bbx-history-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 8px;
}

/* Responsive: make kv stack and history become cards */
@media (max-width: 680px) {
  .bbx-kv__row {
    grid-template-columns: 1fr;
  }

  .bbx-table {
    display: none;
  }

  .bbx-history-cards {
    display: grid;
  }

  .bbx-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bbx-btn {
    width: 100%;
    text-align: center;
  }
}
