:root {
    --primary: #e91e63;
    --primary-hover: #c2185b;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg: #f5f5f5;
    --card-bg: white;
    --border: #e0e0e0;
    --surface: #f8f9fa;
    --surface-hover: #fce4ec;
}

body.dark-mode {
    --text: #e0e0e0;
    --text-light: #b0b0b0;
    --text-lighter: #888;
    --bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --border: #4d4d4d;
    --surface: #3d3d3d;
    --surface-hover: #4a2c3a;
    --primary: #ff4081;
    --primary-hover: #f50057;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 { font-size: 2.5em; margin-bottom: 20px; }
h2 { font-size: 1.8em; margin-bottom: 15px; }

.subtitle {
    font-size: 1.2em;
    color: var(--text-light);
    margin-bottom: 30px;
}

.intro-text { margin-bottom: 30px; }

.image-placeholder {
    width: 100%;
    height: 300px;
    background: var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-lighter);
    font-size: 1.1em;
    margin: 30px 0;
}

/* Buttons */
.start-btn, .restart-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.start-btn:hover, .restart-btn:hover {
    background: var(--primary-hover);
}

.back-btn, .quit-btn, .runner-up-btn, .share-btn {
    background: transparent;
    border: 2px solid var(--border);
    padding: 10px 20px;
    font-size: 0.95em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-light);
}

.runner-up-btn, .share-btn {
    color: var(--primary);
    border-color: var(--primary);
    padding: 12px 30px;
    font-size: 1em;
    margin-bottom: 15px;
}

.share-btn {
    width: 100%;
    max-width: 300px;
}

.back-btn:hover, .quit-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
}

.runner-up-btn:hover, .share-btn:hover {
    background: var(--primary);
    color: white;
}

.back-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.back-btn:disabled:hover {
    background: transparent;
    border-color: var(--border);
    color: var(--text-light);
}

/* Quiz */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.question-number {
    color: var(--text-light);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.5em;
    margin-bottom: 30px;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 20px;
    text-align: left;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}

.answer-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

/* Results */
.result-section {
    margin-bottom: 40px;
}

.result-title {
    font-size: 2em;
    color: #e74c3c;
    margin-bottom: 10px;
}

.result-subtitle {
    font-size: 1.3em;
    color: var(--text-light);
    margin-bottom: 20px;
}

.result-content p {
    margin-bottom: 15px;
    font-size: 1.05em;
    line-height: 1.7;
}

.result-content strong {
    display: block;
    margin-top: 20px;
    margin-bottom: 5px;
}

.tie-notice {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
    color: #856404;
}

body.dark-mode .tie-notice {
    background: #3d3310;
    color: #ffd54f;
}

.runner-up-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid var(--border);
}

.runner-up-section h3 {
    color: var(--text-light);
    font-size: 1.3em;
    margin-bottom: 20px;
}

/* Newsletter */
.newsletter-cta {
    margin: 30px 0;
    padding: 25px;
    background: var(--surface);
    border-radius: 8px;
    text-align: center;
}

.newsletter-cta p {
    margin-bottom: 15px;
    font-size: 0.95em;
    color: var(--text-light);
}

.newsletter-cta a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.newsletter-cta a:hover {
    text-decoration: underline;
}

.embeddable-buttondown-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.embeddable-buttondown-form input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1em;
    background: var(--card-bg);
    color: var(--text);
}

.embeddable-buttondown-form input[type="submit"] {
    padding: 10px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.embeddable-buttondown-form input[type="submit"]:hover {
    background: var(--primary-hover);
}

.buttondown-credit {
    margin-top: 10px;
    font-size: 0.8em;
    opacity: 0.6;
}

.buttondown-credit a {
    font-weight: normal;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 0.95em;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.social-links {
    margin-top: 10px;
}

.social-links a {
    margin: 0 10px;
}

.hidden {
    display: none;
}

/* Link improvements */
a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.2s;
}

a:hover {
    text-decoration-thickness: 2px;
    opacity: 0.8;
}

/* Exception: footer and form links can stay as they were */
.footer a,
.newsletter-cta a {
    text-decoration: none;
}

.footer a:hover,
.newsletter-cta a:hover {
    text-decoration: underline;
}

/* Links in result content need better contrast */
.result-content a {
    font-weight: 500;
}

/* Who's that raccoon? hero animation */
.wtr {
  --duration: 4s;
  --offset: 1s;

  width: 100%;
  aspect-ratio: 2360 / 1640; /* match background image dimensions */
  max-height: 320px;
  margin-bottom: 28px;

  position: relative;

  /*background-color: var(--primary);*/
  background-image: url("images/whosthatraccoon/bg.png");
  background-size: 100% 100%;
  background-position: left top;
  border-radius: 12px;
}

.wtr-sil {
  height: 81.25%; /* 260/320 - scales with container */
  width: auto; /* maintain aspect ratio */
  max-height: 260px; /* cap on larger screens */

  position: absolute;
  left: 2.5%;
  top: 15%;

  animation-name: wtr-fade-in-out;
  animation-duration: var(--duration);
  animation-delay: calc(var(--offset) + var(--duration) * var(--i));

  transform: scale(0%);
}

@media (width >= 640px) {
  .wtr-sil {
    left: 12.5%;
  }
}

.wtr-sil:last-child {
  animation: wtr-fade-in;
  /* retain end keyframe styles on last image. needs explicit duration and delay.*/
  animation-fill-mode: forwards;
  animation-duration: var(--duration);
  animation-delay: calc(var(--offset) + var(--duration) * var(--i));
}

@keyframes wtr-fade-in-out {
  0% {
    transform: scale(0%);
  }
  10% {
    transform: scale(100%);
  }
  90% {
    transform: scale(100%);
  }
  100% {
    transform: scale(0%);
  }
}

@keyframes wtr-fade-in {
  0% {
    transform: scale(0%);
  }
  10% {
    transform: scale(100%);
  }
  100% {
    transform: scale(100%);
  }
}
