/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf5ef;
  --card: #ffffff;
  --primary: #8B5E3C;
  --primary-light: #A67B5B;
  --accent: #D4A574;
  --text: #2c1810;
  --text-light: #7a5a40;
  --green: #4CAF50;
  --red: #e74c3c;
  --gray: #95a5a6;
  --shadow: 0 4px 24px rgba(139, 94, 60, 0.12);
  --radius: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== AD PLACEHOLDER (reminder only) ===== */
.ad-banner {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: #e8ddd0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 14px;
  margin: 12px auto;
  /* Replace this div with actual AdSense code when approved */
  border: 2px dashed #c4a88a;
}

.ad-skyscraper {
  width: 160px;
  min-height: 600px;
  background: #e8ddd0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 13px;
  border: 2px dashed #c4a88a;
}

/* ===== HEADER ===== */
header {
  width: 100%;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px 24px;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}

header h1 {
  font-size: 28px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

header h1 span { color: var(--accent); }

header p {
  color: var(--text-light);
  font-size: 14px;
  margin-top: 4px;
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
  display: flex;
  gap: 20px;
  max-width: 1060px;
  width: 100%;
  padding: 20px;
  flex: 1;
  align-items: flex-start;
}

.main-layout .left-rail,
.main-layout .right-rail {
  display: none;
}

/* ===== GAME CONTAINER ===== */
.game-container {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
}

/* ===== VIEWS ===== */
.view {
  display: none;
  animation: fadeIn 0.4s ease;
}
.view.active { display: block; }

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

/* ===== WELCOME VIEW ===== */
.welcome-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 48px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.welcome-card .paw-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.welcome-card h2 {
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 12px;
}

.welcome-card p {
  color: var(--text-light);
  line-height: 1.7;
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 8px;
}

.welcome-card .instructions {
  background: #f6efe7;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px auto;
  max-width: 440px;
  text-align: left;
}

.welcome-card .instructions li {
  margin: 8px 0;
  font-size: 15px;
  color: var(--text-light);
  list-style: none;
}

.welcome-card .instructions li::before {
  content: "🐾 ";
}

.btn {
  display: inline-block;
  padding: 16px 48px;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 94, 60, 0.3);
}

.btn-secondary {
  background: var(--accent);
  color: white;
}
.btn-secondary:hover {
  background: #c49565;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* ===== GAME VIEW ===== */
.game-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.game-progress {
  margin-bottom: 24px;
}

.progress-bar {
  height: 6px;
  background: #e8ddd0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
  text-align: right;
}

.question-area {
  text-align: center;
  margin: 24px 0;
}

.question-paw { font-size: 36px; margin-bottom: 8px; }

.breeds-remaining {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.question-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 28px;
}

.answer-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.answer-buttons .btn {
  min-width: 120px;
  padding: 14px 28px;
  font-size: 16px;
}

.btn-yes { background: var(--green); color: white; }
.btn-yes:hover { background: #43a047; transform: translateY(-2px); }

.btn-no { background: var(--red); color: white; }
.btn-no:hover { background: #c0392b; transform: translateY(-2px); }

.btn-unsure { background: var(--gray); color: white; }
.btn-unsure:hover { background: #7f8c8d; transform: translateY(-2px); }

/* ===== RESULT VIEW ===== */
.result-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.result-emoji {
  font-size: 72px;
  margin-bottom: 8px;
}

.result-card h2 {
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 8px;
}

.result-breed {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin: 16px 0;
  letter-spacing: -0.5px;
}

.result-fact {
  background: #f6efe7;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
}

.result-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
}

.stat-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 20px;
  text-align: center;
}
.stat-box .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.stat-box .stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ===== FOOTER ===== */
footer {
  width: 100%;
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  border-top: 1px solid #e0d5c8;
  margin-top: auto;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 900px) {
  .main-layout .left-rail,
  .main-layout .right-rail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 160px;
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  header h1 { font-size: 22px; }
  .welcome-card { padding: 32px 20px; }
  .welcome-card h2 { font-size: 20px; }
  .game-card { padding: 24px 16px; }
  .question-text { font-size: 18px; }
  .answer-buttons .btn { min-width: 90px; padding: 12px 20px; font-size: 14px; }
  .result-breed { font-size: 26px; }
  .result-stats { flex-direction: column; align-items: center; }
  .main-layout { padding: 12px; }
}