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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Microsoft YaHei", sans-serif;
  background: #f7f5f2;
  color: #2d2d2d;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.container {
  width: 100%;
  max-width: 700px;
  margin-top: 40px;
}

header {
  text-align: center;
  margin-bottom: 36px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
  white-space: nowrap;
}

.subtitle {
  color: #888;
  font-size: 15px;
}

/* --- Step visibility --- */
.step { display: none; }
.step.active { display: block; }

/* --- Questions --- */
.question-group {
  margin-bottom: 28px;
  text-align: center;
}

.q-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #444;
  text-align: center;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.options button {
  padding: 10px 16px;
  border: 1.5px solid #e0dcd5;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.options button:hover {
  border-color: #c4b5a5;
  color: #333;
}

.options button.selected {
  background: #2d2d2d;
  color: #fff;
  border-color: #2d2d2d;
}

/* --- Buttons --- */
.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #d4c5b2;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 8px;
}

.btn-primary:not(:disabled):hover {
  background: #c4b5a2;
}

.btn-primary:disabled {
  background: #e8e4de;
  color: #b8b0a4;
  cursor: not-allowed;
}

.btn-outline {
  padding: 10px 24px;
  border: 1.5px solid #e0dcd5;
  border-radius: 12px;
  background: #fff;
  color: #777;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-outline:hover {
  border-color: #bbb;
  color: #555;
}

.vs-stop-area {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed #e0dcd5;
}

.vs-stop-hint {
  font-size: 15px;
  color: #6b5d4a;
  margin-bottom: 10px;
  font-weight: 500;
}

.btn-stop {
  padding: 12px 32px;
  border: none;
  border-radius: 14px;
  background: #8a7a65;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-stop:hover {
  background: #6b5d4a;
}

/* --- Tags --- */
.result-tags {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 3px 10px;
  border-radius: 20px;
  background: #f2eeea;
  font-size: 12px;
  color: #7a7265;
}

/* --- VS Arena --- */
.vs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#vs-counter {
  font-size: 15px;
  font-weight: 600;
  color: #777;
}

.vs-arena {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.vs-card {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  border: 2.5px solid #e8e4de;
  text-align: center;
  position: relative;
}

.vs-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  border-color: #d4c5b2;
}

/* Locked state - tapped but not yet confirmed */
.vs-card.locked {
  border-color: #c4a46c;
  box-shadow: 0 0 0 4px rgba(196, 164, 108, 0.15), 0 4px 20px rgba(0,0,0,0.10);
  transform: translateY(-3px);
}

.vs-card.locked .btn-pick {
  display: block;
}

/* Champion (left) - confirmed winner */
.vs-card.champion {
  border-color: #8a7a65;
}

/* Challenger (right) - new opponent */
.vs-card.challenger {
  border-color: #7a9eb1;
  box-shadow: 0 0 0 3px rgba(122, 158, 177, 0.12), 0 4px 20px rgba(0,0,0,0.08);
  animation: slideIn 0.4s ease;
}

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

/* Badge */
.vs-badge {
  display: none;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.vs-card.champion .vs-badge {
  display: block;
  background: #8a7a65;
  color: #fff;
}

.vs-card.challenger .vs-badge {
  display: block;
  background: #7a9eb1;
  color: #fff;
}

/* Pick button */
.btn-pick {
  display: none;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: #c4a46c;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-pick:hover {
  background: #b0895a;
}

.vs-name {
  font-size: 20px;
  margin-bottom: 6px;
  color: #4a3728;
}

.vs-tips {
  font-size: 14px;
  color: #5c4a3a;
  line-height: 1.6;
  margin-bottom: 10px;
  font-weight: 450;
  background: #faf8f5;
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 3px solid #d4c5b2;
  text-align: center;
}

.vs-address {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 4px;
}

.vs-link {
  display: inline-block;
  font-size: 12px;
  color: #8a7a65;
  text-decoration: none;
  border-bottom: 1px dashed #c4b5a2;
  transition: all 0.15s ease;
}

.vs-link:hover {
  color: #5a4a35;
  border-bottom-color: #5a4a35;
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 50px;
}

.vs-text {
  font-size: 16px;
  font-weight: 800;
  color: #ccc;
  letter-spacing: 2px;
}

.vs-hint {
  text-align: center;
  font-size: 13px;
  color: #bbb;
  margin-top: 8px;
}

.result-detail {
  margin-top: 12px;
}

.result-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.result-card h2 {
  font-size: 24px;
  color: #4a3728;
  margin-bottom: 12px;
}

.result-detail .btn-outline {
  margin-top: 20px;
}

.result-card .tips {
  font-size: 16px;
  color: #3d2e1f;
  line-height: 1.7;
  margin-bottom: 16px;
  padding: 14px 16px;
  text-align: center;
  background: #fdfaf5;
  border-radius: 12px;
  border: 1px solid #e8dfcf;
}

.result-card .address {
  text-align: center;
  margin-bottom: 8px;
}

.result-card .vs-link {
  display: block;
  text-align: center;
  margin-bottom: 18px;
}

#btn-detail-back {
  display: block;
  margin: 0 auto;
}

/* --- Result --- */
.result-title {
  text-align: center;
  font-size: 22px;
  margin-bottom: 24px;
  color: #3d2e1f;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border-radius: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rank-item:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  transform: translateX(4px);
}

.rank-num {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.rank-info strong {
  display: block;
  font-size: 17px;
  color: #3d2e1f;
  margin-bottom: 2px;
}

.rank-detail {
  font-size: 13px;
  color: #7a7265;
  font-weight: 450;
}

/* --- Empty --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 16px;
  color: #666;
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 14px !important;
  color: #999 !important;
  margin-bottom: 24px !important;
}

/* --- Footer --- */
footer {
  margin-top: auto;
  padding: 32px 0 16px;
  text-align: center;
}

footer p {
  font-size: 13px;
  color: #b8b0a4;
}

footer a {
  color: #8a7e6e;
  text-decoration: underline;
}

/* --- Mobile --- */
@media (max-width: 500px) {
  .container {
    max-width: 100%;
    margin-top: 16px;
  }

  header h1 {
    font-size: 22px;
    white-space: normal;
  }

  .vs-arena {
    flex-direction: column;
    gap: 10px;
  }

  .vs-divider {
    width: 100%;
    height: 30px;
  }

  .vs-name {
    font-size: 17px;
  }

  .vs-card {
    padding: 16px 14px;
  }
}
