@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap');

/* =============================================
   Theme variables
   To switch themes, set data-theme on <html>:
     data-theme="nejm"  → orange (NEJM collaborative days)
     data-theme="teal"  → teal  (regular days)
   ============================================= */

/* Maroon / NEJM theme (default) */
:root {
  /* Core */
  --color-primary: #5C1027;
  --color-primary-hover: #480D1F;
  --color-accent: #5C1027;
  --color-bg-start: #F9E8EC;
  --color-dot: #C07080;

  /* Header */
  --header-bg: #5C1027;
  --header-text: #F8EEF0;
  --header-muted: #D4A0B0;
  --nav-bg: #5C1027;
  --nav-bg-deep: #3D081A;

  /* Card */
  --card-border-color: transparent;
  --card-title-color: #5C1027;

  /* Clue / symptom boxes */
  --clue-bg: #FDF5F6;
  --clue-text: #5C1027;
  --clue-border: #E8C0C8;

  /* Input */
  --input-bg: #ffffff;
  --input-border: #D4A8B4;
  --input-placeholder: #B07080;

  /* Primary action button */
  --btn-bg: #5C1027;
  --btn-bg-hover: #480D1F;
  --btn-text: #ffffff;

  /* Guess history rows */
  --correct-bg: #D6F0E8;
  --correct-text: #0F6E56;
  --correct-border: #c3e6cb;
  --wrong-bg: #FEF0F0;
  --wrong-text: #8B2020;
  --wrong-border: #FACACA;
  --skip-bg: #f7f7f7;
  --skip-text: #777;
  --skip-border: #e0e0e0;

  /* Footer */
  --footer-bg: #5C1027;
  --footer-text-color: #D4A0B0;
  --footer-border-color: #5C1027;
}

/* Teal theme (regular days) */
[data-theme="teal"] {
  /* Core */
  --color-primary: #1A5C5C;
  --color-primary-hover: #124040;
  --color-accent: #1AA898;
  --color-bg-start: #F2F6F8;
  --color-dot: #5BBFBA;

  /* Header */
  --header-bg: #1C3A52;
  --header-text: #F2F8FA;
  --header-muted: #6A9BB0;
  --nav-bg: #1C3A52;
  --nav-bg-deep: #0F2230;

  /* Card */
  --card-border-color: #C8D8E4;
  --card-title-color: #1C3A52;

  /* Clue / symptom boxes */
  --clue-bg: #EEF6FB;
  --clue-text: #1C3A52;
  --clue-border: #C8DEEC;

  /* Input */
  --input-bg: #F7FBFC;
  --input-border: #C8D8E4;
  --input-placeholder: #9AB8C6;

  /* Primary action button */
  --btn-bg: #1AA898;
  --btn-bg-hover: #168a7a;
  --btn-text: #ffffff;

  /* Guess history rows */
  --correct-bg: #D6F0E8;
  --correct-text: #0F6E56;
  --correct-border: #A8DACE;
  --wrong-bg: #FEF0F0;
  --wrong-text: #8B2020;
  --wrong-border: #FACACA;
  --skip-bg: #F5F7F9;
  --skip-text: #7A8A94;
  --skip-border: #DDE4E9;

  /* Footer */
  --footer-bg: #1C3A52;
  --footer-text-color: #7A9AAA;
  --footer-border-color: #1C3A52;
}

/* Docturtle logo — teal days only */
.docturtle-logo {
  display: none;
  height: 2rem;
  width: auto;
  vertical-align: middle;
  flex-shrink: 0;
}

[data-theme="teal"] .docturtle-logo {
  display: inline-block;
}

/* Hide old NEJM branding on teal days */
[data-theme="teal"] .heading-x,
[data-theme="teal"] .nejm-seal,
[data-theme="teal"] .heading-nejm,
[data-theme="teal"] .header-nejm-right,
[data-theme="teal"] .nejm-header-subtitle {
  display: none;
}

/* NEJM header subtitle — "REAL WORLD CASE" + permission line */
.nejm-header-subtitle {
  text-align: center;
  margin-top: 0.2rem;
  line-height: 1.5;
}

.nejm-real-world-case {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #F0C8D0;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.nejm-rule {
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background-color: #C8849A;
  vertical-align: middle;
  flex-shrink: 0;
}

.nejm-permission-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 0.05rem;
}

/* In-card NEJM link shown after game complete */
.nejm-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem auto 0.5rem;
  max-width: fit-content;
  padding: 0.55rem 1.2rem;
  border: 2px solid var(--color-accent);
  border-radius: 999px;
  background-color: transparent;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.nejm-card-link:hover {
  background-color: var(--color-accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-content .nejm-card-link {
  font-size: 1.2rem;
  padding: 0.75rem 1.75rem;
  gap: 0.6rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  /* Background fades from warm orange-salmon at bottom-left to white at top-right */
  background: linear-gradient(to top right, var(--color-bg-start) 0%, #ffffff 90%);
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 0;
  /* establishes stacking context so z-index:-1 pseudo-elements sit above body background */
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(circle, var(--color-dot) 2px, transparent 1px);
  background-size: 22px 22px;
}

/* Dots solid at bottom-left, transparent by 70% diagonally toward top-right */
body::before {
  mask-image: linear-gradient(to top right, black 0%, black 15%, transparent 40%);
  -webkit-mask-image: linear-gradient(to top right, black 0%, black 15%, transparent 40%);
}

/* Mirror: dots solid at bottom-right, transparent by 70% diagonally toward top-left */
body::after {
  mask-image: linear-gradient(to top left, black 0%, black 5%, transparent 30%);
  -webkit-mask-image: linear-gradient(to top left, black 0%, black 5%, transparent 30%);
}

header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 0.85rem 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

header.anniversary-mode {
  background: linear-gradient(to right, #56CCE1, #9B6EE8, #E88EC5) !important;
}

header.anniversary-mode .hamburger-line {
  background-color: #000 !important;
}

.heading {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--header-text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.01em;
}

.heading-x {
  font-weight: 300;
  color: var(--header-text);
  margin: 0 0.1rem;
}

.tm-mark {
  font-size: 0.38em;
  font-weight: 400;
  vertical-align: super;
  letter-spacing: 0;
}

.heading-nejm {
  color: var(--color-accent);
  font-family: 'Playfair Display', Georgia, serif;
}

.nejm-seal {
  vertical-align: middle;
  flex-shrink: 0;
}

.header-nejm-right {
  position: absolute;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  text-align: right;
  line-height: 1.4;
}

.nejm-collab-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
}

.nejm-collab-sub {
  font-size: 0.75rem;
  color: #555;
  white-space: nowrap;
}

.nejm-collab-italic {
  font-size: 0.75rem;
  color: var(--color-accent);
  font-style: italic;
  white-space: nowrap;
}

@media screen and (max-width: 820px) {
  .header-nejm-right {
    display: none;
  }
}

.card-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 2rem 1rem;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--card-border-color);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
}

/* Card flip zone — only wraps the clue area */
.card-flip-zone {
  position: relative;
  perspective: 1200px;
  -webkit-perspective: 1200px;
}

.card-flip-inner {
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.card-flip-inner.flipped {
  transform: rotateY(180deg);
}

/* Front face stays in normal flow — its height drives the zone */
.card-face-front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Back face overlays the front face exactly */
.card-face-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg) translateZ(0);
  -webkit-transform: rotateY(180deg) translateZ(0);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

.summary-title {
  color: var(--card-title-color);
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.summary-text {
  text-align: left;
  line-height: 1.7;
  font-size: 0.95rem;
  color: #333;
  flex: 1;
  overflow-y: auto;
  width: 100%;
}

.anki-btn-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  width: 100%;
  flex-shrink: 0;
}

.anki-btn-wrap {
  flex: 1;
}

.anki-btn-wrap .anki-btn {
  width: 100%;
}

.anki-btn {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.anki-btn:hover {
  background-color: var(--btn-bg-hover);
}

.anki-faq .faq-content {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 4px);
}

/* Summary toggle button — replaces submit button after game ends */
.summary-btn {
  background: linear-gradient(135deg, #1DA1F2 0%, #0d8bd9 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
  animation: shareButtonPulse 2s ease-in-out infinite;
  /* Fixed width based on the longer label so it never resizes */
  width: 13rem;
  white-space: nowrap;
  overflow: hidden;
}

.summary-btn:hover {
  background: linear-gradient(135deg, #0d8bd9 0%, #0a6fb8 100%);
  box-shadow: 0 6px 16px rgba(29, 161, 242, 0.4);
  animation: none;
}

.summary-btn:active {
  transform: scale(0.98);
}

.card-title {
  font-size: 1.6rem;
  font-weight: 600;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--card-title-color);
  margin-bottom: 0.5rem;
}

.card-title::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px;
  margin: 0.6rem auto 1.25rem;
}

.symptom-list {
  margin-bottom: 1.5rem;
}

.symptom {
  background-color: var(--clue-bg);
  border: 1px solid var(--clue-border);
  border-radius: 12px;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--clue-text);
  margin: 0.5rem 0;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#guess-history-list {
  margin-top: 0.5rem;
}

.guess-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 50px;
  padding: 0.35rem 0.75rem;
  font-weight: 500;
  font-size: 0.85rem;
  margin: 0.25rem 0;
  text-align: left;
}

.guess-history-item.correct {
  background-color: var(--correct-bg);
  border: 1px solid var(--correct-border);
  color: var(--correct-text);
}

.guess-history-item.wrong {
  background-color: var(--wrong-bg);
  border: 1px solid var(--wrong-border);
  color: var(--wrong-text);
}

.guess-history-badge {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.4rem;
}

.guess-history-item.skip {
  background-color: var(--skip-bg);
  border: 1px solid var(--skip-border);
  color: var(--skip-text);
}

.guess-history-icon {
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.guess-section {
  margin-top: 1.5rem;
}

#guess {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 8px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  margin-bottom: 1rem;
}

#guess::placeholder {
  color: var(--input-placeholder);
}

.btn_color {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn_color:hover {
  background-color: var(--btn-bg-hover);
}

.feedback {
  font-weight: bold;
  color: var(--card-title-color);
  margin-top: 0;
  height: auto;
  min-height: auto;
  display: block;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer {
  margin: 0;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background-color: var(--footer-bg);
  color: var(--footer-text-color);
  font-size: 0.9rem;
  border-top: 2px solid var(--footer-border-color);
}

.footer-sep {
  font-size: 1.3em;
  font-weight: 300;
  margin: 0 0.5em;
}

.footer-link {
  color: inherit;
  text-decoration: none;
}

.footer-ig {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Fade-in animation */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.fade_in {
  animation: fadeIn 0.5s ease forwards;
}

/* Flip-in animation */
@keyframes flipInX {
  0% {
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }

  100% {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

.flip_in {
  animation: flipInX 0.6s ease forwards;
}

/* Result base styling */
.result {
  font-weight: 700;
  font-size: 1.25rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  display: inline-block;
  transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

#result_class {
  /* Start transparent until content is added */
  background-color: transparent;
  border: none;
  border-radius: 12px;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0.5rem 0 !important;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Text wrapping properties */
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* Override any container positioning */
  position: relative;
  z-index: 1;
}

/* Ensure result_class maintains symptom box styling even with result class */
#result_class.result {
  display: flex !important;
  margin: 0.5rem 0 !important;
  padding: 0.75rem !important;
  font-size: 1.1rem !important;
  /* Keep green styling for completed state */
  background-color: #d4edda !important;
  color: #155724 !important;
  /* Add animation for all result states */
  animation: scalePulse 0.5s ease forwards;
}

/* When it has incorrect class, make it red for wrong answers */
#result_class.result.incorrect {
  background-color: #f8d7da !important;
  color: #721c24 !important;
  /* Ensure animation plays for incorrect results too */
  animation: scalePulse 0.5s ease forwards;
}

/* Correct result styling */
.feedback .result.correct {
  background-color: #d4edda;
  color: #155724 !important;
  box-shadow: 0 0 8px 2px #28a745aa;
  animation: scalePulse 0.5s ease forwards;
}

/* Incorrect result styling */
.feedback .result.incorrect {
  background-color: #f8d7da;
  color: #721c24 !important;
  box-shadow: 0 0 8px 2px #dc3545aa;
  animation: scalePulse 0.5s ease forwards;
}

/* Completed game styling */
.feedback .result.completed {
  background-color: #d4edda;
  color: #155724 !important;
  box-shadow: 0 0 8px 2px #28a745aa;
  animation: scalePulse 0.5s ease forwards;
}

/* Scale pulse animation */
@keyframes scalePulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  60% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: none;
  width: 100%;
}

.suggestion-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
}

.suggestion-item:hover {
  background-color: #d6ecfa;
}

.suggestion-item[style*="not-allowed"]:hover {
  background-color: #f5f5f5 !important;
}

.guess-section {
  margin-top: 1.5rem;
  position: relative;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

#guess {
  flex: 1;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 8px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  margin-bottom: 0;
}

@media screen and (max-width: 768px) {
  .heading {
    font-size: 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .symptom {
    font-size: 1rem;
    padding: 0.5rem;
  }

  .btn_color,
  #guess {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  .suggestion-item {
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
  }

  .stats-button {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .archive-button-wrapper {
    top: 0.75rem;
    left: 0.75rem;
  }

  .archive-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Ensure consistent margins for result_class at tablet sizes */
  #result_class,
  #result_class.result {
    margin: 0.5rem 0 !important;
  }

  .footer {
    flex-direction: column;
    gap: 0.2rem;
  }

  .footer-sep {
    display: none;
  }
}

@media screen and (max-width: 480px) {

  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  header {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  header:has(.hamburger-new-badge) {
    padding-top: 1.4rem;
  }

  .footer {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .heading {
    font-size: 1rem;
  }

  .nejm-seal {
    width: 26px;
    height: 26px;
  }

  .card-container {
    padding: 1rem 0.5rem;
  }

  .card {
    padding: 1rem;
    border-radius: 12px;
    max-width: 100%;
  }

  .symptom {
    font-size: 0.95rem;
    min-height: 2.5rem;
  }

  .btn_color,
  #guess {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  .guess-section {
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
  }

  .guess-section #guess {
    flex: 1;
  }

  .guess-section .btn_color {
    white-space: nowrap;
  }

  .stats-button {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .archive-button-wrapper {
    top: 0.5rem;
    left: 0.5rem;
  }

  .archive-button {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  /* Mobile specific adjustments */
  #result_class,
  #result_class.result {
    font-size: 0.95rem;
    padding: 0.5rem;
    min-height: 2.5rem;
    margin: 0.5rem 0 !important;
  }

  /* Override feedback height constraints on mobile */
  .feedback {
    height: auto !important;
    min-height: auto !important;
  }

  /* Ensure result container doesn't overflow */
  #result-container {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .result-group {
    max-width: 100%;
  }
}

@media screen and (max-width: 380px) {
  .heading {
    font-size: 0.85rem;
  }

  .nejm-seal {
    width: 22px;
    height: 22px;
  }

  .footer {
    font-size: 0.72rem;
    padding: 0.4rem;
  }
}

/* Share button styling */
.share-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  color: #000000;
  /* keep your green or pick another color */
  display: none;
  /* keep hidden initially */
}

.share-button svg {
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
  /* so clicks register on button, not svg */
}

.share-button svg {
  transition: filter 0.3s ease;
}

.share-button:hover svg {
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8));
  cursor: pointer;
}

.share-result {
  display: none;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  word-wrap: break-word;
}

#result-container {
  display: block;
  width: 100%;
}

#copy-message {
  min-width: 110px;
  /* reserve space so icon/text don't move */
  opacity: 0;
  color: black;
  font-size: 0.9rem;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease;
  margin-left: 0.5rem;
  /* add some spacing from the icon */
}

#copy-message.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Modal base styling */
.modal-hidden {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-visible {
  display: flex;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#modal-message {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

#modal-share-btn,
#modal-close-btn {
  margin: 0.5rem;
}

.modal-hidden {
  display: none;
}

.modal-visible {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  animation: bounceUp 0.7s ease-out forwards;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  margin-bottom: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: text-shadow 0.3s ease;
}

.close-btn:hover {
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(0, 0, 0, 0.3),
    0 0 15px rgba(0, 0, 0, 0.2);
}

@keyframes bounceUp {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }

  60% {
    transform: translateY(-20px);
    opacity: 1;
  }

  80% {
    transform: translateY(10px);
  }

  90% {
    transform: translateY(-5px);
  }

  100% {
    transform: translateY(0);
  }
}

/* Additional CSS for disabled game state - add this to your existing CSS */

/* Disabled input styling */
#guess:disabled {
  background-color: #f5f5f5;
  color: #888;
  cursor: not-allowed;
  border-color: #ddd;
}

#guess:disabled::placeholder {
  color: #888;
  font-style: italic;
}

/* Disabled button styling */
.btn_color:disabled {
  background-color: #cccccc !important;
  color: #666666 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.btn_color:disabled:hover {
  background-color: #cccccc !important;
  transform: none;
}

/* Completed game message styling */
.game-completed-message {
  background-color: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 1rem;
  font-weight: 500;
  color: #1a5490;
  text-align: center;
}

/* Visual indicator for revealed symptoms */
/* .hints_shown {
  background-color: #fff3cd !important;
  border-color: #ffeaa7 !important;
  color: #856404;
} */

/* Cookie Notification Bar Styles - Add this to your existing CSS */

.cookie-notification {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: white;
  padding: 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  border-top: 3px solid #d6ecfa;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-notification.show {
  transform: translateY(0);
}

.cookie-notification.hidden {
  transform: translateY(100%);
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(214, 236, 250, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d6ecfa;
}

.cookie-icon svg {
  width: 24px;
  height: 24px;
}

.cookie-text {
  flex: 1;
  min-width: 300px;
}

.cookie-text h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #d6ecfa;
}

.cookie-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cookie-accept {
  background: #d6ecfa;
  color: var(--color-primary);
}

.cookie-accept:hover {
  background: #c0e0f0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(214, 236, 250, 0.3);
}

.cookie-decline {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-decline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Game overlay when cookies are declined */
.game-disabled-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28, 58, 82, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(4px);
}

.game-disabled-content {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  max-width: 400px;
  margin: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-disabled-content h3 {
  margin: 0 0 1rem 0;
  color: var(--color-primary);
  font-size: 1.3rem;
}

.game-disabled-content p {
  margin: 0 0 1.5rem 0;
  color: #666;
  line-height: 1.5;
}

.game-disabled-content .btn_color {
  margin: 0 0.5rem;
}

/* Responsive design for mobile */
@media screen and (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .cookie-icon {
    order: -1;
  }

  .cookie-text {
    min-width: auto;
  }

  .cookie-text h4 {
    font-size: 1rem;
  }

  .cookie-text p {
    font-size: 0.85rem;
  }

  .cookie-actions {
    width: 100%;
    justify-content: center;
  }

  .cookie-btn {
    flex: 1;
    max-width: 140px;
  }
}

@media screen and (max-width: 480px) {
  .cookie-notification {
    padding: 0.75rem;
  }

  .cookie-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cookie-btn {
    max-width: none;
    width: 100%;
  }

  .game-disabled-content {
    padding: 1.5rem;
    margin: 0.5rem;
  }
}

/* Statistics container styling - Updated for inline layout */
.stats-container {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: #f8f9ff;
  border-radius: 12px;
  border: 1px solid #e1e8ff;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #d6ecfa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  flex: 1;
  min-width: 80px;
  max-width: 120px;
  /* Ensure all items have the same width */
  width: 100%;
}

.stat-number {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
  /* Ensure consistent label height */
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Modal content adjustments for stats */
.modal-content {
  max-width: 500px;
  /* Increase width for stats */
  max-height: 90vh;
  overflow-y: auto;
}

/* Responsive design for statistics */
@media screen and (max-width: 768px) {
  .stats-button {
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    gap: 0.3rem;
  }

  .archive-button-wrapper {
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
  }

  .archive-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    gap: 0.3rem;
  }

  .stats-grid {
    gap: 0.75rem;
  }

  .stat-item {
    padding: 0.5rem 0.25rem;
    min-width: 70px;
    max-width: 100px;
  }

  .stat-number {
    font-size: 1.25rem;
    min-height: 1.8rem;
  }

  .stat-label {
    font-size: 0.7rem;
    min-height: 2rem;
  }

  .stats-container {
    padding: 0.75rem;
    margin-top: 1rem;
  }

  .disclaimer {
    font-size: 0.75rem;
    margin: 1.5rem 0.75rem 0.75rem;
    line-height: 1.3;
  }
}

@media screen and (max-width: 480px) {
  .stats-button {
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .archive-button-wrapper {
    top: 50%;
    left: 0.5rem;
    transform: translateY(-50%);
  }

  .archive-button {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .stats-grid {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .stat-item {
    padding: 0.4rem 0.2rem;
    min-width: 65px;
    max-width: 85px;
    /* Ensure items don't get too small on mobile */
    flex: 1 1 calc(25% - 0.5rem);
  }

  .stat-number {
    font-size: 1.1rem;
    min-height: 1.5rem;
  }

  .stat-label {
    font-size: 0.65rem;
    line-height: 1.1;
    min-height: 1.8rem;
    letter-spacing: 0.3px;
  }

  .modal-content {
    max-width: 95%;
    padding: 1.5rem;
  }

  .disclaimer {
    font-size: 0.7rem;
    margin: 1rem 0.5rem 0.5rem;
    padding: 0 0.5rem;
  }
}

@media screen and (max-width: 360px) {
  .stats-button {
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    gap: 0.2rem;
  }

  .archive-button-wrapper {
    top: 50%;
    left: 0.5rem;
    transform: translateY(-50%);
  }

  .archive-button {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    gap: 0.2rem;
  }

  .stats-grid {
    gap: 0.3rem;
  }

  .stat-item {
    padding: 0.3rem 0.1rem;
    min-width: 60px;
    max-width: 75px;
  }

  .stat-number {
    font-size: 1rem;
    min-height: 1.3rem;
  }

  .stat-label {
    font-size: 0.6rem;
    min-height: 1.6rem;
  }

  .disclaimer {
    font-size: 0.65rem;
    margin: 0.75rem 0.25rem 0.25rem;
    padding: 0 0.25rem;
    line-height: 1.2;
  }
}

/* Guess Distribution Chart Styles */
/* Enhanced Guess Distribution Chart Styles - Replace your existing distribution styles */
.guess-distribution-chart {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #f8f9ff;
  border-radius: 8px;
  border: 1px solid #e1e8ff;
}

.guess-distribution-chart h4 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--color-primary);
  font-weight: 600;
}

.distribution-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.distribution-row:last-child {
  margin-bottom: 0;
}

.guess-number {
  font-weight: 600;
  color: var(--color-primary);
  min-width: 20px;
  text-align: center;
  font-size: 0.9rem;
  padding: 2px 6px;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 4px;
}

.guess-number.highlighted {
  border-color: #2196F3;
  background-color: rgba(33, 150, 243, 0.1);
}

.distribution-bar-container {
  flex: 1;
  position: relative;
  height: 24px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: visible;
  /* Changed from hidden to visible for external count positioning */
}

.distribution-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--btn-bg) 0%, var(--btn-bg-hover) 100%);
  border-radius: 4px;
  transition: width 0.8s ease-in-out;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Remove bar highlighting - use number highlighting instead */

.distribution-count {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1;
  transition: all 0.3s ease;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .guess-distribution-chart {
    padding: 0.75rem;
    margin-top: 1rem;
  }

  .distribution-row {
    gap: 0.5rem;
    margin-bottom: 0.4rem;
  }

  .guess-number {
    min-width: 18px;
    font-size: 0.85rem;
  }

  .distribution-bar-container {
    height: 20px;
  }

  .distribution-count {
    font-size: 0.75rem;
  }
}

@media screen and (max-width: 480px) {
  .guess-distribution-chart {
    padding: 0.5rem;
  }

  .distribution-row {
    gap: 0.4rem;
    margin-bottom: 0.3rem;
  }

  .guess-number {
    min-width: 16px;
    font-size: 0.8rem;
  }

  .distribution-bar-container {
    height: 18px;
  }

  .distribution-count {
    font-size: 0.7rem;
  }
}

.stats-button {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  z-index: 100;
}

.stats-button:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stats-button:active {
  transform: translateY(-50%);
}

.archive-button {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  z-index: 100;
  text-decoration: none !important;
}

.archive-button:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none !important;
}

.archive-button:active {
  transform: none;
}

.today-button {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  z-index: 100;
  text-decoration: none !important;
  width: auto;
}

.today-button:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: var(--color-primary);
  text-decoration: none !important;
}

.today-button:active {
  transform: translateY(-50%);
}

/* Mobile hamburger menu */
.mobile-menu-button {
  display: none;
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  height: 30px;
  justify-content: center;
  align-items: center;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: var(--header-muted);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Hamburger to X transformation */
.mobile-menu-button.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translateY(0);
  position: absolute;
}

.mobile-menu-button.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-button.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translateY(0);
  position: absolute;
}

/* Mobile menu overlay */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  background: var(--color-primary);
  z-index: 999;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.active {
  max-height: 500px;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
  text-decoration: none !important;
}

.mobile-menu-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(214, 236, 250, 0.3) 20%, rgba(214, 236, 250, 0.3) 80%, transparent);
}

.mobile-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  padding-left: 2rem;
}

.mobile-menu-item svg {
  flex-shrink: 0;
}

/* Desktop buttons visible by default */
.desktop-only {
  display: flex;
}

/* Mobile menu hidden by default */
.mobile-menu-button {
  display: none;
}

/* Show mobile menu on small screens, hide desktop buttons */
@media screen and (max-width: 768px) {
  .mobile-menu-button {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  .desktop-only {
    display: none !important;
  }
}

.symptom.revealed-on-correct {
  background-color: #e8f5e8;
  border-left: 4px solid #4caf50;
  padding-left: 12px;
  transition: all 0.3s ease;
}

/* Optional: Add a slight delay to the reveal animation for better visual effect */
.symptom.flip_in.revealed-on-correct {
  animation-delay: 0.2s;
}

.disclaimer {
  text-align: center;
  font-size: 0.8rem;
  color: #999;
  margin: 1rem 0 0;
  font-style: italic;
}

.count-hidden {
  display: none;
}

.count-inside {
  color: white !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.count-outside {
  color: #333 !important;
  text-shadow: none !important;
}

/* New badge styles */
.new-badge {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.4);
  animation: pulse 2s ease-in-out infinite;
  white-space: nowrap;
}

/* Archive button wrapper to position badge relative to button */
.archive-button-wrapper {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
}

/* Desktop badge - overlaps top-right corner of Archive button like iOS notification */
.desktop-badge {
  position: absolute;
  top: -0.5rem;
  /* Position so bottom of badge overlaps top of button */
  right: -1rem;
  /* Position so left of badge overlaps right of button */
  z-index: 1000;
  /* Ensure it appears in front of the button */
}

/* Mobile hamburger badge - aligned with hamburger button */
.mobile-hamburger-badge {
  display: none;
  position: absolute;
  right: 3.5rem;
  /* Position to the left of hamburger */
  top: 50%;
  /* Center vertically with hamburger */
  transform: translateY(-50%);
  /* Center vertically */
  z-index: 10;
  /* Ensure it appears above the button */
}

/* Mobile menu item badge - pinned to right edge, out of text flow */
.menu-item-badge {
  position: absolute;
  right: 1.5rem;
  flex-shrink: 0;
}

/* Pulse animation for the badge */
@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(255, 82, 82, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 82, 82, 0.6);
  }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {

  /* Hide desktop badge on mobile */
  .desktop-badge {
    display: none;
  }

  /* Show mobile hamburger badge */
  .mobile-hamburger-badge {
    display: block;
    top: 37%;
    /* Match header padding at this breakpoint */
  }

  /* Adjust pulse animation for menu item badge */
  .menu-item-badge {
    animation: pulse 2s ease-in-out infinite;
  }
}

@media screen and (max-width: 480px) {
  .new-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }

  .mobile-hamburger-badge {
    right: 3rem;
    top: 35%;
    /* Match header padding at this breakpoint */
  }
}

/* Hamburger-adjacent "New" badge — bottom-left overlaps top-right of button */
/* Button: left=1rem, width≈46px (30px + 8px padding each side), height=40px, top=calc(50%-20px) */
.hamburger-new-badge {
  position: absolute;
  left: 2.5rem;
  top: calc(50% - 5px);
  z-index: 1002;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease;
  animation: hamburgerBadgePulse 2s ease-in-out infinite;
}

.mobile-menu-button.active+.hamburger-new-badge {
  opacity: 0;
}

@keyframes hamburgerBadgePulse {

  0%,
  100% {
    transform: translateY(-100%) scale(1);
    box-shadow: 0 2px 6px rgba(255, 82, 82, 0.4);
  }

  50% {
    transform: translateY(-100%) scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 82, 82, 0.6);
  }
}

/* Account signup promo modal */
.account-promo-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}

.account-promo-modal.visible {
  display: flex;
}

.account-promo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.account-promo-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  max-width: 380px;
  width: calc(100% - 2rem);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: promoSlideIn 0.3s ease;
}

@keyframes promoSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.account-promo-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.account-promo-close:hover {
  color: #555;
}

.account-promo-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.account-promo-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--color-primary);
}

.account-promo-body {
  font-size: 0.95rem;
  color: #555;
  margin: 0 0 0.5rem;
  line-height: 1.55;
}

.account-promo-migrate {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

.account-promo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.account-promo-btn {
  display: block;
  text-align: center;
  text-decoration: none !important;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.account-promo-login {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.1rem;
}

.account-promo-login:hover {
  text-decoration: underline;
}

.account-promo-dismiss {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem;
}

.account-promo-dismiss:hover {
  color: #777;
}

/* =============================================
   Hamburger menu overrides (always-visible drawer)
   ============================================= */

/* Make hamburger menu always visible and move to left */
.mobile-menu-button.always-visible {
  display: flex !important;
  left: 1rem !important;
  right: auto !important;
  height: 40px !important;
}

/* Base: ensure menu is rendered for JS to toggle */
.mobile-menu {
  display: block !important;
}

/* Desktop: drawer slides in from left */
@media screen and (min-width: 769px) {
  .mobile-menu {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    right: auto !important;
    width: 280px !important;
    height: 100vh !important;
    background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-deep) 100%) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
    transition: left 0.3s ease !important;
    padding-top: 70px !important;
    overflow-y: auto !important;
    max-height: none !important;
  }

  .mobile-menu.active {
    left: 0 !important;
  }

  .menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .menu-backdrop.active {
    display: block;
    opacity: 1;
  }
}

/* Mobile: dropdown from header */
@media screen and (max-width: 768px) {
  .mobile-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    height: auto !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease !important;
    padding-top: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-deep) 100%) !important;
  }

  .mobile-menu.active {
    max-height: 500px !important;
  }

  .menu-backdrop {
    display: none !important;
  }
}

/* =============================================
   Archive list page
   ============================================= */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding: 0 1rem;
}

.archive-tile {
  background: #EBF6FD;
  border: 1.5px solid #9ACFE8;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.archive-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.archive-tile.nejm {
  background: #FDF0F2;
  border-color: #E8A0B0;
}

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

.tile-left {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.tile-number {
  font-size: 15px;
  font-weight: 700;
  color: #1a2744;
}

.tile-date {
  display: flex;
  gap: 4px;
  font-size: 12px;
  color: #6B7A99;
  margin-top: 3px;
  white-space: nowrap;
}

.checkmark-circle {
  width: 20px;
  height: 20px;
  min-width: 20px;
  background-color: #E6F5EE;
  border: 1.5px solid #2E9E6A;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkmark {
  color: #1A7A45;
  font-weight: 900;
  font-size: 0.75rem;
  line-height: 1;
  font-family: Arial, sans-serif;
}

.x-circle {
  width: 20px;
  height: 20px;
  min-width: 20px;
  background-color: #FDEAEA;
  border: 1.5px solid #C94040;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.x-mark {
  color: #A02828;
  font-weight: 900;
  font-size: 0.75rem;
  line-height: 1;
  font-family: Arial, sans-serif;
}

.archive-tile-nejm-tag {
  position: absolute;
  top: 0;
  right: 0;
  background: #5C1027;
  color: white;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 8px 5px 10px;
  border-radius: 0 10.5px 0 8px;
  line-height: 1;
}

@media screen and (max-width: 480px) {
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0 0.25rem;
  }

  .archive-tile {
    padding: 10px 12px;
  }

}

/* =============================================
   Archive game page
   ============================================= */

.archive-subtitle {
  color: #666;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  text-align: center;
}

.archive-back-row {
  text-align: center;
  padding: 0.75rem 0;
}

.archive-back-btn {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--color-accent);
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
}

.archive-back-btn:hover {
  background: var(--color-accent);
  color: #fff;
}

/* Archive game prev/next navigation */
.archive-card-row {
  display: flex;
  justify-content: center;
  padding: 0 0 1rem;
}

.archive-card-row .card {
  max-width: 600px;
  width: 100%;
}

/* Header row: arrows flanking the title text */
.archive-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.archive-card-header-text {
  flex: 1;
  text-align: center;
}

.archive-card-header-text .card-title {
  margin-bottom: 0;
}

.archive-card-nav-btn-wrap {
  flex-shrink: 0;
  width: 90px;
  display: flex;
  align-items: center;
}

.archive-card-nav-prev-wrap {
  justify-content: flex-end;
}

.archive-card-nav-next-wrap {
  justify-content: flex-start;
}

.archive-card-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: white;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  width: 90px;
  height: 48px;
  white-space: nowrap;
  transition: filter 0.2s;
  letter-spacing: 0.02em;
}

.archive-card-nav-prev {
  clip-path: polygon(100% 12%, 40% 12%, 40% 0%, 0% 50%, 40% 100%, 40% 88%, 100% 88%);
  padding-left: 28px;
}

.archive-card-nav-next {
  clip-path: polygon(0% 12%, 60% 12%, 60% 0%, 100% 50%, 60% 100%, 60% 88%, 0% 88%);
  padding-right: 28px;
}

.archive-card-nav-btn:hover {
  filter: brightness(0.82);
}

@media screen and (max-width: 768px) {
  .archive-card-row {
    padding: 1rem 0.5rem;
  }

  .archive-card-row .card {
    max-width: 100%;
  }

  .archive-card-nav-btn-wrap {
    width: 72px;
  }

  .archive-card-nav-btn {
    width: 72px;
    height: 40px;
    font-size: 0.72rem;
  }
}


/* =============================================
   Meet the Team page
   ============================================= */

.team-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

.team-title {
  text-align: center;
  color: var(--color-primary);
  font-size: 2rem;
  margin-bottom: 2rem;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.team-member.reverse {
  flex-direction: row-reverse;
}

.team-photo {
  flex-shrink: 0;
}

.team-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.team-photo .placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d6ecfa 0%, #a8d5f7 100%);
  border: 4px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--color-primary);
}

.team-info {
  flex: 1;
}

.team-name {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.team-role {
  font-size: 1rem;
  color: #666;
  margin: 0 0 1rem 0;
}

.team-role strong {
  color: var(--color-primary);
}

.team-bio {
  font-size: 1rem;
  color: #333;
  line-height: 1.6;
}

@media screen and (max-width: 768px) {
  .team-member {
    flex-direction: column !important;
    text-align: center;
    gap: 1rem;
  }

  .team-photo img,
  .team-photo .placeholder {
    width: 150px;
    height: 150px;
  }

  .team-title {
    font-size: 1.5rem;
  }
}

@media screen and (max-width: 480px) {
  .team-container {
    padding: 0.5rem;
  }

  .team-member {
    padding: 1rem;
    margin-bottom: 2rem;
  }

  .team-photo img,
  .team-photo .placeholder {
    width: 120px;
    height: 120px;
  }

  .team-name {
    font-size: 1.25rem;
  }
}

/* Special Share Button Styling */
.share-btn-special {
  background: linear-gradient(135deg, #1DA1F2 0%, #0d8bd9 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 0.85rem 1.75rem !important;
  font-size: 1.05rem !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3) !important;
  animation: shareButtonPulse 2s ease-in-out infinite;
}

/* Hidden state for share button */
.share-btn-special[style*="display: none"] {
  display: none !important;
}

.share-btn-special:hover {
  background: linear-gradient(135deg, #0d8bd9 0%, #0a6fb8 100%) !important;
  box-shadow: 0 6px 16px rgba(29, 161, 242, 0.4) !important;
  animation: none;
  /* Stop pulsing on hover */
}

.share-btn-special:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(29, 161, 242, 0.3) !important;
}

.share-btn-special svg {
  flex-shrink: 0;
}

/* Pulse animation for share button - matches "New!" badge style */
@keyframes shareButtonPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.5);
  }
}

/* =============================================
   Modal card flip
   ============================================= */

.modal-flip-container {
  perspective: 1200px;
  background: transparent !important;
  padding: 0 !important;
  overflow: visible !important;
}

.modal-flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  border-radius: 12px;
}

.modal-flip-inner.flipped {
  transform: rotateY(180deg);
}

.modal-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
}

.modal-face-front {
  position: relative;
}

.modal-face-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  transform: rotateY(180deg);
  box-sizing: border-box;
  overflow-y: auto;
}

@media screen and (max-width: 768px) {
  .modal-face {
    padding: 1.5rem;
  }
}

/* NEJM case report card in modal */
.nejm-case-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f0f3f8;
  border: 1px solid #d4dce8;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.nejm-case-card:hover {
  background: #e4eaf4;
  border-color: #b0bdd0;
  text-decoration: none;
}

.nejm-case-card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nejm-case-card-left svg {
  flex-shrink: 0;
}

.nejm-case-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a2744;
  line-height: 1.3;
}

.nejm-case-card-sub {
  font-size: 0.8rem;
  color: #6b7a99;
  margin-top: 0.1rem;
}

/* Guess recap list on modal back face */
.guess-recap-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  text-align: left;
}

.guess-recap-item.correct {
  background: #e8f5e9;
}

.guess-recap-item.wrong {
  background: #fde8e8;
}

.guess-recap-item.skip {
  background: #f0f0f0;
}

.guess-recap-number {
  font-weight: bold;
  color: var(--color-primary);
  min-width: 1.2rem;
}

.guess-recap-name {
  flex: 1;
  font-size: 0.95rem;
}

.guess-recap-icon {
  font-size: 1.1rem;
}

/* ── Auth pages (login, signup, complete profile, account) ── */
.auth-container {
  max-width: 420px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
  padding: 2rem 2rem 1.5rem;
}

.auth-title {
  text-align: center;
  color: var(--color-primary);
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
}

.auth-desc {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}

/* FAQ tooltip */
.faq-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: default;
  padding-top: 8px;
  margin-top: -8px;
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 0;
  flex-shrink: 0;
  padding-top: 1px;
  padding-left: 0.5px;
}

.faq-content {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 100%;
  transform: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  width: 230px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  font-size: 0.82rem;
  color: #555;
  text-align: left;
  font-weight: normal;
  line-height: 1.5;
  white-space: normal;
}

.faq-content strong {
  display: block;
  margin-bottom: 0.4rem;
  color: #222;
  font-size: 0.85rem;
}

.faq-tooltip:hover .faq-content,
.faq-tooltip.active .faq-content {
  display: block;
}

.auth-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #c8bfb3;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  box-sizing: border-box;
  background: #fafafa;
  transition: border-color 0.15s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem;
  font-size: 1rem;
}

.auth-error {
  background: #fff3f3;
  border: 1.5px solid #e57373;
  color: #c62828;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-success {
  background: #f1f8f4;
  border: 1.5px solid #66bb6a;
  color: #2e7d32;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-field-error {
  color: #c62828;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

.password-input-wrapper {
  position: relative;
}

.password-input-wrapper .auth-input {
  padding-right: 2.5rem;
  box-sizing: border-box;
}

.password-toggle-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  color: #aaa;
  display: flex;
  align-items: center;
  line-height: 1;
}

.password-toggle-btn:hover {
  color: #555;
}

.password-requirements {
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.3rem;
}

.guess-history-name {
  flex: 1;
  text-align: center;
}

.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #777;
}

.auth-links a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: #aaa;
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0d9d0;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem;
  border: 1.5px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.btn-google:hover {
  background: #f8f8f8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.btn-facebook {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem;
  border: none;
  border-radius: 8px;
  background: #1877F2;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  margin-top: 0.6rem;
}

.btn-facebook:hover {
  background: #166fe5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

/* Account settings page */
.account-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #ede8e2;
}

.account-info-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

.account-info-value {
  font-size: 0.95rem;
  color: #444;
}

.account-section-divider {
  height: 1px;
  background: #ede8e2;
  margin: 1.5rem 0;
}

.account-section {
  margin-bottom: 0.25rem;
}

.account-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.5rem 0;
}

.static-page-container {
  max-width: 720px;
  margin: 2rem auto 3rem;
  padding: 2rem 2.5rem 2.5rem;
  color: var(--color-primary);
  line-height: 1.7;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
}

.static-page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.25rem;
}

.static-page-meta {
  font-size: 0.85rem;
  opacity: 0.6;
  margin: 0 0 1rem;
}

.static-page-divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 1rem 0 1.5rem;
}

.static-page-container h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 1.75rem 0 0.5rem;
}

.static-page-container a {
  color: var(--color-accent);
}

.static-page-container ul {
  margin: 0.25rem 0 0.75rem 1.5rem;
}

.account-section-desc {
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 0.5rem 0;
}

.account-link-btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--color-accent);
  border-radius: 8px;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.account-link-btn:hover {
  background: var(--color-accent);
  color: #fff;
}

.account-logout-btn {
  width: 100%;
  padding: 0.65rem;
  border: 1.5px solid #e57373;
  border-radius: 8px;
  background: none;
  color: #c62828;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.account-logout-btn:hover {
  background: #e57373;
  color: #fff;
}

/* Stats migration prompt */
.migration-prompt {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  width: min(420px, calc(100vw - 2rem));
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.migration-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  padding: 1.5rem;
  text-align: center;
  border-top: 4px solid #4caf8a;
}

.migration-decline-btn {
  padding: 0.5rem 1.25rem;
  border: 1.5px solid #c8bfb3;
  border-radius: 8px;
  background: none;
  color: #777;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.migration-decline-btn:hover {
  background: #f5f5f5;
}
/* Maintenance banner */
.maintenance-banner {
  background-color: #f5a623;
  color: #1a1a1a;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
}

/* ── Ad placements ───────────────────────────────────────────── */

/* 3-column layout: [left ad] [game card] [right ad] */
.game-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  flex: 1;
}

/* Make the center column fill remaining width */
.game-layout .card-container,
.game-layout .archive-card-row {
  flex: 1;
  min-width: 0;
}

/* Each sidebar ad column */
.ad-column {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}

/* Sticky sidebar slot — follows scroll but stops below the sticky header */
.ad-sidebar-slot {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

/* Reserve fixed space so the page never reflows when the ad loads */
.ad-sidebar-slot ins {
  display: block;
  min-width: 160px;
  min-height: 600px;
}

/* "Advertisement" / "Sponsored" label */
.ad-label {
  display: none;
}

/* Modal ad — sits between result message and share button */
.ad-modal-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin: 0.5rem 0 1rem;
  width: 100%;
  /* Reserve height so modal doesn't shift when ad loads */
  min-height: calc(100px + 1rem);
}

.ad-modal-slot ins {
  display: block;
  width: 100%;
  min-height: 100px;
}

/* Mobile bottom banner — hidden on desktop, shown on mobile */
.ad-mobile-bottom {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem 0.75rem;
  min-height: calc(50px + 1.5rem);
}

.ad-mobile-bottom ins {
  display: block;
  min-width: 320px;
  min-height: 50px;
}

/* Hide desktop sidebars when viewport is too narrow to fit them */
@media screen and (max-width: 1100px) {
  .ad-column {
    display: none;
  }
}

/* Show mobile bottom banner only on mobile */
@media screen and (max-width: 768px) {
  .ad-mobile-bottom {
    display: flex;
  }
}
