:root {
  --primary-color: #ff6b6b;
  --primary-hover: #fa5252;
  --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --card-bg: #ffffff;
  --text-main: #212529;
  --text-muted: #6c757d;
  --border-radius: 20px;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
  padding: 16px;
}

.app-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: #343a40;
}

.lang-toggle {
  background: #ffffff;
  border: 1px solid #dee2e6;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 28px 20px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.card.active {
  display: flex;
}

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

.hero-icons {
  font-size: 2.2rem;
  margin: 24px 0;
  letter-spacing: 4px;
}

#start-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}

#start-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: #f1f3f5;
  border-radius: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.count-badge {
  align-self: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-color);
  background: #ffe3e3;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}

#question-text {
  font-size: 1.25rem;
  margin-bottom: 24px;
  line-height: 1.4;
  word-break: keep-all;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  background: #f8f9fa;
  border: 1.5px solid #e9ecef;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.option-btn:active {
  background: #ffe3e3;
  border-color: var(--primary-color);
  transform: scale(0.98);
}

.badge-tag {
  align-self: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #495057;
  background: #e9ecef;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.animal-avatar {
  font-size: 4rem;
  margin: 6px 0;
}

#res-name {
  font-size: 1.6rem;
  font-weight: 800;
}

.tagline {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 16px;
}

.stat-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  text-align: left;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.stat-val {
  color: var(--primary-color);
}

.stat-track {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8787, #fa5252);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.desc-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #495057;
  text-align: left;
  margin-bottom: 16px;
  word-break: keep-all;
}

.manual-box {
  background: #fdfdfd;
  border: 1px dashed #dee2e6;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: left;
  font-size: 0.85rem;
}

.manual-box h3 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: #343a40;
}

.manual-item {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.manual-item.warning {
  margin-bottom: 0;
}

/* Match Section & Clickable Cards */
.match-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.match-box {
  display: flex;
  gap: 8px;
}

.match-col {
  flex: 1;
  padding: 12px 10px;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.match-col.best {
  background: #fff0f6;
  border: 1.5px solid #fcc2d7;
}

.match-col.worst {
  background: #f1f3f5;
  border: 1.5px solid #ced4da;
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.match-label {
  font-size: 0.75rem;
  font-weight: 700;
}

.toggle-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.match-name {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.match-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #495057;
  word-break: keep-all;
  display: block;
  margin-top: 6px;
}

/* Custom Summon Bestie Button */
.btn-summon {
  background: linear-gradient(135deg, #ff8787 0%, #fa5252 100%);
  color: #ffffff;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(250, 82, 82, 0.25);
}

.btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-secondary {
  background: #212529;
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  color: #495057;
  border: 1.5px solid #ced4da;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 37, 41, 0.92);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 100;
  width: 90%;
  max-width: 380px;
  word-break: keep-all;
}

.toast.show {
  opacity: 1;
}