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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  max-width: 900px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

header p {
  font-size: 1rem;
  opacity: 0.9;
}

/* Табы */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tab.active {
  border-bottom-color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Секции */
section {
  background: rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 12px;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

/* Биты */
.beat-controls {
  display: flex;
  gap: 10px;
}

#beatSelect {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 1rem;
  cursor: pointer;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #667eea;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

#playBeat, #stopBeat {
  width: 50px;
  font-size: 1.2rem;
}

/* Режим */
.mode-section select {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 1rem;
  margin-bottom: 15px;
}

.timer-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.timer-controls label {
  flex: 1;
}

.timer-controls input {
  width: 80px;
  padding: 8px;
  border: none;
  border-radius: 6px;
  margin-left: 10px;
}

/* Дисплей */
.display-section {
  text-align: center;
  padding: 40px 20px;
}

.word-display {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

/* Описание приёмов */
.technique-display {
  margin: 20px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  text-align: left;
}

.technique-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffd700;
}

.technique-description {
  font-size: 1rem;
  margin-bottom: 8px;
  opacity: 0.9;
}

.technique-example {
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 12px;
  opacity: 0.8;
}

.technique-task {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hint-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.95rem;
}

.hints-display {
  margin: 15px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
}

.timer-display {
  font-size: 2rem;
  font-weight: 300;
  opacity: 0.9;
}

/* Действия */
.actions {
  display: flex;
  gap: 15px;
}

.actions button {
  flex: 1;
}

/* Словари */
.dict-section .hint {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 20px;
}

.dict-group {
  margin-bottom: 20px;
}

.dict-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.dict-group textarea,
.linked-form textarea {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 0.95rem;
  font-family: 'Monaco', 'Courier New', monospace;
  resize: vertical;
  margin-bottom: 10px;
}

.word-input {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 1rem;
  margin-bottom: 10px;
}

.add-btn {
  background: #4caf50;
  color: #fff;
  width: 100%;
}

.show-btn {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 12px 16px;
  white-space: nowrap;
}

.edit-btn-inline {
  background: rgba(255, 200, 100, 0.3);
  color: #fff;
  padding: 12px 16px;
  white-space: nowrap;
}

/* Связанные словари */
.linked-dict {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.linked-form {
  margin-bottom: 10px;
}

/* Блок редактирования */
.edit-block {
  margin-top: 15px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-bottom: 8px;
}

.edit-row span {
  font-size: 0.95rem;
}

.delete-variant-btn {
  background: transparent;
  color: #ff5b5b;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.delete-word-btn {
  background: #ff5b5b;
  color: #fff;
  width: 100%;
  margin-top: 10px;
}

.save-status {
  margin-top: 15px;
  text-align: center;
  font-size: 0.95rem;
  min-height: 24px;
}

footer {
  text-align: center;
  margin-top: 30px;
  opacity: 0.7;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .word-display {
    font-size: 2rem;
  }
  
  .beat-controls, .timer-controls, .actions {
    flex-direction: column;
  }
  
  #playBeat, #stopBeat {
    width: 100%;
  }
  
  .edit-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .technique-title {
    font-size: 1.2rem;
  }
}