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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  text-align: center;
  max-width: 500px;
  padding: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #e94560;
}

.top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.lang-toggle {
  display: flex;
  gap: 0.25rem;
}

.hints-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50%;
  border: 2px solid #5eead4;
  background: #16213e;
  color: #5eead4;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hints-btn.active {
  background: #5eead4;
  border-color: #5eead4;
  color: #0a0f1a;
}

.hints-btn:hover:not(.active) {
  background: rgba(94, 234, 212, 0.15);
}

.word-category.hidden {
  display: none;
}

.btn-help {
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50%;
  background: #16213e;
  border: 2px solid #5eead4;
  color: #5eead4;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-help.active {
  background: #5eead4;
  border-color: #5eead4;
  color: #0a0f1a;
}

.btn-help:hover:not(.active) {
  background: rgba(94, 234, 212, 0.15);
}

.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 1rem;
}

.help-overlay.hidden {
  display: none;
}

.help-modal {
  background: #16213e;
  border: 2px solid #333;
  border-radius: 12px;
  max-width: 460px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  text-align: left;
  line-height: 1.5;
}

.help-modal h2 {
  color: #e94560;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.help-modal h3 {
  color: #f5a623;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.help-modal p {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.5rem;
}

.help-modal .help-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.help-chip.kids { background: #f5a623; color: #1a1a2e; }
.help-chip.regular { background: #e94560; color: #fff; }
.help-chip.off { background: #16213e; border: 1px solid #333; color: #999; }

.help-icon.hints {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid #5eead4;
  background: #16213e;
  font-size: 0.9rem;
  vertical-align: middle;
}

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

.help-close:hover {
  color: #e94560;
  background: none;
}

.lang-btn {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid #333;
  border-radius: 20px;
  background: #16213e;
  color: #eee;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.selected {
  background: #e94560;
  border-color: #e94560;
}

.lang-btn:hover:not(.selected) {
  border-color: #e94560;
}

#topic-selector {
  margin-bottom: 1.5rem;
}

.topic-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.topic-spacer {
  width: 100%;
  height: 0.5rem;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  background: #16213e;
  border: 2px solid #333;
  transition: all 0.2s;
  user-select: none;
}

.topic-chip.preset {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.topic-chip.selected {
  background: #e94560;
  border-color: #e94560;
}

.topic-chip.kids {
  border-color: #f5a623;
}

.topic-chip.kids.selected {
  background: #f5a623;
  border-color: #f5a623;
  color: #1a1a2e;
}

.topic-chip.preset.kids {
  border-color: #5eead4;
}

.topic-chip.preset.kids.selected {
  background: #5eead4;
  border-color: #5eead4;
  color: #1a1a2e;
}

.topic-chip.preset.all {
  border-color: #5eead4;
}

.topic-chip.preset.all.selected {
  background: #5eead4;
  border-color: #5eead4;
  color: #1a1a2e;
}

.topic-chip input[type="checkbox"] {
  display: none;
}

#words {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.word-card {
  background: #16213e;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-text {
  flex: 1;
}

.word-category {
  font-size: 0.65rem;
  color: #fff;
  background: #e94560;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.word-category.kids {
  background: #f5a623;
  color: #1a1a2e;
}

#timer {
  font-size: 4rem;
  font-weight: bold;
  color: #e94560;
  margin-bottom: 1.5rem;
}

.controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #e94560;
  color: #fff;
  transition: background 0.2s;
}

button:hover:not(:disabled) {
  background: #c73652;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.controls-next {
  margin-top: 2rem;
  text-align: center;
}

.btn-next {
  padding: 1.1rem 3rem;
  font-size: 1.35rem;
  font-weight: bold;
  border-radius: 12px;
}
