:root {
  --primary-color: #0A2142; /* Navy Blue */
  --secondary-color: #1F8B31; /* Green */
  --accent-color: #28a745;
  --bg-color: #F5F7fa;
  --card-bg: #FFFFFF;
  --text-dark: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --danger-color: #dc3545;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--primary-color);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 480px; /* Mobile width */
  background-color: var(--bg-color);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

/* Screens */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: fadeIn 0.3s ease;
  padding-bottom: 80px; /* Space for bottom floating bar */
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Headers */
.header-main {
  background-color: var(--primary-color);
  color: white;
  padding: 20px;
  text-align: center;
}
.header-main h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  color: #fff;
}
.header-main h1 span {
  color: #F6A821; /* Yellow/Orange accent in QUIEN GANA */
}

.header-nav {
  background-color: var(--primary-color);
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-nav .back-btn {
  color: white;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  margin-right: 15px;
}
.header-nav h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.header-nav .subtitle {
  font-size: 12px;
  color: #a0aec0;
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

/* Titles */
.section-title {
  padding: 20px;
  text-align: center;
}
.section-title h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 5px;
}
.section-title p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Content Area */
.content-area {
  padding: 0 20px;
  flex: 1;
}

/* Category Cards */
.category-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid var(--border-color);
}
.category-card:active {
  transform: scale(0.98);
}
.category-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(31, 139, 49, 0.1);
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 15px;
}
.category-info {
  flex: 1;
}
.category-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 3px 0;
}
.category-info p {
  font-size: 13px;
  color: var(--secondary-color);
  margin: 0;
}
.category-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

/* Screen 2: Top Summary */
.top-summary {
  background: var(--card-bg);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 59px;
  z-index: 9;
}
.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.summary-header h3 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.summary-header .counter {
  font-size: 13px;
  color: var(--secondary-color);
  font-weight: 600;
}
.amount-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.amount-input-group label {
  font-weight: 600;
}
.amount-field {
  flex: 1;
  position: relative;
}
.amount-field i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.amount-field input {
  width: 100%;
  padding: 10px 10px 10px 25px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}
.quick-amounts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
}
.quick-amounts::-webkit-scrollbar {
  display: none;
}
.btn-quick {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-quick.active {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

/* Matches */
.matches-list {
  padding: 20px;
}
.match-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
}
.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.match-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.match-index {
  background: rgba(31, 139, 49, 0.1);
  color: var(--secondary-color);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}
.btn-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}
.odds-container {
  display: flex;
  gap: 8px;
}
.odd-btn {
  flex: 1;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.odd-btn.active {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}
.odd-name {
  font-size: 12px;
  margin-bottom: 4px;
}
.odd-value {
  font-size: 14px;
  font-weight: 700;
}

/* Floating Bottom Bar */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 20;
}
.win-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.win-label {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.win-label i {
  color: var(--text-muted);
  font-size: 14px;
}
.win-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--secondary-color);
}
.btn-primary {
  width: 100%;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:disabled {
  background: #a5d6b0;
  cursor: not-allowed;
}
.btn-primary:active:not(:disabled) {
  opacity: 0.9;
}
.bottom-bar p.note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}

/* Screen 3: PICK Output */
.pick-info-alert {
  background: rgba(31, 139, 49, 0.1);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  gap: 10px;
  margin: 20px;
}
.pick-info-alert i {
  color: var(--secondary-color);
  font-size: 18px;
}
.pick-info-alert p {
  font-size: 13px;
  margin: 0;
}

.qr-container {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 30px;
  margin: 0 20px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
#qrcode {
  width: 100%;
  max-width: 250px;
  height: auto;
  aspect-ratio: 1;
}
#qrcode img {
  width: 100%;
}

.summary-box {
  background: white;
  border-radius: 12px;
  padding: 15px 20px;
  margin: 0 20px 20px;
  border: 1px solid var(--border-color);
}
.summary-box h4 {
  font-size: 14px;
  margin: 0 0 15px 0;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}
.summary-row:last-child {
  margin-bottom: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  font-size: 16px;
  font-weight: 700;
}
.summary-row:last-child span:last-child {
  color: var(--secondary-color);
}

.actions-container {
  padding: 0 20px;
  margin-bottom: 20px;
}
.btn-save {
  width: 100%;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.capture-hint {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  font-size: 14px;
  font-weight: 600;
}

.disclaimers {
  padding: 20px;
  border-top: 1px dashed var(--border-color);
}
.disclaimer-item {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}
.disclaimer-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(31, 139, 49, 0.1);
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.disclaimer-item p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}
.disclaimer-item p strong {
  color: var(--text-dark);
  display: block;
  margin-bottom: 2px;
}

/* Modals / Bottom Sheets */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.bottom-sheet {
  background: white;
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 25px 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .bottom-sheet {
  transform: translateY(0);
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.sheet-header h3 {
  font-size: 18px;
  margin: 0;
}
.btn-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}
.steps-list {
  list-style: none;
  margin-bottom: 20px;
}
.steps-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
}
.step-number {
  background: var(--secondary-color);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Helpers */
.whatsapp-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  margin: 0 20px 20px;
  text-decoration: none;
  color: var(--text-dark);
}
.wa-icon {
  color: #25D366;
  font-size: 32px;
}
.wa-info h4 {
  margin: 0 0 2px 0;
  font-size: 14px;
}
.wa-info p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.dudas-link {
  display: block;
  text-align: center;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
  margin: 20px 0;
  text-decoration: none;
}
.dudas-link i {
  margin-left: 5px;
}

/* Warnings */
.warning-box {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  color: #664d03;
  padding: 12px;
  border-radius: 8px;
  margin: 15px 20px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.warning-box i {
  color: #ffc107;
  font-size: 18px;
  margin-top: 2px;
}

/* Centered Modals */
.modal-center {
  align-items: center;
}
.modal-card {
  background: white;
  width: 90%;
  max-width: 320px;
  border-radius: 16px;
  padding: 25px 20px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-card {
  transform: scale(1);
}
.modal-card-icon {
  font-size: 48px;
  margin-bottom: 15px;
}
.modal-card-icon.warning {
  color: #ffc107;
}
.modal-card-icon.info {
  color: var(--secondary-color);
}
.modal-card p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 25px;
  color: var(--text-dark);
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.btn-modal {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}
.btn-modal:active {
  opacity: 0.8;
}
.btn-modal-primary {
  background: var(--secondary-color);
  color: white;
}
.btn-modal-secondary {
  background: var(--bg-color);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}
