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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f4ff;
  color: #222;
  min-height: 100vh;
}

nav {
  background: #4f46e5;
  color: white;
  padding: 14px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-logo { font-size: 1.4rem; font-weight: bold; color: white; text-decoration: none; white-space: nowrap; }
.nav-center { display: flex; gap: 8px; }
.nav-link { color: white; text-decoration: none; opacity: 0.9; background: rgba(255,255,255,0.15); padding: 6px 14px; border-radius: 8px; font-size: 0.9rem; }
.nav-link:hover { opacity: 1; background: rgba(255,255,255,0.25); }
.nav-visitors { font-size: 0.88rem; color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.15); padding: 6px 14px; border-radius: 8px; white-space: nowrap; }

main { max-width: 860px; margin: 0 auto; padding: 30px 20px; }

.hero {
  text-align: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  padding: 50px 30px;
  border-radius: 20px;
  margin-bottom: 36px;
}
.hero h1 { font-size: 2.8rem; margin-bottom: 10px; }
.hero .subtitle { font-size: 1.2rem; opacity: 0.9; }

.section-title { font-size: 1.4rem; margin-bottom: 16px; }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.lang-card {
  background: white;
  border: 2px solid #e0e7ff;
  border-radius: 16px;
  padding: 28px 16px;
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: transform 0.15s, border-color 0.2s;
}
.lang-card:hover { transform: translateY(-4px); border-color: #4f46e5; }
.lang-flag { font-size: 2.5rem; margin-bottom: 10px; }
.lang-name { font-size: 1.1rem; font-weight: bold; color: #4f46e5; margin-bottom: 4px; }
.lang-count { font-size: 0.85rem; color: #888; }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 2rem; color: #4f46e5; margin-bottom: 6px; }
.page-header p { color: #666; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.topic-card {
  background: white;
  border: 2px solid #e0e7ff;
  border-radius: 16px;
  padding: 20px;
  text-decoration: none;
  color: #333;
  transition: transform 0.15s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topic-card:hover { transform: translateY(-3px); border-color: #4f46e5; }
.topic-locked { opacity: 0.45; cursor: not-allowed; }
.topic-icon { font-size: 1.8rem; }
.topic-name { font-size: 1rem; font-weight: bold; color: #4f46e5; }
.topic-desc { font-size: 0.85rem; color: #666; line-height: 1.5; }
.topic-meta { margin-top: 6px; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: bold;
}
.tag-done     { background: #ecfdf5; color: #059669; }
.tag-progress { background: #e0e7ff; color: #4f46e5; }
.tag-new      { background: #e0e7ff; color: #4f46e5; }
.tag-soon     { background: #f3f4f6; color: #999; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.level-card {
  background: white;
  border: 2px solid #e0e7ff;
  border-radius: 16px;
  padding: 20px 12px;
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: transform 0.15s, border-color 0.2s;
}
.level-card:hover { transform: translateY(-3px); border-color: #4f46e5; }
.level-locked { opacity: 0.4; cursor: not-allowed; }
.level-done { border-color: #34d399; background: #ecfdf5; }
.level-number { font-size: 1.1rem; font-weight: bold; color: #4f46e5; margin-bottom: 6px; }
.level-done .level-number { color: #059669; }
.level-locked .level-number { color: #aaa; }
.level-title { font-size: 0.85rem; color: #555; margin-bottom: 4px; }
.level-count { font-size: 0.78rem; color: #999; }

.verb-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 24px;
}
.verb-table th { background: #4f46e5; color: white; padding: 13px 16px; text-align: left; }
.verb-table td { padding: 11px 16px; border-bottom: 1px solid #f0f0f0; }
.verb-table tr:last-child td { border-bottom: none; }
.verb-table tr:hover td { background: #f5f7ff; }
.verb-base { font-weight: bold; color: #4f46e5; }

.study-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); opacity: 0.92; }
.btn-big { font-size: 1.15rem; padding: 14px 34px; }
.btn-primary { background: #4f46e5; color: white; }
.btn-secondary { background: #e0e7ff; color: #4f46e5; }

.progress-bar-container { background: #e0e7ff; border-radius: 999px; height: 11px; margin-bottom: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: #4f46e5; border-radius: 999px; transition: width 0.4s; }
.progress-text { text-align: center; font-size: 0.88rem; color: #666; margin-bottom: 22px; }

.question-card { background: white; border-radius: 20px; padding: 38px 28px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.07); }
.question-label { color: #888; font-size: 0.95rem; margin-bottom: 8px; }
.verb-display { font-size: 3.2rem; color: #4f46e5; margin-bottom: 28px; }

.answer-form { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.input-group { display: flex; flex-direction: column; align-items: flex-start; width: 100%; max-width: 300px; }
.input-group label { font-size: 0.88rem; color: #555; margin-bottom: 5px; font-weight: bold; }
.input-group input { width: 100%; padding: 11px 14px; font-size: 1.05rem; border: 2px solid #e0e7ff; border-radius: 10px; outline: none; }
.input-group input:focus { border-color: #4f46e5; }

.result-box { border-radius: 14px; padding: 18px; margin-bottom: 22px; }
.result-box.correct { background: #ecfdf5; border: 2px solid #34d399; }
.result-box.wrong { background: #fff1f2; border: 2px solid #f87171; }
.result-icon { font-size: 1.3rem; font-weight: bold; margin-bottom: 6px; }
.correct-answer { font-size: 1.05rem; color: #333; margin-bottom: 4px; }
.your-answer { font-size: 0.9rem; color: #888; }

.result-page { text-align: center; padding: 20px 0; }
.final-score { background: white; border-radius: 20px; padding: 46px 28px; box-shadow: 0 4px 20px rgba(0,0,0,0.07); margin-bottom: 24px; }
.trophy { font-size: 4.5rem; margin-bottom: 10px; }
.final-score h1 { font-size: 2rem; color: #4f46e5; margin-bottom: 14px; }
.score-number { font-size: 2.8rem; font-weight: bold; color: #333; }
.score-percent { font-size: 1.3rem; color: #888; margin-top: 4px; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.unlock-banner { background: #ecfdf5; border: 2px solid #34d399; border-radius: 14px; padding: 14px 22px; font-size: 1.1rem; font-weight: bold; color: #059669; text-align: center; margin-bottom: 22px; }
.locked-banner { background: #fff7ed; border: 2px solid #f59e0b; border-radius: 14px; padding: 14px 22px; font-size: 0.95rem; color: #d97706; text-align: center; margin-bottom: 22px; }

.back-link { margin-top: 16px; }
.back-link a { color: #4f46e5; text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* ===== NEW HOME PAGE ===== */
.hero-bolt { font-size: 2.5rem; margin-bottom: 8px; }

.section-label {
  font-size: 0.8rem;
  font-weight: bold;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.flag-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}

.flag-en { background: #E6F1FB; color: #0C447C; }
.flag-de { background: #FAEEDA; color: #633806; }
.flag-ru { background: #FCEBEB; color: #791F1F; }
.flag-ge { background: #E1F5EE; color: #085041; }

.lang-topics { font-size: 0.8rem; color: #888; margin-bottom: 10px; }

.lang-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-active { background: #E1F5EE; color: #085041; }
.badge-soon   { background: #f3f4f6; color: #999; }

.lang-locked { opacity: 0.55; cursor: not-allowed; }

/* ===== TOPIC PAGE GAME BUTTONS ===== */
.topic-actions {
  margin-bottom: 24px;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 8px;
}

.level-btns {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== MODE TABS ===== */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.mode-tab {
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
}
.mode-study { background: #e0e7ff; border: 2px solid #4f46e5; }
.mode-play  { background: #ecfdf5; border: 2px solid #34d399; }
.mode-icon  { font-size: 2rem; margin-bottom: 8px; }
.mode-name  { font-size: 1rem; font-weight: bold; color: #222; margin-bottom: 4px; }
.mode-desc  { font-size: 0.82rem; color: #666; line-height: 1.5; }

/* ===== GRID LABEL ===== */
.grid-label {
  font-size: 0.8rem;
  font-weight: bold;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ===== PLAY MODE CARDS ===== */
.level-play {
  border-color: #34d399 !important;
  background: #f0fdf4 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.level-play .level-number { color: #059669; }

/* ===== SMALL BUTTONS ===== */
.btn-sm {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 8px;
  margin-top: 6px;
}

/* ===== MODE TABS CLICKABLE ===== */
.mode-tab {
  text-decoration: none;
  color: inherit;
  display: block;
}
.mode-tab:hover {
  transform: translateY(-3px);
  transition: transform 0.15s;
}

/* ===== ARTICLE COLOUR CODING ===== */
.article-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
}
.art-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 4px;
}
.dot-der { background: #3b82f6; }
.dot-die { background: #ef4444; }
.dot-das { background: #22c55e; }

.art-der { color: #2563eb; font-weight: bold; }
.art-die { color: #dc2626; font-weight: bold; }
.art-das { color: #16a34a; font-weight: bold; }

/* ===== TRANSLATION DROPDOWN ===== */
.th-translation {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.lang-select {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  outline: none;
}
.lang-select option {
  background: #4f46e5;
  color: white;
}
.cell-translation {
  color: #555;
  font-size: 14px;
}

/* ===== ABOUT PAGE ===== */
.about-hero {
  text-align: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  padding: 40px 24px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.about-hero h1 { font-size: 2rem; margin-bottom: 8px; }
.about-hero p { opacity: 0.85; font-size: 1rem; }

.about-card {
  background: white;
  border: 0.5px solid #e0e7ff;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.about-card h2 {
  font-size: 1.1rem;
  font-weight: bold;
  color: #4f46e5;
  margin-bottom: 12px;
}
.about-card p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 10px;
}
.about-card p:last-child { margin-bottom: 0; }
.about-card em { color: #4f46e5; font-style: italic; }
.about-card-highlight { border-color: #4f46e5; background: #f5f3ff; }

.about-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.stack-item { display: flex; gap: 14px; align-items: flex-start; }
.stack-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.stack-title { font-size: 0.95rem; font-weight: bold; color: #333; margin-bottom: 2px; }
.stack-desc { font-size: 0.85rem; color: #666; line-height: 1.6; }

.about-langs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.lang-block { background: #f5f7ff; border-radius: 12px; padding: 16px; }
.lang-block-flag { font-size: 1.8rem; margin-bottom: 6px; }
.lang-block-name { font-size: 0.95rem; font-weight: bold; color: #4f46e5; margin-bottom: 8px; }
.lang-block-list { padding-left: 16px; font-size: 0.85rem; color: #555; line-height: 1.8; }

.contact-email {
  display: inline-block;
  font-size: 1rem;
  font-weight: bold;
  color: #4f46e5;
  background: white;
  padding: 10px 20px;
  border-radius: 10px;
  border: 2px solid #4f46e5;
  text-decoration: none;
  margin-top: 8px;
  transition: background 0.2s, color 0.2s;
}
.contact-email:hover { background: #4f46e5; color: white; }

.privacy-list { padding-left: 0; list-style: none; margin-top: 10px; }
.privacy-list li { font-size: 0.9rem; color: #444; padding: 6px 0; border-bottom: 0.5px solid #f0f0f0; line-height: 1.6; }
.privacy-list li:last-child { border-bottom: none; }
