* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    max-height: flex;
    margin: 0 auto;
    text-align: center;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#header-message {
    font-size: 1.3rem;
    color: #b8b8d1;
    margin-bottom: 20px;
}

#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#selection-count {
    font-size: 1.8rem;
    font-weight: 700;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 0 auto; /* This centers it */
    max-width: 1000px; /* Or whatever width you want */
    animation: fadeIn 0.8s ease;
}

.descriptor-card {
    min-height: 100px;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    position: relative;
      overflow: visible !important;
    height: auto !important;
}


.descriptor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.descriptor-card:hover {
    transform: scale(1.05);
}

.descriptor-card:hover::before {
    opacity: 1;
}

.descriptor-card.selected {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px white, 0 8px 16px rgba(0, 0, 0, 0.4);
    animation: pulse 1.5s ease infinite;
}

/* Card Colors */
.color-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.color-orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.color-yellow { background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%); }
.color-green { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.color-teal { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); }
.color-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.color-indigo { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }
.color-purple { background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%); }
.color-pink { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.color-rose { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }
.color-cyan { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }
.color-lime { background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%); }
.color-amber { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.color-emerald { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.color-sky { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); }
.color-violet { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }

/* Selected Bar */
.selected-bar {
    background: rgba(31, 41, 55, 0.9);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    margin-top: 10px;
    backdrop-filter: blur(10px);
    animation: slideUp 0.4s ease;
}

.selected-bar.hidden {
    display: none;
}

.selected-bar h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.selected-tag {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
}

.your-selected-tag {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(251, 191, 36, 0.3);
    border: 2px solid #fbbf24;
    display: inline-block;
    margin: 5px;
}


.wiki-link {
    display: inline-block;
    margin-top: -10px;
     margin-bottom: 30px;
    color: #4ea5ff;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}
.wiki-link:hover {
    text-decoration: transform;
}

/* Spacing before "You Selected" */
.your-selections {
    margin-top: 40px;
}


.other-matches-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  column-width: 280px;
  column-gap: 12px;
  padding-top: 10px;
}

.other-person-card {
  break-inside: avoid;  /* Prevents cards from splitting across columns */
  margin-bottom: 12px;
  display: inline-block;
  width: 100%;
  padding: 5px;
}




/* Image fixes */
.other-person-img {
  width: 100%;
  height: auto;
  max-height: 250px;
max-width: 200px;
  object-fit: contain;
  object-position: top;   /* <-- REQUIRED FIX */

  border-radius: 8px;
  margin: 10px 0;
}

.other-person-img[style*="display:none"] {
  display: none !important;
}


/* ------------------------------------------
   Twist Mode Button (Original Game)
-------------------------------------------*/
.twist-mode-wrapper {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.twist-mode-btn {
    padding: 12px 26px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    border: 2px solid rgba(255,255,255,0.25);
    transition: all 0.25s ease;
}

.twist-mode-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 26px rgba(99, 102, 241, 0.55);
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
}

.twist-mode-btn:active {
    transform: translateY(0);
}


/* Hover effect intact */
.other-person-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 24px rgba(0,0,0,0.45);
}

/* Titles */
.other-person-card h4 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}



/* Story text */
.other-person-card .story {
    white-space: normal !important;
    text-size: 15px;
}

/* Wrapper spacing */
#other-matches {
    margin-top: 24px;
    margin-bottom: 40px;
    overflow: visible !important;
}

/* Match tags */
.other-matches-tags {
    margin-top: 10px;
}

.other-matches-tags .matched-tag {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    margin: 2px;
}

.other-share-btn {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.other-share-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}

.other-share-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    opacity: 0.9;
}


.reveal-btn {
    width: 100%;
    padding: 18px;
    border-radius: 12px;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reveal-btn:disabled {
    background: #4b5563;
    color: #9ca3af;
    cursor: not-allowed;
}

.reveal-btn:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.reveal-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.4);
}

/* Reveal Section */
.reveal-section {
    animation: fadeIn 0.6s ease;
       overflow: visible !important;
    height: auto !important;
}

.reveal-section.hidden {
    display: none;
}

.reveal-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 60%;
  background: radial-gradient(
    ellipse at center,
    rgba(255,255,255,0.18),
    transparent 70%
  );
  pointer-events: none;
}

.reveal-card {
  position: relative;
  max-width: 720px;
  margin: 0 auto;

  padding: 48px 38px 34px;

  /* This is the key */
  border-radius: 200px;
  /* Forces the shape */
  overflow: visible;
margin-top: 10px;
margin-bottom: 10px;
  background:
    radial-gradient(
      120% 80% at 50% 0%,
      rgba(255,255,255,0.10),
      rgba(255,255,255,0.02) 60%
    );
}

.reveal-card > * {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.person-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 30px;
    border: 6px solid white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: block;
}

.person-image.hidden {
    display: none;
}

.person-info h2 {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.person-years {
    font-size: 1.8rem;
    color: #d1d5db;
    margin-bottom: 40px;
}

.descriptors-match h3 {
    font-size: 1.3rem;
   font: verdana;
    color: white;
    margin-bottom: 20px;
    margin-top: 20px;
}

.matched-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.matched-tag {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
}

.matched-tag.match {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.matched-tag.no-match {
    background: rgba(75, 85, 99, 0.8);
}

.person-story {
    background: rgba(0, 0, 0, 0.3);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.person-story p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #e5e7eb;
}

.try-again-btn {
    display: flex;  
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px;
    background: white;
    color: #1f2937;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.try-again-btn:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}


/* Footer */
.footer {
    margin-top: 60px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 8px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px white, 0 8px 16px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px white, 0 12px 24px rgba(0, 0, 0, 0.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    #header-message {
        font-size: 1rem;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .descriptor-card {
        min-height: 80px;
        padding: 15px;
        font-size: 0.8rem;
    }
    
    .reveal-card {
        padding: 30px 20px;
    }
    
    .person-info h2 {
        font-size: 2.5rem;
    }
    
    .person-image {
        width: 180px;
        height: 180px;
    }
}

.hidden {
    display: none !important;
}

.share-card-btn {
    margin-top: 20px;
     margin-bottom: 20px;
    padding: 8px 14px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.4);
    cursor: pointer;

    color: #fff;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(6px);

    font-weight: 500;
    font-size: 0.95rem;

    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: all .2s ease;
}

.share-card-btn:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}





.reveal-action-btn {
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.4);
    cursor: pointer;
text: align left;
    color: #fff;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(6px);

    font-weight: 500;
    font-size: 0.95rem;

    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: all .2s ease;
}

.reveal-action-btn:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-1px);
   margin-bottom: 40px;
}

/* ================================
   Descriptor Sentence Result Area
   ================================ */

.descriptor-result-area {
  margin: 24px auto 0;
  max-width: 640px;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.18); /* calm the purple */
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* container holding all sentences */
.descriptor-sentences {
  display: flex;
  flex-direction: column;
  padding: 20px;
  
}

#descriptor-sentences {
  width: 100%;
  display: block;
}

/* individual sentence block */
.sentence-block {
  display: flex;
  flex-direction: column;
  gap: 14px;

  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 28px;
  text-align: left;
  line-height: 1.25;
}


/* descriptor label line */
.sentence-tags {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  opacity: 0.6;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* sentence text */
.sentence-text {
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.95;
}

/* italicized descriptors */
.sentence-text em {
  font-style: italic;
  opacity: 1;
  font-weight: 500;
}

/* hide empty states cleanly */
.descriptor-sentences.hidden {
  display: none;
}


