* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: #f4f4f7;
  color: #1a1a1a;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html, body { height: 100%; }

body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  --topDark: clamp(60px, 10vh, 120px);   
  --greenEnd: clamp(180px, 28vh, 320px);  
  --blendEnd: calc(var(--greenEnd) + clamp(90px, 14vh, 180px));

  background: linear-gradient(
    to bottom,
    #bfe0bf 0,
    #c7e6c7 var(--topDark),
    #cfead0 var(--greenEnd),
    #e2e7cd var(--blendEnd),
    #f0e6c8 100%
  );
}

.container { 
  width: 100%;
  max-width: 900px; 
  margin: 0 auto; 
  padding: 0 1rem; 
}

.hero { 
  text-align: center; 
  margin-top: 2rem; 
  margin-bottom: 1.5rem; 
}

.header-minimal {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0 1rem;
  width: 100%;
  text-align: center;
}

.logo-link { 
  text-decoration: none; 
  display: flex; 
  justify-content: center;
  width: auto;
}

.logo {
  font-size: 2.2rem;
  font-weight: 850;
  color: #111;
  letter-spacing: -1.5px;
  line-height: 1;
}

.logo span { color: #2563eb; }

.hero p { 
  color: #666; 
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 260px); 
  gap: 1rem;
  margin: 0 auto 1.5rem;
  justify-content: center; 
}

.game-card, .content-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-card {
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.game-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.game-header h1 {
    font-size: 2.2rem;
    font-weight: 850;
    color: #111;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.game-header p {
    font-size: 1.1rem;
    color: #4b5563;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Ajustări pentru mobil */
@media (max-width: 600px) {
    .game-header h1 {
        font-size: 1.8rem;
    }
    .game-header p {
        font-size: 0.95rem;
    }
}
.img-container {
  width: 100%;
  aspect-ratio: 400 / 270;
  background: #f0f0f0;
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-content { 
  padding: 0.6rem;
  text-align: center;
}

.card-content h3 { 
  font-size: 0.95rem;
  margin-bottom: 0.1rem; 
  color: #111; 
}

.card-content p { font-size: 0.75rem; color: #777; }

.content-card {
  margin-top: 10px;
  max-width: 900px;
  margin: 0 auto 0.5rem;
  padding: 1.5rem;
  text-align: center;
}

.content-card h1 { font-size: 1.8rem; margin-bottom: 0.8rem; letter-spacing: -1px; }
.content-card h2 { font-size: 1.1rem; margin: 1rem 0 0.4rem; color: #111; }
.content-card p { margin-bottom: 0.8rem; color: #4b5563; font-size: 0.9rem; max-width: 95%; margin-left: auto; margin-right: auto; }

.content-card ul { padding: 0; margin: 1rem 0; list-style: none; }
.content-card li { margin-bottom: 0.3rem; font-size: 0.9rem; color: #4b5563; display: flex; align-items: center; justify-content: center; }
.content-card li::before { content: "•"; color: #2563eb; font-weight: bold; margin-right: 8px; }

.site-description {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.site-description .content-card {
  border: none; 
  background: transparent; 
  padding: 0.5rem 0.5rem;
}

.site-description h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.site-description p {
  line-height: 1.6;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.solver-box {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.dict-selector {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 10px;
}

.chip {
  background-color: #e5e7eb !important;
  color: #4b5563 !important;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chip.active {
  background-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.chip:hover:not(.active) {
  background-color: #d1d5db !important;
  color: #111 !important;
}

#solverInput {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 4px;
  outline: none;
  background: white;
  transition: border-color 0.2s;
}

#solverInput:focus { border-color: #2563eb; }

.button-group {
  display: flex;
  gap: 0.5rem;
}

.btn-primary {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}

.btn-secondary {
  background: #e5e7eb;
  color: #4b5563;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.stats-text {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
  min-height: 1.2rem;
  font-style: italic;
}

.results-area {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  width: 100%;
  text-align: center; /* Centrează titlul "Possible Matches" */
}

.word-grid {
  display: flex;       /* Schimbăm din grid în flex */
  flex-wrap: wrap;     /* Permitem trecerea pe rândul următor */
  justify-content: center; /* ACEASTA este linia magică pentru centrare */
  gap: 0.8rem;
  margin-top: 1.5rem;
  max-width: 100%;
}

.word-item {
  background: #ffffff;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  /* Modificăm culoarea textului în verde */
  color: #10b981; 
  /* Modificăm culoarea marginii în verde deschis */
  border: 1px solid #d1fae5; 
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  text-align: center;
}

/* Efectul de Hover (când treci cu mouse-ul) */
.word-item:hover {
  background: #10b981; /* Verde plin la hover */
  color: white;
  border-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
}

.limit-msg {
  grid-column: 1/-1;
  font-size: 0.8rem;
  color: #999;
  margin-top: 10px;
}
/* Fundalul se întinde pe tot ecranul */
.game-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
}

/* Conținutul din interior este limitat și centrat */
.navbar-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem; /* Adaugă un mic spațiu pe margini pentru mobil */
}

.logo-small {
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
    color: #111;
}

.logo-small span { color: #2563eb; }

.game-title-badge h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #374151;
    background: #f3f4f6;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    text-align: center;
}
.game-title-badge {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap; 
}

.back-button {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.back-button:hover { color: #111; }

/* Ascundem subtitlul pe paginile de joc pentru a salva spațiu */
.game-header p { display: none; }
.iframe-wrapper {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  overflow: hidden;
  line-height: 0;
  width: 100%;
  max-width: 900px;
  margin-bottom: 10px;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 650px;
  border: none;
  background: white;
}

.related-games {
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.section-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1rem;
  max-width: 750px;
  margin: 0 auto;
}

.back-link { margin-top: 1.5rem; padding: 1rem 0; text-align: center; }
.back-link a { text-decoration: none; color: #2563eb; font-weight: 600; font-size: 0.85rem; }

footer {
  margin-top: auto;
  padding: 0.5rem 0 1.5rem;
  text-align: center;
  color: #999;
  font-size: 0.75rem;
}

footer a { color: #777; text-decoration: none; margin: 0 6px; }

@media (max-width: 850px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); max-width: 540px; }
}

@media (max-width: 600px) {
  .iframe-wrapper iframe { height: 550px; }
  .mini-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .mini-grid .game-card:last-child { display: none; }
  .content-card { padding: 1rem; }
  .logo { font-size: 1.8rem; }
  .hero { margin-top: 1.5rem; }
}

@media (max-width: 550px) {
  .games-grid { grid-template-columns: 1fr; max-width: 280px; }
}