.test-card {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  padding: 4rem;
  max-width: 900px;
  width: 95%;
  margin: 2rem auto; /* Reduced margin to accommodate ads */
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 
              0 0 100px rgba(157, 80, 255, 0.1);
  z-index: 2;
}

/* Ad Styles */
.ad-container {
  max-width: 900px;
  width: 95%;
  margin: 1.5rem auto;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.ad-container:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 120px;
}

.ad-placeholder i {
  width: 24px;
  height: 24px;
  opacity: 0.5;
}

.top-ad { margin-top: 3rem; }
.bottom-ad { margin-bottom: 3rem; }

.test-screen {
  display: none;
  width: 100%;
  animation: fadeIn 0.5s ease;
}

.test-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

/* Common Components */
h1 { font-family: 'Outfit', sans-serif; font-size: 2.5rem; margin-bottom: 1rem; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 1.8rem; margin-bottom: 1.5rem; color: var(--accent-cyan); }
p { color: var(--text-dim); margin-bottom: 2rem; font-size: 1.1rem; }

.btn-primary-large {
  padding: 1.2rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  color: white;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 10px 20px rgba(157, 80, 255, 0.3);
}

.btn-primary-large:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 30px rgba(157, 80, 255, 0.4);
}

.test-info {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
}

.info-item i { color: var(--accent-purple); }

/* Memory Phase */
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.2rem;
  width: 100%;
  margin-bottom: 2rem;
  justify-content: center;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
  width: 100%;
  margin-bottom: 2rem;
  justify-content: center;
}

.word-tile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.2rem 0.5rem;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: var(--text-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.word-tile:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 242, 255, 0.2);
}

.word-tile.selected {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 25px rgba(157, 80, 255, 0.4);
  transform: scale(1.05);
}

.timer-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  margin-top: 2rem;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  width: 100%;
  transition: width 10s linear;
}

.status-bar {
  margin: 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.btn-primary {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 30px;
  border: none;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  color: white;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 5px 15px rgba(157, 80, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(157, 80, 255, 0.4);
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(1);
}

/* Stroop Phase */
.stroop-game-area {
  background: rgba(0, 0, 0, 0.2);
  padding: 3rem;
  border-radius: 20px;
  width: 100%;
  margin-bottom: 2rem;
}

.stroop-word {
  font-size: 5rem;
  font-weight: 900;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.stroop-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stroop-btn {
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stroop-btn:hover { 
  background: rgba(255, 255, 255, 0.15); 
  border-color: var(--accent-cyan);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 242, 255, 0.2);
}

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

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.progress-bar {
  height: 100%;
  background: var(--accent-purple);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Result Phase */
.age-result {
  margin: 2rem 0;
}

.age-value-wrapper {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
}

.age-value-wrapper .value {
  font-size: 6rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.age-value-wrapper .unit { font-size: 2rem; color: var(--text-dim); }

.score-details {
  display: flex;
  gap: 3rem;
  margin-bottom: 2rem;
}

.score-item { display: flex; flex-direction: column; }
.score-item .label { font-size: 0.9rem; color: var(--text-dim); }
.score-item .val { font-size: 1.5rem; font-weight: 700; color: var(--accent-cyan); }

.recommendation {
  background: rgba(157, 80, 255, 0.1);
  border: 1px solid rgba(157, 80, 255, 0.2);
  padding: 2rem;
  border-radius: 20px;
  width: 100%;
  margin-bottom: 2rem;
}

.recommendation h3 { margin-bottom: 0.5rem; color: var(--accent-purple); }

.action-btns {
  display: flex;
  gap: 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .test-card { padding: 1.5rem; }
  .word-grid { grid-template-columns: repeat(3, 1fr); }
  .options-grid { grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
  .stroop-word { font-size: 2.5rem; }
  .age-value-wrapper .value { font-size: 4rem; }
}
