html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #000;
  background-color: #f7f9fa;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

#app, #app * {
  box-sizing: border-box;
}

#app {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px 40px;
  display: block;
}

h3 {
  margin: 16px 0 8px;
  text-align: center;
  font-size: 17px;
  color: #0038a8;
}

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 12px 0;
}

button, input {
  margin: 5px 0 0;
  padding: 11px;
  border: 1px solid #ddd;
  font-size: 15px;
  display: inline-block;
  width: 100%;
  border-radius: 6px;
  box-sizing: border-box;
}

button {
  background-color: #0038a8;
  color: #fff;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s;
}

button:hover {
  background-color: #002c85;
}

button:active {
  opacity: 0.9;
}

button:disabled {
  background-color: #a0aec0;
  cursor: not-allowed;
}

.btn-exit {
  background-color: #e53e3e;
}
.btn-exit:hover {
  background-color: #c53030;
}

/* Tabs */
.tabs-header {
  display: flex;
  background: #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  margin: 16px 0 10px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 6px;
  background: transparent;
  color: #4a5568;
  border: none;
  margin: 0;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-align: center;
  white-space: nowrap;
}

.tab-btn.active {
  background: #0038a8;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 56, 168, 0.2);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Items in tabs */
.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 8px;
  gap: 10px;
  transition: background 0.15s;
}

.item-card:hover {
  background: #f8fafc;
}

.item-left {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-weight: bold;
  font-size: 14px;
  color: #1a202c;
  line-height: 1.3;
}

.item-desc {
  font-size: 12px;
  color: #718096;
  margin-top: 3px;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.cta-btn {
  width: auto;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  background: #0038a8;
  color: #fff;
  border-radius: 4px;
  flex-shrink: 0;
  margin: 0;
}
.cta-btn:hover {
  background: #002c85;
}

.badge-brand {
  background: #ebf8ff;
  color: #2b6cb0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}

.badge-code {
  background: #edf2f7;
  color: #4a5568;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
}

.badge-discount {
  background: #feebc8;
  color: #c05621;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}

.btn-mission {
  background-color: #ffffff;
  color: #0038a8;
  border: 1px solid #0038a8;
  text-align: left;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: normal;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-mission:hover {
  background-color: #ebf4ff;
}
.btn-mission span.cta-badge {
  background: #0038a8;
  color: #fff;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

/* Rewards listing */
.reward-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  margin-top: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px;
}

.reward-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  background: #f8fafc;
  gap: 8px;
}

.reward-card-left {
  flex: 1;
  min-width: 0;
}
.reward-card-name {
  font-weight: bold;
  font-size: 14px;
  color: #1a202c;
}
.reward-card-sku {
  font-size: 12px;
  color: #718096;
}
.reward-card-date {
  font-size: 11px;
  color: #a0aec0;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 420px;
  width: 100%;
  padding: 18px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 17px;
  font-weight: bold;
  color: #0038a8;
  text-align: center;
}

.reward-box-item {
  padding: 10px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 6px;
}

.tag-success {
  display: inline-block;
  padding: 2px 6px;
  background: #def7ec;
  color: #03543f;
  font-size: 11px;
  font-weight: bold;
  border-radius: 4px;
}
.tag-gray {
  display: inline-block;
  padding: 2px 6px;
  background: #edf2f7;
  color: #4a5568;
  font-size: 11px;
  font-weight: bold;
  border-radius: 4px;
}

.card-done {
  background: #f8fafc;
  opacity: 0.88;
}

.card-done:hover {
  background: #f1f5f9;
}

.badge-done {
  display: inline-block;
  padding: 6px 10px;
  background: #def7ec;
  color: #03543f;
  border: 1px solid #bcf0da;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-ingame {
  display: inline-block;
  padding: 6px 10px;
  background: #edf2f7;
  color: #4a5568;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  white-space: nowrap;
}

.item-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Turn info card */
.turn-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid #bee3f8;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0 12px;
  box-shadow: 0 2px 6px rgba(0, 56, 168, 0.06);
}

.turn-card-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.turn-card-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
}

.turn-card-text {
  display: flex;
  flex-direction: column;
}

.turn-card-title {
  font-size: 13px;
  color: #4a5568;
}

.turn-card-number {
  font-size: 20px;
  font-weight: bold;
  color: #0038a8;
  line-height: 1.2;
}

.btn-refresh-turn {
  width: auto;
  background: transparent;
  color: #0038a8;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 15px;
  cursor: pointer;
  margin: 0;
  transition: all 0.15s ease-in-out;
}

.btn-refresh-turn:hover {
  background: #ebf8ff;
  border-color: #3182ce;
}