:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f0f5f0;
  --text: #132017;
  --text-soft: #667168;
  --line: #dde5dd;
  --green: #228b4e;
  --green-strong: #16653a;
  --green-soft: #e7f5eb;
  --red: #db4b4b;
  --red-soft: #fceced;
  --gray-soft: #eef1ee;
  --gray-mid: #95a096;
  --spot-red: #e4032e;
  --spot-ink: #1a1a1a;
  --shadow: 0 18px 40px rgba(18, 36, 24, 0.08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 16px;
  --container: 920px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 139, 78, 0.11), transparent 28%),
    radial-gradient(circle at top right, rgba(34, 139, 78, 0.06), transparent 22%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(calc(100% - 16px), var(--container));
  margin: 0 auto;
  padding: 14px 0 32px;
}

.app-frame {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 32px;
}

.app-shell {
  position: relative;
}

.app-shell::before {
  content: "";
  display: block;
  height: 5px;
  border-radius: 999px;
  margin: 0 4px 14px;
  background: linear-gradient(90deg, var(--spot-ink) 0%, var(--spot-ink) 32%, var(--spot-red) 32%, var(--spot-red) 100%);
}

.screen {
  display: grid;
  gap: 18px;
}

.topbar,
.progress-panel,
.step-card,
.detail-card,
.modal-panel {
  background: var(--surface);
  border: 1px solid rgba(221, 229, 221, 0.95);
  box-shadow: var(--shadow);
}

.topbar {
  border-radius: var(--radius-xl);
  padding: 22px 20px 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spot-logo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.spot-logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--spot-ink);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--spot-ink);
  line-height: 1;
}

.spot-logo-dot {
  border-color: var(--spot-red);
  background: var(--spot-red);
}

.spot-logo.on-dark .spot-logo-mark {
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

.spot-logo.on-dark .spot-logo-dot {
  border-color: var(--spot-red);
  background: var(--spot-red);
}

.brand {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spot-red);
}

.topbar h1,
.detail-header h2 {
  margin: 8px 0 0;
}

.topbar h1 {
  font-size: clamp(2rem, 8vw, 3.3rem);
  line-height: 0.98;
}

.topbar p,
.detail-header p,
.helper-text,
.mini-caption,
.legend-item {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 1rem;
}

.progress-panel {
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.progress-dots {
  display: flex;
  gap: 10px;
}

.progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d8ded8;
}

.progress-dot.is-done {
  background: var(--green);
}

.progress-dot.is-current {
  background: #b7d7c0;
  box-shadow: 0 0 0 6px rgba(34, 139, 78, 0.12);
}

.progress-row strong {
  font-size: 1.1rem;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5ebe5;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fa95f 0%, #1b7642 100%);
  transition: width 0.25s ease;
}

.steps-grid {
  display: grid;
  gap: 14px;
}

.step-card {
  border: 0;
  border-radius: 28px;
  min-height: 152px;
  padding: 22px 20px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.step-card:disabled {
  cursor: not-allowed;
}

.step-card[data-status="done"] {
  background: #fbfcfb;
  color: #6d776f;
  box-shadow: none;
}

.step-card[data-status="current"] {
  background: linear-gradient(180deg, #f5fbf6 0%, #edf8f0 100%);
  border: 2px solid rgba(34, 139, 78, 0.28);
}

.step-card[data-status="current"]:hover {
  transform: translateY(-2px);
}

.step-card[data-status="locked"] {
  background: #f4f6f4;
  color: #8c978d;
  box-shadow: none;
}

.step-card-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
}

.step-card-icon svg {
  width: 46px;
  height: 46px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

.step-card[data-status="current"] .step-card-icon {
  color: var(--green-strong);
}

.step-card[data-status="done"] .step-card-icon,
.step-card[data-status="locked"] .step-card-icon {
  color: var(--gray-mid);
}

.step-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.step-card-status {
  min-height: 24px;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.step-card[data-status="current"] .step-card-status {
  color: var(--green-strong);
}

.screen-detail {
  gap: 14px;
}

.back-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--green-strong);
  padding: 6px 2px;
  font-weight: 800;
  font-size: 1rem;
}

.detail-content {
  display: grid;
}

.detail-card {
  border-radius: var(--radius-xl);
  padding: 22px 18px 20px;
  display: grid;
  gap: 20px;
}

.detail-header {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.detail-step {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-strong);
}

.detail-icon {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: var(--green-soft);
  display: grid;
  place-items: center;
  color: var(--green-strong);
}

.detail-icon svg {
  width: 44px;
  height: 44px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

.detail-header h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.detail-body {
  display: grid;
  gap: 18px;
}

.visual-panel,
.camera-panel,
.result-panel,
.photo-actions,
.unlock-panel,
.xp-panel {
  border-radius: var(--radius-lg);
  background: #fbfcfb;
}

.visual-panel,
.camera-panel,
.result-panel,
.unlock-panel,
.xp-panel {
  padding: 16px;
  border: 1px solid var(--line);
}

.strategy-strip,
.shelf-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.product-chip {
  min-height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px 4px;
  font-size: 0.75rem;
  font-weight: 800;
}

.ambev {
  background: var(--green-soft);
  color: var(--green-strong);
}

.competitor {
  background: var(--red-soft);
  color: var(--red);
}

.planogram {
  display: grid;
  gap: 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f8fbf8 0%, #eef5ef 100%);
  padding: 14px;
  border: 1px solid var(--line);
}

.planogram-large {
  padding: 18px;
}

.shelf-row {
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.red {
  background: var(--red);
}

.primary-button,
.secondary-button,
.upload-button {
  min-height: 56px;
  border-radius: 18px;
  border: 0;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-strong) 100%);
  color: #fff;
}

.secondary-button,
.upload-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-stack {
  display: grid;
  gap: 12px;
}

.mini-steps {
  display: grid;
  gap: 12px;
}

.mini-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
}

.mini-step-number {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green-strong);
  font-weight: 800;
}

.camera-panel {
  display: grid;
  gap: 16px;
}

.camera-panel input[type="file"] {
  display: none;
}

.preview-frame {
  min-height: 260px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #f4f7f4 0%, #eef3ee 100%);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-placeholder {
  color: var(--text-soft);
  padding: 24px;
  text-align: center;
}

.photo-actions {
  display: grid;
  gap: 12px;
  background: transparent;
}

.loading-state {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(34, 139, 78, 0.16);
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}

.result-panel {
  display: grid;
  gap: 18px;
}

.reward-intro {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.reward-burst {
  font-size: 2rem;
  line-height: 1;
}

.reward-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.reward-subtitle {
  font-size: 1.3rem;
}

.reward-training {
  color: var(--text-soft);
  font-weight: 700;
}

.reward-xp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #173624 0%, #26583a 100%);
  color: #fff;
  font-weight: 800;
}

.reward-message,
.player-card-wrap,
.unlock-panel,
.xp-panel {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.reward-message.is-visible,
.player-card-wrap.is-visible,
.unlock-panel.is-visible,
.xp-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.player-card-wrap {
  display: grid;
  justify-content: center;
}

.player-card {
  width: min(100%, 340px);
  border-radius: 30px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(160deg, #8e9aa3 0%, #50616b 100%);
  box-shadow: 0 20px 46px rgba(16, 28, 20, 0.22);
  display: grid;
  gap: 16px;
}

.player-card.level-bronze {
  background: linear-gradient(160deg, #9e6f4b 0%, #65452d 100%);
}

.player-card.level-prata {
  background: linear-gradient(160deg, #8e9aa3 0%, #50616b 100%);
}

.player-card.level-ouro {
  background: linear-gradient(160deg, #d3a73d 0%, #8b6420 100%);
}

.player-card.level-diamante {
  background: linear-gradient(160deg, #79b8cf 0%, #2f6d86 100%);
}

.player-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.player-card-brand,
.player-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.player-card-level {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.84rem;
  font-weight: 800;
}

.player-card-avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.player-card-avatar img,
.player-avatar-fallback {
  width: 100%;
  height: 100%;
}

.player-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 40%),
    rgba(255, 255, 255, 0.08);
}

.player-card-user {
  text-align: center;
}

.player-card-user h3,
.player-card-user p {
  margin: 0;
}

.player-card-user h3 {
  font-size: 1.55rem;
  line-height: 1.05;
}

.player-card-user p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
}

.player-meta {
  margin: 0;
  display: grid;
  gap: 8px;
}

.player-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.player-meta dt,
.player-meta dd {
  margin: 0;
}

.player-meta dt {
  color: rgba(255, 255, 255, 0.72);
}

.player-meta dd {
  font-weight: 700;
  text-align: right;
}

.player-attributes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.attribute-item {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 4px;
}

.attribute-item span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.attribute-item strong {
  font-size: 1.55rem;
  line-height: 1;
}

.player-skills {
  display: grid;
  gap: 10px;
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-badge {
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
  font-weight: 700;
}

.unlocked-skill {
  margin-top: 10px;
  min-height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff7e1 0%, #f7e6a5 100%);
  color: #6d5317;
  font-weight: 800;
  animation: pulseReward 0.9s ease-out 1;
}

.evolution-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.evolution-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.evolution-item span {
  color: var(--text-soft);
}

.xp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.xp-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e5ebe5;
  overflow: hidden;
  margin: 12px 0 10px;
}

.xp-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c8d0cb 0%, #8b9790 18%, #5b6670 50%, #7d6540 100%);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 19, 13, 0.56);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 12px), 920px);
  margin: 6px auto;
  min-height: calc(100vh - 12px);
  border-radius: 30px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.icon-button {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.9rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseReward {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 rgba(214, 170, 55, 0);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(214, 170, 55, 0.12);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(214, 170, 55, 0);
  }
}

@media (min-width: 720px) {
  .app-shell {
    width: min(calc(100% - 40px), var(--container));
    padding-top: 24px;
  }

  .screen-home,
  .screen-detail {
    gap: 20px;
  }

  .topbar,
  .progress-panel,
  .detail-card {
    padding-left: 24px;
    padding-right: 24px;
  }

  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .step-card {
    min-height: 180px;
  }

  .detail-card {
    padding-top: 26px;
    padding-bottom: 24px;
  }

  .button-stack.dual {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
